]> git.saurik.com Git - bison.git/blob - ChangeLog
maint: don't update copyright years in bootstrap.
[bison.git] / ChangeLog
1 2011-01-03 Joel E. Denny <joeldenny@joeldenny.org>
2
3 maint: don't update copyright years in bootstrap.
4 * .x-update-copyright: Add entry for bootstrap.
5 * bootstrap: Remove 2011 from copyright years. The bootstrap
6 version we're currently using comes from an older version of
7 gnulib.
8 * bootstrap.conf (bootstrap_sync): Add comments explaining this
9 issue.
10
11 2011-01-02 Joel E. Denny <joeldenny@joeldenny.org>
12
13 maint: run "make update-copyright".
14
15 2011-01-02 Joel E. Denny <joeldenny@joeldenny.org>
16
17 maint: prepare to use date ranges in copyright notices.
18 * README (Copyright statements): New section explaining the range
19 notation. The GNU coding standards require this explanation. I
20 copied ours from coreutils.
21 * build-aux/update-b4-copyright: Revert 2010-06-17 changes that
22 disabled Bison's automated use of ranges.
23 * cfg.mk (update-copyright-env): Likewise.
24
25 2011-01-02 Joel E. Denny <joeldenny@joeldenny.org>
26
27 Correct my email address.
28 * ChangeLog: In all recent entries.
29 * THANKS (Joel E. Denny): Here.
30
31 2010-12-19 Joel E. Denny <joeldenny@joeldenny.org>
32
33 doc: cleanup.
34 * NEWS (2.5): Try to sort entries according to how interesting
35 users might find them.
36
37 2010-12-19 Joel E. Denny <joeldenny@joeldenny.org>
38
39 doc: cleanup.
40 * NEWS (2.5): Make some minor improvements to wording, and format
41 entries more consistently.
42 * doc/bison.texinfo (Language and Grammar): Point out that IELR
43 and canonical LR are experimental features.
44 (Decl Summary): In list of %define variables, make wording more
45 consistent. Improve discussion of using LALR for GLR.
46
47 2010-12-19 Joel E. Denny <joeldenny@joeldenny.org>
48
49 parse.lac: document.
50 * NEWS (2.5): Add entry for LAC, and mention LAC in entry for
51 other corrections to verbose syntax error messages.
52 * doc/bison.texinfo (Decl Summary): Rewrite entries for
53 lr.default-reductions and lr.type to be clearer, to mention
54 %nonassoc's effect on canonical LR, and to mention LAC. Add entry
55 for parse.lac.
56 (Glossary): Add entry for LAC.
57
58 2010-12-11 Joel E. Denny <joeldenny@joeldenny.org>
59
60 parse.lac: implement exploratory stack reallocations.
61 * data/yacc.c: Rename %define variable parse.lac.es-capacity to
62 parse.lac.es-capacity-initial. Accept parse.lac.memory-trace
63 with values of "failures" (default) or "full".
64 (b4_declare_parser_state_variables): Add yyesa, yyes, and
65 yyes_capacity variables.
66 (YYSTACK_USE_ALLOCA): Ignore it if LAC requested.
67 (YYSTACK_ALLOC, YYSTACK_FREE, YYSTACK_ALLOC_MAXIMUM): Define if
68 LAC requested.
69 (YYCOPY_NEEDED): New cpp macro.
70 (YYCOPY): Define if LAC requested.
71 (yy_lac_stack_realloc): New function implementing stack
72 reallocations. Use YYMAXDEPTH for maximum stack size given that
73 the stack should never need to grow larger than the main state
74 stack needs to grow without LAC.
75 (YY_LAC_ESTABLISH): Update yy_lac invocation.
76 (yy_lac): Add arguments for exploratory stack memory data
77 recorded in the main parser. Invoke yy_lac_stack_realloc when
78 reallocation is necessary.
79 (yysyntax_error): Add the same new arguments and pass them to
80 yy_lac.
81 (yypstate_delete): Free yyes if necessary.
82 (yyesa, yyes, yyes_capacity): #define these to yypstate members
83 in the case of push parsing.
84 (yyparse, yypush_parse): Initialize yyes and yyes_capacity.
85 Update yysyntax_error invocations. At yyreturn, free yyes if
86 necessary.
87 * src/parse-gram.y: %define parse.lac full.
88 * tests/input.at (LAC: errors for %define): Extend for
89 parse.lac-memory-trace.
90 * tests/regression.at (LAC: Exploratory stack): Extend to check
91 that stack reallocs happen when expected.
92 (LAC: Memory exhaustion): Update to use YYMAXDEPTH and
93 parse.lac.es-capacity-initial.
94
95 2010-12-11 Joel E. Denny <joeldenny@joeldenny.org>
96
97 parse.lac: implement as %define variable.
98 LAC = lookahead correction. See discussion at
99 <http://lists.gnu.org/archive/html/bison-patches/2009-09/msg00034.html>.
100 However, one point there must be corrected: because of %nonassoc,
101 LAC is *not* always redundant for lr.type=canonical-lr.
102 * data/yacc.c: Accept values of "none" (default) or "full" for
103 parse.lac. Accept %define parse.lac.es-capacity to specify
104 capacity of LAC's temporary exploratory stack. It defaults to 20
105 and, for now, will not grow dynamically.
106 (b4_lac_flag, b4_lac_if): New m4 macros. Evaluate as true for
107 parse.lac!=none.
108 (YYBACKUP): Invoke YY_LAC_DISCARD.
109 (YY_LAC_ESTABLISH, YY_LAC_DISCARD): New cpp macros that invoke
110 yy_lac and track when it needs to be invoked
111 (yy_lac): New function that, given the current stack, determines
112 whether a token can eventually be shifted. Return status mimics
113 yyparse return status.
114 (yysyntax_error): Change yystate argument to yyssp so stack top
115 can be passed to yy_lac. If LAC is requested, build expected
116 token list by invoking yy_lac for every token instead of just
117 checking the current state for lookaheads. Return 2 if yy_lac
118 exhausts memory.
119 (yyparse, yypush_parse): Use local variable yy_lac_established and
120 cpp macros YY_LAC_ESTABLISH and YY_LAC_DISCARD to implement LAC.
121 Update yysyntax_error invocation. Add yyexhaustedlab code if LAC
122 is requested.
123 * tests/conflicts.at (%nonassoc and eof): Extend to check the
124 effect of each of -Dlr.type=canonical-lr and -Dparse.lac=full.
125 (parse.error=verbose and consistent errors): Likewise.
126 (LAC: %nonassoc requires splitting canonical LR states): New test
127 group demonstrating how LAC can fix canonical LR.
128 * tests/input.at (LAC: Errors for %define): New test group.
129 * tests/regression.at (LAC: Exploratory stack): New test group.
130 (LAC: Memory exhaustion): New test group.
131
132 2010-11-21 Joel E. Denny <joeldenny@joeldenny.org>
133
134 build: use gnulib's new bootstrap_sync option.
135 Now, whenever we update bison's copy of gnulib, bootstrap will
136 update itself the next time it's run.
137 * bootstrap: Copy from latest gnulib for bootstrap_sync support.
138 * bootstrap.conf (bootstrap_sync): Set to true.
139 * gnulib: Update to latest so bootstrap is in sync now.
140
141 2010-11-07 Joel E. Denny <joeldenny@joeldenny.org>
142
143 yysyntax_error: fix for consistent error with lookahead.
144 * NEWS (2.5): Document.
145 * data/yacc.c (yysyntax_error): In a verbose syntax error
146 message while in a consistent state with a default action (which
147 must be an error action given that yysyntax_error is being
148 invoked), continue to drop the expected token list, but don't
149 drop the unexpected token unless there actually is no lookahead.
150 Moreover, handle that internally instead of returning 1 to tell
151 the caller to do it. With that meaning of 1 gone, renumber
152 return codes more usefully.
153 (yyparse, yypush_parse): Update yysyntax_error usage. Most
154 importantly, set yytoken to YYEMPTY when there's no lookahead.
155 * data/glr.c (yyreportSyntaxError): As in yacc.c, don't drop the
156 unexpected token unless there actually is no lookahead.
157 * data/lalr1.cc (yy::parser::parse): If there's no lookahead,
158 pass yyempty_ not yyla.type to yysyntax_error_.
159 (yy::parser::yysyntax_error_): Again, don't drop the unexpected
160 token unless there actually is no lookahead.
161 * data/lalr1.java (YYParser::parse): If there's no lookahead,
162 set yytoken to yyempty_ before invoking yysyntax_error.
163 (YYParser::yysyntax_error): Again, don't drop the unexpected
164 token unless there actually is no lookahead.
165 * tests/conflicts.at (parse.error=verbose and consistent
166 errors): Extend test group to further reveal how the previous
167 use of the simple "syntax error" message was too general. Test
168 yacc.c, glr.c, lalr1.cc, and lalr1.java. No longer an expected
169 failure.
170 * tests/java.at (AT_JAVA_COMPILE, AT_JAVA_PARSER_CHECK): Move
171 to...
172 * tests/local.at: ... here.
173 (_AT_BISON_OPTION_PUSHDEFS): Push AT_SKEL_JAVA_IF definition.
174 (AT_BISON_OPTION_POPDEFS): Pop it.
175 (AT_FULL_COMPILE): Extend to handle Java.
176
177 2010-11-07 Joel E. Denny <joeldenny@joeldenny.org>
178
179 yysyntax_error: more preparation for readability of next patch.
180 There are no behavioral changes here.
181 * data/glr.c (yyreportSyntaxError): Reorganize.
182 * data/lalr1.cc (yy::parser::yysyntax_error_): Reorganize.
183 * tests/conflicts.at (parse.error=verbose and consistent errors):
184 Reorganize.
185
186 2010-11-07 Joel E. Denny <joeldenny@joeldenny.org>
187
188 yysyntax_error: prepare for readability of next patches.
189 These are purely whitespace changes that result in ugly code
190 but that make the next couple of patches much easier to read.
191 * data/glr.c (yyreportSyntaxError): Reindent.
192 * data/lalr1.cc (yy::parser::yysyntax_error_): Reindent.
193 * data/lalr1.java (YYParser::yysyntax_error): Reindent.
194 * data/yacc.c (yysyntax_error): Reindent.
195
196 2010-10-31 Joel E. Denny <joeldenny@joeldenny.org>
197
198 Fix memory leak.
199 * src/output.c (prepare_rules): Free temporary array.
200
201 2010-10-31 Joel E. Denny <joeldenny@joeldenny.org>
202
203 yysyntax_error: improve invocation readability.
204 * data/yacc.c (yyparse, yypush_parse): For yysyntax_error
205 invocation, get rid of the while loop, which is misleading
206 because there are really at most two iterations.
207
208 2010-10-31 Joel E. Denny <joeldenny@joeldenny.org>
209
210 * ChangeLog: Correct some errors in previous entries.
211
212 2010-10-17 Joel E. Denny <joeldenny@joeldenny.org>
213
214 maint: re-anchor all .gitignore entries.
215 * bootstrap: Copy from gnulib's latest for the fix to
216 automatically anchor entries it constructs.
217 * gnulib: Update to latest just so it has the same bootstrap.
218 * .gitignore, build-aux/.gitignore, doc/.gitignore:
219 * lib/.gitignore, m4/.gitignore, po/.gitignore:
220 * runtime-po/.gitignore: Re-anchor all entries.
221
222 2010-10-08 Paul Eggert <eggert@cs.ucla.edu>
223
224 Fix portability problem on OpenBSD 4.7.
225
226 Jim Meyering reported this in
227 <http://lists.gnu.org/archive/html/bug-bison/2010-10/msg00007.html>.
228 * data/yacc.c: Use EXIT_SUCCESS as a witness for stdlib.h,
229 not _STDLIB_H. EXIT_SUCCESS has been defined by the standard
230 for quite some time.
231 * src/parse-gram.c, src/parse-gram.h: Regenerate.
232 * tests/regression.at: Tamper with the renamed witness.
233
234 Adjust to recent changes to gnulib bootstrap.
235
236 * .cvsignore, build-aux/.cvsignore, doc/.cvsignore, etc/.cvsignore:
237 * examples/calc++/.cvsignore, lib/.cvsignore, m4/.cvsignore:
238 * po/.cvsignore, runtime-po/.cvsignore, src/.cvsignore:
239 * tests/.cvsignore: Remove; I don't use CVS to maintain Bison
240 anymore and don't know of anybody else who does. If someone needs
241 these files, they can resurrect them.
242 * .gitignore, build-aux/.gitignore, doc/.gitignore, lib/.gitignore:
243 * m4/.gitignore, po/.gitignore, runtime-po/.gitignore:
244 Omit leading '/', since bootstrap omits it.
245 Adjust file names to match current contents better.
246 * bootstrap: Sync from gnulib: this contains the new gnulib_mk_hook
247 installed just for us.
248 * bootstrap.conf (excluded_files): Don't exclude codeset.m4,
249 glibc21.m4, inttypes_h.m4, size_max.m4, xsize.m4, as they are now
250 needed somehow. Don't have time to look into why.
251 (gnulib_modules): Change malloc to malloc-gnu. Do we really assume
252 the GNU malloc behavior, where malloc (0) != NULL unless we're
253 out of storage? If not, we can omit malloc-gnu; but for now I left
254 it in to be safe.
255 (vc_ignore): Remove.
256 (gnulib_mk_hook): New function.
257 * README-hacking: Renamed from HACKING, since gnulib bootstrap now
258 uses that convention.
259
260 2010-09-09 Paul Hilfinger <hilfinger@cs.berkeley.edu>
261
262 * data/glr.c (yySymbol): Define as int to avoid compiler warnings about
263 possible change of value.
264
265 2010-09-08 Paul Hilfinger <hilfinger@cs.berkeley.edu>
266
267 * data/glr.c (yy_reduce_print): Change yyrhsVals to yyvsp to remove
268 compiler errors when using %debug.
269 Add declaration of yylow when locations in use to avoid compilation
270 error.
271 (yyglrReduce): Conditionalize message "Parse ... rejected by rule..."
272 on whether we are in split mode, for consistency with behavior of
273 non-GLR parsing.
274
275 2010-09-01 Akim Demaille <demaille@gostai.com>
276
277 Address GCC warnings about shadowed local variables (yyflag).
278 * data/glr.c (YYCHK): Rename yyflag as yychk_flag.
279 (yyprocessOneStack): Reduce the scope of yyaction, yyconflicts,
280 yyrule, and yyflag.
281
282 2010-08-05 Joel E. Denny <joeldenny@joeldenny.org>
283
284 Version 2.4.3.
285 * NEWS (2.4.3): Set date.
286
287 2010-08-04 Joel E. Denny <joeldenny@joeldenny.org>
288
289 maint: add gettext version to release announcements.
290 Suggested by Paul Hilfinger at
291 <http://lists.gnu.org/archive/html/bison-patches/2010-07/msg00019.html>
292 <http://lists.gnu.org/archive/html/bison-patches/2010-08/msg00002.html>.
293 * cfg.mk (bootstrap-tools): Add gettext.
294
295 2010-08-04 Joel E. Denny <joeldenny@joeldenny.org>
296
297 doc: fix -W and %expect documentation some.
298 * NEWS (2.4.3): Mention that there are documentation fixes.
299 * doc/bison.texinfo (Expect Decl): Make it clear that %expect
300 turns conflicts into errors not warnings.
301 (Shift/Reduce): Likewise.
302 (Bison Options): Don't mention -Wsyntax. It doesn't exist.
303
304 2010-08-01 Joel E. Denny <joeldenny@joeldenny.org>
305
306 -Werror: fix for rules useless in parser after conflicts.
307 * NEWS (2.4.3): Document fix.
308 * src/complain.c (error_message): Extend to handle incomplete
309 error messages so warn and warn_at can be used in more cases.
310 * src/gram.c (grammar_rules_useless_report): Use warn_at so that
311 -Werror is always obeyed.
312 * src/reduce.c (reduce_print): Use warn so that the "warnings
313 being treated as errors" message is printed consistently before
314 the first warning message. This makes testing easier.
315 * tests/local.at (AT_BISON_WERROR_MSG): New macro.
316 (AT_BISON_CHECK_NO_XML): Extend to check -Werror and
317 --warnings=error when warnings appear in bison's stderr.
318
319 2010-07-29 Joel E. Denny <joeldenny@joeldenny.org>
320
321 maint: enable gnits only at stable releases.
322 * configure.ac (AM_INIT_AUTOMAKE): Underscore or dash in a
323 version string should disable gnits. Explain in comments.
324
325 2010-07-28 Joel E. Denny <joeldenny@joeldenny.org>
326
327 i18n: update.
328 * po/POTFILES.in: Add src/graphviz.c.
329
330 2010-07-28 Joel E. Denny <joeldenny@joeldenny.org>
331
332 i18n: fix for gnulib.
333 * po/POTFILES.in: Add remaining gnulib files that have
334 translatable strings.
335
336 2010-07-25 Joel E. Denny <joeldenny@joeldenny.org>
337
338 build: fix our adjustments for gnulib files in lib.
339 * configure.ac: For prepending lib/ to the values of config
340 variables, fix detection of empty values. Also, due to recent
341 gnulib changes, add LIBUNISTRING_UNITYPES_H and
342 LIBUNISTRING_UNIWIDTH_H to the list of those variables.
343
344 2010-07-25 Joel E. Denny <joeldenny@joeldenny.org>
345
346 maint: use announce-gen's new --mail-headers.
347 * HACKING (Announce): Update instructions.
348 * cfg.mk (announcement_Cc_): Define.
349 * configure.ac (AM_GNU_GETTEXT_VERSION): Update to 0.18 as
350 required by latest gnulib.
351 * gnulib: Update to latest.
352
353 2010-07-24 Joel E. Denny <joeldenny@joeldenny.org>
354
355 tests: handle Valgrind that complains about >&-.
356 * tests/output.at (AT_CHECK_OUTPUT): Extend to accept pre-tests.
357 (Output files: -dv >&-): Skip test group if running
358 maintainer-check-valgrind.
359
360 2010-07-23 Paul Hilfinger <hilfingr@EECS.Berkeley.EDU>
361
362 * NEWS: Describe new semantic-predicate feature.
363 * data/c.m4 (b4_predicate_case): New definition.
364 * data/java.m4 (b4_predicate_case): New definition.
365 * data/glr.c (yyimmediate): Add definition.
366 (yydoAction): Remove comment, now obsolete.
367 Do YY_REDUCE_PRINT here.
368 (yyglrReduce): Alter comment to indicate that semantic values
369 need not be deferred.
370 Remove YY_REDUCE_PRINT from here; done in yydoAction.
371 (yyprocessOneStack): Pass immediate flag.
372 Delete stacks rejected by predicates in newly split-off parsers.
373 Change handling of yyerr so that only current stack gets deleted
374 when semantic predicate fails.
375 (yyfillin): Don't crash if a semantic value is unresolved (as may
376 happen in predicate rules).
377 Copy lr state as well in debugging mode.
378 Update comment on setting of yysval to include yyloc as well.
379 (yy_reduce_print): Add yynormal argument. Perform fillin properly.
380 Report unresolved RHS values.
381 (yyimmediate): New table.
382 * src/gram.h (struct rule): Add is_predicate field.
383 * src/output.c (user_actions_output): Use b4_predicate_case for
384 predicates.
385 (prepare_symbols): Output yyimmediate.
386 * src/scan-gram.l: Add %? token, SC_PREDICATE state.
387 * src/scan-code.l (code_props_rule_action_init): Add is_predicate
388 argument.
389 * src/scan-code.h (struct code_props): Add is_predicate field.
390 (code_props_rule_action_init): New interface.
391 * src/parse-gram.y (%?{...}): New token.
392 (rhs): Add %?{...} rule.
393 * src/parse-gram.c: Regenerate.
394 * src/parse-gram.h: Regenerate.
395 * src/reader.c (grammar_current_rule_action_append): Add
396 immediate argument.
397 (grammar_midrule_action): Use new interface for
398 code_props_rule_action_init.
399 (grammar_current_rule_action_append): Ditto.
400 (packgram): Transfer is_predicate value.
401 * src/reader.h (grammar_current_rule_action_append): New interface.
402 * doc/bison.texinfo: Document semantic predicates (%?).
403
404 * data/glr.c (yylhsNonterm, yyisDefaultedState,yyDefaultAction)
405 (yygetLRActions,yynewGLRStackItem,yyaddDeferredAction,yyinitStateSet)
406 (yyinitGLRStack,yyexpandGLRStack,yyupdateSplit,yymarkStackDeleted)
407 (yyundeleteLastStack,yyglrShift,yyglrShiftDefer,yydoAction,yyglrReduce)
408 (yyidenticalOptions,yymergeOptionSets,yyresolveStates,yyresolveAction)
409 (yyresolveLocations,yyresolveValue,yyreducePrint): Update parameter
410 names in comments and mention all parameters.
411 (struct yyGLRState): Fix description of yyposn field.
412 (yyresolveLocations): Correct comment so as not to imply action when
413 yyn1==0.
414
415 2010-06-17 Paul Eggert <eggert@cs.ucla.edu>
416
417 Update from GFDL GFDL 1.2 to 1.3.
418 * doc/bison.texinfo: Update GFDL version number.
419 * doc/fdl.texi: Update to version 1.3, taken from:
420 http://www.gnu.org/licenses/fdl.texi
421
422 Do not use date ranges in copyright notices.
423 See http://www.gnu.org/prep/maintain/maintain.html#Copyright-Notices
424
425 * HACKING, Makefile.am, NEWS, PACKAGING, README, README-alpha:
426 * TODO, bootstrap, bootstrap.conf:
427 * build-aux/update-b4-copyright, cfg.mk, configure.ac:
428 * data/README, data/bison.m4, data/c++-skel.m4, data/c++.m4:
429 * data/c-skel.m4, data/c.m4, data/glr.c, data/glr.cc:
430 * data/java-skel.m4, data/java.m4, data/lalr1.cc:
431 * data/lalr1.java, data/local.mk, data/location.cc:
432 * data/stack.hh, data/variant.hh, data/xslt/bison.xsl:
433 * data/xslt/xml2dot.xsl, data/xslt/xml2text.xsl:
434 * data/xslt/xml2xhtml.xsl, data/yacc.c, djgpp/Makefile.maint:
435 * djgpp/README.in, djgpp/config.bat, djgpp/config.sed:
436 * djgpp/config.site, djgpp/config_h.sed, djgpp/djunpack.bat:
437 * djgpp/local.mk, djgpp/subpipe.c, djgpp/subpipe.h:
438 * djgpp/testsuite.sed, doc/bison.texinfo, doc/local.mk:
439 * doc/refcard.tex, etc/README, etc/bench.pl.in, etc/local.mk:
440 * examples/calc++/Makefile.am, examples/extexi:
441 * examples/local.mk, lib/abitset.c, lib/abitset.h:
442 * lib/bbitset.h, lib/bitset.c, lib/bitset.h:
443 * lib/bitset_stats.c, lib/bitset_stats.h, lib/bitsetv-print.c:
444 * lib/bitsetv-print.h, lib/bitsetv.c, lib/bitsetv.h:
445 * lib/ebitset.c, lib/ebitset.h, lib/get-errno.c:
446 * lib/get-errno.h, lib/lbitset.c, lib/lbitset.h:
447 * lib/libiberty.h, lib/local.mk, lib/main.c, lib/timevar.c:
448 * lib/timevar.def, lib/timevar.h, lib/vbitset.c:
449 * lib/vbitset.h, lib/yyerror.c, m4/bison-i18n.m4:
450 * m4/c-working.m4, m4/cxx.m4, m4/subpipe.m4, m4/timevar.m4:
451 * src/AnnotationList.c, src/AnnotationList.h:
452 * src/InadequacyList.c, src/InadequacyList.h, src/LR0.c:
453 * src/LR0.h, src/Sbitset.c, src/Sbitset.h, src/assoc.c:
454 * src/assoc.h, src/closure.c, src/closure.h, src/complain.c:
455 * src/complain.h, src/conflicts.c, src/conflicts.h:
456 * src/derives.c, src/derives.h, src/files.c, src/files.h:
457 * src/flex-scanner.h, src/getargs.c, src/getargs.h:
458 * src/gram.c, src/gram.h, src/graphviz.c, src/ielr.c:
459 * src/ielr.h, src/lalr.c, src/lalr.h, src/local.mk:
460 * src/location.c, src/location.h, src/main.c:
461 * src/muscle-tab.c, src/muscle-tab.h, src/named-ref.c:
462 * src/named-ref.h, src/nullable.c, src/nullable.h:
463 * src/output.c, src/output.h, src/parse-gram.y:
464 * src/print-xml.c, src/print-xml.h, src/print.c, src/print.h:
465 * src/print_graph.c, src/print_graph.h, src/reader.c:
466 * src/reader.h, src/reduce.c, src/reduce.h, src/relation.c:
467 * src/relation.h, src/scan-code.h, src/scan-code.l:
468 * src/scan-gram.h, src/scan-gram.l, src/scan-skel.h:
469 * src/scan-skel.l, src/state.c, src/state.h, src/symlist.c:
470 * src/symlist.h, src/symtab.c, src/symtab.h, src/system.h:
471 * src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h:
472 * tests/actions.at, tests/atlocal.in, tests/c++.at:
473 * tests/calc.at, tests/conflicts.at, tests/cxx-type.at:
474 * tests/existing.at, tests/glr-regression.at:
475 * tests/headers.at, tests/input.at, tests/java.at:
476 * tests/local.at, tests/local.mk, tests/named-refs.at:
477 * tests/output.at, tests/push.at, tests/reduce.at:
478 * tests/regression.at, tests/sets.at, tests/skeletons.at:
479 * tests/synclines.at, tests/testsuite.at, tests/torture.at:
480 Don't use date ranges in copyright notices.
481
482 2010-05-11 Akim Demaille <demaille@gostai.com>
483
484 lalrl1.cc: give a chance to user defined YYLLOC_DEFAULT.
485 * data/lalr1.cc (YYLLOC_DEFAULT): Move its definition from the
486 header file to the implementation file, after the user %code
487 sections.
488 * NEWS (2.5): Document this.
489
490 2010-05-11 Akim Demaille <demaille@gostai.com>
491
492 doc: please Emacs.
493 * doc/bison.texinfo (Local Variables): Move this after the
494 LocalWords, since the latter are looked for in the whole document,
495 while the former are looked for only at its end.
496 Require american spell checking.
497
498 2010-05-10 Akim Demaille <demaille@gostai.com>
499
500 doc: fix lalr1.cc documentation.
501 * doc/bison.texinfo (C++ Scanner Interface): Fix yylex signature.
502 (C++ Bison Interface): Fix lalr1.cc skeleton name.
503 (C++ Parser Interface): Fix semantic_type and location_type names.
504 Document yy::parser::token.
505 Reported by Jerry Quinn.
506
507 2010-05-10 Akim Demaille <demaille@gostai.com>
508
509 c++: use YYRHSLOC.
510 * data/lalr1.cc (YYRHSLOC): New.
511 (YYLLOC_DEFAULT): Use it.
512 * data/glr.cc: If location_type was user defined, do not include
513 location.hh, and do not produce location.hh and position.hh.
514 * tests/calc.at (YYLLOC_DEFAULT): Use YYRHSLOC.
515 Check that glr.cc supports user defined location_type.
516 * NEWS: Document this.
517
518 2010-05-07 Akim Demaille <demaille@gostai.com>
519
520 doc: fix typo.
521 * tests/synclines.at: here.
522
523 2010-05-04 Akim Demaille <demaille@gostai.com>
524
525 tests: enhance AT_SYNCLINES_COMPILE.
526 * tests/synclines.at (AT_SYNCLINES_COMPILE): More distcc patterns.
527 (AT_TEST_SYNCLINE): Remove GCC 4.5 protection which is already
528 taken care of in AT_SYNCLINES_COMPILE.
529
530 2010-05-04 Akim Demaille <demaille@gostai.com>
531
532 lalr1.cc: don't generate location.hh when location_type is defined
533 * data/bison.m4 (b4_percent_define_get): Accept a default value.
534 * data/c++.m4: Do not provide a default value for the %define
535 variable location_type, rather, use b4_percent_define_get with a
536 default argument where its value is needed.
537 * data/lalr1.cc: Do not load location.cc (which outputs both
538 location.hh and position.hh) if the user defined location_type.
539 Do not include location.hh either.
540
541 2010-05-04 Akim Demaille <demaille@gostai.com>
542
543 lalr1.cc: minor refactoring.
544 * data/lalr1.cc: Don't issue empty namespaces.
545
546 2010-05-04 Akim Demaille <demaille@gostai.com>
547
548 tests: fix %printer.
549 Currently, there is no check that %printer ... <foo> (nor
550 %destructor) is about an existing <foo> type. This C++ test had
551 it wrong (<::std::string> vs. <std::string>).
552
553 * tests/c++.at (AT_CHECK_VARIANTS): In list.yy, redefine the
554 pretty-printing of lists into something better for parser traces.
555 Update the expected output.
556 Fix correspondance between %type/%token and %printer.
557
558 2010-05-04 Akim Demaille <demaille@gostai.com>
559
560 lalr1.cc: location_type: make sure we don't depend on loc.(begin|end).
561 * tests/calc.at (Span): Instead of begin/end, as in the built-in
562 location class, use first and last.
563 Define YYLLOC_DEFAULT to adjust to these changes.
564 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Adjust to the
565 location_type changes.
566
567 2010-05-01 Joel E. Denny <joeldenny@joeldenny.org>
568
569 tests: fix maintainer-xml-check.
570 * data/xslt/xml2dot.xsl (xsl:template match="bison-xml-report"):
571 Update output to include comments now produced by --graph.
572 (xsl:template match="automaton"): As for --graph, name the
573 digraph after the grammar file.
574 * src/print-xml.c (escape_bufs): Enlarge array.
575 (print_xml): Add bug-report and url attributes to
576 bison-xml-report element.
577
578 2010-05-01 Joel E. Denny <joeldenny@joeldenny.org>
579
580 In DOT output, convert from "/*" comments to "//" comments.
581 This handles the possibility that a "*/" might appear in
582 variable portions of those comments at some point in the future.
583 * src/graphviz.c (start_graph): Implement.
584
585 2010-04-30 Joel E. Denny <joeldenny@joeldenny.org>
586
587 Document that undefined %prec identifier warnings will remain.
588 * NEWS (2.4.3): Here.
589 (2.4.2): Here.
590
591 2010-04-30 Joel E. Denny <joeldenny@joeldenny.org>
592
593 Revert 2009-12-30 change for undefined %prec token complaints.
594 That is, keep them as warnings because that should be sufficient
595 to satisfy POSIX without creating backward compatibility issues.
596 Suggested by Richard Stallman at
597 <http://lists.gnu.org/archive/html/bison-patches/2010-03/msg00033.html>.
598 * NEWS (2.5): Remove mention of complaint.
599 * src/reader.c (grammar_rule_check): Convert complaint back to
600 warning.
601 * tests/input.at (%prec's token must be defined): Update.
602
603 2010-04-25 Joel E. Denny <joeldenny@joeldenny.org>
604
605 build: don't require src/bison during bootstrap.
606 Suggested by Eric Blake at
607 <http://lists.gnu.org/archive/html/bug-bison/2010-03/msg00003.html>.
608 * bootstrap.conf (bootstrap_epilogue): New function to make sure
609 src/parse-gram.[ch] are stamped later than src/parse-gram.y.
610
611 2010-04-25 Joel E. Denny <joeldenny@joeldenny.org>
612
613 i18n: fix untranslatable string.
614 Reported by Goran Uddeborg at
615 <http://lists.gnu.org/archive/html/bug-bison/2010-03/msg00000.html>.
616 * src/muscle-tab.c (muscle_percent_define_insert): Here.
617
618 2010-04-13 Akim Demaille <demaille@gostai.com>
619
620 tests: calc: minor refactoring.
621 * tests/calc.at (_AT_DATA_CALC_Y): Simplify yylex.
622
623 2010-04-13 Akim Demaille <demaille@gostai.com>
624
625 tests: calc: simplify location management.
626 * tests/local.at (AT_LOC_PUSHDEF, AT_LOC_POPDEF): New.
627 (_AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS): Use them to
628 define the appropriate AT_LOC accessors.
629 * tests/calc.at: Use AT_LOC accessors.
630
631 2010-04-13 Akim Demaille <demaille@gostai.com>
632
633 test location_type.
634 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS):
635 Define AT_LOCATION_TYPE_IF.
636 (_AT_BISON_OPTION_POPDEFS): Undefine AT_LOCATION_TYPE_IF.
637 * tests/calc.at (_AT_DATA_CALC_Y): When %define location_type is
638 used, provide a user location type and use it.
639 (Simple LALR1 C++ Calculator): Add a test case for location_type.
640
641 2010-04-13 Akim Demaille <demaille@gostai.com>
642
643 tests: check fclose's return value.
644 * tests/calc.at (_AT_DATA_CALC_Y): Check fclose's return status.
645
646 2010-04-13 Akim Demaille <demaille@gostai.com>
647
648 tests: don't depend on the actual location type.
649 * tests/calc.at: Use yy::parser::location_type rather than
650 yy::location, since the former is always right, and might point to
651 another type than the latter.
652
653 2010-04-13 Akim Demaille <demaille@gostai.com>
654
655 formatting changes.
656 * tests/calc.at: Formatting changes.
657
658 2010-04-13 Akim Demaille <demaille@gostai.com>
659
660 lalr1.cc: remove useless forward declaration.
661 * data/lalr1.cc: Include location.hh before stack.hh.
662 Remove the useless forward declarations of position and location.
663 Reported by Chris Morley.
664 * data/glr.cc: Likewise.
665
666 2010-04-11 Joel E. Denny <joeldenny@joeldenny.org>
667
668 * NEWS (2.4.3): Mention fix for Sun Studio C++.
669
670 2010-04-10 Joel E. Denny <joeldenny@joeldenny.org>
671
672 tests: fix for newer Sun Studio C++.
673 Reported by Dagobert Michelsen at
674 <http://lists.gnu.org/archive/html/bug-bison/2010-03/msg00023.html>.
675 * THANKS (Dagobert Michelsen): Add.
676 * configure.ac (AC_PREREQ): Set to 2.64 so we get the latest
677 Autoconf macro for handling the restrict keyword.
678 * gnulib: Update to latest, which no longer overrides that macro
679 from Autoconf.
680
681 2010-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
682
683 portability: fix pointer arithmetic to conform to C standard.
684 Reported by Tys Lefering at
685 <http://lists.gnu.org/archive/html/bug-bison/2010-03/msg00035.html>.
686 This fix is already implemented in glr.c and does not apply to
687 lalr1.java.
688 * data/lalr1.cc (yy::parser::parse): Increase size of
689 yyerror_range and adjust subscripting so you don't have to
690 subtract one from the beginning of the array.
691 * data/yacc.c (b4_declare_parser_state_variables,
692 yyparse, yypush_parse): Likewise.
693
694 2010-04-05 Akim Demaille <demaille@gostai.com>
695
696 remove useless include.
697 * src/graphviz.h: Don't include stdbool.h.
698
699 2010-04-05 Akim Demaille <demaille@gostai.com>
700
701 graph: sign the output file.
702 * src/graphviz.c (start_graph): Issue comments about Bison.
703 Suggested by Tys Lefering.
704
705 2010-03-31 Joel E. Denny <jdenny@ces.clemson.edu>
706
707 portability: fix test suite for GCC 4.5's new #error message.
708 Reported by Tys Lefering at
709 <http://lists.gnu.org/archive/html/bug-bison/2010-03/msg00030.html>.
710 * NEWS (2.4.3): Mention.
711 * tests/synclines.at (AT_TEST_SYNCLINE): Implement.
712
713 2010-03-30 Akim Demaille <demaille@gostai.com>
714
715 fix comments.
716 * src/graphviz.h: Add missing license notice.
717 Document.
718
719 2010-03-25 Akim Demaille <demaille@gostai.com>
720
721 tests: fix 250: parse.error=verbose overflow.
722 * tests/regression.at (parse.error=verbose overflow): Avoid the
723 double inclusion of stdlib.h as it triggers hard errors.
724
725 2010-03-23 Joel E. Denny <jdenny@ces.clemson.edu>
726
727 portability: fix for BSD make.
728 Reported by Johan van Selst at
729 <http://lists.gnu.org/archive/html/bug-bison/2010-03/msg00016.html>.
730 * tests/local.mk ($(TESTSUITE)): Qualify package.m4 in
731 this dependency list as in package.m4's target rule.
732
733 2010-03-23 Joel E. Denny <jdenny@ces.clemson.edu>
734
735 portability: fix spawning on at least FreeBSD 8 and FreeBSD 9.
736 Reported by Johan van Selst at
737 <http://lists.gnu.org/archive/html/bug-bison/2010-03/msg00014.html>.
738 * NEWS (2.4.3): New.
739 * THANKS (Johan van Selst): Add.
740 * etc/prefix-gnulib-mk (prefix): Adjust regex for makefile
741 targets so that gnulib's new c++defs.h is matched.
742 * gnulib: Update to latest.
743
744 2010-03-20 Joel E. Denny <jdenny@ces.clemson.edu>
745
746 maint: update for changes to gnulib's announce-gen.
747 * HACKING (Announce): RELEASE_TYPE=major must now be written
748 RELEASE_TYPE=stable.
749
750 2010-03-20 Joel E. Denny <jdenny@ces.clemson.edu>
751
752 Version 2.4.2.
753 * NEWS (2.4.2): Set version and date. For the recent test suite
754 portability fixes, don't be so optimistic about their success
755 given the lack of feedback on the affected platforms.
756
757 2010-02-22 Joel E. Denny <jdenny@ces.clemson.edu>
758
759 tests: fix maintainer-xml-check for recent changes.
760 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): Use
761 AT_BISON_CHECK_NO_XML rather than AT_BISON_CHECK because an
762 output file whose name conflicts with a previous output file
763 is now never generated.
764
765 2010-02-22 Joel E. Denny <jdenny@ces.clemson.edu>
766
767 portability: fix several issues with M4 subprocess.
768
769 M4's output pipe was not being drained upon fatal errors during
770 scan_skel. As a result, broken-pipe messages from M4 were seen
771 on at least AIX, HP-UX, Solaris, and RHEL4, and this caused a
772 failure in the test suite. The problem was that, on platforms
773 where the default disposition for SIGPIPE is ignore instead of
774 terminate, M4 sometimes saw fwrite fail with errno=EPIPE and
775 then reported it. However, there's some sort of race condition,
776 because the new test group occasionally succeeded.
777 Reported by Albert Chin at
778 <http://lists.gnu.org/archive/html/bug-bison/2010-02/msg00004.html>.
779
780 There were also problems with the test suite livelocking on
781 Tru64 5.1b. Reported by Didier Godefroy at
782 <http://lists.gnu.org/archive/html/bug-bison/2009-05/msg00005.html>.
783 Switching to create_pipe_bidi suggested by Akim Demaille.
784
785 To attempt to solve both of these problems, switch to gnulib's
786 create_pipe_bidi and register M4 process as a slave. Along the
787 way, clean up file name conflict handling, which was affected by
788 the broken-pipe problem before the switch.
789 * NEWS (2.4.2): Document.
790 * THANKS (Didier Godefroy): Add.
791 * bootstrap.conf (gnulib_modules): Add pipe.
792 * gnulib: Update to latest to make sure we have all the latest
793 fixes.
794 * lib/local.mk (lib_libbison_a_SOURCES): Remove subpipe.h and
795 subpipe.c.
796 * po/POTFILES.in (lib/subpipe.c): Remove.
797 * src/files.c (compute_output_file_names): Update invocations
798 of output_file_name_check.
799 (output_file_name_check): In the case that the grammar file
800 would be overwritten, use complain instead of fatal, but replace
801 the output file name with /dev/null. Use the /dev/null solution
802 for the case of two conflicting output files as well because it
803 seems safer in case Bison one day tries to open both files at
804 the same time.
805 * src/files.h (output_file_name_check): Update prototype.
806 * src/output.c (output_skeleton): Use create_pipe_bidi and
807 wait_subprocess. Assert that scan_skel completely drains the
808 pipe.
809 * src/scan-skel.l (at_directive_perform): Update
810 output_file_name_check invocation.
811 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): Check that the
812 grammar file actually isn't overwritten.
813 (Conflicting output files: -o foo.y): Update expected output.
814 * tests/skeletons.at (Fatal errors but M4 continues producing
815 output): New test group.
816
817 2010-02-04 Joel E. Denny <jdenny@ces.clemson.edu>
818
819 Update POTFILES.
820 * HACKING (Release Procedure): Add reminder about keeping
821 POTFILES files up-to-date.
822 * po/POTFILES.in (src/muscle-tab.c, src/scan-skel.l): Add.
823
824 2010-02-01 Joel E. Denny <jdenny@clemson.edu>
825
826 Code cleanup.
827 * tests/atlocal.in (abs_top_srcdir): Remove shell variable,
828 which is already defined in atconfig.
829
830 2010-01-22 Joel E. Denny <jdenny@clemson.edu>
831
832 tests: fix missing include caught by g++ 4.4.1.
833 Reported by Tys Lefering.
834 * HACKING (Release checks): Add note about trying a recent GCC.
835 * tests/regression.at (_AT_DATA_DANCER_Y): For C++, include
836 cstdlib for abort.
837 (_AT_DATA_EXPECT2_Y): Likewise.
838
839 2010-01-21 Joel E. Denny <jdenny@clemson.edu>
840
841 * cfg.mk (gnulib_dir): Assume gnulib is a subdirectory.
842
843 2010-01-21 Joel E. Denny <jdenny@clemson.edu>
844
845 maint: automate PACKAGE_COPYRIGHT_YEAR update, and update it.
846 * HACKING (Release Procedure): Update notes on copyright years.
847 * Makefile.am (update-package-copyright-year): New target rule.
848 * build-aux/update-package-copyright-year: New file.
849 * cfg.mk (update-copyright): Add update-package-copyright-year
850 as a dependency.
851
852 2010-01-19 Joel E. Denny <jdenny@clemson.edu>
853
854 * bootstrap: Import improvements from latest gnulib.
855
856 2010-01-19 Joel E. Denny <jdenny@clemson.edu>
857
858 build: require Automake 1.11.1 to avoid a security flaw.
859 * HACKING (Release Procedure): Don't document Automake security
860 flaw here.
861 * configure.ac (AM_INIT_AUTOMAKE): Require 1.11.1, and explain
862 why here.
863
864 2010-01-19 Joel E. Denny <jdenny@clemson.edu>
865
866 gnulib: update to latest.
867
868 2010-01-19 Joel E. Denny <jdenny@clemson.edu>
869
870 ChangeLog (2006-09-15): add Odd Arild Olsen's role for push.c.
871
872 2010-01-15 Joel E. Denny <jdenny@clemson.edu>
873
874 Thank the developer of the initial push parser implementation.
875 This unfortunate oversight is several years old.
876 * THANKS (Odd Arild Olsen): Add.
877
878 2010-01-04 Joel E. Denny <jdenny@clemson.edu>
879
880 Fix some comments concerning LR(0) versus LALR(1).
881
882 Stop equating LR(0) with nondeterminism and LALR(1) with
883 determinism. That is, if all states are consistent, then LR(0)
884 tables are deterministic. On the other hand, LALR(1) tables
885 might be nondeterministic before conflict resolution, and GLR
886 permits LALR(1) tables to remain nondeterministic.
887 * src/LR0.c, src/LR0.h: Here.
888 * src/lalr.c, src/lalr.h: Here.
889 * src/main.c (main): Here.
890 * src/state.c, src/state.h: Here.
891
892 * src/ielr.h (ielr): In preconditions, expect LR(0) not LALR(1)
893 parser tables.
894
895 2010-01-04 Joel E. Denny <jdenny@clemson.edu>
896
897 maint: run "make update-copyright"
898
899 2009-12-30 Joel E. Denny <jdenny@clemson.edu>
900
901 POSIX: complain if %prec's token was not defined.
902 * NEWS (2.5): Document.
903 * src/reader.c (grammar_rule_check): Convert warning to
904 complaint.
905 * tests/input.at (%prec's token must be defined): Update.
906
907 2009-12-30 Joel E. Denny <jdenny@clemson.edu>
908
909 POSIX: warn if %prec's token was not defined.
910 Reported by Florian Krohm at
911 <http://lists.gnu.org/archive/html/bug-bison/2009-12/msg00005.html>.
912 * NEWS (2.4.2): Document.
913 * src/reader.c (grammar_rule_check): Implement.
914 (grammar_current_rule_prec_set): Add comments explaining that we
915 here assume a %prec identifier is a token, but we still manage
916 to support POSIX.
917 * tests/input.at (%prec's token must be defined): New test
918 group.
919
920 2009-12-31 Joel E. Denny <jdenny@clemson.edu>
921
922 * HACKING (Release Procedure): Recommend a secure automake.
923
924 2009-12-29 Joel E. Denny <jdenny@clemson.edu>
925
926 portability: `<' and `>' are not always defined on addresses.
927 Specifically, don't sort objects by their memory addresses when
928 they're not allocated in the same array or other object. Though
929 I haven't found a test case where that fails on my platform, C
930 says the behavior is undefined.
931 * src/AnnotationList.c (AnnotationList__insertInto): Remove
932 FIXME. Use new id field of InadequacyList nodes rather than
933 their memory addresses when sorting.
934 (AnnotationList__compute_from_inadequacies): Add
935 inadequacy_list_node_count argument to pass to
936 InadequacyList__new_conflict.
937 * src/AnnotationList.h
938 (AnnotationList__compute_from_inadequacies): Update prototype
939 and documentation for new argument.
940 * src/InadequacyList.c (InadequacyList__new_conflict): Add
941 node_count argument and use it to assign a unique ID.
942 * src/InadequacyList.h (InadequacyListNodeCount): New typedef.
943 (InadequacyList): Add id field.
944 (InadequacyList__new_conflict): Update prototype and
945 documentation for new argument.
946 * src/ielr.c (ielr_compute_annotation_lists): Update
947 AnnotationList__compute_from_inadequacies invocation.
948
949 2009-12-20 Joel E. Denny <jdenny@clemson.edu>
950
951 Fix handling of yychar manipulation in user semantic actions.
952 The problem was that yacc.c didn't always update the yychar
953 translation afterwards. However, other skeletons appear to be
954 fine. glr.c appears to already translate yychar before every
955 use. lalr1.cc does not define yychar and does not document its
956 replacement, yyla, for users. It does provide yyclearin, but
957 that does not manipulate yyla and thus requires no translation
958 update. In lalr1.java, yychar is out of scope during semantic
959 actions.
960 * NEWS (2.5): Document.
961 * data/yacc.c (YYBACKUP): Don't bother translating yychar into
962 yytoken here.
963 (yyparse, yypush_parse): Instead, translate before every use of
964 yytoken, and add comments explaining this approach.
965 * tests/actions.at (Destroying lookahead assigned by semantic
966 action): New test group checking that translation happens before
967 lookahead destructor calls at parser return. Previously,
968 incorrect destructors were called.
969 * tests/conflicts.at (parse.error=verbose and consistent
970 errors): New test group checking that translation happens at
971 syntax error detection before the associated verbose error
972 message and the associated lookahead destructor calls. While
973 the destructor call is fixed by this patch, the verbose error
974 message is currently incorrect due to another bug (see
975 comments in test group), so this is an expected failure for now.
976
977 2009-12-21 Joel E. Denny <jdenny@clemson.edu>
978
979 YYFAIL: warn about uses and remove from lalr1.java.
980 * NEWS (2.5): Document.
981 * data/lalr1.java (YYParser::YYFAIL): Rename to YYERRLAB,
982 and make it private. Update all uses.
983 * src/scan-code.l (SC_RULE_ACTION): Implement warning.
984
985 2009-12-21 Joel E. Denny <jdenny@clemson.edu>
986
987 YYFAIL: deprecate.
988 * NEWS (2.4.2): Document deprecation and the phase-out plan.
989 * data/lalr1.java (YYParser::YYFAIL): Add comment about
990 deprecation.
991 * data/yacc.c (YYFAIL): Likewise, and suppress warnings about
992 YYFAIL from GCC cpp's -Wunused-macros.
993 * doc/bison.texinfo (Java Action Features): Remove YYFAIL
994 documentation.
995 (LocalWords): Remove YYFAIL.
996
997 2009-12-20 Joel E. Denny <jdenny@clemson.edu>
998
999 tests: cleanup.
1000 * tests/c++.at (Syntax error discarding no lookahead): Don't
1001 ignore stderr. Instead, eliminate remaining warnings.
1002
1003 2009-12-18 Joel E. Denny <jdenny@clemson.edu>
1004
1005 lalr1.cc: don't discard non-existent lookahead on syntax error.
1006 * data/lalr1.cc (yy::parser::parse): Check yyempty first.
1007 * tests/c++.at (Syntax error discarding no lookahead): New test
1008 group.
1009
1010 2009-12-17 Joel E. Denny <jdenny@clemson.edu>
1011
1012 Code cleanup.
1013 * src/symtab.c, src/symtab.h (symbol_class_get_string): Remove
1014 function, which is no longer used.
1015
1016 2009-12-16 Joel E. Denny <jdenny@clemson.edu>
1017
1018 Add gcc's -Wundef to test suite and fix another warning from it.
1019 * NEWS (2.4.2): Update description of -Wundef fix.
1020 * configure.ac (WARN_CXXFLAGS_TEST): New substitution.
1021 (WARN_CFLAGS_TEST): New substitution.
1022 * data/glr.c: Avoid warning about __STRICT_ANSI__.
1023 * tests/atlocal.in (CFLAGS): Use WARN_CFLAGS_TEST instead of
1024 WARN_CFLAGS.
1025 (NO_WERROR_CFLAGS): Likewise.
1026 (CXXFLAGS): Use WARN_CXXFLAGS_TEST instead of WARN_CXXFLAGS.
1027
1028 2009-12-16 Joel E. Denny <jdenny@clemson.edu>
1029
1030 * data/yacc.c: Reformat m4 a little.
1031
1032 2009-12-16 Joel E. Denny <jdenny@clemson.edu>
1033
1034 Document gcc -Wundef fix.
1035 * NEWS (2.4.2): Here.
1036 * THANKS (Jonathan Nieder): Add.
1037
1038 2009-12-15 Jonathan Nieder <jrnieder@gmail.com> (tiny change)
1039
1040 Simplify y.tab.c when location tracking is disabled.
1041 * data/yacc.c: Do not check YYLTYPE_IS_TRIVIAL if location
1042 tracking is not enabled. Instead, unconditionally define
1043 YY_LOCATION_PRINT as a no-op for backward compatibility.
1044
1045 2009-12-15 Jonathan Nieder <jrnieder@gmail.com> (tiny change)
1046
1047 Avoid warnings from gcc -Wundef y.tab.c.
1048 * data/glr.c: Check if YYENABLE_NLS and YYLTYPE_IS_TRIVIAL are
1049 defined before using them.
1050 * data/lalr1.cc: Likewise.
1051 * data/yacc.c: Likewise.
1052
1053 2009-12-15 Joel E. Denny <jdenny@clemson.edu>
1054
1055 autoconf: update to latest for fix of M4 detection.
1056 Reported by Eric Blake.
1057 * submodules/autoconf: Update.
1058
1059 2009-12-15 Joel E. Denny <jdenny@clemson.edu>
1060
1061 portability: use -DGNULIB_POSIXCHECK.
1062 Reported by Eric Blake. See discussions at
1063 <http://lists.gnu.org/archive/html/bug-bison/2009-09/msg00008.html>
1064 and
1065 <http://lists.gnu.org/archive/html/bug-gnulib/2009-10/msg00108.html>.
1066 * HACKING (Release checks): Suggest -DGNULIB_POSIXCHECK.
1067 * bootstrap.conf (gnulib_modules): Add all the printf modules
1068 suggested by -DGNULIB_POSIXCHECK. Add realloc-posix as
1069 suggested by -DGNULIB_POSIXCHECK for gnulib's own vasnprintf.c.
1070 (excluded_files): Remove m4/printf-posix.m4.
1071 * tests/atlocal.in (LIBS): As for LDADD in src/local.mk, add
1072 lib/libbison.a so gnulib libraries can be linked.
1073
1074 2009-12-15 Joel E. Denny <jdenny@clemson.edu>
1075
1076 gnulib: update for fix of fprintf-posix, which we'll use soon.
1077 * etc/prefix-gnulib-mk (prefix): Adjust regex for make file
1078 targets so that gnulib's new arg-nonnull.h and link-warning.h
1079 are matched.
1080 * gnulib: Update.
1081
1082 2009-12-14 Joel E. Denny <jdenny@clemson.edu>
1083
1084 Enable assertion output and --disable-assert for configure.
1085 * bootstrap.conf (gnulib_modules): Add assert module.
1086 * src/system.h (aver): Define as assert, and summarize the
1087 discussion on this issue.
1088
1089 2009-12-14 Joel E. Denny <jdenny@clemson.edu>
1090
1091 Expand GLR acronym in summary of Bison.
1092 Based on discussion with Akim Demaille starting at
1093 <http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00087.html>.
1094 * doc/bison.texinfo (Introduction): Here.
1095 * src/getargs.c (usage): Here.
1096
1097 2009-10-03 Alex Rozenman <rozenman@gmail.com>
1098
1099 Document named references.
1100 * doc/bison.texinfo (Actions): Add new example and xref to
1101 Using Named References node.
1102 (Using Named References): New node.
1103
1104 2009-10-16 Joel E. Denny <jdenny@clemson.edu>
1105
1106 cleanup.
1107 * src/Sbitset.c (Sbitset__new_on_obstack): Use Sbitset instead
1108 of char*.
1109 (Sbitset__isEmpty): Use Sbitset instead of char*.
1110 * src/Sbitset.h (Sbitset): Make it a pointer to unsigned char
1111 instead of char. This helps to avoid casting errors.
1112 (Sbitset__or): Use Sbitset instead of char*.
1113
1114 2009-10-16 Joel E. Denny <jdenny@clemson.edu>
1115
1116 portability: don't assume 8-bit bytes.
1117 That is, use CHAR_BIT and UCHAR_MAX instead of 8 and 0xff.
1118 * src/Sbitset.h (Sbitset__nbytes): Here.
1119 (Sbitset__byteAddress): Here.
1120 (Sbitset__bit_mask): Here.
1121 (Sbitset__last_byte_mask): Here.
1122 (Sbitset__ones): Here.
1123 (SBITSET__FOR_EACH): Here.
1124
1125 2009-10-11 Joel E. Denny <jdenny@clemson.edu>
1126
1127 portability: use va_start and va_end in the same function.
1128 * src/complain.c (error_message): Move va_end from here...
1129 (ERROR_MESSAGE): ... to here.
1130
1131 2009-10-08 Joel E. Denny <jdenny@clemson.edu>
1132
1133 * data/bison.m4: Update comments for rename to muscle-tab.h.
1134
1135 2009-10-07 Joel E. Denny <jdenny@clemson.edu>
1136
1137 Minor code cleanup.
1138 * src/muscle-tab.c (MUSCLE_USER_NAME_CONVERT): Remove macro and
1139 replace all uses with UNIQSTR_CONCAT.
1140 * src/uniqstr.c (uniqstr_vsprintf): New function.
1141 * src/uniqstr.h (uniqstr_vsprintf): Add prototype.
1142 (UNIQSTR_CONCAT, UNIQSTR_GEN_FORMAT, UNIQSTR_GEN_FORMAT_): New
1143 macros.
1144
1145 2009-10-06 Joel E. Denny <jdenny@clemson.edu>
1146
1147 * TODO (Complaint submessage indentation): New.
1148
1149 2009-10-04 Joel E. Denny <jdenny@clemson.edu>
1150
1151 Minor code cleanup.
1152 * src/parse-gram.y: Clean up sorting of declarations.
1153 Use types to simplify %printer declarations where possible.
1154 Provide %printer for BRACKETED_ID and symbol.prec.
1155 * src/symtab.c: Whitespace change.
1156
1157 2009-10-04 Joel E. Denny <jdenny@clemson.edu>
1158
1159 tests: skip tests of file names that platform does not support.
1160 Reported by Michael Raskin at
1161 <http://lists.gnu.org/archive/html/bug-bison/2009-09/msg00001.html>.
1162 * THANKS (Michael Raskin): Add.
1163 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Fix. Cygwin used
1164 to fail at least for file names containing ":" or "\".
1165
1166 2009-09-23 Joel E. Denny <jdenny@clemson.edu>
1167
1168 yysyntax_error: avoid duplicate lookahead collection.
1169 Except when memory reallocation is required, this change
1170 eliminates the need to invoke yysyntax_error twice and thus to
1171 repeat the collection of lookaheads. It also prepares for
1172 future extensions that will make those repetitions more
1173 expensive and that will require additional memory management in
1174 yysyntax_error. Finally, it fixes an obscure bug already
1175 exercised in the test suite.
1176 * data/yacc.c (yysyntax_error): Add arguments for message
1177 buffer variables stored in the parser. Instead of size, return
1178 status similar to yyparse status but indicating success of
1179 message creation. Other than the actual reallocation of the
1180 message buffer, import and clean up memory management code
1181 from...
1182 (yyparse, yypush_parse): ... here.
1183 * tests/regression.at (parse.error=verbose overflow): No longer
1184 an expected failure.
1185
1186 2009-09-23 Joel E. Denny <jdenny@clemson.edu>
1187
1188 yysyntax_error: test memory management more.
1189 * tests/atlocal.in (NO_WERROR_CFLAGS): New cpp macro.
1190 * tests/regression.at (parse.error=verbose and
1191 YYSTACK_USE_ALLOCA): New test group.
1192 (parse.error=verbose overflow): New test group that reveals an
1193 obscure bug. Expected fail for now.
1194
1195 2009-10-04 Joel E. Denny <jdenny@clemson.edu>
1196
1197 benchmarks: use %debug consistently among grammars.
1198 * etc/bench.pl.in (generate_grammar_triangular): Do not activate
1199 %debug by default. It can affect the timings even if yydebug=0.
1200 (generate_grammar_calc): For consistency with other grammars,
1201 use YYDEBUG environment variable to set yydebug.
1202
1203 2009-10-03 Joel E. Denny <jdenny@clemson.edu>
1204
1205 Remove dead code.
1206 * src/symtab.c (symbol_pack): Here because every symbol's number
1207 is always defined by this time.
1208
1209 2009-10-03 Alex Rozenman <rozenman@gmail.com>
1210
1211 Add additional space after periods in NEWS.
1212 * NEWS (2.5): here.
1213
1214 2009-09-29 Joel E. Denny <jdenny@clemson.edu>
1215
1216 Use the correct conversion specifier for size_t.
1217 Reported by Jim Meyering.
1218 * src/Sbitset.h (SBITSET__INDEX__CONVERSION_SPEC): New, "zu"
1219 because Sbitset__Index is size_t.
1220 * src/Sbitset.c (Sbitset__fprint): Use it instead of %d.
1221
1222 2009-09-27 Joel E. Denny <jdenny@clemson.edu>
1223
1224 tests: don't abuse AT_BISON_CHECK.
1225 * tests/regression.at (parse-gram.y: LALR = IELR): Move
1226 additional shell commands outside of AT_BISON_CHECK.
1227
1228 2009-09-26 Joel E. Denny <jdenny@clemson.edu>
1229
1230 tests: check that parse-gram.y's IELR and LALR are identical.
1231 * tests/atlocal.in (abs_top_srcdir): New shell variable.
1232 * tests/regression.at (parse-gram.y: LALR = IELR): New test
1233 group.
1234
1235 2009-09-19 Alex Rozenman <rozenman@gmail.com>
1236
1237 Keep sub-messages aligned. Fix strings for translation.
1238 * src/location.h (location_print): Add return value.
1239 * src/location.c (location_print): Return number of printed
1240 characters.
1241 * src/complain.h (complain_at_indent, warn_at_indent): Prototype
1242 new functions.
1243 * src/complain.cpp (indent_ptr): New static variable.
1244 (error_message, complain_at_indent, warn_at_indent): Implement
1245 the alignment mechanism.
1246 * src/scan-code.l (parse_ref, show_sub_messages): Fix strings
1247 for translations. Use new alignment mechanism.
1248 * tests/named-ref.at: Adjust test-cases.
1249 * NEWS (2.5): Add an announcement about named references.
1250
1251 2009-09-17 Akim Demaille <demaille@gostai.com>
1252
1253 doc: fixes.
1254 * doc/bison.texinfo: here.
1255 Reported by Alex Rozenman.
1256
1257 2009-09-16 Akim Demaille <demaille@gostai.com>
1258
1259 doc: lalr1.cc and variants.
1260 * doc/bison.texinfo (Decl Summary): Document the "lex_symbol" and
1261 "variant" %define variables.
1262 (C++ Semantic Values): Split into...
1263 (C++ Unions, C++ Variants): these.
1264 The latter is new.
1265 (C++ Parser Interface): Fix type names.
1266 Document parser::syntax_error.
1267 Document the fact that locations are not mandatory.
1268 (C++ Scanner Interface): Split into...
1269 (Split Symbols, Complete Symbols): these.
1270 The later is new.
1271 (Calc++ Parsing Driver): Use variants.
1272 Add more comments.
1273 Adjust style.
1274 (Calc++ Parser): Declare all the tokens, no
1275 longer accept raw characters.
1276 Remove %union.
1277 Adjust types and printers.
1278 Remove destructors.
1279 (Calc++ Scanner): Use make_<SYMBOL> functions.
1280 Use strerror in error message.
1281
1282 2009-09-16 Akim Demaille <demaille@gostai.com>
1283
1284 doc: spell checking.
1285 * doc/bison.texinfo: here.
1286
1287 2009-09-16 Akim Demaille <demaille@gostai.com>
1288
1289 doc: comment changes.
1290 * doc/bison.texinfo: Comment changes.
1291
1292 2009-09-16 Akim Demaille <demaille@gostai.com>
1293
1294 lalr1.cc: factor the yytranslate_ invocation in make_SYMBOLS.
1295 * data/c++.m4, data/lalr1.cc (parser::symbol_type): Change the
1296 constructor to take a token_type instead of the (internal) symbol
1297 number.
1298 Call yytranslate_.
1299 * data/variant.hh (b4_symbol_constructor_define_): Therefore,
1300 don't call yytranslate_ here.
1301
1302 2009-09-16 Akim Demaille <demaille@gostai.com>
1303
1304 TODO: statistics.
1305 * TODO (Figures): New.
1306
1307 2009-09-13 Joel E. Denny <jdenny@clemson.edu>
1308
1309 tests: clean up push.at test group titles.
1310 * tests/push.at: Remove "Push Parsing: " from test group titles
1311 because these are already under the banner "Push Parsing Tests".
1312
1313 2009-09-12 Alex Rozenman <rozenman@gmail.com>
1314
1315 Provide an additional sub-message for clarity.
1316 Add "symbol not found in production" error message when
1317 an "invalid reference" is detected in named references
1318 resolution.
1319 * src/scan-code.l: Update "invalid reference" case.
1320 * tests/named-ref.at: Adjust test-cases.
1321
1322 2009-09-10 Joel E. Denny <jdenny@clemson.edu>
1323
1324 Clean up yacc.c a little.
1325 * data/yacc.c: Clean up M4 for readability, and make output
1326 whitespace more consistent. For the main parse function
1327 comment, instead of saying "yyparse or yypush_parse", say either
1328 "yyparse" or "yypush_parse" depending on which it actually is.
1329
1330 2009-09-10 Joel E. Denny <jdenny@clemson.edu>
1331
1332 Fix --enable-gcc-warnings.
1333 * src/parse-gram.y (%printer <param>): Handle param_none.
1334
1335 2009-09-09 Akim Demaille <demaille@gostai.com>
1336
1337 lalr1.cc: syntax_error as exceptions.
1338 It is common to use sort of factories in the user actions. These
1339 factories may check some "syntactic" constraints that are not
1340 enforced by the grammar itself. This is possible using YYERROR
1341 within the action itself. Provide the user with a means to throw
1342 a syntax_error exception.
1343
1344 * data/c++.m4 (b4_public_types_declare, b4_public_types_define):
1345 Declare and define yy::parser::syntax_error.
1346 * data/lalr1.cc: Include stdexcept.
1347 (yy::parser::parse): Wrap the user action within a try/catch.
1348 * data/glr.cc: Include stdexcept.
1349
1350 2009-09-09 Akim Demaille <demaille@gostai.com>
1351
1352 lalr1.cc: add missing "inline".
1353 * data/c++.m4 (b4_public_types_define): Add missing inline to
1354 implementations provided in headers.
1355
1356 2009-09-09 Akim Demaille <demaille@gostai.com>
1357
1358 %param: documentation.
1359 * NEWS (2.6): Document %param, %lex-param, and %parse-param
1360 changes.
1361 * doc/bison.texinfo: Document that %lex-param and %parse-param
1362 are n-ary.
1363 Changes some examples to demonstrate it.
1364 (Calc++ Parser): Use %param.
1365
1366 2009-09-09 Akim Demaille <demaille@gostai.com>
1367
1368 Regen.
1369
1370 2009-09-09 Akim Demaille <demaille@gostai.com>
1371
1372 style changes.
1373 * src/parse-gram.y (add_param): Scope changes.
1374
1375 2009-09-09 Akim Demaille <demaille@gostai.com>
1376
1377 %parse: support several arguments.
1378 * src/parse-gram.y (current_param): New.
1379 (param_type): Add param_none.
1380 (params): New nonterminal.
1381 Use it.
1382
1383 2009-09-09 Akim Demaille <demaille@gostai.com>
1384
1385 Regen.
1386
1387 2009-09-09 Akim Demaille <demaille@gostai.com>
1388
1389 %param.
1390 Provide a means to factor lex-param and parse-param common
1391 declarations.
1392
1393 * src/parse-gram.y (param_type): New.
1394 Define a %printer for it.
1395 (add_param): Use it.
1396 (%parse-param, %lex-param): Merge into...
1397 (%parse): this new token.
1398 Adjust the grammar to use it.
1399 * src/scan-gram.l (RETURN_VALUE): New.
1400 (RETURN_PERCENT_FLAG): Use it.
1401 (RETURN_PERCENT_PARAM): New.
1402 Use it to support %parse-param, %lex-param and %param.
1403
1404 2009-09-03 Joel E. Denny <jdenny@clemson.edu>
1405
1406 Use aver not assert.
1407 * src/output.c: Don't include assert.h.
1408 (output_skeleton): Use aver not assert.
1409 * src/system.h (aver): In documentation of why, add links to
1410 Paul Eggert's explanations in the mailing lists.
1411
1412 2009-09-05 Alex Rozenman <rozenman@gmail.com>
1413
1414 Use "Unresolved reference" error message when no symbols were found
1415 in a symbolic reference resolution. Remove .expr and -expr from
1416 the shown reference when the reference is unresolved.
1417 * src/scan-code.l: Change the error message, adjust location columns,
1418 rename variable "exact_mode" to "explicit_bracketing".
1419 * tests/named-ref.at: Adjust existing tests and add a new one.
1420
1421 2009-09-04 Akim Demaille <demaille@gostai.com>
1422
1423 Adjust synclines in src/parse-gram.[ch].
1424 * tests/bison.in: Do some magic (including working around issues
1425 with ylwrap) when this wrapper is used to compile
1426 src/parse-gram.y.
1427
1428 2009-09-03 Joel E. Denny <jdenny@clemson.edu>
1429
1430 Complain about unused %define variables and %code qualifiers.
1431 * NEWS (2.5): Document.
1432 * data/bison.m4 (b4_check_user_names): Complain instead of warn.
1433 * doc/bison.texinfo (Decl Summary): Document complaint, and
1434 improve %define documentation a little otherwise.
1435 * tests/input.at (Reject unused %code qualifiers): Update.
1436 (%define errors): Update.
1437 (%define, --define, --force-define): Update.
1438 (%define backward compatibility): Update.
1439 (Unused %define api.pure): Update.
1440 * tests/push.at (Push Parsing: Unsupported Skeletons): Update.
1441
1442 2009-09-03 Joel E. Denny <jdenny@clemson.edu>
1443
1444 Don't suppress warnings about unused parse.error.
1445 * data/bison.m4 (b4_error_verbose_flag): Don't examine value of
1446 %define variable parse.error unless b4_error_verbose_flag is
1447 actually expanded in a skeleton.
1448
1449 2009-09-03 Akim Demaille <demaille@gostai.com>
1450
1451 * NEWS (2.4.2): Add "Internationalization" item.
1452
1453 2009-09-03 Akim Demaille <demaille@gostai.com>
1454
1455 bootstrap: fix/improve find_tool.
1456 * bootstrap (find_tool): Improve error messages.
1457 Fix typo about find_tool_names.
1458
1459 2009-08-29 Joel E. Denny <jdenny@clemson.edu>
1460
1461 Fix gcc 3.4.4 shadowing warning reported by Eric Blake.
1462 See
1463 <http://lists.gnu.org/archive/html/bison-patches/2009-08/msg00093.html>.
1464 * src/scan-code.h (code_props_rule_action_init): Rename
1465 named_ref arg to name so it doesn't shadow named_ref type. This
1466 makes it consistent with the function definition in scan-code.l
1467 anyway.
1468
1469 2009-08-28 Joel E. Denny <jdenny@clemson.edu>
1470
1471 %define: accept unquoted values.
1472 * NEWS (2.5): Group all %define changes together, and document
1473 this one. Remove quotes in IELR and canonical LR entry.
1474 * doc/bison.texinfo: Remove quotes in most examples throughout.
1475 (Decl Summary): Update %define documentation.
1476 (Table of Symbols): Likewise.
1477 * src/ielr.c (LrType): Update documentation.
1478 * src/parse-gram.y (content.opt): Add production for ID.
1479 * tests/actions.at: Remove quotes in most tests.
1480 * tests/calc.at: Likewise.
1481 * tests/existing.at: Likewise.
1482 * tests/input.at: Likewise.
1483 * tests/local.at: Likewise.
1484 * tests/push.at: Likewise.
1485 * tests/reduce.at: Likewise.
1486 * tests/torture.at: Likewise.
1487
1488 2009-08-28 Joel E. Denny <jdenny@clemson.edu>
1489
1490 %define lr.type: make values lowercase IDs.
1491 That is, "LALR" => "lalr", "IELR" => "ielr", and
1492 "canonical LR" => "canonical-lr".
1493 * NEWS (2.5): Update documentation.
1494 * doc/bison.texinfo (Decl Summary): Likewise.
1495 * src/ielr.c (ielr): Use new values.
1496 * src/ielr.h (ielr): Update documentation.
1497 * src/reader.c (prepare_percent_define_front_end_variables): Use
1498 and validate new values.
1499 * tests/existing.at (AT_TEST_EXISTING_GRAMMAR): Update test
1500 grammars.
1501 * tests/reduce.at (AT_TEST_LR_TYPE): Likewise.
1502
1503 2009-08-27 Eric Blake <ebb9@byu.net>
1504
1505 scan-gram: avoid portability trap with ctype usage.
1506 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
1507 Avoid compiler warning.
1508
1509 2009-08-27 Joel E. Denny <jdenny@clemson.edu>
1510
1511 tests: use perl for printing special sequences to files.
1512 And skip tests if perl is not available. This is better than
1513 playing tricks with shell portability. Suggested by Akim
1514 Demaille.
1515 * tests/input.at (Bad character literals): Use it here for
1516 omitting final newlines.
1517 (Bad escapes in literals): Use it here for special characters.
1518
1519 2009-08-26 Joel E. Denny <jdenny@clemson.edu>
1520
1521 tests: show a use of %define lr.default-reductions "consistent"
1522 * tests/conflicts.at (%nonassoc and eof): Extend to test that it
1523 prevents the omission of expected tokens for %error-verbose.
1524
1525 2009-08-26 Akim Demaille <demaille@gostai.com>
1526
1527 tests: portability fix.
1528 * tests/input.at (Bad escapes in literals): Don't expect "echo
1529 '\0'" to output \ then 0.
1530
1531 2009-08-26 Joel E. Denny <jdenny@clemson.edu>
1532
1533 Actually handle the yytable zero value correctly this time.
1534 * data/bison.m4 (b4_integral_parser_tables_map): Don't mention
1535 zero values in the YYTABLE comments.
1536 * data/glr.c (yytable_value_is_error): Don't check for zero
1537 value.
1538 * data/lalr1.cc (yy_table_value_is_error_): Likewise.
1539 * data/yacc.c (yytable_value_is_error): Likewise.
1540 * data/lalr1.java (yy_table_value_is_error_): Likewise.
1541 (yysyntax_error): Fix typo in code: use yytable_ not yycheck_.
1542 * src/tables.h: In header comments, explain why it's useless to
1543 check for a zero value in yytable.
1544
1545 2009-08-25 Joel E. Denny <jdenny@clemson.edu>
1546
1547 More fixes related to last two patches.
1548 * data/bison.m4 (b4_integral_parser_tables_map): Fix YYTABLE
1549 comments: zero indicates syntax error not default action.
1550 * data/c.m4 (b4_table_value_equals): Comment that YYID must be
1551 defined.
1552 * data/glr.c (yyis_pact_ninf): Rename to...
1553 (yypact_value_is_default): ... this.
1554 (yyisDefaultedState): Update for rename.
1555 (yyis_table_ninf): Rename to...
1556 (yytable_value_is_error): ... this, and check for value zero
1557 besides just YYTABLE_NINF.
1558 (yygetLRActions): Check for default value from yypact. It
1559 appears that this check is always performed before this function
1560 is invoked, and so adding the check here is probably redundant.
1561 However, the code may evolve after this subtlety is forgotten.
1562 Also, update for rename to yytable_value_is_error. Because that
1563 macro now checks for zero, a different but equivalent branch of
1564 the if-then-else here is evaluated.
1565 (yyreportSyntaxError): Update for rename to
1566 yytable_value_is_error. The zero condition was mishandled
1567 before.
1568 (yyrecoverSyntaxError): Update for renames. No behavioral
1569 changes.
1570 * data/lalr1.cc, data/lalr1.java (yy_pact_value_is_default_):
1571 New function.
1572 (yy_table_value_is_error_): New function.
1573 (parse): Use new functions where possible. No behavioral
1574 changes.
1575 (yysyntax_error_, yysyntax_error): Use yy_table_value_is_error_.
1576 The zero condition was mishandled before.
1577 * data/yacc.c (yyis_pact_ninf): Rename to...
1578 (yypact_value_is_default): ... this.
1579 (yyis_table_ninf): Rename to...
1580 (yytable_value_is_error): ... this, and check for value zero
1581 besides just YYTABLE_NINF.
1582 (yysyntax_error): Update for rename to yytable_value_is_error.
1583 The zero condition was mishandled before.
1584 (yyparse): Update for renames. No behavioral changes.
1585 * src/tables.h: Improve comments about yypact, yytable, etc.
1586 more. Most importantly, say yytable value of zero means syntax
1587 error not default action.
1588
1589 2009-08-25 Joel E. Denny <jdenny@clemson.edu>
1590
1591 Fix %error-verbose for conflicts resolved by %nonassoc.
1592 * NEWS (2.5): Document.
1593 * data/glr.c (yyreportSyntaxError): Fix this by checking
1594 yyis_table_ninf.
1595 * data/yacc.c (yysyntax_error): Likewise.
1596 * data/lalr1.cc (yysyntax_error_): Fix this by checking
1597 yytable_ninf_.
1598 * data/lalr1.java (yysyntax_error): Likewise.
1599 * tests/conflicts.at (%nonassoc and eof): Update expected output
1600 and remove FIXME.
1601
1602 2009-08-25 Joel E. Denny <jdenny@clemson.edu>
1603
1604 Some code and documentation improvements.
1605 * data/c.m4 (b4_table_value_equals): New macro to capture
1606 some repeated code.
1607 * data/glr.c (yyis_pact_ninf): Use it here.
1608 (yyis_table_ninf): Likewise.
1609 (yyreportSyntaxError): Improve internal comments.
1610 * data/yacc.c (yyis_pact_ninf): New macro copied from glr.c.
1611 Use it everywhere possible.
1612 (yyis_table_ninf): Likewise.
1613 (yysyntax_error): Improve internal comments.
1614 * data/lalr1.cc (yysyntax_error_): Likewise.
1615 * data/lalr1.java (yysyntax_error): Likewise.
1616 * src/tables.h: Improve comments about yypact, yytable, etc.
1617
1618 2009-08-21 Joel E. Denny <jdenny@clemson.edu>
1619
1620 Use locale when quoting.
1621 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER): Use
1622 quote rather than implementing quoting here.
1623
1624 2009-08-20 Eric Blake <ebb9@byu.net>
1625
1626 Make previous patch more robust.
1627 * src/output.c (ARRAY_CARDINALITY): New macro, copied from
1628 argmatch.h.
1629 (output_skeleton): Use it.
1630 Suggested by Akim Demaille.
1631
1632 Import latest m4/m4.m4.
1633 * submodules/autoconf: Update to autoconf 2.64.
1634 * configure.ac (M4_GNU_OPTION): New define.
1635 * src/output.c (output_skeleton): Use it to resolve FIXME.
1636 * NEWS: Mention this.
1637
1638 2009-08-19 Joel E. Denny <jdenny@clemson.edu>
1639
1640 Fix complaints about escape sequences.
1641 Discussed starting at
1642 <http://lists.gnu.org/archive/html/bison-patches/2009-08/msg00036.html>.
1643 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER):
1644 For a \0 and similar escape sequences meaning the null
1645 character, report an invalid escape sequence instead of an
1646 invalid null character because the latter does not actually
1647 appear in the user's input.
1648 In all escape sequence complaints, don't escape the initial
1649 backslash, and don't quote when the sequence appears at the end
1650 of the complaint line unless there's whitespace that quotearg
1651 won't escape.
1652 Consistently say "invalid" not "unrecognized".
1653 Consistently prefer "empty character literal" over "extra
1654 characters in character literal" warning for invalid escape
1655 sequences; that is, consistently discard those sequences.
1656 * tests/input.at (Bad escapes in literals): New.
1657
1658 2009-08-19 Akim Demaille <demaille@gostai.com>
1659
1660 doc: fixes.
1661 * doc/bison.texinfo: Fix minor Texinfo errors.
1662
1663 2009-08-19 Akim Demaille <demaille@gostai.com>
1664
1665 tests: distcc compliance.
1666 * tests/synclines.at (AT_SYNCLINES_COMPILE): Discard distcc's
1667 error messages from the output.
1668
1669 2009-08-19 Akim Demaille <demaille@gostai.com>
1670
1671 variables: simplify the upgrade of namespace into api.namespace.
1672
1673 This patch simplifies "variables: rename namespace as
1674 api.namespace", commit 67501061076ba46355cfd9f9361c7eed861b389c.
1675 Suggested by Joel E. Denny in
1676 http://lists.gnu.org/archive/html/bison-patches/2009-07/msg00006.html
1677
1678 * src/muscle-tab.c (muscle_percent_variable_update): New.
1679 (muscle_percent_define_insert): Use it in replacement of the
1680 previous tr invocation.
1681 Remove variable_tr, no longer needed.
1682 * data/bison.m4 (b4_percent_define_copy_, b4_percent_define_copy):
1683 Remove.
1684 * data/c++.m4: No longer handle namespace -> api.namespace.
1685 * tests/input.at (%define backward compatibility): Check that
1686 namespace is treated as api.namespace.
1687
1688 2009-08-19 Akim Demaille <demaille@gostai.com>
1689
1690 doc: %initial-action to initialize yylloc.
1691 Reported by Bill Allombert.
1692 * doc/bison.texinfo: Set fill-column to 76.
1693 (Location Type): Document the use of %initial-action to initialize
1694 yylloc.
1695
1696 2009-08-19 Akim Demaille <demaille@gostai.com>
1697
1698 lalr1.cc: use state_type.
1699 * data/lalr1.cc (yysyntax_error_): Use state_type.
1700 Move argument names into yy*.
1701
1702 2009-08-19 Akim Demaille <demaille@gostai.com>
1703
1704 lalr1.cc: get rid of yyparse's yystate.
1705 yystate and yystack_[0].state are equal, keep only the latter.
1706 The former was also used as a temporary variable to compute the
1707 post-reduction state. Move this computation into an auxiliary
1708 function.
1709
1710 * data/glr.c (yyLRgotoState): Fuse variable definition and first
1711 assignment.
1712 * data/lalr1.cc (yy_lr_goto_state_): New.
1713 (yyparse): Use it.
1714 Replace remaining uses of yystate by yystate_[0].state.
1715 Remove the former.
1716
1717 2009-08-19 Akim Demaille <demaille@gostai.com>
1718
1719 lalr1.cc: destroy $$ when YYERROR is called.
1720 * data/lalr1.cc (yyreduce): Compute the resulting state before
1721 running the user action so that yylhs is a valid symbol.
1722 (yyerrorlab): Since yylhs is complete (it knows its type), we can
1723 simply call yy_destroy_ to destroy $$ on YYERROR invocations.
1724 * tests/c++.at (AT_CHECK_VARIANTS): Test YYERROR with variants.
1725
1726 2009-08-18 Joel E. Denny <jdenny@clemson.edu>
1727
1728 maint: update for gnulib's recent update-copyright changes
1729 * gnulib: Update.
1730 * .x-update-copyright (COPYING): Add as it's no longer implied
1731 when .x-update-copyright is present.
1732 * cfg.mk (update-copyright-local): Remove, now ignored.
1733 (update-copyright): Declare update-b4-copyright as a dependency.
1734
1735 2009-08-17 Akim Demaille <demaille@gostai.com>
1736
1737 build: require gettext 0.17.
1738
1739 Suggested by Bruno Haible.
1740 http://lists.gnu.org/archive/html/bug-bison/2009-08/msg00009.html
1741 * configure.ac: require gettext 0.17 to ensure compatibility with
1742 gnulib.
1743
1744 2009-08-17 Akim Demaille <demaille@gostai.com>
1745
1746 build: lower gettext requirements.
1747
1748 Bison was uselessly requiring the formatstring macros from
1749 gettext, which resulted in mo files not being installed on systems
1750 that perfectly supported Bison mo files. Lower the requirement.
1751 http://lists.gnu.org/archive/html/bug-bison/2009-08/msg00006.html
1752
1753 * configure.ac: Require need-ngettext instead of
1754 need-formatstring-macros.
1755 Reported by Martin Jabocs.
1756 Suggested by Bruno Haible.
1757 * INSTALL: Restructure.
1758 (Internationalization): New.
1759
1760 2009-08-14 Joel E. Denny <jdenny@clemson.edu>
1761
1762 maint: fix use of copyright year intervals.
1763 * gnulib: Update.
1764 * bootstrap.conf (gnulib_modules): Update getopt to getopt-gnu
1765 as now recommended in gnulib/NEWS.
1766 * build-aux/update-b4-copyright: Fix.
1767 * cfg.mk (update-copyright-env): Configure update-copyright.
1768
1769 2009-08-13 Joel E. Denny <jdenny@clemson.edu>
1770
1771 Make it easier to write deterministic tests.
1772 Continues Akim's work from his 2009-06-10 commits.
1773 * src/reader.c (check_and_convert_grammar): Don't add any
1774 symbols after the first symbols_do invocation.
1775 * src/symtab.c (symbols_sorted): New static global.
1776 (user_token_number_redeclaration): Update comments.
1777 (symbol_from_uniqstr): If a new symbol is being created, assert
1778 that symbols_sorted hasn't been allocated yet.
1779 (symbols_free): Free symbols_sorted.
1780 (symbols_cmp, symbols_cmp_qsort): New functions.
1781 (symbols_do): Sort symbol_table into symbols_sorted on first
1782 invocation.
1783 * tests/input.at (Numbered tokens): Recombine tests now that the
1784 output should be deterministic across multiple numbers.
1785
1786 2009-08-12 Akim Demaille <demaille@gostai.com>
1787
1788 tests: GCC 4.5 compliance.
1789 * tests/synclines.at (AT_SYNCLINES_COMPILE): Adjust to GCC 4.5's
1790 messages about #error.
1791
1792 2009-08-12 Akim Demaille <demaille@gostai.com>
1793
1794 build: fix the generation of the documentation.
1795 Some of our targets use "bison --help", but they can't depend on
1796 "bison" itself (to avoid additional requirements on the user), so
1797 they used to call "make src/bison" in the commands. Then
1798 concurrent builds may fail: one make might be aiming one of its
1799 jobs at compiling src/bison, and another job at generating the man
1800 page. If the latter is faster than the former, then we have two
1801 makes that concurrently try to compile src/bison.
1802
1803 This might also be a more convincing explanation for the failure
1804 described in the patch "build: fix paths".
1805
1806 * Makefile.am (SUFFIXES): Initialize.
1807 * build-aux/move-if-change: New, symlink to gnulib's.
1808 * build-aux/local.mk: Ship it.
1809 * doc/common.x: Remove, merged into...
1810 * doc/bison.x: here.
1811 * doc/local.mk (doc/bison.help): New.
1812 ($(CROSS_OPTIONS_TEXI)): Depend on it.
1813 Use src/bison.
1814 (.x.1): Replace with...
1815 (doc/bison.1): this explicit, simpler, target.
1816 (common_dep): Remove, inlined where appropriate.
1817 (SUFFIXES, PREPATH): Remove, unused.
1818
1819 2009-08-12 Akim Demaille <demaille@gostai.com>
1820
1821 gnulib: improve prefixing.
1822 * configure.ac (gl_PREFIXED_LIBOBJS): Don't rename it, rather,
1823 change the value of...
1824 (gl_LIBOBJS): this.
1825 Adjust more variables.
1826 * etc/prefix-gnulib-mk (prefix_assignment): Don't rename
1827 gl_LIBOBJS.
1828 (prefix): Also transform rules whose targets have slashes.
1829 Use $prefix liberally.
1830 Map @MKDIR_P@ to $(MKDIR_P).
1831 Prefix directories that are mkdir'd.
1832
1833 2009-08-12 Akim Demaille <demaille@gostai.com>
1834
1835 build: fix paths.
1836 When using $(top_builddir) inconsistently, Make (including GNU
1837 Make) is sometimes confused. As a result it may want to build
1838 lib/libbison.la and $(top_builddir)/lib/libbison.la (the same
1839 file, different names) concurrently, which, amusingly enough,
1840 might end with:
1841
1842 ranlib lib/libbison.a
1843 ranlib lib/libbison.a
1844 make[2]: *** [lib/libbison.a] Segmentation fault
1845
1846 on OS X.
1847
1848 * doc/local.mk, src/local.mk: Do not use $(top_builddir) when not
1849 needed.
1850
1851 2009-08-12 Akim Demaille <demaille@gostai.com>
1852
1853 distcheck: fix.
1854
1855 * examples/calc++/Makefile.am: (EXTRA_DIST): Ship calc.stamp.
1856
1857 2009-08-10 Joel E. Denny <jdenny@clemson.edu>
1858
1859 * tests/local.mk (TESTSUITE_AT): Add named-refs.at.
1860
1861 2009-08-10 Joel E. Denny <jdenny@clemson.edu>
1862
1863 Miscellaneous code readability improvements.
1864
1865 * src/reader.c (reader): Move %define front-end variable
1866 defaults and checking into...
1867 (prepare_percent_define_front_end_variables): ... this new
1868 function.
1869
1870 * src/scan-gram.l (INITIAL): For consistency with string
1871 literals, don't store open quote on character literal. It's
1872 discarded before returning anyway.
1873 (SC_ESCAPED_CHARACTER): Similarly, don't store close quote.
1874 Make length test more readable, and make the character stored
1875 for an empty literal more obvious while consistent with the
1876 previous behavior.
1877
1878 * src/symtab.c, src/symtab.h: Rename USER_NUMBER_ALIAS to
1879 USER_NUMBER_HAS_STRING_ALIAS throughout.
1880 * src/symtab.c (symbol_make_alias): Remove comment from symtab.c
1881 that is repeated in symtab.h. Improve argument names to make it
1882 clear which side of the symbol-string alias pair is which.
1883 (symbol_check_alias_consistency): Improve local variable names
1884 for the same purpose.
1885 * src/symtab.h (struct symbol): Make comments about aliases
1886 clearer.
1887 (symbol_make_alias): Improve comments and argument name.
1888 * src/output.c (token_definitions_output): Update for rename to
1889 USER_NUMBER_HAS_STRING_ALIAS and improve comments about aliases.
1890
1891 2009-08-08 Alex Rozenman <rozenman@gmail.com>
1892
1893 Convert "misleading reference" messages to warnings.
1894 * src/scan-code.l: New function 'show_sub_messages', more
1895 factoring.
1896 * tests/named-ref.at: Adjust tests.
1897
1898 2009-08-06 Joel E. Denny <jdenny@clemson.edu>
1899
1900 maint: run "make update-copyright"
1901
1902 2009-08-06 Joel E. Denny <jdenny@clemson.edu>
1903
1904 maint: make update-b4-copyright easier to use
1905 * build-aux/update-b4-copyright: In warnings, report line
1906 numbers rather than character positions.
1907 * cfg.mk (update-copyright-local): Set to update-b4-copyright so
1908 that update-copyright runs it.
1909 * gnulib: Update.
1910
1911 2009-08-05 Joel E. Denny <jdenny@clemson.edu>
1912
1913 maint: clean up update-b4-copyright code
1914 * build-aux/update-b4-copyright: Do not accept 2-digit
1915 UPDATE_COPYRIGHT_YEAR, which was not handled correctly.
1916 Don't accept a `[' in a b4_copyright argument.
1917 Format code more consistently.
1918 Don't assume b4*copyright never occurs.
1919
1920 2009-08-04 Joel E. Denny <jdenny@clemson.edu>
1921
1922 maint: automate b4_copyright updates.
1923 * Makefile.am (update-b4-copyright): New target rule.
1924 * build-aux/local.mk (EXTRA_DIST): Add update-b4-copyright.
1925 * build-aux/update-b4-copyright: New.
1926 * data/yacc.c: Remove stray characters around b4_copyright
1927 invocations.
1928
1929 2009-08-04 Joel E. Denny <jdenny@clemson.edu>
1930
1931 maint: automate annual package-wide copyright-year update.
1932 * .x-update-copyright: New.
1933 * Makefile.am (EXTRA_DIST): Remove maint.mk.
1934 * bootstrap.conf (gnulib_modules): Add maintainer-makefile and
1935 update-copyright. Remove gnumakefile, which is implied by
1936 maintainer-makefile.
1937 * cfg.mk (bootstrap-tools): Copy from old maint.mk.
1938 * gnulib: Update.
1939 * maint.mk: Remove, now copied from gnulib.
1940 * examples/extexi: Add missing "(C)" in copyright statement so
1941 update-copyright can recognize it.
1942 * src/LR0.h: Likewise.
1943 * src/print.h: Likewise.
1944 * src/print_graph.h: Likewise.
1945 * src/gram.c: Add missing comma in copyright statement.
1946 * src/gram.h: Likewise.
1947
1948 2009-08-04 Joel E. Denny <jdenny@clemson.edu>
1949
1950 Fix "make distcheck".
1951 * examples/calc++/Makefile.am: Say $(srcdir)/calc.stamp instead
1952 of just calc.stamp.
1953
1954 2009-08-01 Joel E. Denny <jdenny@clemson.edu>
1955
1956 Pacify "gcc -Wunused" for the input function from Flex.
1957 Reported by Alex Rozenman. This warning shows up with gcc-4.3.0
1958 and later.
1959 * src/scan-code.l: Add "%option noinput", which I cannot find in
1960 the Flex manual, but which Flex has supported since at least as
1961 far back as 2.5.4. However, if any of our developers still use
1962 Flex 2.5.4, they'll need to stop configuring with
1963 --enable-gcc-warnings because "%option noinput" didn't work
1964 correctly until Flex 2.5.6.
1965 * src/scan-gram.l: Likewise.
1966 * src/scan-skel.l: Likewise.
1967
1968 2009-07-31 Alex Rozenman <rozenman@gmail.com>
1969
1970 Fix --enable-gcc-warnings problems.
1971 * src/reader.c: Adjust variable names.
1972 * src/scan-code.l: Fix prototypes and adjust names.
1973 * src/named-ref.c: Remove redundant "if".
1974
1975 2009-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
1976
1977 Fix a --enable-gcc-warnings problem.
1978 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Actually use length
1979 variable.
1980
1981 2009-07-24 Joel E. Denny <jdenny@ces.clemson.edu>
1982
1983 Warn about character literals not of length one.
1984 * NEWS (2.5): Document.
1985 * src/scan-gram.l (INITIAL): Remove comment that we don't check
1986 the length.
1987 (SC_ESCAPED_CHARACTER): Warn if length is wrong.
1988 * tests/input.at (Bad character literals): New test group.
1989
1990 2009-07-24 Alex Rozenman <rozenman@gmail.com>
1991
1992 Fix some memory leaks.
1993 * src/named-ref.c: Add a pointer check (named_ref_free).
1994 * src/scan-code.l: New function (variant_table_free). Called in
1995 code_scanner_free.
1996 * src/symlist.c: Call to named_ref_free (symbol_list_free).
1997
1998 2009-07-24 Joel E. Denny <jdenny@ces.clemson.edu>
1999
2000 * src/lalr.c (state_lookahead_tokens_count): Correct comment.
2001
2002 2009-07-22 Joel E. Denny <jdenny@ces.clemson.edu>
2003
2004 Some M4 cleanup in the testsuite.
2005 Suggested by Eric Blake at
2006 <http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00083.html>.
2007 * tests/existing.at (_AT_TEST_EXISTING_GRAMMAR): Do not
2008 complicate the code by distinguishing between a missing value
2009 and an empty string value for an optional argument. This fix is
2010 allowed by the similar fix in AT_TEST_TABLES_AND_PARSE below.
2011 * tests/local.at (_AT_TEST_TABLES_AND_PARSE): Merge into...
2012 (AT_TEST_TABLES_AND_PARSE): ... this now that the special
2013 arguments are not needed because of the following changes.
2014 Fix stale comments.
2015 Bison developers should use GNU M4 and should not use
2016 POSIXLY_CORRECT when building the test suite, so do not
2017 complicate the code by avoiding $10 and above.
2018 Do not quote an empty string value for an optional argument, and
2019 do not distinguish between a missing value and an empty string
2020 value.
2021
2022 2009-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
2023
2024 Revert unnecessary column realignment in --help output.
2025 Reported by Akim Demaille at
2026 <http://lists.gnu.org/archive/html/bison-patches/2009-06/msg00010.html>.
2027 * src/getargs.c (usage): Here.
2028
2029 2009-07-04 Alex Rozenman <rozenman@gmail.com>
2030
2031 Alphabetical order in src/local.mk.
2032 * src/local.mk: Adjust.
2033
2034 2009-07-04 Alex Rozenman <rozenman@gmail.com>
2035
2036 Style changes and factoring.
2037 * src/named-ref.h: Add comments.
2038 * src/parse-gram.y: Readability and style changes.
2039 * src/reader.c: Factoring: assign_named_ref function.
2040 * src/scan-code.l: Factoring and style changes. Rename
2041 parse_named_ref to parse_ref. Use "c-ctype.h" from gnulib.
2042 Use "unsigned" type for variant index. Improve readablity.
2043 * src/scan-gram.l: Change error messages and add comments.
2044 * src/symlist.h: symbol_list_null: New function decl.
2045 * src/symlist.c: symbol_list_null: Implement here.
2046 * tests/named-refs.at: Adjust for new error messages.
2047
2048 2009-06-29 Eric Blake <ebb9@byu.net>
2049
2050 scan-code: avoid compiler warnings
2051 * src/scan-code.l (parse_named_ref): Use correct specifiers.
2052
2053 2009-06-29 Akim Demaille <demaille@gostai.com>
2054
2055 build: avoid concurrent extraction of calc++.
2056 * examples/calc++/Makefile.am (calc.stamp): New.
2057 Depend on it to create the sources of calc++ so that concurrent
2058 builds don't launch several "extexi" in parallel.
2059 Not only this is inefficient, this also builds incorrect sources
2060 with several extractions mixed together.
2061
2062 2009-06-29 Akim Demaille <demaille@gostai.com>
2063
2064 parse.error: fix.
2065 * data/bison.m4: Move code related to specific variables after the
2066 definition of the variable-maintaining macros so that we don't
2067 "invoke" b4_percent_define_check_values before it is defined.
2068
2069 2009-06-29 Akim Demaille <demaille@gostai.com>
2070
2071 variables: parse.error
2072
2073 Implement, document, and test the replacement of %error-verbose
2074 by %define parse.error "verbose".
2075 * data/bison.m4 (b4_error_verbose_if): Reimplement to track the
2076 values of the parse.error variable.
2077 Make "simple" its default value.
2078 Check the valid values.
2079 * src/parse-gram.y: Use %define parse.error.
2080 (PERCENT_ERROR_VERBOSE): New token.
2081 Support it.
2082 * src/scan-gram.l: Support %error-verbose.
2083
2084 * doc/bison.texinfo (Decl Summary): Replace the documentation of
2085 %define error-verbose by that of %define parse.error.
2086 * NEWS: Document it.
2087
2088 * tests/actions.at, tests/calc.at: Use parse.error instead of
2089 %error-verbose.
2090
2091 2009-06-27 Alex Rozenman <rozenman@gmail.com>
2092
2093 Implement support for named symbol references.
2094 * src/parse-gram.y: Add new syntax (named_ref.opt).
2095 * src/reader.c: Store named refs in symbol lists.
2096 * src/reader.h: New argument for symbol_append and
2097 action_append functions.
2098 * src/scan-code.h: Add new field (named_ref) into
2099 code_props data structure. Keeps named ref of midrule
2100 actions.
2101 * src/scan-code.l: Support for named refs in semantic
2102 action code. New function 'parse_named_ref'.
2103 * src/scan-gram.l: Support bracketed id.
2104 * src/symlist.c: Store named refs in symbol lists.
2105 * src/symlist.h: New field in symbol list: named_ref.
2106 * src/named-ref.h: New file, a struct for named_ref.
2107 * src/named-ref.cp: New file, named_ref_new function.
2108 * src/local.mk: Add two new files.
2109 * tests/testsuite.at: Include new test group:
2110 * tests/named-refs.at: this new file.
2111
2112 2009-06-25 Akim Demaille <demaille@gostai.com>
2113
2114 hash: check insertion for memory exhaustion.
2115 * src/uniqstr.c (uniqstr_new): New.
2116
2117 2009-06-24 Akim Demaille <demaille@gostai.com>
2118
2119 variables: rename namespace as api.namespace.
2120 Discussed in
2121 http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00033.html
2122
2123 * data/bison.m4 (b4_percent_define_copy_, b4_percent_define_copy):
2124 New.
2125 (b4_percent_define_use): New.
2126 Use it where applicable.
2127 * data/c++.m4: Replace uses of the variable "namespace" by
2128 "api.namespace".
2129 Default the latter to the former.
2130 * doc/bison.texinfo (Decl Summary): Document "namespace" as
2131 obsolete.
2132 Document api.namespace.
2133 Use @samp to document %define uses, keep @code for identifiers.
2134 * NEWS: Likewise.
2135 * tests/c++.at, tests/input.at: Test api.namespace instead of
2136 namespace. (The tests passed with namespace.)
2137
2138 2009-06-11 Akim Demaille <demaille@gostai.com>
2139
2140 style changes.
2141 * data/xslt/xml2dot.xsl, data/xslt/xml2xhtml.xsl: Space changes.
2142 * src/print-xml.c: Style changes.
2143 * tests/conflicts.at: Comment changes.
2144
2145 2009-06-11 Akim Demaille <demaille@gostai.com>
2146
2147 xml: beware of user strings used to give a %prec to rules.
2148 * tests/conflicts.at (%prec with user strings): New.
2149 * src/gram.c (grammar_rules_print_xml): Escape the precedence for
2150 XML output.
2151
2152 2009-06-11 Akim Demaille <demaille@gostai.com>
2153
2154 hash: check insertion for memory exhaustion.
2155 * src/muscle-tab.c (muscle_insert, muscle_grow)
2156 * src/state.c (state_hash_insert): Check the return value of
2157 hash_insert.
2158
2159 2009-06-11 Akim Demaille <demaille@gostai.com>
2160
2161 tests: honor TESTSUITEFLAGS in every check target.
2162 * tests/local.mk (RUN_TESTSUITE): New.
2163 (check-local, installcheck-local, maintainer-check-g++)
2164 (maintainer-check-posix, maintainer-check-valgrind): Use it.
2165
2166 2009-06-10 Akim Demaille <demaille@gostai.com>
2167
2168 deterministic test suite.
2169 Some consistency checks on symbols are performed after all the
2170 symbols were read, by an iteration over the symbol table. This
2171 traversal is nondeterministic, which can be a problem for test
2172 cases.
2173 Avoid this.
2174 Addresses another form of nondeterminism reported by Joel E. Denny.
2175 http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00023.html
2176
2177 * tests/input.at (Numbered tokens): Split the hexadecimal/decimal
2178 test in two.
2179 Use different file names for the three tests to make the
2180 maintenance easier.
2181
2182 2009-06-10 Akim Demaille <demaille@gostai.com>
2183
2184 gnulib: update.
2185 * gnulib: Update to latest.
2186 * lib/.cvsignore, lib/.gitignore, m4/.cvsignore,
2187 * m4/.gitignore: Regen.
2188 * src/symtab.c (symbol_from_uniqstr, semantic_type_from_uniqstr):
2189 Call xalloc_die on hash_insert failures.
2190 Requested by the new __warn_unused_result__ attribute of
2191 hash_insert.
2192
2193 2009-06-10 Akim Demaille <demaille@gostai.com>
2194
2195 deterministic user-token-number redeclaration errors.
2196 Address nondeterminism reported by Joel E. Denny.
2197 http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00023.html
2198
2199 * src/uniqstr.h: Comment changes.
2200 * src/location.h (boundary_cmp, location_cmp): New.
2201 * src/symtab.c (user_token_number_redeclaration): New.
2202 (symbol_translation): Use it.
2203 * tests/input.at (Numbered tokens): Adjust the expected output.
2204
2205 2009-05-25 Akim Demaille <demaille@gostai.com>
2206
2207 build: avoid ignored errors.
2208 * doc/local.mk ($(CROSS_OPTIONS_TEXI)): Don't generate ignored
2209 errors, they pollute the output.
2210
2211 2009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
2212
2213 Convert multiple variable definition warnings to complaints.
2214 * NEWS (2.5): Add a new entry for that change.
2215 * doc/bison.texinfo (Decl Summary): Update %define entry.
2216 (Bison Options): Update -D/--define/-F/--force-define entry.
2217 * src/muscle-tab.c (muscle_percent_define_insert): Implement.
2218 * src/muscle-tab.h (muscle_percent_define_insert): Update
2219 comments.
2220 * tests/input.at (`%define errors'): Update.
2221 (`%define, --define, --force-define'): Update.
2222
2223 2009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
2224
2225 -F/--force-define and relative %define/-D/--define priorities.
2226 * NEWS (2.5): Add documentation to -D/--define entry.
2227 * build-aux/cross-options.pl: Hard-code association of
2228 --force-define with %define.
2229 * doc/bison.texinfo (Decl Summary): In %define entry,
2230 cross-reference command-line options.
2231 (Bison Options): Add documentation to -D/--define entry.
2232 (Option Cross Key): Widen column for --force-define row.
2233 * src/getargs.c (usage): Document -F/--force-define. Realign
2234 options in output.
2235 (short_options, long_options, getargs): Parse -F/--force-define,
2236 and update muscle_percent_define_insert invocations.
2237 * src/muscle-tab.h (muscle_percent_define_how): New enum type.
2238 (muscle_percent_define_insert): Add argument with that type.
2239 * src/muscle-tab.c (muscle_percent_define_insert): Implement
2240 -F/--force-define behavior and priorities.
2241 (muscle_percent_define_ensure): Update
2242 muscle_percent_define_insert invocation.
2243 * src/parse-gram.y (prologue_declaration): Update
2244 muscle_percent_define_insert invocations.
2245 * tests/input.at (`%define, --define'): Rename to...
2246 (`%define, --define, --force-define'): ... this and extend.
2247
2248 2009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
2249
2250 Update some comments to make sense for -D.
2251 * data/bison.m4 (b4_check_user_names): In header comments, say
2252 "user occurrence" instead of "grammar occurrence".
2253 * src/muscle-tab.h (muscle_percent_define_insert): Likewise.
2254 (muscle_percent_code_grow): Likewise just for consistency.
2255
2256 2009-05-20 Joel E. Denny <jdenny@ces.clemson.edu>
2257
2258 * data/c++.m4 (b4_namespace_close): Simplify slightly.
2259
2260 2009-05-19 Joel E. Denny <jdenny@ces.clemson.edu>
2261
2262 Handle a trailing `:' in a user-supplied C++ namespace better.
2263 * data/c++.m4 (b4_namespace_close): Don't let it be printed
2264 among the closing braces here. This fix might make the
2265 generated code easier to debug, but otherwise it should be
2266 insignificant because a trailing `:' is a C++ error already.
2267
2268 2009-05-19 Akim Demaille <demaille@gostai.com>
2269
2270 remove useless variable.
2271 * src/getargs.c (skeleton_arg): Remove now useless variable.
2272 Should help the compiler see that this printf-like call is sane.
2273
2274 2009-05-15 Akim Demaille <demaille@gostai.com>
2275
2276 Rename token.prefix as api.tokens.prefix.
2277 Discussed here.
2278 http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00024.html.
2279
2280 * NEWS, data/bison.m4, data/c.m4, data/java.m4, doc/bison.texinfo,
2281 * tests/c++.at, tests/calc.at, tests/java.at, tests/local.at
2282 (token.prefix): Rename as...
2283 (api.tokens.prefix): this.
2284
2285 2009-05-11 Akim Demaille <demaille@gostai.com>
2286
2287 doc: use C++ headers.
2288 * doc/bison.texinfo (Calc++ Scanner): Prefer C++ headers to C
2289 headers.
2290
2291 2009-05-11 Akim Demaille <demaille@gostai.com>
2292
2293 doc: token.prefix
2294 * doc/bison.simple (Decl Summary): Document token.prefix.
2295 (Calc++ Parser): Various fixes.
2296 Formatting changes.
2297 Use token.prefix.
2298 Introduce a macro TOKEN to shorten the code and make it more
2299 readable.
2300 (Calc++ Scanner): Adjust.
2301 * NEWS (Variable token.prefix): New.
2302
2303 2009-05-04 Akim Demaille <demaille@gostai.com>
2304
2305 bison: catch bad symbol names.
2306 * src/scan-gram.l({int}{id}): Report as an invalid identifier.
2307 * tests/input.at: Adjust.
2308
2309 2009-05-04 Akim Demaille <demaille@gostai.com>
2310
2311 identifiers: dashes are letters.
2312 Dashes can now start identifiers (symbols and directives).
2313
2314 * src/scan-gram.l ({letter}): Add dash.
2315 ({id}): Remove it.
2316 * tests/input.at (Symbols): Adjust.
2317 Remove stray comment.
2318 * tests/regression.at (Invalid inputs): Adjust error message.
2319 * doc/bison.texinfo (Symbols): Update.
2320
2321 2009-05-01 Joel E. Denny <jdenny@ces.clemson.edu>
2322
2323 Declare %code to be a permanent feature.
2324 * NEWS (2.4.2): Here.
2325 * doc/bison.texinfo (Prologue Alternatives): Don't say it's
2326 experimental.
2327 (Decl Summary): Likewise.
2328
2329 2009-04-30 Joel E. Denny <jdenny@ces.clemson.edu>
2330
2331 Convert underscores to dashes in some %define variable names.
2332 For now, just api.push-pull and lr.keep-unreachable-states.
2333 Maintain old names for backward compatibility.
2334 * NEWS (2.5): Document.
2335 * data/c.m4 (b4_identification): Update comment.
2336 * data/yacc.c: Update access.
2337 * doc/bison.texinfo: Update.
2338 * etc/bench.pl.in (bench_push_parser): Update use.
2339 * src/files.c (tr): Move to...
2340 * src/getargs.c, src/getargs.h (tr): ... here because I can't
2341 think of a better place to expose it. My logic is that, for all
2342 uses of tr so far, command-line arguments can be involved, and
2343 getargs.h is already included.
2344 * src/main.c (main): Update access.
2345 * src/muscle_tab.c (muscle_percent_define_insert): Convert old
2346 variable names to new variable names before assigning value.
2347 * src/reader.c (reader): Update setting default.
2348 * tests/calc.at: Update uses.
2349 * tests/conflicts.at (Unreachable States After Conflict
2350 Resolution): Update use.
2351 * tests/input.at (%define enum variables): Update use.
2352 (%define backward compatibility): New test group.
2353 * tests/push.at: Update uses.
2354 * tests/reduce.at: Update uses.
2355 * tests/torture.at: Update uses.
2356
2357 2009-04-30 Joel E. Denny <jdenny@ces.clemson.edu>
2358
2359 Set all front-end %define defaults in one place.
2360 * src/main.c (main): Move lr.keep_unreachable_states default...
2361 * src/reader.c (reader): ... to here.
2362
2363 2009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
2364
2365 Rename lr.default_reductions to lr.default-reductions.
2366 * NEWS (2.5): Here.
2367 * doc/bison.texinfo: Here.
2368 * src/lalr.c (initialize_LA): Here.
2369 * src/print.c (print_reductions): Here.
2370 * src/reader.c (reader): Here.
2371 * src/tables.c (action_row): Here.
2372 * tests/input.at (%define enum variables): Here.
2373 * tests/reduce.at (AT_TEST_LR_DEFAULT_REDUCTIONS): Here.
2374
2375 2009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
2376
2377 Pacify ./configure --enable-gcc-warnings.
2378 * tests/input.at (Symbols): Prototype yyerror and yylex.
2379
2380 2009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
2381
2382 Document how `%define "var" "value"' is not M4-friendly.
2383 * src/parse-gram.y (variable): In comments here.
2384
2385 2009-04-24 Joel E. Denny <jdenny@ces.clemson.edu>
2386
2387 Clean up recent patches a little.
2388 Reported by Akim Demaille.
2389 * doc/bison.texinfo (Understanding): Fix typos.
2390 * src/print.c (print_reductions): Don't use negated variable.
2391
2392 2009-04-24 Joel E. Denny <jdenny@ces.clemson.edu>
2393
2394 List accepted values for a %define enum variable with an invalid value.
2395 Suggested by Akim Demaille at
2396 <http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00082.html>.
2397 * data/bison.m4 (_b4_percent_define_check_values): Implement.
2398 * src/muscle-tab.c (muscle_percent_define_check_values): Implement.
2399 * tests/input.at (%define lr.default_reductions invalid values): Merge
2400 into...
2401 (%define enum variables): ... here, and update output.
2402
2403 2009-04-23 Joel E. Denny <jdenny@ces.clemson.edu>
2404
2405 Rename "default rule" to "default reduction".
2406 This includes changing variable names in code, changing
2407 comments, and renaming %define lr.default_rules to %define
2408 lr.default_reductions.
2409 * NEWS (2.5): Update IELR documentation.
2410 * data/bison.m4 (b4_integral_parser_tables_map): Adjust YYDEFACT
2411 documentation.
2412 * data/glr.c, data/lalr1.java: Sync copyright dates.
2413 * doc/bison.texinfo (Decl Summary): Adjust lr.default_reductions
2414 and lr.type documentation. Make some other wording
2415 improvements.
2416 (Glossary): Adjust cross-references and Default Reduction
2417 definition.
2418 * src/lalr.c (state_lookahead_tokens_count): Adjust code.
2419 Remove a confusing comment pointed out by Akim Demaille.
2420 (initialize_LA): Adjust code.
2421 * src/print-xml.c (print_reductions): Adjust code.
2422 * src/print.c (print_reductions): Adjust code.
2423 * src/reader.c (reader): Adjust code.
2424 * src/tables.c (action_row): Adjust code.
2425 (token_actions): Adjust code.
2426 * src/tables.h: Adjust YYDEFACT documentation.
2427 * tests/input.at (%define lr.default_rules invalid values):
2428 Rename test group to...
2429 (%define lr.default_reductions invalid values): ... this, and
2430 update grammar file and expected output.
2431 * tests/reduce.at (AT_TEST_LR_DEFAULT_RULES): Rename to...
2432 (AT_TEST_LR_DEFAULT_REDUCTIONS): ... this, and update.
2433
2434 2009-04-21 Akim Demaille <demaille@gostai.com>
2435
2436 tests: check the use of dashes and periods in symbols.
2437 * tests/input.at (Symbol): New test group.
2438
2439 2009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
2440
2441 Document %define lr.type and lr.default_rules.
2442 * NEWS (2.5): Add an entry.
2443 * src/getargs.c (usage): Mention IELR(1) and canonical LR(1)
2444 besides just LALR(1) and GLR(1).
2445 * doc/bison.texinfo (Introduction): Likewise.
2446 (Language and Grammar): Bison is no longer limited to LALR(1)
2447 restrictions.
2448 (GLR parsing): Say deterministic or LR(1) rather than LALR(1)
2449 when trying to distinguish from GLR. Talk about LR(1) grammars
2450 rather than LALR(1) grammars.
2451 (Decl Summary): In %define api.push_pull entry, say it applies
2452 to deterministic parsers in C rather than LALR(1) parsers in C.
2453 Add lr.default_rules entry.
2454 Add lr.type entry.
2455 (Mystery Conflicts): Bison is no longer limited to LALR(1)
2456 restrictions.
2457 (Generalized LR Parsing): Same changes as for the previous GLR
2458 section.
2459 (Memory Management): Say deterministic rather than LALR(1).
2460 (Understanding): Correct some bison output.
2461 Index discussion of "accepting state".
2462 Say deterministic rather than LALR(1).
2463 (Bison Options): In --yacc entry, say deterministic rather than
2464 LALR(1).
2465 In --report, --graph, and --xml entries, just don't mention
2466 LALR(1).
2467 (C++ Parsers): Say deterministic rather than LALR(1).
2468 (Table of Symbols): Likewise in YYSTACK_USE_ALLOCA entry.
2469 (Glossary): Add Accepting State, Consistent State, Default Rule,
2470 and IELR(1) definitions.
2471 In Generalized LR (GLR) definition, make same changes as in
2472 previous GLR sections.
2473 In LALR(1) definition, say Bison uses LALR(1) by default rather
2474 than implying Bison is limited to LALR(1).
2475 (LocalWords): Add IELR.
2476
2477 2009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
2478
2479 Finish implementing %define lr.type.
2480 Its value can be "LALR", "IELR", or "canonical LR".
2481 * lib/timevar.def (TV_IELR_PHASE1): New var.
2482 (TV_IELR_PHASE2): New var.
2483 (TV_IELR_PHASE3): New var.
2484 (TV_IELR_PHASE4): New var.
2485 * src/Makefile.am (bison_SOURCES): Add AnnotationList.c,
2486 AnnotationList.h, InadequacyList.c, InadequacyList.h, Sbitset.c,
2487 Sbitset.h, ielr.h, and ielr.c.
2488 * src/getargs.h, src/getargs.c (enum trace, trace_args,
2489 trace_types): Add trace_ielr.
2490 * src/lalr.h, src/lalr.c (ngotos): Export it.
2491 (F): Rename to...
2492 (goto_follows): ... this, update all uses, and export it.
2493 (set_goto_map): Export it.
2494 (map_goto): Export it.
2495 (compute_lookahead_tokens): Don't free goto_follows yet. Now
2496 handled in ielr.
2497 (initialize_LA): Export it. Move lookback allocation to...
2498 (lalr): ... here because, for canonical LR, initialize_LA must
2499 be invoked but lookback and much of the rest of LALR isn't
2500 needed.
2501 * main.c (main): Instead of lalr, invoke ielr, which invokes
2502 lalr.
2503 * src/reader.c (reader): Default lr.type to "LALR".
2504 Default lr.default_rules to "accepting" if lr.type is "canonical
2505 LR". Leave the default as "all" otherwise.
2506 Check for a valid lr.type value.
2507 * src/state.h, src/state.c (struct state_list): Add state_list
2508 member.
2509 (state_new): Initialize state_list member to NULL.
2510 (state_new_isocore): New function, exported.
2511 * tests/existing.at (AT_TEST_EXISTING_GRAMMAR): New macro that
2512 exercises all values of lr.type.
2513 (GNU AWK Grammar): Rename test group to...
2514 (GNU AWK 3.1.0 Grammar): ... this, and extend to use
2515 AT_TEST_EXISTING_GRAMMAR.
2516 (GNU Cim Grammar): Extend to use AT_TEST_EXISTING_GRAMMAR.
2517 (GNU pic Grammar): Rename test group to...
2518 (GNU pic (Groff 1.18.1) Grammar): ... this, and extend to use
2519 AT_TEST_EXISTING_GRAMMAR.
2520 * tests/reduce.at (AT_TEST_LR_TYPE): New macro that exercises
2521 all values of lr.type.
2522 (Single State Split): New test groups using AT_TEST_LR_TYPE.
2523 (Lane Split): Likewise.
2524 (Complex Lane Split): Likewise.
2525 (Split During Added Lookahead Propagation): Likewise.
2526
2527 2009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
2528
2529 Add new files for IELR and canonical LR implementation.
2530 * src/AnnotationList.c: New.
2531 * src/AnnotationList.h: New.
2532 * src/InadequacyList.c: New.
2533 * src/InadequacyList.h: New.
2534 * src/Sbitset.c: New.
2535 * src/Sbitset.h: New.
2536 * src/ielr.c: New.
2537 * src/ielr.h: New.
2538
2539 2009-04-20 Joel E. Denny <jdenny@ces.clemson.edu>
2540
2541 Implement %define lr.default_rules.
2542 Its value describes the states that are permitted to contain
2543 default rules: "all", "consistent", or "accepting".
2544 * src/reader.c (reader): Default lr.default_rules to "all".
2545 Check for a valid lr.default_rules value.
2546 * src/lalr.c (state_lookahead_tokens_count): If lr.default_rules
2547 is "accepting", then only mark the accepting state as
2548 consistent.
2549 (initialize_LA): Tell state_lookahead_tokens_count whether
2550 lr.default_rules is "accepting".
2551 * src/tables.c (action_row): If lr.default_rules is not "all",
2552 then disable default rules in inconsistent states.
2553 * src/print.c (print_reductions): Use this opportunity to
2554 perform some assertions about whether lr.default_rules was
2555 obeyed correctly.
2556 * tests/local.at (AT_TEST_TABLES_AND_PARSE): New macro that
2557 helps with checking the parser tables for a grammar.
2558 * tests/input.at (%define lr.default_rules invalid values): New
2559 test group.
2560 * tests/reduce.at (AT_TEST_LR_DEFAULT_RULES): New macro using
2561 AT_TEST_TABLES_AND_PARSE.
2562 (`no %define lr.default_rules'): New test group generated by
2563 AT_TEST_LR_DEFAULT_RULES.
2564 (`%define lr.default_rules "all"'): Likewise.
2565 (`%define lr.default_rules "consistent"'): Likewise.
2566 (`%define lr.default_rules "accepting"'): Likewise.
2567
2568 2009-04-20 Akim Demaille <demaille@gostai.com>
2569
2570 Formatting change.
2571
2572 2009-04-20 Akim Demaille <demaille@gostai.com>
2573
2574 bison: factoring.
2575 * src/output.c (token_definitions_output): Use symbol_id_get
2576 instead of duplicating its logic.
2577 * TODO (YYERRCODE): Extend.
2578
2579 2009-04-20 Akim Demaille <demaille@gostai.com>
2580
2581 variables: prefer error-verbose to error_verbose.
2582 * data/bison.m4 (b4_error_verbose_if): Based on error-verbose
2583 instead of error_verbose.
2584 * src/scan-gram.l (%error-verbose): Map to the error-verbose
2585 variable.
2586 * doc/bison.texinfo: Promote %define error-verbose instead of
2587 %error-verbose.
2588 * tests/actions.at: Prefer %define error-verbose to %error-verbose.
2589
2590 2009-04-15 Akim Demaille <demaille@gostai.com>
2591
2592 variables: accept dashes.
2593 * data/bison.m4 (b4_percent_define_if_define_): Also map dashes to
2594 underscores.
2595 * src/scan-gram.l ({id}): Also accept dashes after the initial
2596 letter.
2597 ({directive}): Use {id}.
2598 * src/parse-gram.y: Comment and formatting changes.
2599 * doc/bison.texinfo (Symbols): Adjust the lexical definitions of
2600 symbols.
2601 * src/complain.h, src/complain.c (yacc_at): New.
2602 * src/symtab.c (symbol_new): Use yacc_at to report inappropriate
2603 symbol names.
2604 * src/output.c (token_definitions_output): Do not #define token
2605 names with dashes.
2606
2607 2009-04-20 Akim Demaille <demaille@gostai.com>
2608
2609 Consistently refer to Yacc, not YACC.
2610 * src/getargs.c (usage, warnings_args): s/YACC/Yacc/.
2611
2612 2009-04-17 Joel E. Denny <jdenny@ces.clemson.edu>
2613
2614 Pacify make maintainer-check-posix.
2615 * tests/input.at (%define, --define): Move bison command-line
2616 options before grammar file name.
2617
2618 2009-04-04 Joel E. Denny <jdenny@ces.clemson.edu>
2619
2620 Document semicolon warnings.
2621 * NEWS (2.5): Here.
2622
2623 2009-04-14 Akim Demaille <demaille@gostai.com>
2624
2625 variables: use `parse.assert' instead of `assert'.
2626 * TODO (assert): Remove.
2627 * data/bison.m4 (b4_assert_if): Replace with...
2628 (b4_parse_assert_if): this.
2629 * data/lalr1.cc, data/variant.hh, tests/c++.at: Adjust.
2630 * doc/bison.texinfo (Decl Summary): Document parse.assert.
2631
2632 2009-04-14 Akim Demaille <demaille@gostai.com>
2633
2634 variables: use `parse.trace' instead of `debug'.
2635 * src/getargs.c (getargs): Map -t to %define trace.parse.
2636 * src/scan-gram.l (%debug): Map to %define trace.parse.
2637 * data/bison.m4 (b4_percent_define_if_define): Map `.' in variable
2638 names to `_' in macro names.
2639 (b4_debug_if): Replace with...
2640 (b4_parse_trace_if): this.
2641 * data/glr.c, data/glr.cc, data/lalr1.cc, data/lalr1.java,
2642 * data/yacc.c: Adjust.
2643 * doc/bison.texinfo (Decl Summary): Document %debug as obsoleted.
2644 Use @code to label the variable list.
2645 Document the variable parse.trace.
2646 (Tracing): Promote the parse.trace variable.
2647 * TODO: %printer is not documented.
2648
2649 2009-04-14 Akim Demaille <demaille@gostai.com>
2650
2651 doc: minor fixes.
2652 * doc/bison.texinfo (Decl Summary): Fix entry about %debug.
2653 (Table of Symbols): Remove duplicate entry for %debug.
2654
2655 2009-04-10 Eric Blake <ebb9@byu.net>
2656
2657 submodules: update to latest
2658 * submodules/autoconf: Use latest upstream Autoconf.
2659
2660 2009-04-06 Eric Blake <ebb9@byu.net>
2661
2662 Work around autoconf 2.63b bug in testsuite.
2663 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Avoid tripping
2664 autoconf bug related to # in test.
2665
2666 2009-04-06 Joel E. Denny <jdenny@ces.clemson.edu>
2667
2668 * NEWS (2.5): New section. Describe new -D/--define feature.
2669
2670 2009-04-06 Akim Demaille <demaille@gostai.com>
2671
2672 Regen.
2673 * src/parse-gram.h, src/parse-gram.c: Regen.
2674
2675 2009-04-06 Akim Demaille <demaille@gostai.com>
2676
2677 rename muscle_tab.* as muscle-tab.* for consistency.
2678 * src/muscle_tab.h, src/muscle_tab.c: Rename as...
2679 * src/muscle-tab.h, src/muscle-tab.c: these.
2680 * src/getargs.c, src/local.mk, src/main.c, src/output.c,
2681 * src/parse-gram.y, src/reader.c, src/scan-code.l: Adjust.
2682
2683 2009-04-06 Akim Demaille <demaille@gostai.com>
2684
2685 Makefile: introduce $(BISON).
2686 * src/local.mk (BISON): New.
2687 (YACC): Use it.
2688
2689 2009-04-06 Akim Demaille <demaille@gostai.com>
2690
2691 parser: handle %locations as %define locations.
2692 * src/getargs.h, src/getargs.c (locations_flag): Remove.
2693 * src/getargs.c, src/scan-code.l: Use muscle_percent_define_ensure
2694 to set "locations" to true.
2695 * src/output.c (prepare): Don't output "locations".
2696 * src/scan-gram.l (%locations): Handle it as a %<flag>.
2697 * src/parse-gram.y: It's no longer a token.
2698 Don't handle it.
2699 * data/bison.m4 (b4_locations_if): Define it with
2700 b4_percent_define_if_define.
2701 * data/c.m4, data/glr.cc: Adjust.
2702
2703 2009-04-06 Akim Demaille <demaille@gostai.com>
2704
2705 Regen.
2706 * src/parse-gram.c: Regen.
2707
2708 2009-04-06 Akim Demaille <demaille@gostai.com>
2709
2710 muscle: factor the handling of obsolete of obsolete directives.
2711 Suggested by Joel E. Denny.
2712
2713 * src/muscle_tab.h, src/muscle_tab.c (muscle_percent_define_ensure):
2714 New, extracted from...
2715 * src/parse-gram.y (prologue_declaration: pure-parser): here.
2716 Remove it.
2717 (prologue_declaration: "%<flag>"): Use
2718 muscle_percent_define_ensure.
2719 (%error-verbose, %pure-parser): No longer tokens.
2720 * src/scan-gram.l (pure-parser): Return as a %<flag>.
2721
2722 2009-04-06 Joel E. Denny <jdenny@ces.clemson.edu>
2723
2724 Fix options documentation.
2725 * build-aux/cross-options.pl: As in --help output, write optional
2726 arguments as [=ARG] not =[ARG].
2727 * doc/bison.texinfo (Bison Options): Add -W/--warnings argument.
2728
2729 2009-04-04 Joel E. Denny <jdenny@ces.clemson.edu>
2730
2731 Replace BISON_PROG_GNU_M4 with Autoconf's AC_PROG_GNU_M4.
2732 If the first m4 in $PATH is wrong, it keeps looking. Moreover, its
2733 requirements for a correct m4 are stricter.
2734 * m4/m4.m4: Make it a symbolic link to submodules/autoconf/m4/m4.m4.
2735 * configure.ac: Update to use AC_PROG_GNU_M4.
2736 Reported by Eric Blake.
2737
2738 2009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
2739
2740 Help with updating web manual.
2741 * HACKING: Incorporate instructions from gnulib/doc/README.
2742 * bootstrap.conf (gnulib_modules): Add gendocs.
2743
2744 2009-04-03 Akim Demaille <demaille@gostai.com>
2745
2746 Regen.
2747 * src/parse-gram.h, src/parse-gram.c: Regen.
2748
2749 2009-04-03 Akim Demaille <demaille@gostai.com>
2750
2751 Factor %FLAG at scan level.
2752 * src/parse-gram.y (PERCENT_DEBUG, PERCENT_ERROR_VERBOSE): Token
2753 definitions and associated rules, replaced by....
2754 (PERCENT_FLAG): this new token type, and rule.
2755 * src/scan-gram.l (RETURN_PERCENT_FLAG): New.
2756 Use it for %debug and %error-verbose.
2757
2758 2009-04-03 Akim Demaille <demaille@gostai.com>
2759
2760 Regen.
2761 * src/parse-gram.h, src/parse-gram.c: Regen.
2762
2763 2009-04-03 Akim Demaille <demaille@gostai.com>
2764
2765 Treat %debug as %define debug.
2766 * data/bison.m4 (b4_debug_if): New.
2767 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c,
2768 * data/lalr1.java: Use it instead of b4_debug_flag.
2769 * src/getargs.h, src/getargs.c (debug_flag): Remove.
2770 * src/output.c (prepare): Don't output it.
2771 * src/parse-gram.y: Treat %debug as %define debug.
2772
2773 2009-04-03 Akim Demaille <demaille@gostai.com>
2774
2775 Treat %error-verbose as %define error_verbose.
2776 This allows to pass -Derror_verbose on the command line. Better
2777 yet, it allows to pass -Derror_verbose=$(ERROR_VERBOSE), with
2778 ERROR_VERBOSE being defined as false or true.
2779 * data/bison.m4 (b4_percent_define_if_define): Instead of relying
2780 on b4_percent_define_ifdef, for does not check the defined value,
2781 but only whether the symbol is defined, rely on
2782 b4_percent_define_flag_if, so that a value of "false" is processed
2783 as a false.
2784 If not defined, define the flag to "false".
2785 (b4_error_verbose_if): New.
2786 * data/glr.c, data/lalr1.cc, data/yacc.c: Use it instead of
2787 b4_error_verbose_flag.
2788 * src/getargs.h, src/getargs.c (error_verbose_flag): Remove.
2789 * src/output.c (prepare): Don't output it.
2790 * src/parse-gram.y (%error-verbose): Treat as %define error_verbose.
2791
2792 2009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
2793
2794 Fix strange %define locations for default values.
2795 Reported by Akim Demaille at
2796 <http://lists.gnu.org/archive/html/bug-bison/2007-12/msg00001.html>
2797 and discussed again starting at
2798 <http://lists.gnu.org/archive/html/bison-patches/2008-11/msg00102.html>.
2799 * data/bison.m4 (b4_percent_define_default): Leave syncline blank
2800 because location information is bogus.
2801 Use angle brackets to delimit fake file name because square brackets
2802 look like underexpanded m4. Choose a better fake file name.
2803 Use negative line numbers.
2804 * src/muscle_tab.c (muscle_percent_define_default): Likewise.
2805 * src/location.c (location_print): If line for a boundary is negative,
2806 only print that boundary's file name.
2807 * src/location.h: Document that.
2808 * tests/skeletons.at (%define Boolean variables: invalid skeleton
2809 defaults): Update output.
2810
2811 2009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
2812
2813 Pacify ./configure --enable-gcc-warnings.
2814 * Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS) because many files
2815 in lib won't compile with it.
2816 * src/local.mk (src_bison_CFLAGS): Use $(WERROR_CFLAGS) here only.
2817
2818 2009-03-31 Akim Demaille <demaille@gostai.com>
2819
2820 bootstrap: --help to stdout.
2821 * bootstrap (usage): Don't send --help to stderr.
2822 Use a here doc instead of a long string.
2823
2824 2009-03-31 Akim Demaille <demaille@gostai.com>
2825
2826 bootstrap: README-hacking no longer exists
2827 * bootstrap (checkout_only_file): Set to HACKING.
2828
2829 2009-03-26 Akim Demaille <demaille@gostai.com>
2830
2831 doc: merge HACKING and README-hacking.
2832 Two files is confusing.
2833 Reported by Alexandre Duret-Lutz.
2834
2835 * README-hacking: Merge into...
2836 * HACKING (Working from the repository): here.
2837
2838 2009-03-26 Akim Demaille <demaille@gostai.com>
2839
2840 doc: update README-hacking.
2841 * README-hacking: We now use git and git submodules.
2842 Reported by Ralf Wildenhues and Alexandre Duret-Lutz.
2843
2844 2009-03-26 Akim Demaille <demaille@gostai.com>
2845
2846 lalr1.cc: avoid GCC 4.3 warnings.
2847 GCC 4.3 now warns about "a || b && c" and asks for explicit
2848 parentheses.
2849 Reported by Alexandre Duret-Lutz.
2850 * data/location.cc: Update copyright years.
2851 (Position::operator==): Use parens to make precedence explicit.
2852 Compare lines and columns first, as they are more likely to be
2853 different, and they are faster to compare.
2854
2855 2009-03-26 Akim Demaille <demaille@gostai.com>
2856
2857 gnulib: update.
2858 * gnulib: Update to latest.
2859 * src/local.mk (AM_CFLAGS): Move to...
2860 * Makefile.am: here.
2861 * etc/prefix-gnulib-mk (prefix_assignment): Also transform
2862 AM_CFLAGS.
2863
2864 2009-03-02 Akim Demaille <demaille@gostai.com>
2865
2866 Comment changes.
2867
2868 2009-03-02 Akim Demaille <demaille@gostai.com>
2869
2870 Share b4_yytranslate_define.
2871 * data/lalr1.cc (b4_yytranslate_define): Move to...
2872 * data/c++.m4: here.
2873
2874 2009-03-02 Akim Demaille <demaille@gostai.com>
2875
2876 Use locations in the variant example.
2877 Yes, this obfuscates the point of this example, variants only.
2878 But glr.cc cannot work (yet?) without locations. This change
2879 makes it easier to use this example with glr.cc.
2880
2881 * examples/variant.yy (assert): %define it.
2882 (locations): Request them.
2883 (yylex): Bind the location to the stage.
2884
2885 2009-03-02 Akim Demaille <demaille@gostai.com>
2886
2887 Dub make_TOKEN as a public type interface.
2888 * data/c++.m4 (b4_symbol_constructor_declare)
2889 (b4_symbol_constructor_define): New empty stubs.
2890 (b4_public_types_declare, b4_public_types_define): Use them.
2891 * data/lalr1.cc (b4_symbol_constructor_declare)
2892 (b4_symbol_constructor_declare_)
2893 (b4_symbol_constructor_define_, b4_symbol_constructor_define):
2894 Move to...
2895 * data/variant.hh: here.
2896 Remove the "b4_variant_if" parts, as variant.hh is loaded only if
2897 needed.
2898 * data/lalr1.cc: No longer invoke b4_symbol_constructor_define and
2899 b4_symbol_constructor_declare, as it is now done by
2900 b4_public_types_define and b4_public_types_declare.
2901
2902 2009-03-02 Akim Demaille <demaille@gostai.com>
2903
2904 Coding style changes.
2905 * data/lalr1.cc (b4_symbol_constructor_declaration_)
2906 (b4_symbol_constructor_declarations)
2907 (b4_symbol_constructor_definition_)
2908 (b4_symbol_constructor_definitions)
2909 (b4_yytranslate_definition): Rename as...
2910 (b4_symbol_constructor_declare_)
2911 (b4_symbol_constructor_declare)
2912 (b4_symbol_constructor_define_)
2913 (b4_symbol_constructor_define)
2914 (b4_yytranslate_define): these.
2915 * data/variant.hh (b4_variant_definition): Rename as...
2916 (b4_variant_define): this.
2917
2918 2009-03-02 Akim Demaille <demaille@gostai.com>
2919
2920 Factor b4_assert_if, b4_lex_symbol_if, and b4_variant_if.
2921 * data/bison.m4 (b4_percent_define_if_define): New.
2922 * data/c++.m4 (b4_variant_if): Move to...
2923 * data/bison.m4: Here, using b4_percent_define_if_define.
2924 * data/lalr1.cc (b4_assert_if, b4_lex_symbol_if): Move to...
2925 * data/bison.m4: Here, using b4_percent_define_if_define.
2926
2927 2009-03-02 Akim Demaille <demaille@gostai.com>
2928
2929 Dub symbol_type_base as a public type.
2930 * data/c++.m4 (b4_public_types_declare): Now define
2931 symbol_type_base and symbol_type.
2932 (b4_public_types_define): New.
2933 In both cases, the definitions are taken verbatim from lalr1.cc.
2934 * data/lalr1.cc: Adjust.
2935
2936 2009-03-02 Akim Demaille <demaille@gostai.com>
2937
2938 b4_public_types_declare.
2939 * data/c++.m4 (b4_public_types_declare): New.
2940 * data/glr.cc, data/lalr1.cc: Use it.
2941
2942 2009-03-02 Akim Demaille <demaille@gostai.com>
2943
2944 b4_semantic_type_declare.
2945 * data/c++.m4 (b4_semantic_type_declare): New.
2946 Factors and generalizes what was in glr.cc and lalr1.cc.
2947 * data/variant.hh (b4_semantic_type_declare): Redefine it for
2948 variants.
2949 * data/lalr1.cc, data/glr.cc: Use it.
2950
2951 2009-02-26 Akim Demaille <demaille@gostai.com>
2952
2953 Upgrade gnulib.
2954 * gnulib: Upgrade from master.
2955 * lib/.cvsignore, lib/.gitignore, m4/.cvsignore, m4/.gitignore:
2956 Regen.
2957
2958 2009-02-25 Akim Demaille <demaille@gostai.com>
2959
2960 Remove useless arguments.
2961 * data/glr.c (yy_reduce_print): $$ and @$ are not used and not
2962 relevant.
2963
2964 2009-02-25 Akim Demaille <demaille@gostai.com>
2965
2966 Comment changes.
2967 * data/lalr1.cc: here.
2968
2969 2009-02-25 Akim Demaille <demaille@gostai.com>
2970
2971 Fix glr.cc's debug level handling.
2972 * data/glr.cc (yydebug_): Remove, as it is actually yydebug from
2973 glr.c which is used.
2974 (debug_level, set_debug_level): Adjust.
2975
2976 2009-02-25 Akim Demaille <demaille@gostai.com>
2977
2978 Copyright years.
2979 * data/glr.c: Add 2007 and 2008 here, consistenly with the comments.
2980
2981 2009-02-25 Akim Demaille <demaille@gostai.com>
2982
2983 Style changes.
2984 * etc/bench.pl.in (generate_grammar_list): Consitently use
2985 location_type, not yy::location.
2986
2987 2009-02-25 Akim Demaille <demaille@gostai.com>
2988
2989 Comment change.
2990 * data/lalr1.cc: here.
2991
2992 2009-02-19 Akim Demaille <demaille@gostai.com>
2993
2994 Make yyparser::error public.
2995 * data/lalr1.cc: here.
2996 There is no good reason to keep it private (and it is convenient
2997 to use it from the scanner for instance). It is already public in
2998 glr.cc.
2999
3000 2009-02-19 Akim Demaille <demaille@gostai.com>
3001
3002 Comment changes.
3003 * data/glr.cc: here.
3004
3005 2009-02-19 Akim Demaille <demaille@gostai.com>
3006
3007 Remove trailing blanks.
3008 The epilogue has its own ending \n, no need to add another.
3009
3010 * data/glr.c, data/lalr1.java, data/yacc.c: dnl when outputing the
3011 epilogue.
3012 * data/glr.cc: dnl when extending the epilogue.
3013 Remove stray "private:".
3014
3015 2009-02-19 Akim Demaille <demaille@gostai.com>
3016
3017 Use b4_c_modern.
3018 * data/c.m4 (b4_c_function_decl): Here.
3019
3020 2009-02-19 Akim Demaille <demaille@gostai.com>
3021
3022 Comment changes.
3023 * data/lalr1.cc: here.
3024
3025 2009-02-19 Akim Demaille <demaille@gostai.com>
3026
3027 Extract variant.hh
3028 * data/variant.hh: New, extracted from...
3029 * data/lalr1.cc: here.
3030 Adjust.
3031 * data/local.mk: Adjust.
3032
3033 2009-02-19 Akim Demaille <demaille@gostai.com>
3034
3035 Extract stack.hh from lalr1.cc.
3036 * data/stack.hh: New.
3037 * data/lalr1.cc: Extract from here.
3038 * data/local.mk: Adjust.
3039
3040 2009-02-03 Joel E. Denny <jdenny@ces.clemson.edu>
3041
3042 Add reminder about uploading public key to keys.gnupg.net.
3043 * HACKING (Release Procedure): Here.
3044
3045 2009-01-28 Akim Demaille <demaille@gostai.com>
3046
3047 * NEWS: Update information about 2.4.1 and 2.4.2.
3048
3049 2008-11-04 Akim Demaille <demaille@gostai.com>
3050
3051 Reformat NEWS.
3052 * NEWS: Use more outline-mode markup.
3053 Suggested by Jim Meyering.
3054
3055 2009-01-08 Akim Demaille <demaille@gostai.com>
3056
3057 Fix grep portability issues.
3058 Grep on Solaris does not support -q.
3059 Reported by Summum Bonum.
3060
3061 * NEWS: Add a stub for 2.4.2.
3062 * THANKS: Add Summum Bonum.
3063 * tests/atlocal.in (EGREP): New.
3064 (CC, CXX, XSLTPROC): Make it possible to override them via
3065 envvars.
3066 * tests/java.at: Use $EGREP instead of egrep.
3067 Use AT_CHECK's ignore instead of grep's -q.
3068
3069 2008-12-11 Akim Demaille <demaille@gostai.com>
3070
3071 Pass the token type to yysyntax_error.
3072 * data/yacc.c (yysyntax_error): Take the transated token instead
3073 of the raw number.
3074 Adjust callers.
3075 * TODO: Update.
3076
3077 2008-12-11 Akim Demaille <demaille@gostai.com>
3078
3079 Formatting changes.
3080 * data/glr.c: Formatting changes.
3081
3082 2008-12-11 Akim Demaille <demaille@gostai.com>
3083
3084 Propagate i18n changes into glr.c.
3085 * TODO: Update.
3086 * data/glr.c (yyreportSyntaxError): Use "switch" instead of
3087 building the error message format dynamically.
3088 * data/lalr1.java: Formatting changes.
3089
3090 2008-12-11 Akim Demaille <demaille@gostai.com>
3091
3092 Use testsuite -C.
3093 * tests/local.mk: Replace "cd && testsuite" by "testsuite -C".
3094 Solves problems when top_srcdir is an absolute path.
3095 Suggested by Eric Blake.
3096 * configure.ac: Require Autoconf 2.62.
3097
3098 2008-12-11 Akim Demaille <demaille@gostai.com>
3099
3100 Simplify the i18n of the error messages.
3101 * data/lalr1.cc: Comment changes.
3102 * data/yacc.c (yysyntax_error): Rewrite, using a switch as in
3103 lalr1.cc instead of building dynamically the format string.
3104
3105 2008-12-08 Akim Demaille <demaille@gostai.com>
3106
3107 Fix portability issue in the test suite.
3108 * tests/local.at (AT_MATCHES_CHECK): New.
3109 Based on Perl instead of Sed. Sed has too many portability
3110 pitfalls, not ever Sed is GNU Sed.
3111 * tests/actions.at (Fix user actions without a trailing semicolon):
3112 Use it.
3113
3114 2008-12-08 Akim Demaille <demaille@gostai.com>
3115
3116 Update data/README.
3117 * data/README: Document glr.cc, lalr1.java, m4sugar and xslt.
3118
3119 2008-12-08 Akim Demaille <demaille@gostai.com>
3120
3121 Install autoconf as a submodule to get m4sugar.
3122 * .gitmodules: Add submodules/autoconf.
3123 * data/m4sugar/foreach.m4, data/m4sugar/m4sugar.m4: Now links into
3124 submodules/autoconf.
3125
3126 2008-12-08 Akim Demaille <demaille@gostai.com>
3127
3128 Test token.prefix in all the skeletons.
3129 * data/java.m4 (b4_token_enum): Use the token.prefix.
3130 * tests/local.at (AT_BISON_OPTION_PUSHDEFS): Define AT_TOKEN_PREFIX.
3131 * tests/calc.at (_AT_DATA_CALC_Y): Use it.
3132 Add checks for yacc.c, glr.c, lalr1.cc and glr.cc.
3133 * tests/java.at: Comment changes.
3134 (AT_CHECK_JAVA_MINIMAL): Define the END token.
3135 (Java parser class and package names): Add token.prefix check.
3136
3137 2008-12-08 Akim Demaille <demaille@gostai.com>
3138
3139 Fix regeneration of atconfig.
3140 * tests/local.mk (tests/atconfig): The rule was incorrect, but
3141 remove it: now that there is no tests/Makefile.am, the top-level
3142 Makefile properly updates atconfig when needed.
3143
3144 2008-12-07 Di-an Jan <dianj@freeshell.org>
3145
3146 Implement the FIXME that ends an user action with a semicolon
3147 if it seems necessary.
3148 * src/scan-code.l (flex rules section): Flag cpp directive from
3149 any `#' to the first unescaped end-of-line. Semicolon is not
3150 needed after `;', `{', '}', or cpp directives and is needed after
3151 any other token (whitespaces and comments have no effect).
3152 * tests/actions.at (Fix user actions without a trailing semicolon):
3153 New test.
3154 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add semicolons to
3155 to make user actions complete statements.
3156 Adjust column numbers in error messages.
3157 * tests/regression.at (Fix user actions without a trailing semicolon):
3158 Remove. Covered by new test.
3159
3160 2008-12-07 Akim Demaille <demaille@gostai.com>
3161
3162 Update gnulib.
3163 * gnulib: Update from master.
3164
3165 2008-12-05 Eric Blake <ebb9@byu.net>
3166
3167 Avoid compiler warning.
3168 * src/output.c (muscle_insert_item_number_table): Delete unused
3169 function.
3170
3171 2008-12-02 Eric Blake <ebb9@byu.net>
3172
3173 Build testsuite with newer autoconf.
3174 * tests/output.at (m4_expand): Don't override in newer autoconf,
3175 where the underlying implementation changed.
3176 * tests/cxx-type.at (_AT_RESOLVED_GLR_OUTPUT)
3177 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT)
3178 (_AT_AMBIG_GLR_OUTPUT_WITH_LOC, _AT_GLR_STDERR)
3179 (_AT_VERBOSE_GLR_STDERR): Expand to double-quoted strings,
3180 since some of them contain unbalanced ')'.
3181
3182 2008-12-01 Akim Demaille <demaille@gostai.com>
3183
3184 Use b4_symbol for printers and destructors everywhere.
3185 * data/bison.m4 (b4_symbol_action_location): New.
3186 * data/c.m4 (b4_symbol_actions): Remove.
3187 Adjust all callers to use by b4_symbol_foreach and the corresponding
3188 b4_symbol_printer/destructor macro.
3189 * data/glr.cc: Adjust.
3190 * data/lalr1.java: Adjust the %destructor sanity check.
3191 * src/output.c (symbol_code_props_output): Remove, we no longer
3192 need the b4_symbol_printers/destructors tables.
3193
3194 2008-12-01 Akim Demaille <demaille@gostai.com>
3195
3196 Use b4_symbol_case_.
3197 * data/lalr1.cc, data/bison.m4 (b4_symbol_action): Use
3198 b4_symbol_case_.
3199
3200 2008-12-01 Akim Demaille <demaille@gostai.com>
3201
3202 Move b4_symbol based macro to bison.m4.
3203 * data/lalr1.cc (b4_symbol_, b4_symbol, b4_symbol_if)
3204 (b4_symbol_action, b4_symbol_destructor, b4_symbol_printer)
3205 (b4_symbol_case_, b4_symbol_foreach, b4_type_action_)
3206 (b4_type_foreach): Move to...
3207 * data/bison.m4: Here.
3208 * data/lalr1.cc (b4_symbol_action): Specialize for C++: use
3209 b4_symbol_value_template instead of b4_symbol_value.
3210
3211 2008-12-01 Akim Demaille <demaille@gostai.com>
3212
3213 b4_symbol/type_foreach.
3214 * data/lalr1.cc (b4_symbol_foreach, b4_type_foreach): New.
3215 Use them.
3216
3217 2008-12-01 Akim Demaille <demaille@gostai.com>
3218
3219 Use the symbol properties to output the printer/destructor for lalr1.cc.
3220 Instead of defining complex list of tuples to define various
3221 properties of the symbols, we now prefer to define symbols as
3222 "structs" in m4: using the symbol key (its number), and the
3223 property name, b4_symbol gives it value. Use this to handle
3224 destructors and printers.
3225
3226 * src/output.c (CODE_PROP): New.
3227 (prepare_symbol_definitions): Use it to define the printer and
3228 destructor related attributes of the symbols.
3229 * data/lalr1.cc (b4_symbol_actions): Rename as...
3230 (b4_symbol_action): this.
3231 Use b4_symbol instead of 6 arguments.
3232 (b4_symbol_printer, b4_symbol_destructor): New.
3233 Use them instead of b4_symbol_actions.
3234
3235 2008-12-01 Akim Demaille <demaille@gostai.com>
3236
3237 Avoid capturing variables too easily.
3238 * src/muscle_tab.h (MUSCLE_INSERT_BOOL, MUSCLE_OBSTACK_SGROW): Use
3239 v__ and p__ instead of v and p.
3240
3241 2008-12-01 Akim Demaille <demaille@gostai.com>
3242
3243 Remove spurious empty line before syncline.
3244 * data/bison.m4 (b4_syncline): Don't output an empty line before
3245 the output.
3246
3247 2008-11-26 Akim Demaille <demaille@gostai.com>
3248
3249 Convert lib/Makefile.am into lib/local.mk.
3250 The real problem is rather gnulib.mk, which itself is extracted
3251 from a Makefile.am that gnulib expects to the "recursive". The
3252 tool prefix-gnulib-mk converts such a gnulib.mk to be
3253 non-recursive. Also, some AC_SUBST variables need to be adjusted.
3254
3255 * etc/prefix-gnulib-mk: New.
3256 * bootstrap (slurp): Use it to convert further gnulib.mk.
3257 No longer try to avoid re-creation of lib/gnulib.mk as the changes
3258 are deeper.
3259 * lib/Makefile.am: Rename as...
3260 * lib/local.mk: this.
3261 Adjust to be prefixed.
3262 * Makefile.am, configure.ac: Adjust.
3263 * src/local.mk (AM_CPPFLAGS): Extend it, don't define it.
3264
3265 2008-11-26 Akim Demaille <demaille@gostai.com>
3266
3267 s/_FLAGS/FLAGS/.
3268 * tests/local.mk (TESTSUITE_FLAGS, AUTOTEST_FLAGS): Rename as...
3269 (TESTSUITEFLAGS, AUTOTESTFLAGS): these to compy with the GCS.
3270 Reported by Eric Blake.
3271
3272 2008-11-26 Akim Demaille <demaille@gostai.com>
3273
3274 Use b4_parser_tables_define in glr.cc.
3275 * data/glr.c: Use b4_parser_tables_define instead of defining the
3276 (deterministic integral) tables by hand.
3277
3278 2008-11-26 Akim Demaille <demaille@gostai.com>
3279
3280 Use b4_parser_tables_define in Java.
3281 * data/java.m4 (b4_typed_parser_table): Rename as...
3282 (b4_typed_parser_table_define): this, for consistency.
3283 Accept a comment as $4.
3284 Move $2 into yy*_.
3285 (b4_integral_parser_table): Rename as...
3286 (b4_integral_parser_table_define): this.
3287 * data/lalr1.java: Adjust all uses.
3288 Use b4_parser_tables_define instead of generation by hand.
3289
3290 2008-11-26 Akim Demaille <demaille@gostai.com>
3291
3292 Prepare the convergence bw C style and Java table generation.
3293 * data/bison.m4 (b4_tables_map, b4_tables_declare)
3294 (b4_tables_define): Rename as...
3295 (b4_integral_parser_tables_map, b4_parser_tables_declare)
3296 (b4_parser_tables_define): these.
3297 * data/c.m4 (b4_table_define): Rename as...
3298 (b4_integral_parser_table_define): this.
3299 * data/lalr1.cc: Adjust.
3300 (b4_table_define, b4_table_declare): Rename as...
3301 (b4_integral_parser_table_define)
3302 (b4_integral_parser_table_declare): these.
3303 (yyrline_): Move the comment where it is actually used.
3304 * data/yacc.c: Adjust.
3305 (yyrline): Use b4_integral_parser_table_define.
3306
3307 2008-11-26 Akim Demaille <demaille@gostai.com>
3308
3309 Regen.
3310 * src/parse-gram.h, src/parse-gram.c: Regen.
3311
3312 2008-11-26 Akim Demaille <demaille@gostai.com>
3313
3314 Factor the generation of the (integral) tables bw yacc.c and lalr1.cc.
3315 * data/lalr1.cc (b4_tables_map): Move to...
3316 * data/bison.m4: here.
3317 Update the comment for yytable during the flight.
3318 (b4_tables_declare, b4_tables_define): New.
3319 * data/lalr1.cc: Use them.
3320 * data/c.m4 (b4_table_define): New.
3321 * data/yacc.c: Use b4_tables_define instead of output the tables
3322 by hand.
3323 * tests/regression.at (Web2c Actions): Adjust the expected output,
3324 the order of the tables changed.
3325
3326 2008-11-26 Akim Demaille <demaille@gostai.com>
3327
3328 Get rid of (yy)rhs and (yy)prhs.
3329 These tables are no longer needed in the parsers, and they don't seem to
3330 be useful. They are not documented either.
3331
3332 * src/output.c (prepare_rules): Get rid of rhs and prhs.
3333 Adjust the computation of (yy)r2.
3334
3335 2008-11-26 Akim Demaille <demaille@gostai.com>
3336
3337 Rule length is unsigned.
3338 * src/gram.h, src/gram.c (rule_rhs_length): Return a size_t.
3339
3340 2008-11-26 Akim Demaille <demaille@gostai.com>
3341
3342 Get rid of lalr1-split.cc.
3343 It was no longer maintainer.
3344
3345 * data/lalr1-split.cc: Remove.
3346 * etc/bench.pl.in (bench_fusion_parser): Remove.
3347 Adjust.
3348
3349 2008-11-26 Akim Demaille <demaille@gostai.com>
3350
3351 Use yy* consistently.
3352 * data/glr.c: Now that yyrhs no longer exists as a global
3353 variable, rename local "rhs" variables into "yyrhs" for
3354 consistency.
3355
3356 2008-11-25 Akim Demaille <demaille@gostai.com>
3357
3358 Get rid of yyrhs and yyprhs in glr.c.
3359 * data/glr.c (yyrhs, yyprhs): Remove.
3360 Instead, use the state stack and yystos.
3361
3362 2008-11-25 Akim Demaille <demaille@gostai.com>
3363
3364 Flag glr tests.
3365 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): If glr, declare it
3366 as an Autotest keyword.
3367
3368 2008-11-25 Akim Demaille <demaille@gostai.com>
3369
3370 Prefer TESTSUITE_FLAGS.
3371 TESTSUITEFLAGS is barely readable.
3372
3373 * tests/local.mk (TESTSUITE_FLAGS): Default to $(TESTSUITEFLAGS)
3374 for backward compatibility.
3375 Use the former instead of the latter.
3376
3377 2008-11-25 Akim Demaille <demaille@gostai.com>
3378
3379 Get rid of yyrhs and yyprhs in larl1.java.
3380 * data/lalr1.java (yyrhs_, yyprhs_): Remove.
3381 (yy_reduce_print): Rather, use yystos_ and the state stack.
3382
3383 2008-11-25 Akim Demaille <demaille@gostai.com>
3384
3385 Formatting changes.
3386
3387 2008-11-25 Akim Demaille <demaille@gostai.com>
3388
3389 Get rid of yyrhs and yyprhs in yacc.c.
3390 They were used to get the symbol types, given a rule number, when
3391 displaying the top of the stack before a reduction. But the
3392 symbol type is available from the state stack. This has two be
3393 benefits: two tables less in the parser (making it smaller), and a
3394 more consistent use of the three stacks which will help to fuse
3395 them.
3396
3397 * data/yacc.c (yyprhs, yyrhs): Remove.
3398 (YY_REDUCE_PRINT): Pass yyssp to yy_reduce_print.
3399 (yy_reduce_print): Take yyssp as argument.
3400 Use it, together with yystos, to get the symbol type.
3401 * tests/regression.at (Web2c Report): Remove these tables from the
3402 expected output.
3403
3404 2008-11-25 Akim Demaille <demaille@gostai.com>
3405
3406 b4_tables_map.
3407 The point is to factor the generation of the tables across skeletons.
3408 This is language dependant.
3409
3410 * data/c.m4 (b4_comment_): New.
3411 Should be usable to define how to generate tables independently of
3412 the language.
3413 (b4_c_comment): New.
3414 (b4_comment): Bounce to b4_c_comment.
3415 Now support $2 = [PREFIX] for indentation.
3416 * data/lalr1.cc (b4_table_declare): Don't output a comment if
3417 there is no comment.
3418 Indent it properly when there is one.
3419 Output the ending semicolon.
3420 (b4_table_define): Space changes.
3421 Output the ending semicolon.
3422 (b4_tables_map): New.
3423 Use it twice instead of declaring and defining the (integral)
3424 tables by hand.
3425
3426 2008-11-25 Akim Demaille <demaille@gostai.com>
3427
3428 b4_table_declare.
3429 * data/lalr1.cc (b4_table_declare): New.
3430 Use it to declare the tables defined with b4_table_define.
3431 (b4_table_define): Declare a third arg to match b4_table_declare
3432 signature.
3433 Move all the comments around invocations of b4_table_define into
3434 the invocations itselves.
3435 Move things around to have the order for declarations and
3436 definitions.
3437
3438 2008-11-25 Akim Demaille <demaille@gostai.com>
3439
3440 Formatting changes.
3441 * data/lalr1.java: here.
3442
3443 2008-11-25 Akim Demaille <demaille@gostai.com>
3444
3445 b4_args is more general than only C++.
3446 * data/lalr1.cc (b4_args, _b4_args): Move to...
3447 * data/bison.m4: here.
3448
3449 2008-11-21 Di-an Jan <dianj@freeshell.org>
3450
3451 Implement no-XXX arguments for --warnings, --report, --trace.
3452 * src/getargs.c (flags_argmatch): Handles no-XXX.
3453 Fix typo in doxygen comment.
3454
3455 2008-11-21 Akim Demaille <demaille@gostai.com>
3456
3457 Display the changes in cross-options.texi.
3458 * build-aux/cross-options.pl ($sep): New, to separate items.
3459 * doc/local.mk ($(CROSS_OPTIONS_TEXI)): Use diff to display the
3460 changes.
3461
3462 2008-11-20 Di-an Jan <dianj@freeshell.org>
3463
3464 Improves options in the manual.
3465 * doc/bison.texinfo (-g, -x): Add space before argument.
3466 (Option Cross Key): Implement FIXME: listing directives also.
3467 * build-aux/cross-options.pl: Read from <STDIN> rather than <>.
3468 (Short Option): Special case -d. Put arguments inside @option.
3469 (Bison Directive): Add column, automatically extracted from
3470 src/scan-gram.l (actual name passed as the first argument)
3471 with special case for %define.
3472 * doc/local.mk (doc/cross-options.texi): Pass src/scan-gram.l
3473 to build-aux/cross-options.pl.
3474 * src/getargs.c (usage): Document limitations of cross-options.pl.
3475 * src/scan-gram.l: Likewise.
3476
3477 2008-11-18 Joel E. Denny <jdenny@ces.clemson.edu>
3478
3479 Fix unexpanded macros in GLR defines file.
3480 Reported by Csaba Raduly at
3481 <http://lists.gnu.org/archive/html/bug-bison/2008-11/msg00048.html>.
3482 * THANKS (Csaba Raduly): Add.
3483 * data/glr.c: Fix overquoting on b4_prefix for yylval and yylloc.
3484 * tests/calc.at (_AT_DATA_CALC_Y): If %defines is specified, generate
3485 lexer in a separate module that includes the defines file.
3486 (AT_CHECK_CALC): From AT_FULL_COMPILE, request compilation of lexer
3487 source.
3488 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_DEFINES_IF.
3489 Adjust AT_LOC and AT_VAL to use AT_NAME_PREFIX.
3490 (AT_BISON_OPTION_POPDEFS): Pop AT_DEFINES_IF.
3491 (AT_DATA_SOURCE_PROLOGUE): New.
3492 (AT_DATA_GRAMMAR_PROLOGUE): Use AT_DATA_SOURCE_PROLOGUE.
3493 (AT_DATA_SOURCE): New.
3494 (AT_FULL_COMPILE): Extend to support an additional source file.
3495
3496 2008-11-18 Akim Demaille <demaille@gostai.com>
3497
3498 More TODO.
3499 * TODO: More short term issues.
3500
3501 2008-11-18 Akim Demaille <demaille@gostai.com>
3502
3503 Regen.
3504 * src/parse-gram.h, src/parse-gram.c: Regen.
3505
3506 2008-11-18 Akim Demaille <demaille@gostai.com>
3507
3508 Use b4_subtract where possible.
3509 * data/lalr1.cc (b4_subtract): Move to...
3510 * data/bison.m4: here.
3511 * data/glr.c (b4_rhs_data): Use it.
3512 * data/yacc.c (b4_rhs_value, b4_rhs_location): Use it.
3513
3514 2008-11-18 Akim Demaille <demaille@gostai.com>
3515
3516 Remove incorrect mode specification.
3517 * data/glr.cc: Don't pretend it's C code.
3518
3519 2008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
3520
3521 Simplify last patch slightly.
3522 * src/getargs.c (getargs): Here.
3523
3524 2008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
3525
3526 Fix last warning from --enable-gcc-warnings.
3527 * src/getargs.c (getargs): Don't assign const address to non-const
3528 pointer.
3529
3530 2008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
3531
3532 Don't let maintainer-*-check targets force a version update.
3533 * cfg.mk (_is-dist-target): Implement. maintainer-check* was already
3534 handled.
3535
3536 2008-11-17 Di-an Jan <dianj@freeshell.org>
3537
3538 * doc/bison.texinfo: Synchronize ``Detail Node Listing''.
3539 Align menus. Adjust word wrapping. Use node names for menu names.
3540 (Examples): Don't abbreviate node names.
3541 (LocalWords): Remove abbreviations.
3542 (Copying): Make description a sentence.
3543 (Java Action Features): Remove period to match the rest of menu.
3544
3545 2008-11-17 Di-an Jan <dianj@freeshell.org>
3546
3547 Handles several --enable-gcc-warnings.
3548 * src/getargs.c (command_line_location): Set parameters to void.
3549 * src/output.c (symbol_type_name_cmp): Make static.
3550 (symbols_by_type_name): Set parameters to void.
3551 (symbol_definitions_output): Remove unused parameter. Rename as...
3552 (prepare_symbol_definitions): this.
3553 (muscles_output): Move symbol_definitions_output to...
3554 (output): here as prepare_symbol_definitions.
3555 * tests/c++.at (AT_CHECK_VARIANTS): Remove unused parameters of main.
3556 (AT_CHECK_NAMESPACE): Make unused parameter lloc unnamed.
3557
3558 2008-11-17 Di-an Jan <dianj@freeshell.org>
3559
3560 * tests/c++.at (AT_CHECK_VARIANTS): Fixes tests 198-202.
3561 Use AT_DATA_GRAMMAR instead of AT_DATA for compiled tests.
3562
3563 2008-11-16 Akim Demaille <demaille@gostai.com>
3564
3565 Add missing $(EXEEXT).
3566 * doc/local.mk ($(CROSS_OPTIONS_TEXI)): The target is
3567 "src/bison$(EXEEXT)".
3568 Reported by Di-an Jan.
3569
3570 2008-11-15 Akim Demaille <demaille@gostai.com>
3571
3572 * TODO: Update.
3573
3574 2008-11-15 Akim Demaille <demaille@gostai.com>
3575
3576 Formatting changes.
3577 * tests/input.at: here.
3578
3579 2008-11-15 Akim Demaille <demaille@gostai.com>
3580
3581 Remove duplicate header inclusion.
3582 * src/LR0.c: here.
3583
3584 2008-11-15 Akim Demaille <demaille@gostai.com>
3585
3586 * src/parse-gram.h, src/parse-gram.c: Regen.
3587
3588 2008-11-15 Akim Demaille <demaille@gostai.com>
3589
3590 Support parametric types.
3591
3592 There are two issues to handle: first scanning nested angle
3593 bracket pairs to support types such as std::pair< std::string,
3594 std::list<std::string> > >.
3595
3596 Another issue is to address idiosyncracies of C++: do not glue two
3597 closing angle brackets together (otherwise it's operator>>), and
3598 avoid sticking blindly a TYPE to the opening <, as it can result
3599 in '<:' which is a digraph for '['.
3600
3601 * src/scan-gram.l (brace_level): Rename as...
3602 (nesting): this.
3603 (SC_TAG): New.
3604 Implement support for complex tags.
3605 (tag): Accept
3606 , but not <.
3607 * data/lalr1.cc (b4_symbol_value, b4_symbol_value_template)
3608 (b4_symbol_variant): Leave space around types as parameters.
3609 * examples/variant.yy: Use nested template types and leading ::.
3610 * src/parse-gram.y (TYPE, TYPE_TAG_ANY, TYPE_TAG_NONE, type.opt):
3611 Rename as...
3612 (TAG, TAG_ANY, TAG_NONE, tag.opt): these.
3613 * tests/c++.at: Test parametric types.
3614
3615 2008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
3616
3617 Test token.prefix.
3618 This is not sufficient, but we test at least that the make_SYMBOL
3619 interface is not affected by token.prefix. A more general test
3620 will be implemented when the support of token.prefix is generalized
3621 to more skeletons.
3622
3623 * tests/c++.at: One more variant test, using token.prefix.
3624
3625 2008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
3626
3627 Test the make_TOKEN interface.
3628 * tests/c++.at (AT_CHECK_VARIANTS): Require and use locations.
3629 Factor the common code in yylex.
3630 Use it to test "%define lex_symbol".
3631
3632 2008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
3633
3634 Formatting change.
3635
3636 2008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
3637
3638 Simplify code for variants bench marks.
3639 * etc/bench.pl.in (&generate_grammar_list): Define and use
3640 location_type.
3641 Factor the common code in yylex.
3642
3643 2008-11-15 Akim Demaille <demaille@gostai.com>
3644
3645 Better error message.
3646 * bootstrap (find_tool): Fix the error message.
3647
3648 2008-11-15 Akim Demaille <demaille@gostai.com>
3649
3650 Update variant.yy to newest interface.
3651 * examples/variant.yy: Define lex_symbol.
3652 Adjust.
3653
3654 2008-11-15 Akim Demaille <demaille@gostai.com>
3655
3656 Don't use locations in variant.yy.
3657 * examples/variant.yy: Adjust to not using locations.
3658
3659 2008-11-15 Akim Demaille <demaille@gostai.com>
3660
3661 Comment changes.
3662 * data/local.mk, etc/local.mk, examples/local.mk: Use Automake
3663 comments for the license.
3664
3665 2008-11-15 Akim Demaille <demaille@gostai.com>
3666
3667 Remove tests/Makefile.am.
3668 * tests/Makefile.am: Rename as...
3669 * tests/local.mk: this.
3670 * Makefile.am, configure.ac: Adjust.
3671 * Makefile.am (DISTCLEANFILES): Define.
3672 (maintainer-check, maintainer-xml-check, maintainer-push-check):
3673 Remove, we no longer need to bounce to the real targets.
3674
3675 2008-11-15 Akim Demaille <demaille@gostai.com>
3676
3677 Comment changes.
3678
3679 2008-11-15 Akim Demaille <demaille@gostai.com>
3680
3681 djgpp/local.mk.
3682 * Makefile.am (EXTRA_DIST): Move djgpp related part to...
3683 * djgpp/local.mk: this new file.
3684
3685 2008-11-15 Akim Demaille <demaille@gostai.com>
3686
3687 Remove doc/Makefile.am.
3688 * doc/Makefile.am: Rename as...
3689 * doc/local.mk: this.
3690 Adjust paths
3691 * Makefile.am, configure.ac: Adjust.
3692 * Makefile.am (MOSTLYCLEANFILES): New.
3693 * src/local.mk: Adjust.
3694
3695 2008-11-15 Akim Demaille <demaille@gostai.com>
3696
3697 Move sc_tight_scope into maint.mk.
3698 It does not work, and I don't know how it was supposed to work: it
3699 seems to be looking for sources in the build tree. I just moved
3700 it at a better place, fixing it is still required.
3701
3702 * src/local.mk (echo): Remove.
3703 (sc_tight_scope): Move to...
3704 * maint.mk: here.
3705
3706 2008-11-15 Akim Demaille <demaille@gostai.com>
3707
3708 Regen.
3709 * src/parse-gram.h, src/parse-gram.h: Regen.
3710
3711 2008-11-15 Akim Demaille <demaille@gostai.com>
3712
3713 Remove src/Makefile.am.
3714 * src/Makefile.am: Rename as...
3715 * src/local.mk: this.
3716 Prefix all the paths with src/.
3717 (AUTOMAKE_OPTIONS): Build object files in the sub dirs.
3718 (AM_CPPFLAGS): Find find in builddir/src.
3719 (YACC): Move the flags into...
3720 (AM_YFLAGS): here.
3721 * maint.mk (sc_tight_scope): Disable.
3722 It used to bounce to the version in src/Makefile.am which is now
3723 part of this very Makefile.
3724 * Makefile.am, configure.ac: Adjust.
3725 * src/scan-code-c.c, src/scan-code.l: We can no longer rely on
3726 include "..." to find files "here": we are no longer in src/, so
3727 qualify the includes with src/.
3728 * doc/Makefile.am (PREPATH): No longer include the top_builddir
3729 prefix.
3730 (.x.1): Adjust to be able to create src/foo from the top level
3731 Makefile, instead of going bounce to src/Makefile the creation of
3732 foo.
3733
3734 2008-11-15 Akim Demaille <demaille@gostai.com>
3735
3736 Remove useless variable.
3737 * doc/Makefile.am (srcsrcdir): Remove.
3738
3739 2008-11-15 Akim Demaille <demaille@gostai.com>
3740
3741 Remove data/Makefile.am.
3742 * data/Makefile.am: Rename as...
3743 * data/local.mk: this.
3744 Adjust paths.
3745 * Makefile.am, configure.ac: Adjust.
3746
3747 2008-11-15 Akim Demaille <demaille@gostai.com>
3748
3749 Remove etc/Makefile.am.
3750 * etc/Makefile.am: Rename as...
3751 * etc/local.mk: this.
3752 Adjust.
3753 * Makefile.am, configure.ac: Adjust.
3754
3755 2008-11-15 Akim Demaille <demaille@gostai.com>
3756
3757 Remove examples/local.mk.
3758 examples/calc++/Makefile.am might be interesting to keep as is, since
3759 it is an example in itself.
3760
3761 * examples/Makefile.am: Rename as...
3762 * examples/local.mk: this.
3763 Adjust.
3764 * Makefile.am, configure.ac: Adjust.
3765
3766 2008-11-15 Akim Demaille <demaille@gostai.com>
3767
3768 Remove build-aux/Makefile.am.
3769 Recursive Makefiles are really way too slow, let's get rid of some of
3770 them.
3771
3772 * build-aux/Makefile.am: Rename as...
3773 * build-aux/local.mk: this.
3774 Adjust paths.
3775 * Makefile.am, configure.ac: Adjust.
3776
3777 2008-11-15 Akim Demaille <demaille@gostai.com>
3778
3779 Provide convenience constructors for locations and positions.
3780 * data/location.cc (position::position): Accept file, line and
3781 column as arguments with default values.
3782 Always qualify initial line and column literals as unsigned.
3783 (location::location): Provide convenience constructors.
3784
3785 2008-11-15 Akim Demaille <demaille@gostai.com>
3786
3787 Instead of using make_symbol<TOK_FOO>, generate make_FOO for each
3788 token type.
3789 Using template buys us nothing, and makes it uselessly complex to
3790 construct a symbol. Besides, it could not be generalized to other
3791 languages, while make_FOO would work in C/Java etc.
3792
3793 * data/lalr1.cc (b4_symbol_): New.
3794 (b4_symbol): Use it.
3795 (b4_symbol_constructor_declaration_)
3796 (b4_symbol_constructor_definition_): Instead of generating
3797 specializations of an overloaded template function, just generate
3798 several functions whose names are forged from the token names
3799 without the token.prefix.
3800 (b4_symbol_constructor_declarations): Generate them for all the
3801 symbols, not just by class of symbol type, now that instead of
3802 specializing a function template by the token, we generate a
3803 function named after the token.
3804 (b4_symbol_constructor_specialization_)
3805 (b4_symbol_constructor_specializations): Remove.
3806 * etc/bench.pl.in: Adjust to this new API.
3807
3808 2008-11-13 Akim Demaille <demaille@gostai.com>
3809
3810 %define token.prefix.
3811 Provide a means to add a prefix to the name of the tokens as
3812 output in the generated files. Because of name clashes, it is
3813 good to have such a prefix such as TOK_ that protects from names
3814 such as EOF, FILE etc. But it clutters the grammar itself.
3815
3816 * data/bison.m4 (token.prefix): Empty by default.
3817 * data/c.m4 (b4_token_enum, b4_token_define): Use it.
3818 * data/lalr1.cc (b4_symbol): Ditto.
3819
3820 2008-11-13 Akim Demaille <demaille@gostai.com>
3821
3822 Compute at M4 time some of the subtractions.
3823 * data/lalr1.cc (b4_subtract): New.
3824 (b4_rhs_data): Use it.
3825
3826 2008-11-13 Akim Demaille <demaille@gostai.com>
3827
3828 symbol::token.
3829 This allows the user to get the type of a token returned by yylex.
3830
3831 * data/lalr1.cc (symbol::token): New.
3832 (yytoknum_): Define when %define lex_symbol, independently of
3833 %debug.
3834 (yytoken_number_): Move into...
3835 (symbol::token): here, since that's the only use.
3836 The other one is YYPRINT which was not officially supported
3837 by lalr1.cc, and anyway it did not work since YYPRINT uses this
3838 array under a different name (yytoknum).
3839
3840 2008-11-13 Akim Demaille <demaille@gostai.com>
3841
3842 YYERRCODE.
3843 * TODO (YYERRCODE): Mention the case of $undef.
3844
3845 2008-11-13 Akim Demaille <demaille@gostai.com>
3846
3847 TODO: YYPRINT.
3848 * TODO (YYPRINT): New.
3849
3850 2008-11-13 Akim Demaille <demaille@gostai.com>
3851
3852 Comment changes.
3853 * data/lalr1.cc, data/yacc.c: Fix the description of the
3854 yytranslate and yytoknum tables.
3855
3856 2008-11-13 Akim Demaille <demaille@gostai.com>
3857
3858 Define make_symbol in the header.
3859 To reach good performances these functions should be inlined (yet
3860 this is to measure precisely). To this end they must be available
3861 to the caller.
3862
3863 * data/lalr1.cc (b4_symbol_constructor_definition_): Qualify
3864 location_type with the class name.
3865 Since will now be output in the header, declare "inline".
3866 No longer use b4_symbol_constructor_specializations, but
3867 b4_symbol_constructor_definitions in the header.
3868 Don't call it in the *.cc file.
3869
3870 2008-11-13 Akim Demaille <demaille@gostai.com>
3871
3872 Define yytranslate in the header for lex_symbol.
3873 * data/lalr1.cc: Move the invocation of b4_yytranslate_definition
3874 into the header file when using %define lex_symbol.
3875 (yytranslate_): Declare inline.
3876
3877 2008-11-13 Akim Demaille <demaille@gostai.com>
3878
3879 Define the constructors of symbol_type in
3880 b4_symbol_constructor_definitions.
3881 The constructors are called by the make_symbol functions, which a
3882 forthcoming patch will move elsewhere. Hence the interest of
3883 putting them together.
3884
3885 The stack_symbol_type does not need to be moved, it is used only
3886 by the parser.
3887
3888 * data/lalr1.cc: Move symbol_type and symbol_base_type
3889 constructors into...
3890 (b4_symbol_constructor_definitions): here.
3891 Adjust.
3892
3893 2008-11-13 Akim Demaille <demaille@gostai.com>
3894
3895 Make it easier to move the definition of yytranslate_.
3896 Forthcoming changes will make it possible to use yytranslate_
3897 from outside the parser implementation file.
3898
3899 * data/lalr1.cc (b4_yytranslate_definition): New.
3900 Use it.
3901
3902 2008-11-13 Akim Demaille <demaille@gostai.com>
3903
3904 Remove useless class specification.
3905 * data/lalr1.cc (b4_symbol_constructor_specialization_): No need
3906 to refer to the class name to use a type defined by the class for
3907 arguments of member functions.
3908
3909 2008-11-13 Akim Demaille <demaille@gostai.com>
3910
3911 Finer input type for yytranslate.
3912 This patch is debatable: the tradition expects yylex to return an int
3913 which happens to correspond to token_number (which is an enum). This
3914 allows for instance to return characters (such as '*' etc.). But this
3915 goes against the stronger typing I am trying to have with the new
3916 lex interface which return a symbol_type. So in this case, feed
3917 yytranslate_ with a token_type.
3918
3919 * data/lalr1.cc (yytranslate_): When in %define lex-symbol,
3920 expect a token_type.
3921
3922 2008-11-13 Akim Demaille <demaille@gostai.com>
3923
3924 Honor lex-params in %define lex_symbol mode.
3925 * data/lalr1.cc: Use b4_lex_param.
3926
3927 2008-11-13 Akim Demaille <demaille@gostai.com>
3928
3929 Simplify names.
3930 * src/output.c (symbol_definitions_output): Rename symbol
3931 attributes type_name and has_type_name as type and has_type.
3932 * data/lalr1.cc: Adjust uses.
3933
3934 2008-11-13 Akim Demaille <demaille@gostai.com>
3935
3936 Use b4_type_names for the union type.
3937 The union used to compute the size of the variant used to iterate
3938 over the type of all the symbols, with a lot of redundancy. Now
3939 iterate over the lists of symbols having the same type-name.
3940
3941 * data/lalr1.cc (b4_char_sizeof_): New.
3942 (b4_char_sizeof): Use it.
3943 Adjust to be called with a list of numbers instead of a single
3944 number.
3945 Adjust its caller for new-line issues.
3946
3947 2008-11-13 Akim Demaille <demaille@gostai.com>
3948
3949 Define the "identifier" of a symbol.
3950 Symbols may have several string representations, for instance if
3951 they have an alias. What I call its "id" is a string that can be
3952 used as an identifier. May not exist.
3953
3954 Currently the symbols which have the "tag_is_id" flag set are
3955 those that don't have an alias. Look harder for the id.
3956
3957 * src/output.c (is_identifier): Move to...
3958 * src/symtab.c (is_identifier): here.
3959 * src/symtab.h, src/symtab.c (symbol_id_get): New.
3960 * src/output.c (symbol_definitions_output): Use it to define "id"
3961 and "has_id".
3962 Remove the definition of "tag_is_id".
3963 * data/lalr1.cc: Use the "id" and "has_id" whereever "tag" and
3964 "tag_is_id" were used to produce code.
3965 We still use "tag" for documentation.
3966
3967 2008-11-11 Akim Demaille <demaille@gostai.com>
3968
3969 Locations are no longer required by lalr1.cc.
3970 * data/lalr1.cc (_b4_args, b4_args): New.
3971 Adjust all uses of locations to make them optional.
3972 * tests/c++.at (AT_CHECK_VARIANTS): No longer use the locations.
3973 (AT_CHECK_NAMESPACE): Check the use of locations.
3974 * tests/calc.at (_AT_DATA_CALC_Y): Adjust to be usable with or
3975 without locations with lalr1.cc.
3976 Test these cases.
3977 * tests/output.at: Check lalr1.cc with and without location
3978 support.
3979 * tests/regression.at (_AT_DATA_EXPECT2_Y, _AT_DATA_DANCER_Y):
3980 Don't use locations.
3981
3982 2008-11-11 Akim Demaille <demaille@gostai.com>
3983
3984 AT_FULL_COMPILE.
3985 * tests/local.at (AT_FULL_COMPILE): New.
3986 * tests/actions.at, tests/calc.at, tests/regression.at: Use it.
3987
3988 2008-11-11 Akim Demaille <demaille@gostai.com>
3989
3990 Support parens in calc++.
3991 * doc/bison.texinfo (Calc++ Scanner, Calc++ Parser): Support parens.
3992 * examples/calc++/test (run): Check the expected output.
3993 Adjust callers.
3994 Check parens too.
3995
3996 2008-11-11 Akim Demaille <demaille@gostai.com>
3997
3998 Simplify lalr1.cc since %defines is mandatory.
3999 * data/lalr1.cc: Remove useless calls to b4_defines_if.
4000
4001 2008-11-11 Akim Demaille <demaille@gostai.com>
4002
4003 TODO: yyfmt.
4004 * TODO (yysyntax_error): New item.
4005
4006 2008-11-11 Akim Demaille <demaille@gostai.com>
4007
4008 Prefer M4 to CPP.
4009 * data/lalr1.cc: Use b4_error_verbose_if instead of #if
4010 YYERROR_VERBOSE.
4011
4012 2008-11-11 Akim Demaille <demaille@gostai.com>
4013
4014 Support i18n of the parse error messages.
4015 * TODO (lalr1.cc/I18n): Remove.
4016 * data/lalr1.cc (yysyntax_error_): Support the translation of the
4017 error messages, as done in yacc.c.
4018 Stay within the yy* pseudo namespace.
4019
4020 2008-11-11 Akim Demaille <demaille@gostai.com>
4021
4022 More TODO.
4023 * TODO (single stack, yysyntax_error): New.
4024
4025 2008-11-11 Akim Demaille <demaille@gostai.com>
4026
4027 Make it possible to return a symbol_type from yylex.
4028 * data/lalr1.cc (b4_lex_symbol_if): New.
4029 (parse): When lex_symbol is defined, expected yylex to return the
4030 complete lookahead.
4031 * etc/bench.pl.in (generate_grammar_list): Extend to support this
4032 yylex interface.
4033 (bench_variant_parser): Exercise it.
4034
4035 2008-11-11 Akim Demaille <demaille@gostai.com>
4036
4037 Remove useless bench case.
4038 * etc/bench.pl.in (bench_variant_parser): VARIANT_DESTROY is
4039 no longer used.
4040
4041 2008-11-11 Akim Demaille <demaille@gostai.com>
4042
4043 Improve display of directives.
4044 * etc/bench.pl.in (parse_term): Don't add useless eol.
4045
4046 2008-11-11 Akim Demaille <demaille@gostai.com>
4047
4048 Use string_cast in the bench.
4049 * etc/bench.pl.in (generate_grammar_list): Define and use
4050 string_cast.
4051
4052 2008-11-11 Akim Demaille <demaille@gostai.com>
4053
4054 Replace yychar with a Boolean.
4055 * data/lalr1.cc (parse::yychar): Replace by...
4056 (parse::yyempty): this.
4057
4058 2008-11-11 Akim Demaille <demaille@gostai.com>
4059
4060 Factor the tables.
4061 * TODO: New item.
4062
4063 2008-11-11 Akim Demaille <demaille@gostai.com>
4064
4065 Let yytranslate handle the eof case.
4066 * data/lalr1.cc (yytranslate_): Handle the EOF case.
4067 Adjust callers.
4068 No longer expect yychar to be equal to yyeof_, rather, test the
4069 lookahead's (translated) kind.
4070
4071 2008-11-11 Akim Demaille <demaille@gostai.com>
4072
4073 yychar cannot be empty in yyerrlab.
4074 * TODO (yychar == yyempty_): New.
4075 * data/lalr1.cc: Remove the handling of this case.
4076 This eases forthcoming changes related to yychar and yytranslate.
4077
4078 2008-11-11 Akim Demaille <demaille@gostai.com>
4079
4080 Bench: syntactic sugar for %define/#define.
4081 * etc/bench.pl.in (parse_dirs): Support %d and #d with arguments.
4082 (&bench_push_parser, bench_variant_parser): Use this feature.
4083 (&eat): New.
4084 Use it.
4085
4086 2008-11-11 Akim Demaille <demaille@gostai.com>
4087
4088 Less memory pressure on the "list" bench.
4089 * etc/bench.pl.in (generate_grammar_list): Do not accumulate all
4090 the values, to limit memory pressure.
4091
4092 2008-11-11 Akim Demaille <demaille@gostai.com>
4093
4094 Introduce make_symbol.
4095 make_symbol provides a means to construct a full symbol (kind,
4096 value, location) in a single shot. It is meant to be a Symbol
4097 constructor, parameterized by the symbol kind so that overloading
4098 would prevent incorrect kind/value pairs. Unfortunately
4099 parameterized constructors do not work well in C++ (unless the
4100 parameter also appears as an argument, which is not acceptable),
4101 hence the use of a function instead of a constructor.
4102
4103 * data/lalr1.cc (b4_symbol_constructor_declaration_)
4104 (b4_symbol_constructor_declarations)
4105 (b4_symbol_constructor_specialization_)
4106 (b4_symbol_constructor_specializations)
4107 (b4_symbol_constructor_definition_)
4108 (b4_symbol_constructor_definitions): New.
4109 Use them where appropriate to generate declaration, declaration of
4110 the specializations, and implementations of the templated
4111 overloaded function "make_symbol".
4112 (variant::variant): Always define a default ctor.
4113 Also provide a copy ctor.
4114 (symbol_base_type, symbol_type): New ctor overloads for value-less
4115 symbols.
4116 (symbol_type): Now public, so that functions such as yylex can use
4117 it.
4118
4119 2008-11-11 Akim Demaille <demaille@gostai.com>
4120
4121 Inform m4 whether a tag is a valid id.
4122 * src/output.c (is_identifier): New.
4123 (symbol_definitions_output): Use it to define tag_is_id.
4124 But maybe this should be done at m4 level?
4125
4126 2008-11-11 Akim Demaille <demaille@gostai.com>
4127
4128 Test 214 was failing: it greps with a pattern containing [ ]*
4129 which obviously meant to catch spaces and tabs, but contained only
4130 spaces. Tabulations in sources are a nuisance, so to simplify the
4131 matter, get rid of all the tabulations in the Java sources. The
4132 other skeletons will be treated equally later.
4133
4134 * data/java.m4, data/lalr1.java: Untabify.
4135 * tests/java.at: Simplify AT_CHECK_JAVA_GREP invocations:
4136 tabulations are no longer generated.
4137
4138 2008-11-11 Paolo Bonzini <bonzini@gnu.org>
4139
4140 * bootstrap.conf: Replace m4/warning.m4 with warnings module.
4141 * configure.ac: Adjust usage.
4142 * lib/Makefile.am: Replace $(WARNING_CFLAGS) with $(WARN_CFLAGS).
4143 * src/Makefile.am: Replace $(WARNING_CFLAGS) with $(WARN_CFLAGS).
4144 * tests/atlocal.in: Replace $(WARNING_*FLAGS) with $(WARN_*FLAGS).
4145
4146 2008-11-10 Di-an Jan <dianj@freeshell.org>
4147
4148 Workaround Java's ``code too large'' problem for parser tables
4149 in most cases, by using one function per initialization.
4150 * data/java.m4 (b4_typed_parser_table, b4_integral_parser_table): New.
4151 * data/lalr1.java (yypact_, yydefact_, yypgoto_, yydefgoto_,
4152 yytable_, yycheck_, yystos_, yytoken_number_, yyr1_, yyr2_, yyrhs_
4153 yyprhs_, yyrline_, yytranslate_table_): Use b4_integral_parser_table.
4154 (yytname_): Use b4_typed_parser_table.
4155 * doc/bison.texinfo (Java Bison Interface): Add note on Java's
4156 ``code too large'' error.
4157
4158 2008-11-10 Di-an Jan <dianj@freeshell.org>
4159
4160 * NEWS: Document them.
4161
4162 General Java skeleton improvements.
4163 * configure.ac (gt_JAVACOMP): Request target of 1.4, which allows
4164 using gcj < 4.3 in the testsuite, according to comments in
4165 gnulib/m4/javacomp.m4.
4166 * data/java.m4 (stype, parser_class_name, lex_throws, throws,
4167 location_type, position_type): Remove extraneous brackets from
4168 b4_percent_define_default.
4169 (b4_lex_param, b4_parse_param): Remove extraneous brackets from
4170 m4_define and m4_define_default.
4171 * data/lalr1.java (b4_pre_prologue): Change to b4_user_post_prologue,
4172 which marks the end of user code with appropriate syncline, like all
4173 the other skeletons.
4174 (b4_user_post_prologue): Add. Don't silently drop.
4175 (yylex): Remove.
4176 (parse): Inline yylex.
4177 * doc/bison.texinfo (bisonVersion, bisonSkeleton): Document.
4178 (%{...%}): Fix typo of %code imports.
4179 * tests/java.at (AT_JAVA_COMPILE): Add "java" keyword.
4180
4181 Support annotations on parser class with %define annotations.
4182 * data/lalr1.java (annotations): Add to parser class modifier.
4183 * doc/bison.texinfo (Java Parser Interface): Document
4184 %define annotations.
4185 (Java Declarations Summary): Document %define annotations.
4186 * tests/java.at (Java parser class modifiers): Test annotations.
4187
4188 Do not generate code for %error-verbose unless requested.
4189 * data/lalr1.java (errorVerbose): Rename to yyErrorVerbose.
4190 Make private. Make conditional on %error-verbose.
4191 (getErrorVerbose, setErrorVerbose): New.
4192 (yytnamerr_): Make conditional on %error-verbose.
4193 (yysyntax_error): Make some code conditional on %error-verbose.
4194 * doc/bison.texinfo (Java Bison Interface): Remove the parts
4195 about %error-verbose having no effect.
4196 (getErrorVerbose, setErrorVerbose): Document.
4197
4198 Move constants for token names to Lexer interface.
4199 * data/lalr1.java (Lexer): Move EOF, b4_token_enums(b4_tokens) here.
4200 * data/java.m4 (b4_token_enum): Indent for move to Lexer interface.
4201 (parse): Qualify EOF to Lexer.EOF.
4202 * doc/bison.texinfo (Java Parser Interface): Move documentation of
4203 EOF and token names to Java Lexer Interface.
4204 * tests/java.at (_AT_DATA_JAVA_CALC_Y): Remove Calc qualifier.
4205
4206 Make yyerror public.
4207 * data/lalr1.java (Lexer.yyerror): Use longer parameter name.
4208 (yyerror): Change to public. Add Javadoc comments. Use longer
4209 parameter names. Make the body rather than the declarator
4210 conditional on %locations.
4211 * doc/bison.texinfo (yyerror): Document. Don't mark as protected.
4212
4213 Allow user to add code to the constructor with %code init.
4214 * data/java.m4 (b4_init_throws): New, for %define init_throws.
4215 * data/lalr1.java (YYParser.YYParser): Add b4_init_throws.
4216 Add %code init to the front of the constructor body.
4217 * doc/bison.texinfo (YYParser.YYParser): Document %code init
4218 and %define init_throws.
4219 (Java Declarations Summary): Document %code init and
4220 %define init_throws.
4221 * tests/java.at (Java %parse-param and %lex-param): Adjust grep.
4222 (Java constructor init and init_throws): Add tests.
4223
4224 2008-11-10 Akim Demaille <demaille@gostai.com>
4225
4226 Update TODO.
4227 * TODO (-D): is implemented.
4228 (associativity): Same precedence must have the same associativity.
4229 For instance, how can a * b / c be parsed if * is %left and / is
4230 %right?
4231 (YYERRORCODE, YYFAIL, YYBACKUP): New.
4232
4233 2008-11-10 Akim Demaille <demaille@gostai.com>
4234
4235 Formatting changes.
4236
4237 2008-11-10 Akim Demaille <demaille@gostai.com>
4238
4239 More information about the symbols.
4240 * src/output.c (type_names_output): Document all the symbols,
4241 including those that don't have a type-name.
4242 (symbol_definitions_output): Define "is_token" and
4243 "has_type_name".
4244 * data/lalr1.cc (b4_type_action_): Skip symbols that have an empty
4245 type-name, now that they are defined too in b4_type_names.
4246
4247 2008-11-10 Akim Demaille <demaille@gostai.com>
4248
4249 Regen.
4250
4251 2008-11-10 Akim Demaille <demaille@gostai.com>
4252
4253 Make parser::yytranslate static.
4254 Small speedup (1%) on the list grammar. And makes yytranslate_
4255 available in non member functions.
4256
4257 * data/lalr1.cc (yytranslate_): Does not need to be a instance
4258 function.
4259
4260 2008-11-10 Akim Demaille <demaille@gostai.com>
4261
4262 Avoid trailing spaces.
4263 * data/c.m4: b4_comment(TEXT): Don't indent empty lines.
4264 * data/lalr1.cc: Don't indent before rule and symbol actions, as
4265 they can be empty, and anyway this incorrectly indents the first
4266 action.
4267
4268 2008-11-10 Akim Demaille <demaille@gostai.com>
4269
4270 Comment changes.
4271
4272 2008-11-10 Akim Demaille <demaille@gostai.com>
4273
4274 Use "enum" for integral constants.
4275 This is just nicer to read, I observed no speedup.
4276
4277 * data/lalr1.cc (yyeof_, yylast_, yynnts_, yyempty_, yyfinal_)
4278 (yterror_, yyerrcode_, yyntokens_): Define as members of an enum.
4279 (yyuser_token_number_max_, yyundef_token_): Move into...
4280 (yytranslate_): here.
4281
4282 2008-11-10 Akim Demaille <demaille@gostai.com>
4283
4284 Shortcuts in bench directives.
4285 * etc/bench.pl.in (parse_dirs): New.
4286 Use it.
4287 (bench_variant_parser, bench_fusion_parser): Use %s and %d.
4288 Create the benches in "benches/".
4289
4290 2008-11-10 Akim Demaille <demaille@gostai.com>
4291
4292 Formatting changes.
4293 * data/lalr1.cc: here.
4294
4295 2008-11-10 Akim Demaille <demaille@gostai.com>
4296
4297 Adjust verbose message to using emacs.
4298 * etc/bench.pl.in: Inform compilation-mode when we change the
4299 directory.
4300 (generate_grammar_list): Recognize %define "variant" in addition
4301 to %define variant.
4302
4303 2008-11-10 Akim Demaille <demaille@gostai.com>
4304
4305 Classify symbols by type-name.
4306 * src/uniqstr.h (UNIQSTR_CMP): New.
4307 * src/output.c (symbol_type_name_cmp, symbols_by_type_name)
4308 (type_names_output): New.
4309 (muscles_output): Use it.
4310 * data/lalr1.cc (b4_symbol_action_): Remove.
4311 (b4_symbol_case_, b4_type_action_): New.
4312 Adjust uses of b4_symbol_action_ to use b4_type_action_.
4313
4314 2008-11-10 Akim Demaille <demaille@gostai.com>
4315
4316 Change the handling of the symbols in the skeletons.
4317 Before we were using tables which lines were the symbols and which
4318 columns were things like number, tag, type-name etc. It is was
4319 difficult to extend: each time a column was added, all the numbers had
4320 to be updated (you asked for colon $2, not for "tag"). Also, it was
4321 hard to filter these tables when only a subset of the symbols (say the
4322 tokens, or the nterms, or the tokens that have and external number
4323 *and* a type-name) was of interest.
4324
4325 Now instead of monolithic tables, we define one macro per cell. For
4326 instance "b4_symbol(0, tag)" is a macro name which contents is
4327 self-decriptive. The macro "b4_symbol" provides easier access to
4328 these cells.
4329
4330 * src/output.c (type_names_output): Remove.
4331 (symbol_numbers_output, symbol_definitions_output): New.
4332 (muscles_output): Call them.
4333 (prepare_symbols): Define b4_symbols_number.
4334
4335 2008-11-10 Akim Demaille <demaille@gostai.com>
4336
4337 --trace=muscles
4338 * src/getargs.h, src/getargs.c (trace_muscle): New.
4339 (trace_types, trace_args): Support it.
4340 * src/output.c (output_skeleton): Use it.
4341
4342 2008-11-10 Akim Demaille <demaille@gostai.com>
4343
4344 muscles_output.
4345 * src/output.c (muscles_output): New, extracted from...
4346 (output_skeleton): here.
4347 Adjust.
4348
4349 2008-11-10 Akim Demaille <demaille@gostai.com>
4350
4351 Formatting changes.
4352
4353 2008-11-10 Akim Demaille <demaille@gostai.com>
4354
4355 Update the variant example.
4356 * examples/variant.yy: Formatting changes.
4357 One stage build.
4358
4359 2008-11-10 Akim Demaille <demaille@gostai.com>
4360
4361 Support constructor with an argument.
4362 This improves the "list" bench by 2%.
4363
4364 * data/lalr1.cc (variant::build): Add an overloaded version with
4365 an argument.
4366 * tests/c++.at (AT_CHECK_VARIANT): Check it.
4367
4368 2008-11-10 Akim Demaille <demaille@gostai.com>
4369
4370 Test variants.
4371 * tests/c++.at (AT_CHECK_VARIANTS): New.
4372 Use it with and without %define assert.
4373
4374 2008-11-10 Akim Demaille <demaille@gostai.com>
4375
4376 Add %precedence support.
4377 Unfortunately it is not possible to reuse the %prec directive. This
4378 is because to please POSIX, we do not require to end the rules with a
4379 semicolon. As a result,
4380
4381 foo: bar %prec baz
4382
4383 is ambiguous: either a rule which precedence is that of baz, or a rule,
4384 and then a declaration of the precedence of the token baz.
4385
4386 * doc/bison.texinfo: Document %precedence.
4387 (Precedence Only): New.
4388 * src/assoc.h, src/assoc.c (precedence_assoc): New.
4389 * src/conflicts.c (resolve_sr_conflict): Support it.
4390 * src/scan-gram.l, src/parse-gram.y (%precedence): New token.
4391 Parse it.
4392 * tests/calc.at: Use %precedence for NEG.
4393 * tests/conflicts.at (%precedence does not suffice)
4394 (%precedence suffices): New tests.
4395
4396 2008-11-09 Akim Demaille <demaille@gostai.com>
4397
4398 Make benches in a sub dirs.
4399 * etc/bench.pl.in ($dir): New.
4400 Use it.
4401 Check the use of constructors with an argument.
4402 (bench_variant_parser): Fix.
4403
4404 2008-11-09 Akim Demaille <demaille@gostai.com>
4405
4406 fix eof condition
4407
4408 2008-11-09 Akim Demaille <demaille@gostai.com>
4409
4410 Fix --help.
4411
4412 2008-11-09 Akim Demaille <demaille@gostai.com>
4413
4414 Require the generation of parse-gram.output.
4415 * src/Makefile.am (YACC): Pass --report=all.
4416
4417 2008-11-09 Akim Demaille <demaille@gostai.com>
4418
4419 Formatting changes.
4420
4421 2008-11-09 Akim Demaille <demaille@gostai.com>
4422
4423 Update TODO.
4424 * TODO: Remove obsolete items.
4425 Update others.
4426
4427 2008-11-09 Akim Demaille <demaille@gostai.com>
4428
4429 Enhance bench.pl.
4430 * etc/bench.pl.in (parse, parse_expr, parse_term, parse_fact)
4431 (@token, $grammar, $bench): New.
4432 (generate_grammar_variant): Rename as...
4433 (generate_grammar_list): this.
4434 (generate_grammar): Adjust.
4435 (bench_grammar): Rename as...
4436 (bench): this.
4437 Use it in the various bench-marking routines.
4438 (-b, -g): New options.
4439
4440 2008-11-09 Akim Demaille <demaille@gostai.com>
4441
4442 Use a static hierarchy for symbols in the C++ parser.
4443 * data/lalr1.cc (symbol_base_type, symbol_type)
4444 (stack_symbol_type): Make it a static hierarchy.
4445 Adjust dependencies.
4446
4447 2008-11-09 Akim Demaille <demaille@gostai.com>
4448
4449 bench.pl -d, --directive.
4450 * etc/bench.pl.in (@directive): New.
4451 (&bench_grammar): Use it.
4452 (&bench_list_grammar): New, to provide access to the "variant"
4453 grammar.
4454 Use it.
4455 (getopts): Support -d, --directive.
4456
4457 2008-11-09 Akim Demaille <demaille@gostai.com>
4458
4459 Use inline for small operations.
4460 * data/lalr1.cc (symbol_base_type, symbol_type)
4461 (stack_symbol_type): Declare constructor and other operations as
4462 inline.
4463 (yy_destroy_): Inline.
4464
4465 2008-11-09 Akim Demaille <demaille@gostai.com>
4466
4467 Introduce a hierarchy for symbols.
4468 * data/lalr1.cc (symbol_base_type, symbol_type): New.
4469 (data_type): Rename as...
4470 (stack_symbol_type): this.
4471 Derive from symbol_base_type.
4472 (yy_symbol_value_print_): Merge into...
4473 (yy_symbol_print_): this.
4474 Rename as...
4475 (yy_print_): this.
4476 (yydestruct_): Rename as...
4477 (yy_destroy_): this.
4478 (b4_symbols_actions, YY_SYMBOL_PRINT): Adjust.
4479 (parser::parse): yyla is now of symbol_type.
4480 Use its type member instead of yytoken.
4481
4482 2008-11-09 Akim Demaille <demaille@gostai.com>
4483
4484 Rename data_type and stack_symbol_type.
4485 * data/lalr1.cc (data_type): Rename as...
4486 (stack_symbol_type): this.
4487
4488 2008-11-09 Akim Demaille <demaille@gostai.com>
4489
4490 Handle semantic value and location together.
4491 * data/lalr1.cc (b4_symbol_actions): Bounce $$ and @$ to
4492 yydata.value and yydata.location.
4493 (yy_symbol_value_print_, yy_symbol_print_, yydestruct_)
4494 (YY_SYMBOL_PRINT): Now take semantic value and location as a
4495 single arg.
4496 Adjust all callers.
4497 (yydestruct_): New overload for a stack symbol.
4498
4499 2008-11-09 Akim Demaille <demaille@gostai.com>
4500
4501 Push a complete symbol, not connected parts.
4502 * data/lalr1.cc (yypush_): Take a data_type&, not disconnected
4503 state, value and location.
4504 Adjust callers.
4505
4506 2008-11-09 Akim Demaille <demaille@gostai.com>
4507
4508 Agregate yylval and yylloc.
4509 * data/lalr1.cc (parser::yylval, parser::yylloc): Replace by...
4510 (parser::yyla): this.
4511
4512 2008-11-09 Akim Demaille <demaille@gostai.com>
4513
4514 Rely on the state stack to display reduction traces.
4515 To display rhs symbols before a reduction, we used information
4516 about the rule reduced, which required the tables yyrhs and
4517 yyprhs. Now use rely only on the state stack to get the same
4518 information.
4519
4520 * data/lalr1.cc (b4_rhs_data, b4_rhs_state): New.
4521 Use them.
4522 (parser::yyrhs_, parser::yyprhs_): Remove.
4523 (parser::yy_reduce_print_): Use the state stack.
4524
4525 2008-11-09 Akim Demaille <demaille@gostai.com>
4526
4527 Fuse yyval and yyloc into yylhs.
4528 * data/lalr1.cc (b4_lhs_value, b4_lhs_location): Adjust to using
4529 yylhs.
4530 (parse): Replace yyval and yyloc with yylhs.value and
4531 yylhs.location.
4532 After a user action, compute yylhs.state earlier.
4533 (yyerrlab1): Do not play tricks with yylhs.location, rather, use a
4534 fresh error_token.
4535
4536 2008-11-09 Di-an Jan <dianj@freeshell.org>
4537
4538 Remove unused variable.
4539 * src/output.c (type_names_output): Remove unused variable sep.
4540
4541 2008-11-09 Paolo Bonzini <bonzini@gnu.org>
4542
4543 Change tests/output.at quoting.
4544 * tests/output.at (AT_CHECK_OUTPUT): Use conventional m4 quoting when
4545 expanding arguments.
4546
4547 2008-11-07 Joel E. Denny <jdenny@ces.clemson.edu>
4548
4549 Don't add a semicolon to actions for %skeleton or %language.
4550 It breaks Java test cases as reported by Akim Demaille.
4551 * src/scan-code.l: Implement.
4552
4553 2008-11-07 Joel E. Denny <jdenny@ces.clemson.edu>
4554
4555 Clean up %skeleton and %language priority implementation.
4556 * src/getargs.c (skeleton_prio): Use default_prio rather than 2, and
4557 remove static qualifier because others will soon need to see it.
4558 (language_prio): Likewise.
4559 (getargs): Use command_line_prio rather than 0.
4560 * src/getargs.h (command_line_prio, grammar_prio, default_prio): New
4561 enum fields.
4562 (skeleton_prio): Extern it.
4563 (language_prio): Extern it.
4564 * src/parse-gram.y: Use grammar_prio rather than 1.
4565
4566 2008-11-07 Akim Demaille <demaille@gostai.com>
4567
4568 Moving push traces into yypush_.
4569 * data/lalr1.cc (yypush_): Now takes a optional trace message.
4570 Adjust all uses.
4571
4572 2008-11-07 Akim Demaille <demaille@gostai.com>
4573
4574 The single-stack C++ parser is now the standard one.
4575 * data/lalr1.cc: Rename as...
4576 * data/lalr1-split.cc: this.
4577 * data/lalr1-fusion.cc: Rename as...
4578 * data/lalr1.cc: this.
4579 * etc/bench.pl.in: Adjust.
4580
4581 2008-11-07 Akim Demaille <demaille@gostai.com>
4582
4583 Avoid empty-if warnings.
4584 Reported by Quentin Hocquet.
4585
4586 * data/lalr1-fusion.cc (YY_SYMBOL_PRINT, YY_REDUCE_PRINT)
4587 (YY_STACK_PRINT): Provide some contents even when !YYDEBUG.
4588
4589 2008-11-07 Akim Demaille <demaille@gostai.com>
4590
4591 Pass command line location to skeleton_arg and language_argmatch.
4592 * src/getargs.h, src/getargs.c (skeleton_arg, language_argmatch):
4593 The location argument is now mandatory.
4594 Adjust all dependencies.
4595 (getargs): Use command_line_location.
4596
4597 2008-11-07 Akim Demaille <demaille@gostai.com>
4598
4599 -D, --define.
4600 * src/getargs.c (usage): Document -D.
4601 Fix help string for --locations.
4602 (command_line_location): New.
4603 (short_options, long_options, getargs): Support -D, --define.
4604 (getargs): Move -d support at the right place.
4605 * doc/bison.texinfo (Bison Options): Update.
4606 * tests/input.at (%define, --define): New.
4607
4608 2008-11-07 Akim Demaille <demaille@gostai.com>
4609
4610 Initialize the muscle table before parsing the command line.
4611 * src/getargs.c (quotearg.h, muscle_tab.h): Include.
4612 (getargs): Define file_name.
4613 * src/main.c (main): Initialize muscle_tab before calling
4614 getargs.
4615 * src/muscle_tab.c (muscle_init): No longer define file_name, as
4616 its value is not available yet.
4617
4618 2008-11-07 Akim Demaille <demaille@gostai.com>
4619
4620 Locations without columns for command line arguments.
4621 * src/location.c (location_print): Don't display negative columns.
4622 * src/location.h: Document this.
4623
4624 2008-11-07 Akim Demaille <demaille@gostai.com>
4625
4626 Fix --help.
4627 * src/getargs.c (usage): Fix help string for -W.
4628
4629 2008-11-07 Akim Demaille <demaille@gostai.com>
4630
4631 Handle more general types of option arguments.
4632 * build-aux/cross-options.pl: The argument ends at the first
4633 space, not the first non-symbol character.
4634 Use @var for each word appearing the argument description.
4635
4636 2008-11-07 Akim Demaille <demaille@gostai.com>
4637
4638 Destroy the variants that remain on the stack in case of error.
4639 * data/lalr1-fusion.cc (yydestruct_): Invoke the variant's
4640 destructor.
4641 Display the value only if yymsg is nonnull.
4642 (yyreduce): Invoke yydestruct_ when popping lhs symbols.
4643
4644 2008-11-07 Akim Demaille <demaille@gostai.com>
4645
4646 Add "%define assert" to variants.
4647 This is used to help the user catch cases where some value gets
4648 ovewritten by a new one. This should not happen, as this will
4649 probably leak.
4650
4651 Unfortunately this uncovered a bug in the C++ parser itself: the
4652 lookahead value was not destroyed between two calls to yylex. For
4653 instance if the previous lookahead was a std::string, and then an int,
4654 then the value of the std::string was correctly taken (i.e., the
4655 lookahead was now an empty string), but std::string structure itself
4656 was not reclaimed.
4657
4658 This is now done in variant::build(other&) (which is used to take the
4659 value of the lookahead): other is not only stolen from its value, it
4660 is also destroyed. This incurs a new performance penalty of a few
4661 percent, and union becomes faster again.
4662
4663 * data/lalr1-fusion.cc (variant::build(other&)): Destroy other.
4664 (b4_variant_if): New.
4665 (variant::built): New.
4666 Use it whereever the status of the variant changes.
4667 * etc/bench.pl.in: Check the penalty of %define assert.
4668
4669 2008-11-07 Akim Demaille <demaille@gostai.com>
4670
4671 Use "%define variant" in bench.pl.
4672 * etc/bench.pl.in: No longer use the pseudo directive %variants,
4673 just use %define variants.
4674
4675 2008-11-07 Akim Demaille <demaille@gostai.com>
4676
4677 Regen.
4678 * src/parse-gram.h, src/parse-gram.c: Regen.
4679
4680 2008-11-04 Joel E. Denny <jdenny@ces.clemson.edu>
4681
4682 Fix user actions without a trailing semicolon.
4683 Reported by Sergei Steshenko at
4684 <http://lists.gnu.org/archive/html/bug-bison/2008-11/msg00001.html>.
4685 * THANKS (Sergei Steshenko): Add.
4686 * src/scan-code.l (SC_RULE_ACTION): Fix it.
4687 * tests/regression.at (Fix user actions without a trailing semicolon):
4688 New test case.
4689
4690 2008-11-04 Akim Demaille <demaille@gostai.com>
4691
4692 Use b4_copyright_years.
4693 * data/yacc.c (b4_copyright_years): New.
4694 Fix its value according to the comments in the file.
4695 Use it and undefine it.
4696
4697 2008-11-04 Akim Demaille <demaille@gostai.com>
4698
4699 Formatting changes.
4700 * data/lalr1-fusion.cc, src/parse-gram.y: here.
4701
4702 2008-11-04 Akim Demaille <demaille@gostai.com>
4703
4704 Formatting changes.
4705 * data/lalr1-fusion.cc: here.
4706
4707 2008-11-04 Akim Demaille <demaille@gostai.com>
4708
4709 Use strict on bench.pl.
4710 * etc/bench.pl.in (&run, &generate_grammar): New.
4711 Rename the grammar generating functions for consistency.
4712 Change the interface so that the list of benches to run is passed
4713 as (optionless) arguments.
4714 (&compile): Use &run.
4715
4716 2008-11-04 Akim Demaille <demaille@gostai.com>
4717
4718 Remove spurious initial empty lines.
4719 * data/glr.c, data/glr.cc, data/lalr1.cc, data/lalr1.java,
4720 * data/yacc.c: End the @output lines with an @.
4721
4722 2008-11-04 Akim Demaille <demaille@gostai.com>
4723
4724 Improve the display of sizes.
4725 * etc/bench.p.in: Higher precision.
4726 Sort by decreasing size.
4727
4728 2008-11-04 Akim Demaille <demaille@gostai.com>
4729
4730 Don't memcpy C++ structures.
4731 * data/lalr1-fusion.cc (b4_symbol_variant): Adjust additional
4732 arguments.
4733 (variant::build): New overload for
4734 copy-construction-that-destroys.
4735 (variant::swap): New.
4736 (parser::yypush_): Use it in variant mode.
4737
4738 2008-11-04 Akim Demaille <demaille@gostai.com>
4739
4740 Better defaults for bench.pl.
4741 * etc/bench.pl.in ($verbose, $cflags, $iterations): Change the
4742 default values.
4743 Adjust &verbose uses.
4744 (-q, --quiet): New.
4745
4746 2008-11-04 Akim Demaille <demaille@gostai.com>
4747
4748 Make variant.yy more complex.
4749 std::list cannot be copied via memcpy, they are more demanding than
4750 std::string. Use one std::list to strengthen the test.
4751
4752 * examples/variant.yy: Use lalr1-fusion.cc, not lalr1.cc.
4753 Adjust.
4754 Create a list of strings, instead of a single large string.
4755
4756 2008-11-04 Akim Demaille <demaille@gostai.com>
4757
4758 bench.pl --bench.
4759 * etc/bench.pl.in (--bench, $bench): New.
4760
4761 2008-11-04 Akim Demaille <demaille@gostai.com>
4762
4763 Sort methods.
4764 * data/lalr1-fusion.cc (destroy): Use as() in its definition.
4765 Define it after as().
4766
4767 2008-11-04 Akim Demaille <demaille@gostai.com>
4768
4769 Useless parens.
4770 * data/lalr1-fusion.cc (b4_rhs_location): Remove useless parens.
4771
4772 2008-11-04 Akim Demaille <demaille@gostai.com>
4773
4774 Issue missing synclines after user actions.
4775 * data/c.m4 (b4_case): Issue synclines on the output file.
4776
4777 2008-11-04 Akim Demaille <demaille@gostai.com>
4778
4779 Remove trailing empty line.
4780 * data/lalr1-fusion.cc: Don't add an empty line after the user's
4781 epilogue.
4782
4783 2008-11-04 Akim Demaille <demaille@gostai.com>
4784
4785 Fix output of copyright years.
4786 * data/bison.m4 (b4_copyright): Fix the indentation of the
4787 copyright year paragraph.
4788 Use b4_copyright_years when no years are given.
4789 * data/lalr1.cc, data/lalr1-fusion.cc, data/location.cc
4790 (b4_copyright_years): New.
4791 Use it.
4792
4793 2008-11-04 Akim Demaille <demaille@gostai.com>
4794
4795 Avoid the spurious initial empty line.
4796 * data/lalr1-fusion.cc, data/location.cc: Put a trailing "@" at
4797 the end of @output request to suppress the empty line that
4798 results.
4799
4800 2008-11-04 Akim Demaille <demaille@gostai.com>
4801
4802 Remove parser::rhs_number_type.
4803 * data/lalr1-fusion.cc (rhs_number_type): No longer define it.
4804 (yyrhs_): Use b4_table_define.
4805
4806 2008-11-04 Akim Demaille <demaille@gostai.com>
4807
4808 Fix iteration type.
4809 * data/lalr1-fusion.cc: Use an int to iterate up to an int.
4810
4811 2008-11-04 Akim Demaille <demaille@gostai.com>
4812
4813 Factor the declaration of the integer tables.
4814 * data/lalr1-fusion.cc (b4_table_define): New.
4815 Use it.
4816
4817 2008-11-03 Akim Demaille <demaille@gostai.com>
4818
4819 Fix indentation of tables in lalr1.cc
4820 * data/lalr1-fusion.cc: Fix the indentation.
4821
4822 2008-11-03 Akim Demaille <demaille@gostai.com>
4823
4824 Destroy the lhs symbols after reduction.
4825 * data/lalr1-fusion.cc (parse): After the user action, when in
4826 variant mode, destroy the lhs symbols.
4827
4828 2008-11-03 Akim Demaille <demaille@gostai.com>
4829
4830 Simplify yysyntax_error_ use.
4831 * data/lalr1-fusion.cc (yysyntax_error_): Always pass it the token
4832 type, but make it unnamed in the declaration when it is not used.
4833
4834 2008-11-03 Akim Demaille <demaille@gostai.com>
4835
4836 Let yy::variant::build return an lvalue.
4837 * data/lalr1-fusion.cc (variant::build): Return a reference to the
4838 object.
4839
4840 2008-11-03 Akim Demaille <demaille@gostai.com>
4841
4842 Define yy::variant only when needed.
4843 * data/lalr1-fusion.cc (yy::variant): Define only if variants are
4844 used.
4845
4846 2008-11-03 Akim Demaille <demaille@gostai.com>
4847
4848 Bench the three-stack lalr1.cc.
4849 * etc/bench.pl.in: Bench the three-stack lalr1.cc vs. the
4850 one-stack one.
4851
4852 2008-11-03 Akim Demaille <demaille@gostai.com>
4853
4854 Fail on parse error in calc++.
4855 * doc/bison.texinfo (calc++.cc): Propagate failures to the exit
4856 status.
4857 * examples/calc++/test ($me, $number, $exit, run): New.
4858 Use them to propagate errors to the exit status.
4859
4860 2008-11-03 Akim Demaille <demaille@gostai.com>
4861
4862 Don't specify the skeleton twice in the example.
4863 * examples/calc++/Makefile.am: Don't pass -S to Bison, the grammar
4864 file does what is needed.
4865
4866 2008-11-03 Akim Demaille <demaille@gostai.com>
4867
4868 bench: Improve output.
4869 * etc/bench.pl.in (bench_grammar): Tune the printf format.
4870
4871 2008-11-03 Akim Demaille <demaille@gostai.com>
4872
4873 bench: check impact of %debug on variants.
4874 * etc/bench.pl.in (variant_grammar): Fix the computation of
4875 $variant.
4876 Generate a grammar file that can work with or without %debug.
4877 Do use the @directive.
4878 (bench_variant_parser): Check impact of %debug.
4879 (@directives): Rename all the occurrences to...
4880 (@directive): this, for consistency.
4881
4882 2008-11-03 Akim Demaille <demaille@gostai.com>
4883
4884 bench: report the size too.
4885 * etc/bench.pl.in ($iterations): Defaults to -3.
4886 (&bench_grammar): Require hireswallclock.
4887 Compute and display the size of the result.
4888 More comments.
4889
4890 2008-11-03 Akim Demaille <demaille@gostai.com>
4891
4892 bench: More use of the verbosity level.
4893 * etc/bench.pl.in ($verbose, &verbose): New.
4894 Use them.
4895 More POD documentation.
4896
4897 2008-11-03 Akim Demaille <demaille@gostai.com>
4898
4899 bench.pl: a command line interface
4900 * etc/bench.pl.in: More doc.
4901 Some fixes in the documentation.
4902 ($cflags, $iterations, &help, &getopt): New.
4903 Use them.
4904 (&variant_grammar): Let the number of stages be 10 times what is
4905 specified.
4906
4907 2008-11-03 Akim Demaille <demaille@gostai.com>
4908
4909 Bench the use of Boost.Variants.
4910 * etc/bench.pl.in ($cxx, &variant_grammar, &bench_variant_parser):
4911 New.
4912 (&compile): Be ready to compile C++ parsers.
4913 (&bench_push_parser): Move debug information to the outermost
4914 level.
4915 * THANKS: Add Michiel De Wilde.
4916
4917 2008-11-03 Akim Demaille <demaille@gostai.com>
4918
4919 bench.pl: Pass directives as a list instead of as a string.
4920 * etc/bench.pl.in (&directives): New.
4921 (&triangular_grammar, &calc_grammar): Use it to format the Bison
4922 directives.
4923 (&triangular_grammar): Do use the directives (were ignored).
4924 (&bench_grammar, &bench_push_parser): Adjust to pass lists of
4925 directives.
4926
4927 2008-11-03 Akim Demaille <demaille@gostai.com>
4928
4929 Improve genericity of bench.pl.
4930 * etc/bench.pl.in (&bench_grammar): Take the set of benches as
4931 argument.
4932 (&bench_push_parser): New.
4933 Call it.
4934
4935 2008-11-03 Akim Demaille <demaille@gostai.com>
4936
4937 Add documentation to bench.pl.
4938 * etc/bench.pl.in: Comment changes.
4939
4940 2008-11-03 Akim Demaille <demaille@gostai.com>
4941
4942 Fuse the three stacks into a single one.
4943
4944 In order to make it easy to perform benchmarks to ensure that
4945 there are no performance loss, lalr1.cc is forked into
4946 lalr1-fusion.cc. Eventually, lalr1-fusion.cc will replace
4947 lalr1.cc.
4948
4949 Meanwhile, to make sure that lalr1-fusion.cc is correctly
4950 exercized by the test suite, the user must install a symbolic link
4951 from lalr1.cc to it.
4952
4953 Instead of having three stacks (state, value, location), use a
4954 stack of triples. This considerably simplifies the code (and it
4955 will be easier not to require locations as currently does the C++
4956 parser), and also gives a 10% speedup according to
4957 etc/bench (probably mainly since memory allocation is done once
4958 instead of three times).
4959
4960 Another motivation is to make it easier to destruct properly
4961 semantic values: now that they are bound to their state (hence
4962 symbol type) it will be easier to call the appropriate destructor.
4963
4964 These changes should probably benefit the C parser too.
4965
4966 * data/lalr1.cc: Copy as...
4967 * data/lalr1-fusion.cc: this new file.
4968 (b4_rhs_value, b4_rhs_location): New definitions overriding those
4969 from c++.m4.
4970 (state_stack_type, semantic_stack_type, location_stack_type)
4971 (yystate_stack_, yysemantic_stack_, yylocation_stack_): Remove.
4972 (data_type, stack_type, yystack_): New.
4973 (YYLLOC_DEFAULT, yypush_): Adjust.
4974 (yyerror_range): Now based on data_type, not location_type.
4975
4976 2008-11-03 Akim Demaille <demaille@gostai.com>
4977
4978 Push the state, value, and location at the same time.
4979 This is needed to prepare a forthcoming patch that fuses the three
4980 stacks into one.
4981
4982 * data/lalr1.cc (parser::yypush_): New.
4983 (parser::yynewstate): Change the semantics: instead of arriving to
4984 this label when value and location have been pushed, but yystate
4985 is to be pushed on the state stack, now the three of them must
4986 have been pushed before. yystate still must be the new state.
4987 This allows to use yypush_ everywhere instead of individual
4988 handling of the stacks.
4989
4990 2008-11-03 Akim Demaille <demaille@gostai.com>
4991
4992 Prefer references to pointers.
4993 * data/lalr1.cc (b4_symbol_actions): New, overrides the default C
4994 definition to use references instead of pointers.
4995 (yy_symbol_value_print_, yy_symbol_print_, yydestruct_):
4996 Take the value and location as references.
4997 Adjust callers.
4998
4999 2008-11-03 Akim Demaille <demaille@gostai.com>
5000
5001 stack::size instead of stack::height.
5002 * data/lalr1.cc (stack::height): Rename as...
5003 (stack::size): this.
5004 Fix the output type.
5005 Comment changes.
5006
5007 2008-11-03 Akim Demaille <demaille@gostai.com>
5008
5009 Use variants to support objects as semantic values.
5010 This patch was inspired by work by Michiel De Wilde. But he used
5011 Boost variants which (i) requires Boost on the user side, (ii) is
5012 slow, and (iii) has useless overhead (the parser knows the type of
5013 the semantic value there is no reason to duplicate this
5014 information as Boost.Variants do).
5015
5016 This implementation reserves a buffer large enough to store the
5017 largest objects. yy::variant implements this buffer. It was
5018 implemented with Quentin Hocquet.
5019
5020 * src/output.c (type_names_output): New.
5021 (output_skeleton): Invoke it.
5022 * data/c++.m4 (b4_variant_if): New.
5023 (b4_symbol_value): If needed, provide a definition for variants.
5024 * data/lalr1.cc (b4_symbol_value, b4_symbol_action_)
5025 (b4_symbol_variant, _b4_char_sizeof_counter, _b4_char_sizeof_dummy)
5026 (b4_char_sizeof, yy::variant): New.
5027 (parser::parse): If variants are requested, define
5028 parser::union_type, parser::variant, change the definition of
5029 semantic_type, construct $$ before running the user action instead
5030 of performing a default $$ = $1.
5031 * examples/variant.yy: New.
5032 Based on an example by Michiel De Wilde.
5033
5034 2008-11-03 Akim Demaille <demaille@gostai.com>
5035
5036 Parameterize the extraction of semantic values.
5037 To make future changes easier, no longer rely on ".TYPE" being the
5038 way to get a semantic value.
5039
5040 * data/c.m4 (b4_symbol_value): New.
5041 Use it.
5042 * data/c++.m4, data/yacc.c: Use it.
5043 * data/glr.c: Use b4_symbol_value.
5044 (b4_rhs_data): New.
5045 Use it.
5046
5047 2008-11-03 Akim Demaille <demaille@gostai.com>
5048
5049 Prepare easier M4 changes.
5050 * data/lalr1.cc: Use escaped [] instead of literals to prepare
5051 future changes.
5052
5053 2008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
5054
5055 Initiate further development.
5056 * NEWS: Create an empty section for new entries.
5057 * gnulib: Update submodule to HEAD.
5058
5059 2008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
5060
5061 * NEWS: Version 2.4.
5062
5063 2008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
5064
5065 Prepare for next release.
5066 * NEWS: Briefly mention changes since 2.3b.
5067 * README: Say GNU m4 1.4.6, which we've been requiring in release
5068 announcements already, not 1.4.3, which breaks the build.
5069
5070 2008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
5071
5072 Say %language is experimental.
5073 We're thinking of extending it's effect on output file naming. See the
5074 thread at
5075 <http://lists.gnu.org/archive/html/bison-patches/2008-10/msg00003.html>.
5076 * NEWS: Say it's experimental.
5077 * doc/bison.texinfo (Decl Summary): Say it's experimental, and so don't
5078 recommend it over %skeleton for now.
5079 (Bison Options): Likewise.
5080 (C++ Bison Interface): Use %skeleton not %language.
5081 (Calc++ Parser): Use %skeleton not %language.
5082 * src/getargs.c (usage): Say it's experimental.
5083
5084 2008-11-01 Di-an Jan <dianj@freeshell.org>
5085 Paolo Bonzini <bonzini@gnu.org>
5086
5087 Support all Java parser class modifiers.
5088 * data/java.m4 (b4_percent_define_get3): New.
5089 (b4_final_if, b4_strictfp_if): New.
5090 * data/lalr1.java (final, strictfp, extends, implements): Support.
5091 * doc/bison.texinfo (final, strictfp, extends, implements): Add
5092 documentation.
5093 * tests/java.at (AT_CHECK_JAVA_MINIMAL): New.
5094 (AT_CHECK_JAVA_MINIMAL_W_LEXER): New.
5095 (AT_CHECK_JAVA_GREP): New.
5096 (Java parser class modifiers): New test.
5097 (Java parser class extends and implements): New test.
5098
5099 Model exception propagation better with throws and lex_throws.
5100 * data/java.m4 (b4_list2): New.
5101 (throws): Change default.
5102 * data/lalr1.java (yyaction): Add throws.
5103 (parse): Add lex_throws in addition to throws.
5104 * doc/bison.texinfo (throws, lex_throws): Add documentation.
5105 * tests/java.at (Java throws specifications): New test.
5106
5107 Improve documentation for Java parsers.
5108 * doc/bison.texinfo (Java Parsers): Add subsections.
5109 Don't quote first argument of %define.
5110 (Java Bison Interface): Document output files. Move documentation
5111 of parser class and merge into Java Parser Interface. Document
5112 features that error out. Document directives with no effect.
5113 Move note about Javadoc higher.
5114 (Java Semantic Values): Explicitly mention stype.
5115 Document that generic types cannot be used.
5116 (Java Location Values): Use @deftypeivar. Document constructors.
5117 Correct return value for toString.
5118 (Java Parser Interface): List undocumented constants/fields.
5119 Move documentation of fields added by %parse-param closer to list
5120 of members. Document that token names are added as fields.
5121 Document constructors accurately. Remove error method.
5122 (Java Scanner Interface): Move note on %pure-parser to Java Bison
5123 Interface. Describe %code lexer and yylex accutately.
5124 Remove documentation that does not match the code.
5125 (Java Action Features): New.
5126 (Java Differences): Add reference. Add item on semantic values.
5127 Add note about @{ ... @}. Clarify %% epilogue placement.
5128 (Java Declarations Summary): New.
5129
5130 Fix Java skeleton.
5131 * data/java.m4 (b4_prefix): Correct quoting for m4_define_default.
5132 (b4_remove_comma): Quote test argument.
5133 (b4_identification): Remove "bison" field.
5134 * tests/java.at (Java parser class and package names): New test.
5135 (Java %parse-param and %lex-param): New test.
5136 (Java stype, position_class and location_class): New test.
5137
5138 2008-10-31 Di-an Jan <dianj@freeshell.org>
5139
5140 * data/lalr1.jave: Update copyright years.
5141 (YYParser): Correct name of "generated from" file in Javadoc:
5142 use b4_file_name instead of @ofile@.
5143 (Location constructor): Correct Javadoc parameter name.
5144 (yylloc): Add missing opening m4 quote after b4_location_if.
5145 This removes a stray [ in the Javadoc of Lexer.getStartPos.
5146 (Lexer.yyerror): Fix incorrect m4 and Javadoc.
5147 (YYParser constructor): Correct Javadoc parameter name.
5148
5149 2008-10-30 Joel E. Denny <jdenny@ces.clemson.edu>
5150
5151 Always put auxiliary code files in the same dir as other output files.
5152 * src/files.c (compute_file_name_parts): When the user specifies
5153 --output but not --file-prefix, extract the directory prefix from the
5154 file prefix not from the grammar file name. This affects the location
5155 of files like location.hh generated by the C++ skeleton. The includes
5156 in the other output files require this fix.
5157 * tests/output.at (AT_CHECK_OUTPUT): Automatically create directories
5158 for expected output files.
5159 (Output files): Add a test for the above.
5160
5161 2008-10-29 Joel E. Denny <jdenny@ces.clemson.edu>
5162
5163 * gnulib: Update submodule to HEAD.
5164
5165 2008-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
5166
5167 Update copyright year.
5168 * src/files.c: Here.
5169
5170 2008-10-28 Di-an Jan <dianj@freeshell.org> (tiny change)
5171
5172 Don't overwrite the input file.
5173 * src/files.c (output_file_name_check): Fatal error if using input file
5174 for output.
5175 * tests/output.at: (AT_CHECK_CONFLICTING_OUTPUT): Add return status
5176 argument.
5177 (Conflicting output files): Add test.
5178
5179 2008-10-28 Akim Demaille <demaille@gostai.com>
5180
5181 Space changes.
5182 * data/lalr1.cc: Formatting changes.
5183
5184 2008-10-28 Akim Demaille <demaille@gostai.com>
5185
5186 Don't define debugging functions when !YYDEBUG.
5187 * data/lalr1.cc (debug_stream, set_debug_stream)
5188 (debug_level_type, debug_level, set_debug_level): Don't
5189 declare them when YYDEBUG is not defined.
5190 The implementation are already YYDEBUG-aware.
5191
5192 2008-10-28 Akim Demaille <demaille@gostai.com>
5193
5194 Prefer "continue" for empty loop bodies.
5195 * etc/bench.pl.in: Use "continue" instead of {}.
5196
5197 2008-10-28 Akim Demaille <demaille@gostai.com>
5198
5199 Space and comments changes.
5200 * data/c++.m4, data/glr.c, data/lalr1.cc: Copyright year changes.
5201 * data/c.m4, data/lalr1.cc: Space changes.
5202
5203 2008-10-28 Akim Demaille <demaille@gostai.com>
5204
5205 Make gnulib a submodule.
5206 * gnulib: New.
5207 * .gitmodules (gnulib): New.
5208
5209 2008-10-18 Joel E. Denny <jdenny@ces.clemson.edu>
5210
5211 Fix yyerror_range for user-defined location type in C++. Reported by
5212 Georg Sauthoff at
5213 <http://lists.gnu.org/archive/html/bug-bison/2008-08/msg00008.html>.
5214 * data/lalr1.cc (parse): Change type of yyerror_range to location_type.
5215 * THANKS (Georg Sauthoff): Add.
5216
5217 2008-10-18 Joel E. Denny <jdenny@ces.clemson.edu>
5218
5219 Update several administrative files mainly to facilitate releasing.
5220 * HACKING (Administrivia): Make the git-merge-changelog notes more
5221 helpful.
5222 (Test suite): Don't say lalr1.cc is not exercised in the test suite.
5223 (Release Procedure): Update for git and add numerous details that were
5224 previously missing.
5225 * Makefile.am (EXTRA_DIST): Remove Makefile.cfg and Makefile.maint.
5226 * maint.mk (announcement): Don't list bison as a bootstrap tool so
5227 that announcements don't claim we bootstrapped with whatever bison
5228 happened to be in PATH. Add flex as a bootstrap tool.
5229 * Makefile.maint: Remove, previously replaced by maint.mk.
5230 * Makefile.cfg: Remove, and migrate settings to...
5231 * cfg.mk: ... here for the sake of `make announcement'.
5232 * bootstrap.conf (gnulib_modules): Add announce-gen.
5233 * README: Say GNU Bison instead of just Bison. Suggested by Karl
5234 Berry.
5235
5236 2008-10-08 Di-an Jan <dianj@freeshell.org> (tiny change)
5237
5238 Small but important bugfixes for the Java skeleton.
5239 * data/lalr1.java (yyerror): Change Location to b4_location_type.
5240 (yy_symbol_print): Call toString on yyvaluep.
5241
5242 2008-08-29 Akim Demaille <demaille@gostai.com>
5243
5244 Clarify UPDATED use.
5245 * doc/bison.texinfo: It refers to the last edition of this file,
5246 not to the release date of Bison.
5247 Reported by Joel E. Denny.
5248
5249 2008-08-29 Akim Demaille <demaille@gostai.com>
5250
5251 * README: Update FAQ pointer.
5252 Reported by Joel E. Denny.
5253
5254 2008-08-27 Eric Blake <ebb9@byu.net>
5255
5256 Resync m4sugar from autoconf.
5257 * data/m4sugar/m4sugar.m4 (m4_defn, m4_popdef, m4_undefine)
5258 (m4_init): Adjust to latest m4.git changes.
5259 (m4_mapall_sep, _m4_list_cmp, m4_version_compare): Reduce side
5260 effects.
5261 * data/m4sugar/foreach.m4 (_m4_shiftn): Fix off-by-one bug.
5262 (_m4_list_cmp): Reduce side effects.
5263
5264 2008-08-27 Akim Demaille <demaille@gostai.com>
5265
5266 Check yyerrok in calc.at.
5267 * tests/calc.at (calc.y): Use yyerrok on "( error )".
5268 (AT_CHECK_CALC): Add a check that ensures that yyerrok works as
5269 expected.
5270
5271 2008-08-27 Akim Demaille <demaille@gostai.com>
5272
5273 Support yyerrok in lalr1.cc.
5274 YYBACKUP is still to import back into lalr1.cc.
5275 * data/lalr1.cc (yyerrork, yyclearin, YYRECOVERING): Define.
5276
5277 2008-08-26 Joel E. Denny <jdenny@ces.clemson.edu>
5278
5279 For maintainer-check*, don't recompile for a $(VERSION) update.
5280 * cfg.mk: New file.
5281 (_is-dist-target): Override the one in GNUmakefile.
5282 * Makefile.am (EXTRA_DIST): Add cfg.mk.
5283
5284 2008-08-26 Joel E. Denny <jdenny@ces.clemson.edu>
5285
5286 Update for recent change to gnulib.
5287 * src/parse-gram.y: Don't include strverscmp.h. It comes from
5288 string.h now.
5289
5290 2008-08-15 Eric Blake <ebb9@byu.net>
5291
5292 Remaining m4sugar merge from autoconf.
5293 * data/m4sugar/m4sugar.m4: Copy entire file from autoconf.
5294 * data/m4sugar/foreach.m4: New file, copied from autoconf.
5295 * data/Makefile.am (dist_m4sugar_DATA): Distribute it.
5296 * src/output.c (output_skeleton): Tell m4 how to find it.
5297
5298 Partial m4sugar merge from autoconf: m4_map.
5299 * data/m4sugar/m4sugar.m4 (m4_fst): Delete.
5300 (m4_map, m4_map_sep, _m4_map): Rewrite more efficiently.
5301 (m4_apply, _m4_apply, m4_mapall, m4_mapall_sep): New macros.
5302 * data/java.m4 (b4_token_enums): Use more efficient short-circuit
5303 for empty list.
5304 * data/c.m4 (b4_token_defines, b4_token_enums, b4_c_ansi_formals):
5305 Likewise.
5306 (b4_parse_param_for): Avoid m4_fst, now that autoconf no longer
5307 declares it.
5308
5309 2008-08-07 Joel E. Denny <jdenny@ces.clemson.edu>
5310
5311 Keep .version and PACKAGE_VERSION in sync.
5312 * Makefile.am ($(top_srcdir)/.version): Declare configure as a
5313 dependency, and add comments justifying this in more detail. Discussed
5314 starting at
5315 <http://lists.gnu.org/archive/html/bison-patches/2008-07/msg00022.html>.
5316
5317 2008-08-06 Eric Blake <ebb9@byu.net>
5318
5319 Partial m4sugar merge from autoconf: m4_shiftn.
5320 * data/m4sugar/m4sugar.m4 (m4_shiftn): Faster implementation.
5321 (m4_shift2, m4_shift3): New macros.
5322 (m4_case, m4_bmatch, m4_bpatsubsts, m4_join): Adjust clients.
5323 * data/c.m4 (b4_c_function_def, b4_c_ansi_function_def)
5324 (b4_c_ansi_function_decl, b4_c_function_call): Likewise.
5325 * data/java.m4 (b4_remove_comma): Likewise.
5326
5327 Partial m4sugar merge from autoconf: m4_wrap vs. m4 1.6.
5328 * data/m4sugar/m4sugar.m4 (m4_unquote, m4_wrap_lifo): New macros.
5329 (m4_wrap): Guarantee FIFO order, in spite of m4 1.6.
5330 (m4_init): Consolidate wrapped text into single m4_wrap.
5331 * data/bison.m4 (b4_check_user_names_wrap): Stick with LIFO order
5332 in wrapped text.
5333
5334 2008-08-05 Eric Blake <ebb9@byu.net>
5335
5336 Partial m4sugar merge from autoconf: builtins, version.m4.
5337 * data/m4sugar/m4sugar.m4 (changeword): Nuke.
5338 (m4_prepend): Remove, as it is unused and inherently quadratic,
5339 whereas m4_append is linear in newer m4.
5340 (m4_mkstemp): New builtin.
5341 (m4_symbols): Make rename conditional.
5342 (m4_version_prereq): Ensure fatal error if used in bison, which
5343 intentionally lacks version.m4.
5344
5345 Fix comments in m4sugar.
5346 * data/m4sugar/m4sugar.m4: Comment changes, borrowed from autoconf.
5347
5348 2008-08-02 Joel E. Denny <jdenny@ces.clemson.edu>
5349
5350 Update for recent .gitignore fix in Gnulib.
5351 * bootstrap: Back out 2008-07-18 hack now that gnulib-tool creates
5352 anchored .gitignore entries.
5353
5354 2008-08-02 Joel E. Denny <jdenny@ces.clemson.edu>
5355
5356 Set gnu or gnits strictness.
5357 * configure.ac (AM_INIT_AUTOMAKE): Set gnu strictness during
5358 development and gnits strictness for releases. Based on Eric Blake's
5359 suggestion at
5360 <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00019.html>.
5361
5362 2008-07-31 Paolo Bonzini <bonzini@gnu.org>
5363
5364 * NEWS: Clarify documentation of %language.
5365
5366 2008-07-31 Paolo Bonzini <bonzini@gnu.org>
5367
5368 Support usage of git-merge-changelog.
5369 * .gitattributes: New.
5370 * HACKING: Document usage of git-merge-changelog.
5371 * bootstrap: Install git-merge-changelog entries in .git/config
5372 if appropriate.
5373
5374 2008-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
5375
5376 Remove remaining dependence on CVS Id keyword.
5377 * ChangeLog: For the sake of people still using CVS, don't use dollars
5378 when mentioning Id.
5379 * data/xslt/bison.xsl: Remove Id from header comments, where it was
5380 unusual anyway.
5381 * data/xslt/xml2dot.xsl: Likewise.
5382 * data/xslt/xml2text.xsl: Likewise.
5383 * data/xslt/xml2xhtml.xsl: Likewise.
5384 * doc/Doxyfile.in (PROJECT_NUMBER): Don't use ID.
5385 * doc/Makefile.am (neutralize): Remove, no longer needed.
5386 (.x.1): Don't use neutralize.
5387 (edit): Don't substitute for ID.
5388 (Doxyfile): Don't define Id, and thus don't depend on ChangeLog.
5389
5390 2008-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
5391
5392 Fix dependence on computed configure variables.
5393 * doc/Makefile.am (common_dep): Depend on $(top_srcdir)/configure not
5394 $(top_srcdir)/configure.ac so that changes to computed variables, such
5395 as PACKAGE_VERSION, are seen.
5396 * tests/Makefile.am ($(srcdir)/package.m4): Likewise.
5397
5398 2008-07-20 Joel E. Denny <jdenny@ces.clemson.edu>
5399
5400 Update copyright dates for recent changes.
5401 * Makefile.am: Here.
5402 * src/Makefile.am: Here.
5403 * src/reduce.c: Here.
5404 * tests/reduce.at: Here.
5405
5406 2008-07-18 Joel E. Denny <jdenny@ces.clemson.edu>
5407
5408 Use git-version-gen for version names between releases.
5409 * .cvsignore (.tarball-version, GNUmakefile, *~): Add.
5410 * .gitignore (/.tarball-version, /GNUmakefile, /*~): Add.
5411 * .prev-version: New.
5412 * .version.in: Remove.
5413 * ChangeLog: Remove the Id previously used for capturing the CVS
5414 revision.
5415 * GNUmakefile: Remove, now copied from Gnulib.
5416 * Makefile.am: Add code suggested by comments in
5417 build-aux/git-version-gen.
5418 (EXTRA_DIST): Remove GNUmakefile, handled by Gnulib. Add maint.mk,
5419 .prev-version, and .version.
5420 * NEWS (2.3b+): Rename to...
5421 (?.?): ... this because we're dropping the "+" version naming scheme,
5422 but, in general, we still can't be sure of our next release name.
5423 * bootstrap: Add a quick hack to remove from .gitignore the
5424 GNUmakefile entry that gnulib adds. We already have a /GNUmakefile
5425 entry. This should really be fixed in gnulib instead.
5426 * bootstrap.conf (gnulib_modules): Add gnumakefile.
5427 * configure.ac (AC_INIT): Set version name by invoking
5428 build-aux/git-version-gen.
5429 (AC_CONFIG_FILES): Remove .version, now generated by
5430 build-aux/git-version-gen.
5431 * maint.mk: New, copied from coreutils.
5432 * doc/.cvsignore (bison.1): Add.
5433 * doc/.gitignore (/bison.1): Add.
5434 * doc/bison.1: Remove, generated.
5435 * src/.cvsignore (revision.c): Remove.
5436 * src/.gitignore (/revision.c): Remove.
5437 * src/Makefile.am (bison_SOURCES): Remove revision.c and revision.h.
5438 (BUILT_SOURCES): Remove revision.c.
5439 (revision.c): Remove.
5440 * src/getargs.c (version): Don't print revision after the VERSION.
5441 * src/revision.h: Remove.
5442
5443 2008-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
5444
5445 Fix untranslatable composition of sentences. Reported by Goran
5446 Uddeborg at
5447 <http://lists.gnu.org/archive/html/bug-bison/2008-06/msg00000.html>.
5448 * THANKS (Goran Uddeborg): Add.
5449 * src/reduce.c (reduce_print): Report the number of nonterminals and
5450 rules useless in the grammar in separate sentences.
5451 * tests/reduce.at (Useless Rules): Update output.
5452 (Reduced Automaton): Likewise.
5453 (Underivable Rules): Likewise.
5454 (Empty Language): Likewise.
5455
5456 2008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
5457
5458 Fix some .gitignore and .cvsignore problems.
5459 * bootstrap (insert_sorted_if_absent): Replace all uses with...
5460 (insert_vc_ignore): ... this new function, which prepends `/' to all
5461 .gitignore entries before passing them to insert_sorted_if_absent.
5462 * bootstrap.conf (vc_ignore): Set to '.cvsignore .gitignore' so that
5463 .cvsignore files are maintained even though Bison developers run
5464 bootstrap while using Git.
5465 * .cvsignore (*.patch *.log log patches applied): Remove, apparently
5466 unneeded by Bison.
5467 (gnulib): Add.
5468 * .gitignore (/*.patch *.log log patches applied): Remove, broken and
5469 unneeded. Reported by Eric Blake.
5470 * lib/.gitignore (/*~): Add.
5471 * po/.cvsignore, runtime-po/.cvsignore: Sync with .gitignore.
5472 * examples/calc++/.gitignore (/calc++.exe): Add. Reported by Eric
5473 Blake.
5474 * src/.gitignore (/bison.exe): Add. Reported by Eric Blake.
5475
5476 2008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
5477
5478 Improve forward-compatibility with GNU M4. Reported by Eric Blake at
5479 <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00000.html>.
5480 * bootstrap.conf (gnulib_modules): Add unsetenv.
5481 * lib/.gitignore, lib/.cvsignore (/unsetenv.c): Add.
5482 * m4/.gitignore, m4/.cvsignore (/environ.m4): Add.
5483 (/setenv.m4): Add.
5484 * src/output.c (output_skeleton): For the m4 invocation, pass -dV as
5485 the first argument because it may become position-dependent, and unset
5486 POSIXLY_CORRECT so Bison's skeletons have access to GNU M4 extensions.
5487 Add comments explaining these issues in more detail.
5488
5489 2008-07-14 Joel E. Denny <jdenny@ces.clemson.edu>
5490
5491 Add .gitignore everywhere based on .cvsignore.
5492 * .gitignore: New.
5493 * build-aux/.gitignore: New.
5494 * data/.gitignore: New.
5495 * doc/.gitignore: New.
5496 * etc/.gitignore: New.
5497 * examples/.gitignore: New.
5498 * examples/calc++/.gitignore: New.
5499 * lib/.gitignore: New.
5500 * m4/.gitignore: New.
5501 * po/.gitignore: New.
5502 * runtime-po/.gitignore: New.
5503 * src/.gitignore: New.
5504 * tests/.gitignore: New.
5505
5506 2008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
5507
5508 * NEWS (2.3b+): New section, empty for now.
5509 * configure.ac (AC_INIT): 2.3b -> 2.3b+.
5510
5511 2008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
5512
5513 * NEWS (2.3b): Update release date since there has been a delay in
5514 getting the announcements and tarballs out.
5515
5516 2008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
5517
5518 * NEWS: Version 2.3b.
5519 * configure.ac (AC_INIT): Likewise.
5520 (PACKAGE_COPYRIGHT_YEAR): Update to 2008.
5521
5522 2008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
5523
5524 * HACKING: Don't say don't mention HACKING in the ChangeLog. We've
5525 been doing it for years.
5526 (Test suite): Mention maintainer-push-check and maintainer-xml-check.
5527 (Release Procedure): Add FIXME about make alpha being unmaintained.
5528
5529 2008-05-13 Joel E. Denny <jdenny@ces.clemson.edu>
5530
5531 * data/yacc.c: Reformat m4 a little for readability.
5532 * src/lalr.c (build_relations): Correct comment.
5533
5534 2008-05-12 Juan Manuel Guerrero <juan.guerrero@gmx.de>
5535
5536 DJGPP specific issue.
5537 * djgpp/config.sed: Fixes required to run configure scripts generated
5538 by autoconf 2.62.
5539
5540 2008-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
5541
5542 * HACKING (Release Procedure): translation@iro.umontreal.ca is now
5543 coordinator@translationproject.org.
5544
5545 2008-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
5546
5547 * THANKS: Add Eric Blake.
5548
5549 2008-04-23 Eric Blake <ebb9@byu.net>
5550
5551 Revert prior patch, by working around autoconf regression.
5552 * tests/output.at (m4_expand): Add workaround for autoconf 2.62.
5553 ("Output file name: ("): Uncomment test.
5554 ("Output file name: )"): Likewise.
5555 Based on an idea from Noah Misch.
5556
5557 2008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
5558
5559 Work-around an Autoconf 2.62 AT_SETUP bug that was not present in
5560 2.61. Reported by Juan Manuel Guerrero at
5561 <http://lists.gnu.org/archive/html/bug-bison/2008-04/msg00011.html>.
5562 * tests/output.at ("Output file name: ("): Comment out test case for
5563 now.
5564 ("Output file name: )"): Likewise.
5565
5566 2008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
5567
5568 * GNUmakefile: Update git-version-gen invocation so make dist
5569 succeeds.
5570
5571 2008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
5572
5573 Update to the current gnulib CVS repository, and fix trigraph handling
5574 in Bison.
5575 * bootstrap: Update gnulib CVS repository URL.
5576 (symlink_to_dir): Encapsulate the code that guarantees the destination
5577 directory exists into...
5578 (check_dst_dir): ... this new function, and...
5579 (cp_mark_as_generated): ... reuse it here so that bootstrap doesn't
5580 fail when copying files into lib/uniwidth/.
5581 * src/output.c (prepare_symbols): When writing yytname muscles, where
5582 symbol names will be encoded in C-string literals, tell quotearg to
5583 escape trigraphs. This used to be the default in gnulib.
5584 * tests/regression.at (Token definitions): Because of the change in
5585 gnulib's quotearg behavior, string_as_id in parse-gram.y no longer
5586 escapes trigraphs in symbol names. Thus, yytname no longer has
5587 trigraphs unnecessarily doubly escaped. Update test case output.
5588 Extend test case to be sure Bison's own error messages will no longer
5589 have trigraphs in symbol names unnecessarily escaped once.
5590
5591 2008-04-20 Joel E. Denny <jdenny@ces.clemson.edu>
5592
5593 Fix make dist infinite loop reported by Juan Manuel Guerrero at
5594 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00009.html>.
5595 * .cvsignore: Add .version.
5596 * .version.in: New.
5597 * bootstrap.conf (gnulib_modules): Add git-version-gen.
5598 * configure.ac (AC_CONFIG_FILES): Add .version.
5599 * build-aux/.cvsignore: Add git-version-gen.
5600
5601 2008-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
5602
5603 * NEWS (2.3a+): Mention that -g now takes an argument.
5604 * doc/bison.texinfo (Bison Options): Reword -W entry a little for
5605 consistency. Update the -g and -x entries now that they take
5606 arguments. Use brackets to indicate optional arguments.
5607 * src/getargs.c (usage): Explain the relationship between arguments of
5608 long and short options more completely. Document --defines and -d
5609 separately since the former takes an argument but, for POSIX Yacc, the
5610 latter does not.
5611 (short_options): Let -W take an optional argument like --warnings.
5612 (getargs): Sort cases.
5613
5614 2008-02-28 Akim Demaille <demaille@gostai.com>
5615
5616 * doc/bison.texinfo: Fix a few typos.
5617
5618 2008-02-28 Akim Demaille <akim@epita.fr>
5619
5620 * doc/bison.texinfo (Bison Options): Document -W.
5621 Based on Joel E. Denny's NEWS entry, and Automake's documentation.
5622
5623 2008-02-28 Akim Demaille <akim@epita.fr>
5624
5625 * src/getargs.c (short_options): Split and sort for readability.
5626 -g and -x take optional arguments, just like their long options.
5627 * build-aux/cross-options.pl: Use /x to make the regexp easier to
5628 understand.
5629 Fix the handling of $opt which resulted in all the argument to be
5630 considered as optional.
5631
5632 2008-02-22 Joel E. Denny <jdenny@ces.clemson.edu>
5633
5634 * NEWS (2.3a+): Don't say %language is experimental. Mention Java and
5635 say its interface is experimental.
5636 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
5637 Java.
5638 (Bison Options): In the -L and --language entry, mention Java.
5639 (Java Bison Interface): Say the interface is experimental.
5640 * src/getargs.c (usage): Mention -L and --language.
5641
5642 * NEWS (2.3a+): Say the push parsing interface is experimental.
5643 * doc/bison.texinfo (Push Decl): Likewise.
5644 (Decl Summary): Likewise in the "%define api.push_pull" entry.
5645 (Push Parser Function): Likewise.
5646 (Pull Parser Function): Likewise.
5647 (Parser Create Function): Likewise.
5648 (Parser Delete Function): Likewise.
5649 (Table of Symbols): Likewise in the yypstate_delete, yypstate_new,
5650 yypull_parse, and yypush_parse entries.
5651
5652 * NEWS (2.3a+): Mention XML support, and say the schema is
5653 experimental.
5654 * doc/bison.texinfo (Bison Options): Mention -x and --xml.
5655 * src/getargs.c (usage): Say the XML schema is experimental.
5656
5657 * NEWS (2.3a+): Say option instead of flag.
5658
5659 2008-02-21 Wojciech Polak <polak@gnu.org>
5660
5661 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Change footer
5662 text.
5663
5664 2008-02-20 Joel E. Denny <jdenny@ces.clemson.edu>
5665
5666 Fix impure push parser compile error reported by Bob Rossi at
5667 <http://lists.gnu.org/archive/html/help-bison/2008-02/msg00023.html>.
5668 * data/yacc.c: Clean up whitespace in the output a little.
5669 (yypstate_allocated): Define for impure push parsers regardless of
5670 whether the pull interface is also requested.
5671 * tests/push.at (Push Parsing: Multiple impure instances): Extend to
5672 check impure push parsers without the pull interface.
5673
5674 * data/yacc.c (yypstate_new): Don't try to invoke yyerror since
5675 yyerror takes arguments specified by %parse-param while yypstate_new
5676 does not.
5677 * doc/bison.texinfo (Parser Create Function): Document that
5678 yypstate_new returns 0 for multiple impure parser instances.
5679 * tests/push.at (Push Parsing: Multiple impure instances): Update
5680 expected stderr output.
5681
5682 2008-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
5683
5684 * runtime-po/POTFILES.in (push.c): Remove.
5685
5686 2008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
5687
5688 * data/Makefile.am (dist_pkgdata_DATA): Remove push.c.
5689 * data/push.c: Rename to...
5690 * data/yacc.c: ... this, overwriting it.
5691 * etc/bench.pl.in (bench_grammar): `%pure-parser'-> `%define api.pure'.
5692 `%push-pull-parser' -> `%define api.push_pull "both"'.
5693 Remove old yacc.c tests, and update push.c tests to yacc.c.
5694
5695 2008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
5696
5697 * data/bison.m4 (b4_percent_code_get): Output %code block comments like
5698 `"%code top" blocks' instead of `%code "top" blocks'.
5699 * data/push.c: Import yacc.c changes from 2008-01-09 and 2007-08-03.
5700 Clean up whitespace in the output a little.
5701
5702 2008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
5703
5704 Fix documentation problems reported by Tim Josling at
5705 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00013.html>.
5706 * NEWS (2.3a+): Mention removal of --no-parser, -n, and %no-parser.
5707 * doc/bison.texinfo (Token Decl): Token numbers are *nonnegative*
5708 integers. Explain the effect of literal string aliases on error
5709 messages. Copy token 0 documentation from the C++ skeleton
5710 documentation.
5711
5712 2008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
5713
5714 Accept a token number in a %left, %right, or %nonassoc for POSIX
5715 conformance. Reported by Tim Josling at
5716 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00010.html>.
5717 * NEWS (2.3a+): Mention.
5718 * doc/bison.texinfo (Precedence Decl): Describe how literal strings
5719 and code numbers are treated by precedence declarations.
5720 * src/parse-gram.y (precedence_declaration): Use symbols.prec instead
5721 of symbols.1.
5722 (symbols.prec): New, just like symbols.1 but uses symbol.prec instead
5723 of symbol.
5724 (symbol.prec): New, just like symbol but allows INT.
5725 * src/symtab.c (symbol_user_token_number_set): Remove an aver that no
5726 longer holds.
5727 * tests/regression.at (Token number in precedence declaration): New
5728 test case.
5729
5730 2008-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
5731
5732 DJGPP specific issues.
5733 * djgpp/config.bat: Add filenames that are not 8.3 clean and that must
5734 be changed. Copyright timestamp adjusted.
5735 * djgpp/config.sed: Add filenames that are not 8.3 clean and that must
5736 be changed. Copyright timestamp adjusted.
5737 * djgpp/config.site: Copyright timestamp adjusted.
5738 * djgpp/config_h.sed: Copyright timestamp adjusted.
5739 * djgpp/djunpack.bat: Copyright timestamp adjusted.
5740 * djgpp/fnchnage.lst: Add filenames that are not 8.3 clean to the
5741 filename translation list.
5742 * djgpp/subpipe.c (init_subpipe): Check the environment variables
5743 TMPDIR, TMP and TEMP, in that order, to determinate where the temp
5744 files shall be created. Before trying to use the temp dir where the
5745 environment variable points to check that the dir really exists. If
5746 not default to the cwd as temp dir. Copyright timestamp adjusted.
5747 * djgpp/subpipe.h: Copyright timestamp adjusted.
5748 * djgpp/testsuite.sed: Copyright timestamp adjusted.
5749
5750 2008-01-30 Paul Eggert <eggert@cs.ucla.edu>
5751
5752 * doc/bison.texinfo: Update Back-Cover text to reflect new GNU wording.
5753
5754 2008-01-09 Paul Eggert <eggert@cs.ucla.edu>
5755
5756 * data/yacc.c (yyparse): Correct the comment when locations aren't used.
5757 Problem reported by Claudio Saavedra in
5758 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00003.html>.
5759
5760 2008-01-05 Wojciech Polak <polak@gnu.org>
5761
5762 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Precede an XHTML
5763 document's title with the input grammar file name.
5764
5765 2007-12-22 Joel E. Denny <jdenny@ces.clemson.edu>
5766
5767 Automate regression testing of the XML/XSLT implementation. Discussed
5768 starting at
5769 <http://lists.gnu.org/archive/html/bison-patches/2007-11/msg00021.html>.
5770 * configure.ac (XSLTPROC): New substitution.
5771 * Makefile.am (maintainer-xml-check): New phony target invoking...
5772 * tests/Makefile.am (maintainer-xml-check): ... this new phony target
5773 invoking make maintainer-check with BISON_TEST_XML=1.
5774 * tests/atlocal.in (XSLTPROC): New.
5775 * tests/local.at (AT_BISON_CHECK): New macro to (1) instruct Valgrind
5776 not to report reachable memory when Bison is expected to have a
5777 non-zero exit status and (2) to compare XML/XSLT output with --graph
5778 and --report=all output for every working grammar when
5779 BISON_TEST_XML=1.
5780 (AT_BISON_CHECK_NO_XML): Likewise, but skip XML checks.
5781 (AT_BISON_CHECK_XML): New.
5782 (AT_QUELL_VALGRIND): New.
5783 * tests/testsuite.at (ORIGINAL_AT_CHECK): Remove this and...
5784 (AT_CHECK): ... don't redefine this since this was the old way to
5785 quell Valgrind.
5786 * tests/actions.at: Rewrite all AT_CHECK invocations for bison as
5787 AT_BISON_CHECK invocations.
5788 * tests/c++.at: Likewise.
5789 * tests/calc.at: Likewise.
5790 * tests/conflicts.at: Likewise.
5791 * tests/cxx-type.at: Likewise.
5792 * tests/existing.at: Likewise.
5793 * tests/glr-regression.at: Likewise.
5794 * tests/headers.at: Likewise.
5795 * tests/input.at: Likewise.
5796 * tests/java.at: Likewise.
5797 * tests/output.at: Likewise.
5798 * tests/push.at: Likewise.
5799 * tests/reduce.at: Likewise.
5800 * tests/regression.at: Likewise.
5801 * tests/sets.at: Likewise.
5802 * tests/skeletons.at: Likewise.
5803 * tests/synclines.at: Likewise.
5804 * tests/torture.at: Likewise.
5805 (Big triangle): Use AT_BISON_CHECK_NO_XML instead since this grammar
5806 tends to hang xsltproc.
5807 (Big horizontal): Likewise.
5808
5809 2007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
5810
5811 In XML output, remove redundant class attribute on symbol element.
5812 * data/xslt/bison.xsl (xsl:key name="bison:symbolByName"): New.
5813 * data/xslt/xml2xhtml.xsl (xsl:template match="symbol"): Use it to
5814 look up a symbol to determine whether it's a nonterminal or terminal.
5815 * src/gram.c (rule_rhs_print_xml): Remove class attribute.
5816 * src/state.c (state_rule_lookahead_tokens_print_xml): Likewise.
5817
5818 Add prec/assoc information to XML output.
5819 * src/gram.c (grammar_rules_print_xml): For each rule that has a
5820 %prec, add a percent_prec attribute.
5821 * src/print-xml.c (print_grammar): For each terminal that has a
5822 precedence or associativity, add a prec or assoc attribute.
5823 (xml_indent): New.
5824 (xml_puts): Use xml_indent.
5825 (xml_printf): Use xml_indent.
5826 * src/print-xml.h (xml_indent): Prototype.
5827
5828 * tests/existing.at (GNU pic Grammar): Fix a rule miscopied from
5829 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
5830
5831 2007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
5832
5833 * data/xslt/bison.xsl (bison:ruleNumber): Rename to...
5834 (bison:ruleByNumber): ... this for clarity.
5835 * data/xslt/xml2dot.xsl (xsl:template match="item"): Update.
5836 * data/xslt/xml2text.xsl (xsl:template match="item"): Update.
5837 (xsl:template match="reduction"): Update.
5838 (xsl:template match="item"): Update.
5839 (xsl:template match="reduction"): Update.
5840
5841 In the XML output, don't print the list of rules where symbols appear.
5842 Compute it in XSLT instead. Discussed at
5843 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00024.html>.
5844 * data/xslt/bison.xsl (bison:ruleByLhs): New.
5845 (bison:ruleByRhs): New.
5846 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Use
5847 bison:ruleByRhs.
5848 (xsl:template match="terminal/rule"): Remove.
5849 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
5850 bison:ruleByRhs.
5851 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
5852 Remove.
5853 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Use
5854 bison:ruleByRhs and mode="number-link" for rule template.
5855 (xsl:template match="terminal/rule"): Remove.
5856 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
5857 bison:ruleByRhs and mode="number-link" for rule template.
5858 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
5859 Rewrite as...
5860 (xsl:template match="rule" mode="number-link"): ... this.
5861 * src/print-xml.c (print_grammar): Don't print the list of rules.
5862
5863 2007-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
5864
5865 Don't let --report affect XML output; always print all information.
5866 Discussed at
5867 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00020.html>.
5868 * src/conflicts.c (log_resolution): Implement.
5869 * src/print-xml.c (print_core): Implement.
5870 (print_state): Implement.
5871 (print_xml): Implement.
5872
5873 * NEWS (2.3a+): Fix quotes.
5874 * src/parse-gram.y (prologue_declaration): For consistency with -v,
5875 don't let %verbose clear the list specified by --report.
5876
5877 2007-11-26 Akim Demaille <akim@epita.fr>
5878
5879 * data/Makefile.am (dist_pkgdata_DATA): Ship and install bison.xsl.
5880
5881 2007-11-24 Joel E. Denny <jdenny@ces.clemson.edu>
5882
5883 In the XML output, list useless and unused symbols and rules with the
5884 useful ones and add a "usefulness" attribute. Discussed starting at
5885 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00017.html>.
5886 * src/gram.c (grammar_rules_partial_print_xml): Remove.
5887 (grammar_rules_print_xml): Print all rules instead of just those
5888 useful in the grammar, and add a "usefulness" attribute.
5889 * src/gram.h (grammar_rules_partial_print_xml): Remove prototype.
5890 * src/print-xml.c (print_rules_useless_in_parser): Remove.
5891 (print_grammar): Print all nonterminals instead of just useful ones,
5892 and add a "usefulness" attribute to nonterminals and terminals.
5893 (print_xml): Don't print a separate "reductions" or
5894 "rules-useless-in-parser" element.
5895 * src/reduce.c (reduce_output): Use reduce_token_unused_in_grammar.
5896 (reduce_xml): Remove.
5897 (reduce_token_unused_in_grammar): New.
5898 (reduce_nonterminal_useless_in_grammar): New.
5899 * src/reduce.h (reduce_xml): Remove prototype.
5900 (reduce_token_unused_in_grammar): Add prototype.
5901 (reduce_nonterminal_useless_in_grammar): Add prototype.
5902 * data/xslt/xml2text.xsl: Update for XML changes.
5903 * data/xslt/xml2xhtml.xsl: Update for XML changes.
5904 * tests/reduce.at (Useless Terminals): Update output.
5905 (Useless Rules): Update output.
5906 (Reduced Automaton): Update output.
5907
5908 Say "Terminals unused in grammar" instead of "Unused terminals".
5909 * NEWS (2.3a+): Update.
5910 * doc/bison.texinfo (Understanding): Update example output.
5911 * src/reduce.c (reduce_output): Implement.
5912 * data/xslt/xml2text.xsl: Implement.
5913 * data/xslt/xml2xhtml.xsl: Implement.
5914
5915 2007-11-18 Joel E. Denny <jdenny@ces.clemson.edu>
5916
5917 Accept --report-file=FILE to override the default `.output' filename.
5918 * NEWS (2.3a+): Mention.
5919 * doc/bison.texinfo (Bison Options): Add an entry.
5920 * src/files.c (compute_output_file_names): Don't override
5921 spec_verbose_file if already set.
5922 * src/getargs.c (usage): Document --report-file.
5923 (REPORT_FILE_OPTION): New anonymous enum member.
5924 (long_options): Add entry for it.
5925 (getargs): Add case for it setting spec_verbose_file.
5926
5927 * build-aux/cross-options.pl: Don't record a short option just because
5928 there's an arg.
5929 * doc/.cvsignore: Add yacc.1.
5930
5931 2007-11-14 Akim Demaille <akim@epita.fr>
5932
5933 * doc/yacc.1.in: New.
5934 * configure.ac, doc/Makefile.am: Adjust.
5935 * configure.ac (PACKAGE_COPYRIGHT_YEAR): New substitution, and new
5936 config.h symbol.
5937 Use AC_SUBST for assignments too.
5938 * src/getargs.c (version): Use PACKAGE_COPYRIGHT_YEAR.
5939
5940 2007-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
5941
5942 * src/gram.c: Remove comments that duplicate comments in gram.h.
5943
5944 When reporting useless rules and nonterminals, say "useless in grammar"
5945 instead of "useless", and say "useless in parser" instead of "never
5946 reduced". Discussed starting at
5947 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00033.html>.
5948 * NEWS (2.3a+): Mention this change.
5949 * data/xslt/xml2text.xsl: Update output text and expected input XML
5950 element names to match changes below.
5951 * data/xslt/xml2xhtml.xsl: Likewise.
5952 (xsl:template match="bison-xml-report"): Add missing entry in Table of
5953 Contents: "Rules useless in parser due to conflicts".
5954 * doc/bison.texinfo (Decl Summary): Reword a little.
5955 (Understanding): Update example output for changes below.
5956 * src/gram.c: (rule_useful_p): Rename to...
5957 (rule_useful_in_grammar_p): ... this.
5958 (rule_useless_p): Rename to...
5959 (rule_useless_in_grammar_p): ... this.
5960 (rule_never_reduced_p): Rename to...
5961 (rule_useless_in_parser_p): ... this.
5962 (grammar_rules_print): Update for renames.
5963 (grammar_rules_print_xml): Update for renames.
5964 (grammar_rules_never_reduced_report): Rename to...
5965 (grammar_rules_useless_report): ... this since it is used for either
5966 kind of useless rule.
5967 * src/gram.h: Reword comments and update function names in prototypes.
5968 * src/main.c (main): Say "rule useless in parser due to conflicts".
5969 * src/print-xml.c (print_rules_never_reduced): Rename to...
5970 (print_rules_useless_in_parser): ... this, and rename output XML
5971 element "rules-never-reduced" to "rules-useless-in-parser".
5972 (print_xml): Update for rename.
5973 * src/print.c (print_results): Say "Rules useless in parser due to
5974 conflicts".
5975 * src/reduce.c (reduce_grammar_tables): Say "rule useless in grammar".
5976 (nonterminals_reduce): Say "nonterminal useless in grammar".
5977 (reduce_output): Say "Nonterminals useless in grammar".
5978 Say "Rules useless in grammar".
5979 (reduce_xml): Rename output XML element "useless" to
5980 "useless-in-grammar".
5981 (reduce_print): Don't report the count of grammatically useless rules
5982 as "rules never reduced" just because %yacc is specified.
5983 In the correct report of this count, say nonterminal(s) and rule(s)
5984 "useless in grammar".
5985 * tests/conflicts.at (S/R in initial): Update expected output.
5986 (Defaulted Conflicted Reduction): Likewise.
5987 (Unreachable States After Conflict Resolution): Likewise.
5988 * tests/existing.at (GNU pic Grammar): Likewise.
5989 * tests/reduce.at (Useless Nonterminals): Likewise.
5990 (Useless Rules): Likewise.
5991 (Reduced Automaton): Likewise.
5992 (Underivable Rules): Likewise.
5993 (Empty Language): Likewise.
5994
5995 2007-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
5996
5997 * data/bison.m4 (b4_cat): Put a newline after the end delimiter of the
5998 here document and before the EOF so that BSD's implementation of Bourne
5999 shell doesn't parse the delimiter as part of the here document.
6000 * doc/.cvsignore: Add cross-options.texi.
6001 * src/getargs.c (usage): Add a blank line after the warning categories.
6002
6003 2007-11-08 Paolo Bonzini <bonzini@gnu.org>
6004
6005 * data/lalr1.java (Lexer): Remove usage of b4_pure_if.
6006
6007 2007-11-05 Akim Demaille <akim@epita.fr>
6008
6009 Remove Id: from bison.1.
6010 * doc/Makefile.am (remove_time_stamp): Include the sed invocation.
6011 (perl -0777 -pi -e 's/\.PP\nId): New.
6012 (.x.1): Use it to ignore the version control revision.
6013
6014 2007-11-05 Akim Demaille <demaille@gostai.com>
6015
6016 * build-aux/Makefile.am: Ship cross-options.pl.
6017 * doc/Makefile.am: Always refer to cross-options.texi with
6018 $(srcdir).
6019 (MAINTAINERCLEANFILES): Add it.
6020
6021 2007-11-04 Akim Demaille <demaille@gostai.com>
6022
6023 Generate the long/short option cross-table.
6024 * build-aux/cross-options.pl: New.
6025 * doc/Makefile.am (cross-options.texi): New.
6026 * doc/bison.texinfo: Use it.
6027
6028 2007-11-04 Akim Demaille <demaille@gostai.com>
6029
6030 Generate bison.1 using help2man.
6031 * doc/common.x, doc/bison.x: New.
6032 * doc/Makefile.am (bison.1, .x.1): New.
6033 The code is taken from autoconf-2.61/man/Makefile.am.
6034 * configure.ac: Look for help2man.
6035
6036 2007-11-04 Akim Demaille <demaille@gostai.com>
6037
6038 Complete --help.
6039 * src/getargs.c (usage): Document -W, make it clear that -d,
6040 -g and -x have optional arguments.
6041
6042 2007-11-04 Akim Demaille <demaille@gostai.com>
6043
6044 Find sha1sum when named gsha1sum.
6045 * bootstrap (find_tool): New.
6046 ($SHA1SUM): New.
6047
6048 2007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
6049
6050 Deprecate %pure-parser and add `%define api.pure'. Discussed starting
6051 at
6052 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00006.html>.
6053 * NEWS (2.3a+): Mention.
6054 * data/bison.m4 (b4_pure_if): Don't define it here.
6055 * data/c.m4 (b4_identification): Depend on individual skeletons to
6056 define b4_pure_flag, b4_push_flag, or b4_pull_flag if they use the
6057 values of the %define variables api.pure or api.push_pull. Define
6058 YYPURE, YYPUSH, and YYPULL accordingly.
6059 * data/glr.c: Define b4_pure_if based on `%define api.pure' unless
6060 glr.cc has already defined b4_pure_flag.
6061 * data/push.c: Define b4_pure_if based on `%define api.pure'.
6062 Remove YYPUSH and YYPULL since they're back in b4_identification again.
6063 * data/yacc.c: Define b4_pure_if based on `%define api.pure'.
6064 * doc/bison.texinfo (Pure Decl): Update.
6065 (Push Decl): Update.
6066 (Decl Summary): Add api.pure to %define entry.
6067 In %pure-parser entry, say it's deprecated and reference %define.
6068 (Pure Calling): Update.
6069 (Error Reporting): Update.
6070 (C++ Scanner Interface): Update.
6071 (How Can I Reset the Parser): Update.
6072 (Table of Symbols): In %pure-parser entry, say it's deprecated and
6073 reference %define.
6074 * src/getargs.c (pure_parser): Remove global variable.
6075 * src/getargs.h (pure_parser): Remove extern.
6076 * src/output.c (prepare): Don't define pure_flag muscle.
6077 * src/parse-gram.y (prologue_declaration): Implement %pure-parser as a
6078 wrapper around `%define api.pure'.
6079 * tests/calc.at (Simple LALR Calculator): Update.
6080 (Simple GLR Calculator): Update.
6081 * tests/cxx-type.at (GLR: Resolve ambiguity, pure, no locations):
6082 Update.
6083 (GLR: Resolve ambiguity, pure, locations): Update.
6084 (GLR: Merge conflicting parses, pure, no locations): Update.
6085 (GLR: Merge conflicting parses, pure, locations): Update.
6086 * tests/glr-regression.at (Uninitialized location when reporting
6087 ambiguity): Update
6088 * tests/input.at (Unused %define api.pure): New test case.
6089 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Update definition for
6090 AT_PURE_IF and AT_PURE_AND_LOC_IF.
6091 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
6092
6093 2007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
6094
6095 %define push_pull -> %define api.push_pull. Discussed starting at
6096 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00005.html>.
6097 * data/push.c: Expect the new name.
6098 * data/yacc.c: Likewise.
6099 * doc/bison.texinfo (Push Decl): Update.
6100 (Decl Summary): Update %define entry.
6101 (Push Parser Function): Update.
6102 (Pull Parser Function): Update.
6103 (Parser Create Function): Update.
6104 (Parser Delete Function): Update.
6105 * tests/calc.at (Simple LALR Calculator): Update.
6106 * tests/input.at (%define enum variables): Update.
6107 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
6108 (Push Parsing: Multiple impure instances): Update.
6109 (Push Parsing: Unsupported Skeletons): Update.
6110 * tests/torture.at (Exploding the Stack Size with Alloca): Update.
6111 (Exploding the Stack Size with Malloc): Update.
6112
6113 * NEWS (2.3a+): Add an entry for the push parser, and clean up the
6114 other entries some.
6115
6116 2007-10-27 Joel E. Denny <jdenny@ces.clemson.edu>
6117
6118 For the XML output's terminal element, rename @number to @token-number,
6119 and add @symbol-number. In the nonterminal element, rename @number to
6120 @symbol-number. Discussed starting at
6121 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00040.html>.
6122 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Update for
6123 renames.
6124 (xsl:template match="nonterminal"): Likewise.
6125 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Likewise.
6126 (xsl:template match="nonterminal"): Likewise.
6127 * src/print-xml.c (print_grammar): Implement.
6128
6129 2007-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
6130
6131 * data/xslt/xml2dot.xsl (xsl:template match="automaton/state"): After
6132 2007-10-11 change, the child elements here are items not rules.
6133 (xsl:template match="item"): New.
6134 (xsl:template match="rule"): Update for new reduced itemset.
6135 (xsl:template match="point"): Remove.
6136 (xsl:template match="empty"): For consistency with --graph, don't
6137 output "/* empty */".
6138 * data/xslt/xml2text.xsl (xsl:template match="terminal"): When invoking
6139 line-wrap, don't pass a negative value as first-line-length since this
6140 won't work with the following changes.
6141 (xsl:template name="line-wrap"): Simplify slightly.
6142 (xsl:template name="ws-search"): Eliminate recursion.
6143 * src/print_graph.c (print_core): Don't print a reduction's lookahead
6144 set next to an item whose dot is not at the end of the RHS even if it
6145 happens to be associated with the same rule.
6146
6147 2007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
6148
6149 Add %define lr.keep_unreachable_states.
6150 * NEWS (2.3a+): Mention it in the entry for unreachable state removal.
6151 * doc/bison.texinfo (Decl Summary): Mention it in the %define entry.
6152 * src/main.c (main): Implement it.
6153 * tests/conflicts.at (Unreachable States After Conflict Resolution):
6154 Extend to test it, and fix a typo.
6155
6156 2007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
6157
6158 * NEWS (2.3a+): Add entry for recent .output file lookahead set fix.
6159 * doc/bison.texinfo (Understanding): Remove a bogus lookahead set in
6160 the example .output text.
6161 * tests/regression.at (Extra lookahead sets in report): Improve wording
6162 of comments.
6163
6164 2007-10-17 Wojciech Polak <polak@gnu.org>
6165
6166 * src/print-xml.c (print_grammar): Renamed
6167 <terminal> and <nonterminal> attributes:
6168 "type" to "number" and "symbol" to "name".
6169 * data/xslt/xml2text.xsl (xsl:template match="terminal"):
6170 Use new attribute names.
6171 (xsl:template match="nonterminal"): Likewise.
6172 * data/xslt/xml2xhtml.xsl: Likewise.
6173
6174 2007-10-17 Joel E. Denny <jdenny@ces.clemson.edu>
6175
6176 * doc/bison.texinfo (Bison Options): Add entry for --print-datadir.
6177 (Option Cross Key): Likewise.
6178
6179 * src/print-xml.c (print_core): Don't print a reduction's lookahead set
6180 next to an item whose dot is not at the end of the RHS even if it
6181 happens to be associated with the same rule.
6182 * src/print.c (print_core): Likewise.
6183 * tests/conflicts.at (Unresolved SR Conflicts): Update output.
6184 (Resolved SR Conflicts): Update output.
6185 * tests/regression.at (Extra lookahead sets in report): New test case.
6186
6187 2007-10-11 Wojciech Polak <polak@gnu.org>
6188
6189 * src/print-xml.c (print_core): Remove item set
6190 redundancy.
6191 * data/xslt/bison.xsl (bison:ruleNumber): New key.
6192 Improve processing time. Suggested by Joel E. Denny.
6193 * data/xslt/xml2dot.xsl (xsl:template name="escape"):
6194 Write xsl:param "required" attribute as comment.
6195 * data/xslt/xml2text.xsl (xsl:template match="item"): New.
6196 (xsl:template match="rule"): Support new reduced itemset.
6197 (xsl:template match="point"): Remove.
6198 * data/xslt/xml2xhtml.xsl: Likewise.
6199
6200 2007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
6201
6202 * src/getargs.c (version): Update copyright year.
6203
6204 2007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
6205
6206 Make xml2dot.xsl and --graph produce the same output.
6207 * data/xslt/xml2dot.xsl (xsl:template match="rule"): Use a `&#10;'
6208 instead of a `\n'. That is, don't add escapes yet or they'll be doubly
6209 escaped later.
6210 (xsl:template name="output-node"): Use the new escape template instead
6211 of the string-replace template directly.
6212 (xsl:template name="output-edge"): Likewise.
6213 (xsl:template name="escape"): New, escapes backslashes and newlines in
6214 addition to quotation marks.
6215 * src/graphviz.c (start_graph, output_node, output_edge): Add
6216 whitespace to output for legibility.
6217
6218 Make xml2text.xsl and --report produce the same output, and remove the
6219 XML "conflicts" element since a conflict summary is easily extracted
6220 from the automaton.
6221 * data/xslt/bison.xsl: New.
6222 (xsl:template match="state" mode="bison:count-conflicts): New.
6223 * data/xslt/xml2text.xsl: Import bison.xsl.
6224 (xsl:template match="bison-xml-report"): Instead of styling the
6225 "conflicts" element, style the "automaton" element with mode
6226 "conflicts". Unlike the former, the latter lists S/R and R/R
6227 conflicts for a state on the same line.
6228 (xsl:template match="conflicts"): Remove.
6229 (xsl:template match="conflict"): Remove.
6230 (xsl:template match="terminal"): Line-wrap the list of rules in which
6231 the terminal is used.
6232 (xsl:template match="nonterminal"): Likewise for nonterminals.
6233 (xsl:template match="automaton" mode="conflicts"): New.
6234 (xsl:template match="state" mode="conflicts"): New.
6235 (xsl:template name="line-wrap"): New.
6236 (xsl:template name="ws-search"): New.
6237 * data/xslt/xml2xhtml.xsl: Import bison.xsl.
6238 (xsl:template match="bison-xml-report"): Instead of styling the
6239 "conflicts" element, style the "automaton" element with mode
6240 "conflicts."
6241 (xsl:template match="conflicts"): Remove.
6242 (xsl:template match="conflict"): Remove.
6243 (xsl:template match="automaton" mode="conflicts"): New.
6244 (xsl:template match="state" mode="conflicts): New.
6245 * src/conflicts.c (conflicts_output_xml): Remove.
6246 * src/conflicts.h (conflicts_output_xml): Remove prototype.
6247 * src/print-xml.c (print_xml): Don't invoke conflicts_output_xml.
6248 * src/print.c (print_grammar): Consistently wrap at the 66th column so
6249 the corresponding XSLT is easier. Also, never wrap between a word and
6250 the comma that follows it.
6251
6252 2007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
6253
6254 Improve C++ namespace support. Discussed starting at
6255 <http://lists.gnu.org/archive/html/help-bison/2007-09/msg00016.html>.
6256 * data/c++.m4: (b4_namespace_ref, b4_namespace_open,
6257 b4_namespace_close): New macros that interpret the %define variable
6258 "namespace" so its value can contain "::" to indicate nested
6259 namespaces.
6260 * data/glr.cc (b4_namespace): Don't define, and replace all uses with
6261 the above macros.
6262 * data/lalr1.cc (b4_namespace): Likewise.
6263 * data/location.cc (b4_namespace): Likewise.
6264 * doc/bison.texinfo (Decl Summary): Move `%define push_pull' entry
6265 inside a new table in the general %define entry. Document `%define
6266 namespace' there as well. Point the %name-prefix entry to it since it
6267 explains it more completely in the case of C++.
6268 (C++ Bison Interface): Mention `%define namespace' instead of
6269 %name-prefix.
6270 (Table of Symbols): Remove the `%define push_pull' entry. The %define
6271 entry suffices.
6272 * tests/c++.at (Relative namespace references): New test case.
6273 (Absolute namespace references): New test case.
6274 (Syntactically invalid namespace references): New test case.
6275 * tests/input.at (C++ namespace reference errors): New test case.
6276
6277 2007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
6278
6279 Add syncline support and location accessor to internal %define
6280 interfaces.
6281 * data/bison.m4 (b4_percent_define_get_loc): New.
6282 (b4_percent_define_get_syncline): New.
6283 (b4_percent_define_flag_if): Use b4_percent_define_get_loc.
6284 (b4_percent_define_default): Record defining location as line 1 rather
6285 than 0 for the sake of synchronizing #line's, and define
6286 b4_percent_define_syncline(VARIABLE).
6287 (b4_percent_define_check_values): Use b4_percent_define_get_loc.
6288 * src/muscle_tab.c (muscle_syncline_grow): New.
6289 (muscle_code_grow): Use muscle_syncline_grow.
6290 (muscle_percent_define_insert): Use muscle_percent_define_get_loc, and
6291 define b4_percent_define_syncline(VARIABLE).
6292 (muscle_percent_define_get_loc): New.
6293 (muscle_percent_define_get_syncline): New.
6294 (muscle_percent_define_flag_if): Use muscle_percent_define_get_loc, and
6295 remove some unused variables.
6296 (muscle_percent_define_default): Record defining location as line 1
6297 rather than 0 for the sake of synchronizing #line's, and define
6298 b4_percent_define_syncline(VARIABLE).
6299 (muscle_percent_define_check_values): Use
6300 muscle_percent_define_get_loc.
6301 * src/muscle_tab.h (muscle_percent_define_get_loc): Prototype.
6302 (muscle_percent_define_get_syncline): Prototype.
6303 * tests/skeletons.at (%define Boolean variables: invalid skeleton
6304 defaults): Update output for location change.
6305 (Complaining during macro argument expansion): Extend to test
6306 b4_percent_define_get_loc and b4_percent_define_get_syncline errors.
6307
6308 2007-10-07 Joel E. Denny <jdenny@ces.clemson.edu>
6309
6310 Fix some error-reporting macro bugs.
6311 * data/bison.m4 (b4_cat): New.
6312 (b4_error, b4_error_at): Use b4_cat to send error directives directly
6313 to stdout so they don't become arguments to other macros. Update
6314 comments and add examples.
6315 (b4_warn, b4_warn_at, b4_complain, b4_complain_at): Update comments and
6316 add examples.
6317 (b4_fatal, b4_fatal_at): Likewise, and invoke m4_exit(1) immediately
6318 after printing the error directive so that M4 doesn't report subsequent
6319 problems that are induced by this problem.
6320 * src/scan-skel.l: Recognize @` digraph outside of directive arguments
6321 instead of just in them. Recognize @\n in both places. Both expand to
6322 the empty string. Needed by b4_cat.
6323 * tests/skeletons.at (Complaining during macro argument expansion):
6324 New test case.
6325 (Fatal errors make M4 exit immediately): New test case.
6326
6327 2007-10-04 Joel E. Denny <jdenny@ces.clemson.edu>
6328
6329 Implement --print-datadir.
6330 * src/getargs.c (usage): Mention.
6331 (PRINT_DATADIR_OPTION): New anonymous enum member.
6332 (long_options): Add entry for it.
6333 (getargs): Add case for it calling compute_pkgdatadir.
6334 * src/output.c (output_skeleton): Encapsulate data directory
6335 computation from here...
6336 (prepare): ... and from here...
6337 (compute_pkgdatadir): ... into this new function.
6338 * src/output.h (compute_pkgdatadir): Prototype.
6339
6340 2007-09-29 Joel E. Denny <jdenny@ces.clemson.edu>
6341
6342 * src/print-xml.c (escape_bufs): New static global variable
6343 replacing...
6344 (xml_escape_n): ... the static local variable buf here.
6345 (print_xml): Free memory for escape_bufs.
6346 * src/reduce.c (reduce_xml): XML-escape terminal symbol tags.
6347
6348 2007-09-25 Joel E. Denny <jdenny@ces.clemson.edu>
6349
6350 Replace `%push-parser' and `%push-pull-parser' with
6351 `%define push_pull "push"' and `%define push_pull "both"'.
6352 `%define push_pull "pull"' is the default.
6353 * doc/bison.texinfo (Push Decl, Push Parser Function,
6354 Pull Parser Function, Parser Create Function, Parser Delete Function):
6355 Update declarations.
6356 (Decl Summary, Table of Symbols): Replace %push-parser and
6357 %push-pull-parser entries with a %define push_pull entry.
6358 * data/bison.m4 (b4_percent_define_check_values): New macro.
6359 (b4_pull_if, b4_push_if, b4_use_push_for_pull_if): Move these
6360 definitions...
6361 * data/c.m4 (b4_identification): ... and the YYPUSH and YYPULL cpp
6362 definitions...
6363 * data/push.c: ... to here and compute them from the value of the
6364 %define variable push_pull.
6365 * data/c-skel.m4: Instead of choosing the push.c skeleton for push
6366 parsing requests here...
6367 * data/yacc.c: ... hack this to switch to push.c any time
6368 b4_use_push_pull_flag or the %define variable push_pull is set. This
6369 will go away when we mv push.c yacc.c.
6370 * data/c++-skel.m4, data/glr.c, data/java-skel.m4: Don't report that
6371 push parsing is not supported since unused %define variables are
6372 reported anyway.
6373 * src/getargs.c, src/getargs.h (pull_parser, push_parser): Remove.
6374 * src/muscle_tab.h (muscle_percent_define_check_values): Update
6375 comments for consistency with b4_percent_define_check_values.
6376 * src/output.c (prepare): Don't insert b4_pull_flag and b4_push_flag
6377 muscles.
6378 * src/parse-gram.y (PERCENT_PUSH_PARSER, PERCENT_PUSH_PULL_PARSER):
6379 Remove.
6380 (prologue_declaration): Remove %push-parser and %push-pull-parser
6381 rules.
6382 * src/scan-gram.l (%push-parser, %push-pull-parser): Remove rules.
6383 * tests/calc.at: Update declarations.
6384 * tests/input.at (%define enum variables): New test case.
6385 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update
6386 declaration.
6387 (Push Parsing: Multiple impure instances): Update declaration.
6388 (Push Parsing: Unsupported Skeletons): New test case.
6389 * tests/torture.at (Exploding the Stack Size with Alloca): Update
6390 declaration.
6391 (Exploding the Stack Size with Malloc): Update declaration.
6392
6393 2007-09-24 Wojciech Polak <polak@gnu.org>
6394
6395 Add XSLT transformations.
6396
6397 * data/xslt/xml2dot.xsl: Transform XML into DOT.
6398 * data/xslt/xml2text.xsl: Transform XML into plain text.
6399 * data/xslt/xml2xhtml.xsl: Transform XML into XHTML.
6400 * data/Makefile.am (xsltdir): New variable.
6401 (dist_xslt_DATA): Add xslt/*.xsl files.
6402
6403 2007-09-23 Paul Eggert <eggert@cs.ucla.edu>
6404
6405 * src/conflicts.c (log_resolution): Fix indenting bugs I introduced.
6406 Problem reported by Wojciech Polak.
6407 * src/print-xml.c (xml_puts): Work even if LEVEL exceeds INT_MAX/2.
6408 (xml_printf): Undo change I made on 21 September; that is,
6409 indent 2 spaces, not 1.
6410
6411 2007-09-23 Joel E. Denny <jdenny@ces.clemson.edu>
6412
6413 Pacify ./configure --enable-gcc-warnings.
6414 * src/print-xml.c, src/print-xml.h (xml_puts): Make third argument
6415 `char const *' instead of `char *'.
6416 * src/state.c (state_rule_lookahead_tokens_print_xml): Remove unused
6417 local variable `sep'.
6418
6419 2007-09-21 Paul Eggert <eggert@cs.ucla.edu>
6420
6421 * src/gram.c (rule_rhs_print_xml): Now static, since it isn't used
6422 elsewhere.
6423 * src/print-xml.c: Prefer "const" after types; that's more consistent.
6424 (xml_printf): Indent just 1 space for level.
6425 (e_char, xlate_char): Remove.
6426 (xml_escape_string): Rewrite to avoid undefined behavior (used
6427 storage that was freed from the stack).
6428 (xml_escape_n): Don't bother checking for subscript error.
6429
6430 2007-09-21 Wojciech Polak <polak@gnu.org>
6431
6432 Add Bison XML Automaton Report.
6433
6434 Add support for an -x option to generate an XML report.
6435 It is not documented yet.
6436 * src/print-xml.c: New file.
6437 * src/print-xml.h: Likewise.
6438 * lib/timevar.def (TV_XML): New var.
6439 * src/Makefile.am (bison_SOURCES): Add print-xml.c, print-xml.h.
6440 * src/conflicts.c: Include print-xml.h.
6441 (solved_conflicts_xml_obstack): New var.
6442 (log_resolution, conflicts_solve, conflicts_free):
6443 Add support for XML report.
6444 (conflicts_output_val): New function.
6445 * src/conflicts.h (conflicts_output_val): New decl.
6446 * src/files.c (spec_xml_file): New var.
6447 (compute_output_file_names, output_file_names_free): Add XML support.
6448 * src/files.h (spec_xml_file): New decl.
6449 * src/getargs.c (xml_flag): New var.
6450 (usage, short_options, long_options, getargs): Add XML support.
6451 * src/getargs.h (xml_flag): New decl.
6452 * src/gram.c: Include print-xml.h.
6453 (rule_lhs_print_xml, rule_rhs_print_xml):
6454 (grammar_rules_partial_print_xml, grammar_rules_print_xml):
6455 New functions.
6456 * src/gram.h: Declare external ones.
6457 * src/main.c: Include print-xml.h.
6458 (main): Add XML support.
6459 * src/reduce.c: Include print-xml.h.
6460 (reduce_xml): New function.
6461 * src/reduce.h: Declare it.
6462 * src/state.c: Include print-xml.h.
6463 (state_new): Add XML support.
6464 (state_rule_lookahead_tokens_print_xml): New function.
6465 * src/state.h: Declare it.
6466 (struct state): New member solved_conflicts_xml.
6467 * src/symtab.c (symbol_class_get_string): New function.
6468 * src/symtab.h: Declare it.
6469
6470 2007-09-21 Paul Eggert <eggert@cs.ucla.edu>
6471
6472 * GNUmakefile: Switch to coreutils's version.
6473 * bootstrap: Likewise.
6474 * Makefile.cfg: Adjust to new GNUmakefile.
6475 * README-hacking: Likewise.
6476
6477 Import from gnulib:
6478
6479 2006-08-18 Paul Eggert <eggert@cs.ucla.edu>
6480 Bruno Haible <bruno@clisp.org>
6481
6482 * m4/bison-i18n.m4 (BISON_I18N): Also handle the case where yacc exists
6483 and is a script that invokes bison. Tighten the code. Add comments.
6484
6485 2007-08-28 Joel E. Denny <jdenny@ces.clemson.edu>
6486
6487 Spell "boolean" as "Boolean". Reported by Akim Demaille.
6488 * data/bison.m4 (b4_percent_define_flag_if): Fix complaint.
6489 * doc/bison.texinfo (Decl Summary): Fix.
6490 * src/muscle_tab.c (muscle_percent_define_flag_if): Fix complaint.
6491 * tests/input.at (Boolean %define variables): Update output.
6492 * tests/skeletons.at (%define boolean variables: invalid skeleton
6493 defaults): Rename to...
6494 (%define Boolean variables: invalid skeleton defaults): ... this and
6495 update output.
6496
6497 2007-08-17 Joel E. Denny <jdenny@ces.clemson.edu>
6498
6499 In impure push mode, don't allow more than one yypstate to be allocated
6500 since multiple impure parsers would corrupt yynerrs.
6501 * data/push.c (yypstate_allocated): New static global variable
6502 initialized to 0.
6503 (yypull_parse): If yypstate_new returns 0, don't report it as memory
6504 exhaustion if yypstate_allocated is 1, but still return 2.
6505 (yypstate_new): Invoke yyerror and return 0 if yypstate_allocated is
6506 already 1. Otherwise, set it to 1.
6507 (yypstate_delete): Set it to 0.
6508 * tests/push.at (Push Parsing: Multiple impure instances): New test
6509 case.
6510
6511 2007-08-17 Bob Rossi <bob@brasko.net>
6512
6513 * doc/bison.texinfo (Push Decl): Document the push parser.
6514 (Table of Symbols): Ditto.
6515 (Pure Decl): Ditto.
6516 (Decl Summary): Ditto.
6517 (Multiple Parsers, Push Parser Function, Pull Parser Function,
6518 Parser Create Function, Parser Delete Function):
6519 Add new push parser symbols.
6520 (Table of Symbols): Document push-parser, push-pull-parser,
6521 yypush_parse, yypull_parse, yypstate_new and yypstate_delete.
6522
6523 2007-08-15 Paul Eggert <eggert@cs.ucla.edu>
6524
6525 Update to GPLv3.
6526 * doc/gpl-3.0.texi: New file.
6527 * doc/gpl.texi: Remove.
6528 * COPYING, GNUmakefile, HACKING, Makefile.am, Makefile.cfg:
6529 * Makefile.maint, NEWS, PACKAGING, README, README-alpha:
6530 * README-hacking, TODO, bootstrap, bootstrap.conf:
6531 * configure.ac, data/Makefile.am, data/README, data/bison.m4:
6532 * data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4:
6533 * data/glr.c, data/glr.cc, data/java-skel.m4, data/java.m4:
6534 * data/lalr1.cc, data/lalr1.java, data/location.cc:
6535 * data/push.c, data/yacc.c, data/m4sugar/m4sugar.m4:
6536 * djgpp/Makefile.maint, djgpp/README.in, djgpp/config.bat:
6537 * djgpp/config.sed, djgpp/config.site, djgpp/config_h.sed:
6538 * djgpp/djunpack.bat, djgpp/subpipe.c, djgpp/subpipe.h:
6539 * djgpp/testsuite.sed, doc/Makefile.am, doc/bison.texinfo:
6540 * doc/fdl.texi, doc/refcard.tex, etc/Makefile.am, etc/README:
6541 * etc/bench.pl.in, examples/Makefile.am, examples/extexi:
6542 * examples/calc++/Makefile.am, lib/Makefile.am, lib/abitset.c:
6543 * lib/abitset.h, lib/bbitset.h, lib/bitset.c, lib/bitset.h:
6544 * lib/bitset_stats.c, lib/bitset_stats.h, lib/bitsetv-print.c:
6545 * lib/bitsetv-print.h, lib/bitsetv.c, lib/bitsetv.h:
6546 * lib/ebitset.c, lib/ebitset.h, lib/get-errno.c:
6547 * lib/get-errno.h, lib/lbitset.c, lib/lbitset.h:
6548 * lib/libiberty.h, lib/main.c, lib/subpipe.c, lib/subpipe.h:
6549 * lib/timevar.c, lib/timevar.def, lib/timevar.h:
6550 * lib/vbitset.c, lib/vbitset.h, lib/yyerror.c:
6551 * m4/c-working.m4, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4:
6552 * m4/timevar.m4, src/LR0.c, src/LR0.h, src/Makefile.am:
6553 * src/assoc.c, src/assoc.h, src/closure.c, src/closure.h:
6554 * src/complain.c, src/complain.h, src/conflicts.c:
6555 * src/conflicts.h, src/derives.c, src/derives.h, src/files.c:
6556 * src/files.h, src/flex-scanner.h, src/getargs.c:
6557 * src/getargs.h, src/gram.c, src/gram.h, src/graphviz.c:
6558 * src/lalr.c, src/lalr.h, src/location.c, src/location.h:
6559 * src/main.c, src/muscle_tab.c, src/muscle_tab.h:
6560 * src/nullable.c, src/nullable.h, src/output.c, src/output.h:
6561 * src/parse-gram.c, src/parse-gram.h, src/parse-gram.y:
6562 * src/print.c, src/print.h, src/print_graph.c:
6563 * src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c:
6564 * src/reduce.h, src/relation.c, src/relation.h:
6565 * src/revision.h, src/scan-code.h, src/scan-code.l:
6566 * src/scan-gram.h, src/scan-gram.l, src/scan-skel.h:
6567 * src/scan-skel.l, src/state.c, src/state.h, src/symlist.c:
6568 * src/symlist.h, src/symtab.c, src/symtab.h, src/system.h:
6569 * src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h:
6570 * tests/Makefile.am, tests/actions.at, tests/c++.at:
6571 * tests/calc.at, tests/conflicts.at, tests/cxx-type.at:
6572 * tests/existing.at, tests/glr-regression.at:
6573 * tests/headers.at, tests/input.at, tests/java.at:
6574 * tests/local.at, tests/output.at, tests/push.at:
6575 * tests/reduce.at, tests/regression.at, tests/sets.at:
6576 * tests/skeletons.at, tests/synclines.at, tests/testsuite.at:
6577 * tests/torture.at:
6578 Update to GPLv3.
6579
6580 2007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
6581
6582 Get rid of broken %no-parser, -n, and --no-parser implementation and
6583 documentation.
6584 * TODO: Don't mention them.
6585 * doc/bison.1: Likewise.
6586 * doc/bison.texinfo (Decl Summary): Likewise.
6587 (Bison Options): Likewise.
6588 (Option Cross Key): Likewise.
6589 * src/getargs.c (no_parser_flag): Remove global variable.
6590 (usage): Don't print description of -n and --no-parser.
6591 (long_options): Remove --no-parser entry here.
6592 (getargs): Remove -n case in the switch here.
6593 * src/getargs.h (no_parser_flag): Remove extern.
6594 * tests/regression.at (Web2c Actions): Remove comment that mentions
6595 --no-parser.
6596
6597 2007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
6598
6599 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Do not
6600 name user variables starting with `yy'. Just pass NULL instead of a
6601 dummy local &yylval to yypush_parse.
6602 * tests/torture.at (AT_DATA_STACK_TORTURE): Do not name user variables
6603 starting with `yy'.
6604
6605 2007-08-03 Joel E. Denny <jdenny@ces.clemson.edu>
6606
6607 * data/yacc.c (yyexhaustedlab): Define it when YYERROR_VERBOSE is
6608 true since it's then always used regardless of whether yyoverflow is
6609 defined. Reported by Christian Burger at
6610 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00031.html>.
6611 * THANKS: Add Christian Burger.
6612
6613 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
6614 node names: say "Decl Summary" not "Bison Declaration Summary".
6615
6616 2007-07-28 Joel E. Denny <jdenny@ces.clemson.edu>
6617
6618 * src/muscle_tab.c (muscle_percent_define_flag_if): In order to
6619 determine whether this function has already complained about an invalid
6620 value for a %define boolean variable, don't check whether Bison has
6621 ever examined the value. As written, the check was a tautology.
6622 Instead, record and check for this complaint using a separate muscle.
6623
6624 2007-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
6625
6626 Fix push parsing memory leak reported by Brandon Lucia at
6627 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00032.html>.
6628 * THANKS: Add Brandon Lucia.
6629 * data/push.c (yypstate_delete): Free the stack if it was reallocated
6630 but the parse never completed and thus freed it.
6631 * tests/Makefile.am (TESTSUITE_AT): Add push.at.
6632 * tests/testsuite.at: Include push.at.
6633 * test/push.at: New.
6634 (Push Parsing: Memory Leak for Early Deletion): New test case.
6635
6636 2007-07-17 Joel E. Denny <jdenny@ces.clemson.edu>
6637
6638 Improve handling of multiple S/R conflicts in the same state and of S/R
6639 conflicts involving multiple reductions.
6640 * src/conflicts.c (resolve_sr_conflict): Don't assign the error action
6641 set for a state here or Bison will abort if it is reassigned on a
6642 later conflicted reduction in the same state.
6643 Similarly, don't finalize and assign the solved conflicts report here
6644 or it will be lost if it is reassigned on a later conflicted reduction
6645 in the same state.
6646 (set_conflicts): Instead, assign them both here after all S/R conflicts
6647 in the state have been fully examined.
6648 * src/print.c (shift_set): Rename to...
6649 (no_reduce_set): ... this.
6650 (print_reductions): Update for rename, and add %nonassoc error action
6651 tokens to no_reduce_set so that, when printing the first remaining
6652 reduction on an error action token, the reduction is enclosed in
6653 brackets.
6654 (print_results): Update for rename.
6655 * tests/conflicts.at (Solved conflicts report for multiple reductions
6656 in a state): New test case.
6657 (%nonassoc error actions for multiple reductions in a state): New test
6658 case.
6659
6660 * src/main.c (main): Don't depend on C99 features.
6661
6662 2007-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
6663
6664 * build-aux/.cvsignore: Add compile.
6665 * lib/.cvsignore: Add charset.alias, ref-add.sed, ref-del.sed, and
6666 uniwidth.
6667
6668 2007-07-10 Joel E. Denny <jdenny@ces.clemson.edu>
6669
6670 * bootstrap (slurp): Create target directories that don't exist.
6671 Specifically, we need lib/uniwidth/ because of recent Gnulib changes.
6672
6673 2007-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
6674
6675 * LR0.c (new_itemsets): Fix wording in comments: say item index rather
6676 than item number.
6677 * closure.c (closure): Likewise.
6678 * state.h (reductions): Comment sorting of rules.
6679 (state): Comment sorting of items.
6680
6681 2007-07-02 Joel E. Denny <jdenny@ces.clemson.edu>
6682
6683 Fix C++ test cases after recent Gnulib changes. Discussed starting at
6684 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00000.html>.
6685 * examples/calc++/Makefile.am (DEFAULT_INCLUDES): Override Automake's
6686 definition in order to avoid Gnulib headers since we don't use config.h
6687 here.
6688 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Use AT_DATA_GRAMMAR
6689 rather than AT_DATA so that config.h is included.
6690
6691 2007-07-01 Joel E. Denny <jdenny@ces.clemson.edu>
6692
6693 * data/glr.c (yy_yypstack, yypstates, yypdumpstack): Use YYFPRINTF
6694 instead of fprintf. Guard these functions with #if YYDEBUG instead of
6695 #ifdef YYDEBUG for consistency with all other uses of YYDEBUG in Bison
6696 and so that YYFPRINTF is guaranteed to be defined here.
6697
6698 2007-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
6699
6700 * src/muscle_tab.c (muscle_percent_define_invalid_value): Replace
6701 with...
6702 (muscle_percent_define_check_values): ... this more helpful function.
6703 Again, it's not used yet, but it will be.
6704 * src/muscle_tab.h: Likewise.
6705
6706 Improve some comments in parser table construction.
6707 * src/LR0.c (new_itemsets): Explain sorting of itemset and kernel_base.
6708 (generate_states): Don't mention ruleset, which is internal to closure.
6709 * src/closure.c (closure): Explain sorting of core and itemset, which
6710 is required for this function to behave correctly.
6711 * src/closure.h (closure): Mention sorting.
6712
6713 2007-05-28 Joel E. Denny <jdenny@ces.clemson.edu>
6714
6715 * src/lalr.c (state_lookahead_tokens_count): For code readability,
6716 move the check for disabled transitions to an aver since conflict
6717 resolution hasn't happened yet.
6718
6719 * src/lalr.c (state_lookahead_tokens_count): Remove the check that
6720 labels a state as inconsistent just because it has error transitions.
6721 The original form of this check appeared in revision 1.1 of lalr.c,
6722 which was committed on 1991-12-21. Now (at least), changing the
6723 consistency label on such a state appears to have no useful effect in
6724 any of the places it is examined, which I enumerate below. The key
6725 point to understanding each item in this enumeration is that a state
6726 with an error transition is labelled consistent in the first place only
6727 if it has no rules, so the check cannot matter for states that have
6728 rules. (1) Labelling a state as inconsistent will cause set_conflicts
6729 to try to identify its conflicts, and a state must have *rules* to have
6730 conflicts. (2) Labelling a state as inconsistent will affect how
6731 action_row sets the default *rule* for the state. (3) Labelling a
6732 state as inconsistent will cause build_relations to add lookback edges
6733 to *rules* in that state.
6734 * src/state.h (struct state): Word the comment for member consistent
6735 more carefully.
6736
6737 2007-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
6738
6739 Don't depend on C99 features.
6740 * src/conflicts.c (conflicts_update_state_numbers): Fix for-loop.
6741 * src/lalr.c (lalr_update_state_numbers): Fix for-loop.
6742 * src/reader.c (check_and_convert_grammar): Fix for-loop.
6743 * src/state.c (state_mark_reachable_states): Fix for-loop.
6744 (state_remove_unreachable_states): Fix for-loop.
6745
6746 Don't widen struct state with member reachable just to temporarily
6747 record reachability. Instead, use a local bitset.
6748 * src/state.h (struct state): Remove member.
6749 * src/state.c (state_new): Don't initialize it.
6750 (state_mark_reachable_states): Rename to...
6751 (state_record_reachable_states): ... this, and use bitset.
6752 (state_remove_unreachable_states): Use bitset.
6753
6754 2007-05-26 Joel E. Denny <jdenny@ces.clemson.edu>
6755
6756 * src/Makefile.am (yacc): Quote target action commands properly so
6757 that the yacc script isn't corrupt. Reported by Hans Aberg at
6758 <http://lists.gnu.org/archive/html/bug-bison/2007-05/msg00003.html>.
6759
6760 * data/glr.c (yylval): As in yacc.c, don't extern in the header for
6761 the case of pure parsers. Reported by Frans Englich at
6762 <http://lists.gnu.org/archive/html/help-bison/2007-05/msg00018.html>.
6763 * THANKS: Add Frans Englich.
6764
6765 * NEWS (2.3a+): In the %code entry, reference section `Bison
6766 Declaration Summary' from the manual now since the %code summary has
6767 moved there.
6768 * doc/bison.texinfo (Prologue Alternatives): Mention that directives
6769 in the rules section must be terminated by semicolons.
6770
6771 2007-05-20 Joel E. Denny <jdenny@ces.clemson.edu>
6772
6773 Extend the front-end API for %define variables to more completely
6774 mirror the back-end. This will be useful in the future.
6775 * data/bison.m4 (b4_percent_define_get, b4_percent_define_ifdef):
6776 Update comments to mention the new front-end counterparts of these
6777 macros.
6778 * src/muscle_tab.c (MUSCLE_COMMON_DECODE): New macro with common code
6779 for muscle_string_decode and muscle_location_decode.
6780 (muscle_string_decode): New static function.
6781 (muscle_location_decode): Use MUSCLE_COMMON_DECODE.
6782 (muscle_percent_define_get, muscle_percent_define_ifdef): New
6783 functions.
6784 (muscle_percent_define_flag_if): Use muscle_percent_define_ifdef and
6785 muscle_percent_define_get to mimic the b4_percent_define_flag_if
6786 implementation more closely.
6787 (muscle_percent_define_invalid_value): New function.
6788 * src/muscle_tab.h (muscle_percent_define_get,
6789 muscle_percent_define_ifdef, muscle_percent_define_invalid_value):
6790 Prototype.
6791
6792 2007-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
6793
6794 * NEWS (2.3a+): Mention yesterday's state-removal change.
6795 (2.3a): Remove the %language entry, which was added after 2.3a.
6796 * src/LR0.c, src/closure.c, src/closure.h, src/conflicts.c,
6797 src/conflicts.h, src/lalr.c, src/lalr.h, src/print.c,
6798 src/print_graph.c, src/state.c, src/state.h, tests/conflicts.at,
6799 tests/existing.at: Update copyright date.
6800
6801 2007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
6802
6803 If conflict resolution makes states unreachable, remove those states,
6804 report rules that are then unused, and don't report conflicts in those
6805 states.
6806 * src/conflicts.c, src/conflicts.h (conflicts_update_state_numbers):
6807 New global function.
6808 * src/lalr.c, src/lalr.h (lalr_update_state_numbers): New global
6809 function.
6810 * src/main.c (main): After conflict resolution, remove the unreachable
6811 states and update all data structures that reference states by number.
6812 * src/state.c (state_new): Initialize each state's reachable member to
6813 false.
6814 (state_mark_reachable_states): New static function.
6815 (state_remove_unreachable_states): New global function.
6816 * src/state.h (struct state): Add member bool reachable.
6817 (state_remove_unreachable_states): Prototype.
6818 * tests/conflicts.at (Unreachable States After Conflict Resolution):
6819 New test case.
6820 * tests/existing.at (GNU pic Grammar): Update test case output now that
6821 an unused rule is discovered.
6822
6823 2007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
6824
6825 Minor code cleanup in parser table construction.
6826 * src/LR0.c (new_itemsets): Use item_number_is_symbol_number.
6827 (new_itemsets, save_reductions): Update for rename to nitemset.
6828 * src/closure.c (nritemset): Rename to...
6829 (nitemset): ... this since the "r" appears to meaningless and isn't
6830 used in the comments.
6831 (closure): Update for rename.
6832 * src/closure.h (nritemset): Update extern to...
6833 (nitemset): ... this.
6834 * src/lalr.c (LA): Fix a typo in comments.
6835 * src/print.c (print_core): Update for rename to nitemset.
6836 * src/print_graph.c (print_graph): Likewise.
6837 * src/state.h: Fix some typos in header comments.
6838
6839 2007-04-04 Paul Eggert <eggert@cs.ucla.edu>
6840
6841 * THANKS: Use ASCII for Sebastien Fricker's name. Bison source
6842 still sticks to ASCII. Sorry!
6843
6844 * README-hacking: New file, taken mostly from coreutils, with changes
6845 for Bison. Contains much of the contents of:
6846 * README-cvs: Remove.
6847 * bootstrap: Sync from gnulib.
6848 * build-aux/.cvsignore: Remove *.t, mkinstalldirs.
6849 * lib/.cvsignore: Add wchar.h, wctype.h. Remove exit.h.
6850
6851 2007-03-10 Joel E. Denny <jdenny@ces.clemson.edu>
6852
6853 * doc/bison.texinfo (Destructor Decl): Fix typo reported by Sebastian
6854 Setzer.
6855 (Java Differences): Fix some typos.
6856 * THANKS: Add Sebastian Setzer.
6857
6858 2007-03-07 Paolo Bonzini <bonzini@gnu.org>
6859
6860 * data/java.m4 (b4_single_class_if): Remove.
6861 (b4_abstract_if): Look at "%define abstract".
6862 (b4_lexer_if): New.
6863 (b4_union_name): Rename...
6864 (b4_yystype): ... to this. Map to "%define stype".
6865 (b4_rhs_value, b4_parse_param_decl, b4_lex_param_decl,
6866 b4_maybe_throws): Fix quoting.
6867 (b4_lex_param_call): Move below to keep b4_*_param_decl close.
6868 * data/lalr1.java (Lexer interface): Always define.
6869 (Lexer interface within parser class): Remove.
6870 (YYLexer class): New, used when "%code lexer" is present.
6871 (constructor): When "%code lexer" is used, pass %lex-param
6872 to the lexer constructor.
6873 (yylex, yyparse): Remove %lex-param from method invocations
6874 (YYStack, yyaction, yyparse): Rename b4_union_name to b4_yystype.
6875
6876 * doc/bison.texinfo (Java Bison Interface): Mention "%define
6877 abstract". Rename "%define union_name" to "%define stype".
6878 Rename method names according to previous patch.
6879 (Java Scanner Interface): Describe "%code lexer" instead of
6880 "%pure-parser" and "%define single_class".
6881 (Java Differences): Mention "%code lexer".
6882
6883 * tests/java.at (_AT_DATA_JAVA_CALC_Y): Remove final argument.
6884 Include scanner here, using macros from tests/local.at.
6885 (AT_DATA_CALC_Y): Remove final argument.
6886 (_AT_CHECK_JAVA_CALC): Likewise.
6887 (AT_CHECK_JAVA_CALC): Likewise. Test all four combinations
6888 of %locations and %error-verbose.
6889 (main): Test with and without %lex-param.
6890 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_LEXPARAM_IF.
6891 (AT_BISON_OPTION_POPDEFS): Pop it.
6892
6893 2007-03-07 Juan Manuel Guerrero <juan.guerrero@gmx.de>
6894
6895 DJGPP spefic issue. Inhibit the use of disallowed characters for
6896 file name genertion on Win98, WinXP, etc. These are |<>":?*\
6897 and concern testsuite case 46.
6898 * Makefile.am: djgpp/testsuite.sed added to EXTRA_DIST
6899 * djgpp/testsuite.sed: Inhibit the use of disallowed characters.
6900 * djgpp/config.bat: Inhibit the use of disallowed characters.
6901
6902 2007-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
6903
6904 Miscellaneous %define and %code cleanup.
6905 * data/bison.m4 (b4_percent_define_flag_if): Correct comments on how
6906 values are interpreted.
6907 * doc/bison.texinfo (Decl Summary): Clean up and extend %define
6908 documentation a little more.
6909 * src/muscle_tab.c (MUSCLE_USER_NAME_CONVERT,
6910 muscle_percent_define_insert, muscle_percent_code_grow): New
6911 functions/macros.
6912 * src/muscle_tab.h (muscle_percent_define_insert,
6913 muscle_percent_code_grow): Prototype.
6914 * src/parse-gram.y (prologue_declaration): Use
6915 muscle_percent_define_insert and muscle_percent_code_grow when parsing
6916 %define and %code directives.
6917
6918 Make it easy to share %define boolean variables between the front-end
6919 and back-end. Though not used yet, this will be useful in the future.
6920 * data/bison.m4 (b4_check_user_names): Rewrite comments to talk about
6921 Bison uses of names rather than just skeleton uses of names.
6922 (b4_percent_define_get, b4_percent_define_ifdef): Rename
6923 b4_percent_define_skeleton_variables(VARIABLE) to
6924 b4_percent_define_bison_variables(VARIABLE).
6925 (b4_percent_code_get, b4_percent_code_ifdef): Rename
6926 b4_percent_code_skeleton_qualifiers(QUALIFIER) to
6927 b4_percent_code_bison_qualifiers(QUALIFIER).
6928 (b4_check_user_names_wrap): Update for renames.
6929 * src/muscle_tab.c, src/muscle_tab.h (muscle_percent_define_flag_if,
6930 muscle_percent_define_default): New functions mimicking
6931 b4_percent_define_flag_if and b4_percent_define_default.
6932
6933 For %define variables, report locations for invalid values and
6934 redefinitions.
6935 * data/bison.m4 (b4_percent_define_flag_if): Read
6936 b4_percent_define_loc(VARIABLE) to report the location of an invalid
6937 value for VARIABLE.
6938 (b4_percent_define_default): Save a special location in
6939 b4_percent_define_loc(VARIABLE) in case the default value for VARIABLE
6940 must later be reported as invalid.
6941 * src/muscle_tab.c (muscle_location_grow, muscle_location_decode): New
6942 functions.
6943 (muscle_percent_define_insert): Record the location of VARIABLE in
6944 muscle percent_define_loc(VARIABLE), and use it to report the previous
6945 location for a redefinition.
6946 (muscle_percent_define_flag_if): Update like b4_percent_define_flag_if.
6947 (muscle_percent_define_default): Update like b4_percent_define_default.
6948 (muscle_grow_user_name_list): Rename to...
6949 (muscle_user_name_list_grow): ... this for consistency and use
6950 muscle_location_grow.
6951 * src/muscle_tab.h (muscle_location_grow): Prototype.
6952 * tests/input.at (%define errors): Update expected output.
6953 * tests/skeletons.at (%define boolean variables: invalid skeleton
6954 defaults): New test case.
6955
6956 2007-02-28 Joel E. Denny <jdenny@ces.clemson.edu>
6957
6958 * src/print.c (lookahead_set, state_default_rule): Remove.
6959 (print_reductions): Replace state_default_rule invocation with
6960 equivalent use of yydefact, which was computed in token_actions in
6961 tables.c.
6962 (print_results): Don't allocate lookahead_set.
6963
6964 2007-02-27 Paolo Bonzini <bonzini@gnu.org>
6965
6966 * data/lalr1.java: Prefix all private members with yy.
6967
6968 2007-02-24 Joel E. Denny <jdenny@ces.clemson.edu>
6969
6970 Use YYFPRINTF instead of fprintf where appropriate. Reported by
6971 Sebastien Fricker at
6972 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00035.html>.
6973 * THANKS: Add Sebastien Fricker.
6974 * data/glr.c, data/push.c, data/yacc.c (yy_reduce_print): Implement.
6975 * doc/bison.texinfo (Tracing): Make it clearer that YYFPRINTF must
6976 accept a variable number of arguments.
6977
6978 2007-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
6979
6980 * bootstrap: Remove occurrences of .#bootmp from lib/Makefile.
6981
6982 2007-02-13 Juan Manuel Guerrero <juan.guerrero@gmx.de>
6983
6984 * djgpp/config.bat: Adjustments concerning the use of autoconf 2.61.
6985 * djgpp/config.sed: Adjustments concerning the use of autoconf 2.61.
6986 * djgpp/config.site: Adjustments concerning the use of autoconf 2.61.
6987
6988 2007-02-11 Paul Eggert <eggert@cs.ucla.edu>
6989
6990 Undo my 2007-02-07 change, switching back to the c-strcase module
6991 introduced in the 2007-02-03 change. Bruno Haible reported that
6992 the 2007-02-07 change would be dangerous in Turkish if we add a
6993 language whose name contains "i", since "i" is not lowercase "I"
6994 in Turkish.
6995 * bootstrap.conf (gnulib_modules): Add c-strcase. Remove strcase.
6996 * lib/.cvsignore: Add c-ctype.c, c-ctype.h, c-strcase.h,
6997 c-strcasecomp.c, c-strncasecmp.c. Remove strcasecmp.c, strncasecmp.c.
6998 * m4/.cvsignore: Remove strcase.m4.
6999 * src/getargs.c: Revert 2007-02-07 change, as follows.
7000 Include c-strcase.h.
7001 (language_argmatch): Use c_strcasecmp rather than strcasecmp.
7002
7003 2007-02-11 Bruno Haible <bruno@clisp.org>
7004
7005 Enable the Java related testsuite tests when the only Java compiler
7006 found is a gcj < 4.3. Discussed at
7007 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00016.html>.
7008 * configure.ac (gt_JAVACOMP): Don't specify a target_version.
7009
7010 2007-02-11 Joel E. Denny <jdenny@ces.clemson.edu>
7011
7012 * data/Makefile.am: Update copyright date.
7013 * data/push.c (yypull_parse): Report memory exhaustion and return 2 if
7014 yypstate_new returns NULL.
7015 (yypstate_new): Return NULL if malloc does.
7016 * src/reader.c (packgram): Move translation of rule actions from the
7017 beginning of packgram to...
7018 (check_and_convert_grammar): ... here right before packgram is invoked
7019 so it's easier to write more complete comments, and remove redundant
7020 code.
7021
7022 2007-02-10 Joel E. Denny <jdenny@ces.clemson.edu>
7023
7024 As in semantic actions, make @$ in %initial-action, %destructor, and
7025 %printer imply %locations.
7026 * src/scan-code.l (SC_SYMBOL_ACTION): Set locations_flag = true when
7027 scanning @$.
7028 * tests/actions.at (AT_CHECK_ACTION_LOCATIONS): New macro supporting...
7029 (@$ in %initial-action implies %locations,
7030 @$ in %destructor implies %locations,
7031 @$ in %printer implies %locations): ... these new test cases.
7032
7033 2007-02-07 Paul Eggert <eggert@cs.ucla.edu>
7034
7035 Undo most of the 2007-02-03 change, switching to the strcase module
7036 now that gnulib strcase has been fixed.
7037 * bootstrap.conf (gnulib_modules): Remove c-strcase. Add strcase.
7038 * lib/.cvsignore: Remove c-ctype.c, c-ctype.h, c-strcase.h,
7039 c-strcasecomp.c, c-strncasecmp.c. Add strcasecmp.c, strncasecmp.c
7040 * m4/.cvsignore: Add strcase.m4.
7041 * src/getargs.c: Revert 2007-02-03 change, as follows.
7042 Don't include c-strcase.h.
7043 (language_argmatch): Use strcasecmp rather than c_strcasecmp.
7044 strcasecmp has "unspecified behavior" outside the POSIX locale,
7045 but it works fine in practice if at least one argument is ASCII,
7046 as is the case in Bison.
7047
7048 2007-02-07 Paolo Bonzini <bonzini@gnu.org>
7049
7050 * tests/java.at: Skip tests if only one of javac/java is present.
7051 Reported by Joel E. Denny.
7052 * tests/atlocal.in: Adjust copyright years.
7053
7054 2007-02-05 Paolo Bonzini <bonzini@gnu.org>
7055
7056 * data/lalr1.java (Stack): Work around old verifiers that disallow
7057 access to the private fields of an inner class, from the outer class.
7058 We can make Stack's fields public because user code doesn't have access
7059 to the instance of Stack used by parse(). Reported by Paul Eggert.
7060
7061 2007-02-03 Paul Eggert <eggert@cs.ucla.edu>
7062
7063 * .cvsignore: Add javacomp.sh, javaexec.sh. Is this really
7064 the right spot for these files?
7065 * bootstrap.conf (gnulib_modules): Add c-strcase.
7066 * lib/.cvsignore: Add c-ctype.c c-ctype.h, c-strcasecomp.c,
7067 c-strncasecmp.c.
7068 * src/getargs.c: Include c-strcase.h.
7069 (language_argmatch): Use c_strcasecmp rather than strcasecmp,
7070 to avoid unspecified behavior.
7071
7072 2007-02-01 Joel E. Denny <jdenny@ces.clemson.edu>
7073
7074 * doc/bison.texinfo (Decl Summary): Correct typo.
7075
7076 2007-01-30 Paolo Bonzini <bonzini@gnu.org>
7077
7078 * data/bison.m4 (b4_percent_define_flag_if): Don't treat 0 as false.
7079 Complain if the value does not match empty, "true" or "false".
7080 * data/c++.m4: Adjust default definitions of %define variables.
7081 * data/java.m4: Adjust default definitions of %define variables.
7082 * doc/bison.texinfo (Decl Summary): Adjust the %define entry according
7083 to above behavior.
7084 * tests/input.at (Boolean %define variables): Test new behavior.
7085
7086 2007-01-29 Paolo Bonzini <bonzini@gnu.org>
7087
7088 * NEWS: Mention java.
7089 * TODO: Remove things that are done.
7090 * bootstrap.conf: Add javacomp-script and javaexec-script.
7091 * configure.ac: Invoke gt_JAVACOMP and gt_JAVAEXEC.
7092
7093 * data/Makefile.am: Add new files.
7094 * data/java-skel.m4: New.
7095 * data/java.m4: New.
7096 * data/lalr1.java: New.
7097
7098 * doc/bison.texinfo: Put "A Complete C++ Example" under
7099 C++ Parsers. Add Java Parsers. Put C++ Parsers and Java Parsers
7100 under Other Languages.
7101
7102 * src/getargs.c (valid_languages): Add Java.
7103 * src/getargs.h (struct bison_language): Update size of string fields.
7104
7105 * tests/Makefile.am: Add java.at.
7106 * tests/atlocal.in: Add CONF_JAVA and CONF_JAVAC.
7107 * tests/java.at: New.
7108 * tests/testsuite.at: Include it.
7109
7110 2007-01-28 Joel E. Denny <jdenny@ces.clemson.edu>
7111
7112 Clean up.
7113 * src/scan-skel.l (at_directive_perform): Add at_directive_argc and
7114 at_directive_argv arguments so these no longer have to be global
7115 variables. Also, update the implementation for the following changes.
7116 (fail_for_at_directive_too_many_args,
7117 fail_for_at_directive_too_few_args): Add at_directive_name argument.
7118 (at_directive_name): Remove as at_directive_argv[0] will be used for
7119 this now.
7120 (AT_DIRECTIVE_ARGC_MAX): Increment to make space in at_directive_argv
7121 for the directive name.
7122 (at_directive_argc, at_directive_argv): Make these local within
7123 skel_lex instead of global.
7124 (INITIAL): Update directive start action for above changes.
7125 (SC_AT_DIRECTIVE_ARG): Rename to...
7126 (SC_AT_DIRECTIVE_ARGS): ... this, and update for above changes.
7127 (SC_AT_DIRECTIVE_SKIP_WS): Update.
7128 (scan_skel): Move yylex_destroy to...
7129 (skel_scanner_free): ... here.
7130 * tests/skeletons.at (installed skeleton file name): Rename to...
7131 (installed skeleton file names): ... this.
7132
7133 2007-01-27 Joel E. Denny <jdenny@ces.clemson.edu>
7134
7135 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
7136 node names: say "Table of Symbols" not "Bison Symbols", and say "Decl
7137 Summary" not "Directives".
7138 * doc/bison.texinfo (Decl Summary, Calc++ Parser): Cross-reference the
7139 %code entry in "Decl Summary" rather than the one in "Table of Symbols"
7140 since the former is now the more complete one.
7141 (Prologue Alternatives): Likewise and do the same for %defines.
7142 (Table of Symbols): Add summary of %code, add summary of %define, and
7143 move full %code documentation to...
7144 (Decl Summary): ... here for consistency with other entries in these
7145 sections.
7146 Move %define entry in order to keep this list alphabetized.
7147 Reword %define entry a little to put less emphasis on the skeleton
7148 concept, which most users shouldn't have to think about.
7149
7150 2007-01-26 Paul Eggert <eggert@cs.ucla.edu>
7151
7152 Adjust to recent gnulib changes.
7153 * lib/.cvsignore: Remove stpcpy.h, strndup.h, strnlen.h.
7154 Add string.h, string_.h, unistd_.h, wchar_.h.
7155 * m4/.cvsignore: Add gnulib-common.m4, string_h.m4, wchar.m4.
7156 * src/system.h: Don't include <stpcpy.h>; this is now done by
7157 <string.h>.
7158
7159 2007-01-23 Paolo Bonzini <bonzini@gnu.org>
7160
7161 Simplify implementation of unqualified %code, implement macros for
7162 uniform treatment of boolean %define flags. Document %define.
7163 * data/bison.m4 (b4_percent_define_ifdef, b4_percent_define_flag_if,
7164 b4_percent_code_ifdef): New.
7165 (b4_percent_code_get): Map unqualified %code to b4_percent_code().
7166 * data/c++.m4: Define default value for global_tokens_and_yystype.
7167 * data/glr.cc: Likewise.
7168 * data/location.cc: Use b4_percent_define_flag_if.
7169
7170 * doc/bison.texinfo (Decl Summary): Document %define.
7171
7172 * src/parse-gram.y (Unqualified %code): Change muscle name to
7173 b4_percent_code().
7174 (content.opt): Default to empty.
7175
7176 2007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
7177
7178 Implement support for relative and absolute skeleton file names.
7179 Discussed starting at
7180 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00071.html>.
7181 * doc/bison.texinfo (Decl Summary): Document in %skeleton entry.
7182 (Bison Options): Document in --skeleton entry.
7183 * src/output.c (output_skeleton): Use strncpy rather than strcpy since
7184 full_skeleton can't necessarily hold all of pkgdatadir.
7185 If the specified skeleton file name contains a `/', don't prepend
7186 pkgdatadir.
7187 * src/parse-gram.y (prologue_declaration): If the specified skeleton
7188 file name contains a `/', prepend the grammar file directory.
7189 * tests/Makefile.am (TESTSUITE_AT): Add skeletons.at.
7190 * skeletons.at: New file.
7191 (relative skeleton file names): New test case.
7192 (installed skeleton file names): New test case.
7193 * tests/testsuite.at: Include skeletons.at.
7194
7195 * bootstrap: Update copyright to 2007.
7196
7197 2007-01-17 Paolo Bonzini <bonzini@gnu.org>
7198
7199 * bootstrap: Remove occurrences of .#bootmp from the files.
7200
7201 2007-01-17 Akim Demaille <akim@epita.fr>
7202
7203 * doc/bison.texinfo (Calc++ Parser): Don't try to alias
7204 nonterminals.
7205 Use per-type %printer.
7206
7207 2007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
7208
7209 * NEWS, data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4,
7210 data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
7211 djgpp/config.site, src/files.c, src/files.h, src/main.c,
7212 src/muscle_tab.c, src/muscle_tab.h, src/parse-gram.y, src/reader.h,
7213 src/scan-skel.h, src/scan-skel.l, tests/actions.at, tests/calc.at,
7214 tests/glr-regression.at, tests/input.at, tests/local.at,
7215 tests/output.at, tests/torture.at: Update copyright to 2007.
7216
7217 2007-01-16 Akim Demaille <akim@epita.fr>
7218
7219 * doc/bison.texinfo (Calc++ Parsing Driver): Let "parse" return an
7220 error code.
7221 (Calc++ Scanner): Exit with failure if we can't open the input
7222 file.
7223 Accept "-" standing for stdin.
7224 (Calc++ Top Level): Print the result only if the parsing was
7225 successful.
7226
7227 2007-01-16 Akim Demaille <akim@epita.fr>
7228
7229 * data/lalr1.cc (yy_reduce_print_): Add a missing end-of-line.
7230
7231 2007-01-15 Paolo Bonzini <bonzini@gnu.org>
7232 and Joel E. Denny <jdenny@ces.clemson.edu>
7233
7234 Clean up %define and %code implementation in M4 some. Most
7235 importantly, rename all related macros to be in the b4_percent_define
7236 and b4_percent_code namespaces. Also, complete support for `.' in
7237 %define variable names and %code qualifiers.
7238 * data/bison.m4 (b4_check_user_names): Check for special
7239 "SKELETON-NAMESPACE(name)" macros instead of using two nested
7240 m4_foreach loops.
7241 (b4_get_percent_define, b4_get_percent_code): Rename to...
7242 (b4_percent_define_get, b4_percent_code_get): ... these.
7243 Extend documentation with examples.
7244 For SKELETON-NAMESPACE (as documented for b4_check_user_names), use
7245 b4_percent_define_skeleton_variables and
7246 b4_percent_code_skeleton_qualifiers.
7247 Expect any value for the %define variable `foo' to be stored in the
7248 macro named `b4_percent_define(foo)'; expect any %code blocks for the
7249 qualifier `foo' to be stored in a macro named `b4_percent_code(foo)';
7250 expect any unqualified %code blocks to be stored in a macro named
7251 `b4_percent_code_unqualified'.
7252 Use m4_indir so that %define variable names and %code qualifiers can
7253 contain `.', which is allowed by the grammar parser.
7254 (b4_percent_define_default): New macro to set a default value for a
7255 %define variable.
7256 (m4_wrap): Update wrapped code, and fix some underquoting.
7257 (b4_check_user_names_wrap): Update and define outside the m4_wrap.
7258 Expect grammar uses of %define variables and %code qualifiers to be
7259 defined in b4_percent_define_user_variables and
7260 b4_percent_code_user_qualifiers.
7261 * data/c++.m4: Use b4_percent_define_default rather than
7262 m4_define_default. Fix some underquoting. Skeleton usage of %define
7263 variable define_location_comparison now implies skeleton usage of
7264 %define variable filename_type.
7265 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
7266 data/push.c, data/yacc.c: Update macro names.
7267 * src/parse-gram.y (prologue_declaration, grammar_declaration): Update
7268 muscle names.
7269
7270 2007-01-14 Juan Manuel Guerrero <juan.guerrero@gmx.de>
7271
7272 DJGPP specific issues.
7273
7274 * djgpp/config.site: Set ac_cv_path_mkdir to a sane DJGPP specific
7275 default. Set gl_cv_absolute_wctype_h to a sane DJGPP specific default.
7276
7277 2007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
7278
7279 * tests/glr-regression.at: Use AT_PARSER_CHECK rather than AT_CHECK to
7280 run parsers in all tests so that Valgrind is invoked during
7281 maintainer-check-valgrind.
7282 (Duplicate representation of merged trees): Free all semantic values.
7283 (Duplicated user destructor for lookahead): Likewise.
7284
7285 2007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
7286
7287 * tests/local.at (AT_PARSER_CHECK): Add a PRE argument to specify a
7288 command-line prefix.
7289 * tests/torture.at (Exploding the Stack Size with Alloca): Stderr is
7290 ignored, so use that PRE to set --log-fd=1 in VALGRIND_OPTS so we don't
7291 miss Valgrind messages.
7292 (Exploding the Stack Size with Malloc): Likewise.
7293
7294 2007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
7295
7296 Ignore YYSTACK_USE_ALLOCA for push parsers since the stacks can't be
7297 locals. Reported by Juan Manuel Guerrero at
7298 <http://lists.gnu.org/archive/html/bug-bison/2007-01/msg00000.html>.
7299 * data/push.c: Enclose the #ifdef YYSTACK_USE_ALLOCA in b4_push_if.
7300 Fix some indentation also.
7301 * tests/torture.at (Exploding the Stack Size with Alloca): Add comment
7302 explaining this issue.
7303
7304 2007-01-09 Paolo Bonzini <bonzini@gnu.org>
7305 and Joel E. Denny <jdenny@ces.clemson.edu>
7306
7307 Simplify union and prologue handling, and escape union and lex/parse
7308 params with digraphs.
7309 * data/bison.m4 (b4_pre_prologue, b4_post_prologue): Set their default
7310 values to the empty string since these are no longer guaranteed
7311 initialized by the front-end.
7312 * data/glr.c, data/glr.cc, data/lalr1.cc, data/push.c, data/yacc.c: Add
7313 braces around b4_user_stype since this is no longer done by the
7314 front-end.
7315 * src/files.c, src/files.h (pre_prologue_obstack,
7316 post_prologue_obstack): Remove.
7317 * src/muscle_tab.c (muscle_pair_list_grow): Don't duplicate header
7318 comments here. Use MUSCLE_OBSTACK_SGROW so that values are escaped
7319 with digraphs. This fixes lex params and parse params.
7320 * src/muscle_tab.h (muscle_pair_list_grow): Update comments.
7321 * src/output.c (prepare): Remove muscle insertion of the prologues.
7322 (output): Remove freeing of pre_prologue_obstack and
7323 post_prologue_obstack.
7324 * src/parse-gram.y (prologue_declaration): Use muscle_code_grow rather
7325 than prologue_augment for prologue parsing so you don't need prologue
7326 obstacks.
7327 (grammar_declaration): For %union RHS, use `braceless' instead of
7328 "{...}" so that braces are already stripped and code is escaped with
7329 digraphs.
7330 * src/reader.c (prologue_augment): Remove.
7331 (reader): Remove initialization of pre_prologue_obstack and
7332 post_prologue_obstack.
7333 * src/reader.h (prologue_augment): Remove.
7334
7335 * data/c.m4: Remove stray parenthesis.
7336
7337 2007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
7338
7339 Remove quotes from variables names in %define directives and from
7340 qualifiers in %code directives, and restrict the characters that are
7341 allowed in them to M4-friendly ones. For %define, continue to support
7342 the quoted form as a deprecated feature. Discussed starting at
7343 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00023.html>.
7344 * NEWS (2.3a+): Add entry for the change to %define. Update entry for
7345 %code.
7346 * doc/bison.texinfo (Prologue Alternatives): Update.
7347 (Decl Summary): In %defines entry, update mention of `%code requires'
7348 and `%code provides'.
7349 (C++ Location Values): Update %define uses.
7350 (Calc++ Parser Interface): Likewise.
7351 (Calc++ Parser): Likewise, and update `%code requires' uses.
7352 (Table of Symbols): Update %code documentation.
7353 * src/parse-gram.y (prologue_declaration): For %define variables, use
7354 `variable' instead of `STRING'.
7355 (grammar_declaration): For %code qualifiers, use `ID' instead of
7356 `STRING'.
7357 (variable): New nonterminal that takes an `ID' or a `STRING'.
7358 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update %code
7359 and %define uses.
7360 * tests/calc.at (_AT_DATA_CALC_Y): Update %define use.
7361 * tests/input.at (Reject unused %code qualifiers): Update %code uses.
7362 (%define errors): Update %define uses.
7363
7364 2007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
7365
7366 * src/parse-gram.y (prologue_declaration): Use MUSCLE_INSERT_STRING
7367 instead of muscle_insert for %define values so that M4-special
7368 characters are replaced with digraphs.
7369 * tests/input.at (%define errors): Extend to check weird values.
7370
7371 2007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
7372
7373 Instead of having skeletons declare all valid %define variables and
7374 %code qualifiers, provide macros that retrieve the associated values
7375 and build these lists automatically. Thus Bison will now warn when a
7376 variable or qualifier is not used by the skeleton in the current
7377 invocation regardless of whether it might sometimes be used by that
7378 skeleton in other invocations. Also, move all %define value macros to
7379 the b4_percent_define_ namespace, and remove the %define "NAME" {CODE}
7380 form, which is replaced by %code.
7381 * data/bison.m4 (b4_check_for_unrecognized_names): Rename to...
7382 (b4_check_user_names): ... this, and change the series of valid name
7383 arguments to a single list argument for names used in the skeleton
7384 similar to the existing list argument for names used in the grammar.
7385 Warn instead of complaining.
7386 (b4_get_percent_define, b4_get_percent_code): New to retrieve %define
7387 values and %code code, to format %code code properly, and to build
7388 lists of all %define variables and %code qualifiers used in the
7389 skeleton: b4_skeleton_percent_define_variables and
7390 b4_skeleton_percent_code_qualifiers.
7391 (b4_check_percent_define_variables, b4_check_percent_code_qualifiers):
7392 Remove, and...
7393 (m4_wrap): ... m4_wrap b4_check_user_names invocations instead so that
7394 the skeleton names lists can finish building first. In place of
7395 b4_used_percent_define_variables and b4_used_percent_code_qualifiers,
7396 expect the lists b4_user_percent_define_variables and
7397 b4_user_percent_code_qualifiers.
7398 * data/c++.m4: Where setting default values for b4_parser_class_name,
7399 b4_location_type, b4_filename_type, b4_namespace, and
7400 b4_define_location_comparison, update their names to the
7401 b4_percent_define_ namespace.
7402 * data/glr.c: Don't use b4_check_percent_define_variables and
7403 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
7404 * data/glr.cc, data/lalr1.cc: Likewise, and use b4_get_percent_define.
7405 (b4_parser_class_name, b4_namespace): Define these using
7406 b4_get_percent_define for parser_class_name and namespace.
7407 * data/location.cc: Use b4_get_percent_define.
7408 * data/push.c: Don't use b4_check_percent_define_variables and
7409 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
7410 * data/yacc.c: Likewise, and don't call m4_exit in
7411 b4_use_push_for_pull_if or m4_wrap code will never execute.
7412 * src/muscle_tab.c, src/muscle_tab.h (muscle_grow_used_name_list):
7413 Rename to...
7414 (muscle_grow_user_name_list): ... this for consistency with the
7415 terminology used in bison.m4.
7416 * src/parse-gram.y (prologue_declaration): Prepend "percent_define_" to
7417 %define variable names, and rename muscle used_percent_define_variables
7418 to user_percent_define_variables.
7419 (grammar_declaration): Rename muscle used_percent_code_qualifiers to
7420 user_percent_code_qualifiers.
7421 (content): Remove.
7422 (content.opt): Replace content RHS with STRING RHS so %define "NAME"
7423 {CODE} form is no longer accepted.
7424 * tests/input.at (Reject bad %code qualifiers): Rename to...
7425 (Reject unused %code qualifiers): ... this, and update test output.
7426 (%define error): Update test output.
7427
7428 2007-01-07 Joel E. Denny <jdenny@ces.clemson.edu>
7429
7430 Check for unrecognized %define variables similar to checking for
7431 unrecognized %code qualifiers. Check for redefined %define variables.
7432 * data/bison.m4 (b4_check_for_unrecognized_names): New macro that
7433 generalizes...
7434 (b4_check_percent_code_qualifiers): ... this, which now wraps it.
7435 (b4_check_percent_define_variables): New, also wraps it.
7436 * data/glr.c: Unless glr.cc is wrapping glr.c, declare no valid %define
7437 variables using b4_check_percent_define_variables.
7438 * data/glr.cc, data/lalr1.cc: Declare the valid %define variables as
7439 all those exercised in the test suite and all those listed in the
7440 `Default values' section of c++.m4. Are there others?
7441 * data/push.c, data/yacc.c: Declare no valid %define variables.
7442 * src/muscle_tab.c, src/muscle_tab.h (muscle_find_const): New function,
7443 similar to muscle_find, but it works even when the muscle stores a
7444 const value.
7445 (muscle_grow_used_name_list): New function for constructing the used
7446 name list muscles that b4_check_for_unrecognized_names requires.
7447 * src/parse-gram.y (prologue_declaration): Warn if a variable is
7448 %define'd more than once. Define the b4_used_percent_define_variables
7449 muscle with muscle_grow_used_name_list.
7450 (grammar_declaration): Abbreviate %code code with
7451 muscle_grow_used_name_list.
7452 * tests/input.at (%define errors): New.
7453
7454 2007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
7455
7456 Provide warn_at, complain_at, and fatal_at function callbacks to the
7457 skeletons, and use this for %code qualifier complaints.
7458 * data/bison.m4 (b4_error_at): New, invoked by...
7459 (b4_warn_at, b4_complain_at, b4_fatal_at): ... these new macros to wrap
7460 the skeleton scanner's new @warn_at(...@), @complain_at(...@), and
7461 @fatal_at(...@) directives.
7462 (b4_check_percent_code_qualifiers): Rewrite to expect locations for
7463 qualifiers in b4_used_percent_code_qualifiers and to use
7464 b4_complain_at.
7465 * src/location.c, src/location.h (boundary_set_from_string): New global
7466 function.
7467 * src/muscle_tab.c, src/muscle_tab.h (muscle_boundary_grow): New global
7468 function.
7469 * src/parse-gram.y (grammar_declaration): Add locations for qualifiers
7470 to b4_used_percent_code_qualifiers.
7471 * src/scan-skel.l (fail_for_at_directive_too_few_args): New static
7472 function.
7473 (AT_DIRECTIVE_ARGC_MAX): Increase for boundary arguments.
7474 (lineno): Rename to...
7475 (out_lineno): ... this so I don't misunderstand it again.
7476 (SC_AT_DIRECTIVE_SKIP_WS): Don't increment out_lineno for newlines
7477 here; these newlines are in the input but not the output file.
7478 (SC_AT_DIRECTIVE_ARG): Likewise. Extract directive execution to...
7479 (at_directive_perform): ... this new static function, and add handling
7480 of new @warn_at(...@), @complain_at(...@), and @fatal_at(...@)
7481 directives.
7482 * tests/input.at (Reject bad %code qualifiers): Update test output with
7483 locations and extend.
7484
7485 * tests/output.at (Output file name: [, Output file name: ]): Remove
7486 bogus comment about these tests failing.
7487
7488 2007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
7489
7490 Clean up b4_check_percent_code_qualifiers a little.
7491 * data/bison.m4 (b4_check_percent_code_qualifiers): Expect qualifiers
7492 in b4_used_percent_code_qualifiers to be double-M4-quoted. Rewrite
7493 documentation and add examples.
7494 * src/parse-gram.y (grammar_declaration): Double-M4-quote those
7495 qualifiers here.
7496
7497 2007-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
7498
7499 Don't use m4_divert since it makes m4_divert_push and m4_divert_pop
7500 unreliable -- especially when they're hidden inside another macro.
7501 * data/bison.m4, data/c++-skel.m4, data/c++.m4, data/c-skel.m4,
7502 data/c.m4: Remove m4_divert(-1).
7503 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
7504 data/push.c, data/yacc.c: Likewise, and replace m4_divert(0) with
7505 m4_divert_push(0) and m4_divert_pop(0).
7506 * src/output.c (output_skeleton): Don't add an m4_divert_push(0) and
7507 an m4_wrap([m4_divert_pop(0)]) to the M4. Diversion -1, which is
7508 pushed and popped by m4sugar, should be first on the stack.
7509
7510 Provide warn, complain, and fatal function callbacks to the skeletons.
7511 This provides more flexibility than m4_fatal, improves the error
7512 message format, and captures messages for translation. Discussed
7513 starting at
7514 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00063.html>.
7515 * data/bison.m4 (b4_error): New, invoked by...
7516 (b4_warn, b4_complain, b4_fatal): ... these new macros to wrap the
7517 skeleton scanner's new @warn(...@), @complain(...@), and @fatal(...@)
7518 directives. Because these M4 macros might be called when the current
7519 diversion is -1 or 0, m4_divert_push and m4_divert_pop is used; thus
7520 the previous removal of uses of m4_divert, which caused trouble.
7521 (b4_check_percent_code_qualifiers): Use b4_complain instead of
7522 m4_fatal to report unrecognized %code qualifiers.
7523 * data/c++-skel.m4: Use b4_complain instead of m4_fatal to report C++
7524 push parser requests.
7525 * data/glr.c: Use b4_complain instead of m4_fatal to report
7526 non-deterministic push parser requests.
7527 Update @output usage to @output(...@) form.
7528 * data/glr.cc, data/lalr1.cc: Use b4_fatal instead of m4_fatal to
7529 report missing %defines. Update @output usage to @output(...@) form.
7530 * data/location.cc, data/push.c, data/yacc.c: Update @output usage to
7531 @output(...@) form.
7532 * src/main.c (main): Invoke skel_scanner_free.
7533 * src/scan-skel.h (skel_scanner_free): Prototype new function.
7534 * src/scan-skel.l (FLEX_NO_OBSTACK): Don't define; we now need the
7535 obstack_for_string from flex-scanner.h.
7536 (YY_DECL): Use to declare skel_lex static.
7537 (decode_at_digraphs): Remove; now handled in the new
7538 SC_AT_DIRECTIVE_ARG start condition.
7539 (fail_for_at_directive_too_many_args, fail_for_invalid_at): New static
7540 functions.
7541 (at_directive_name, AT_DIRECTIVE_ARGC_MAX, at_directive_argc,
7542 at_directive_argv): New static globals.
7543 (INITIAL): Use fail_for_invalid_at.
7544 Don't parse `@output file_name\n' or `@basename(...@)'. Instead,
7545 recognize the start of a generalized `@directive(...@)' form and
7546 start...
7547 (SC_AT_DIRECTIVE_ARG): ... this new start condition to parse the
7548 directive args (using the new obstack_for_string), to decode the
7549 contained @ diagraphs, and to perform the directive. It recognizes
7550 @basename(...@), @warn(...@), @complain(...@), @fatal(...@), and
7551 @output(...@).
7552 (SC_AT_DIRECTIVE_SKIP_WS): New start condition started by
7553 SC_AT_DIRECTIVE_ARG to skip whitespace after the argument delimiter,
7554 `@,'.
7555 (scan_skel): Initialize obstack_for_string on the first call.
7556 (skel_scanner_free): New function to free obstack_for_string.
7557 * tests/input.at (Reject bad %code qualifiers): Update test output.
7558
7559 2007-01-04 Joel E. Denny <jdenny@ces.clemson.edu>
7560
7561 Consolidate the 4 prologue alternative directives (%code, %requires,
7562 %provides, and %code-top) into a single %code directive with an
7563 optional qualifier field. Discussed at
7564 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00012.html>.
7565 * NEWS (2.3a+): Rewrite the existing entry for the prologue
7566 alternatives.
7567 * doc/bison.texinfo (Prologue Alternatives): Update.
7568 (Decl Summary): Update to %code "requires" and %code "provides".
7569 (Calc++ Parser): Update to %code "requires".
7570 (Table of Symbols): Remove entries for %requires, %provides, and
7571 %code-top. Rewrite %code entry, and add a %code "QUALIFIER" entry.
7572 * data/bison.m4 (b4_user_provides, b4_user_requires): Remove as these
7573 are replaced by b4_percent_code_provides and b4_percent_code_requires,
7574 which are skeleton-specific.
7575 (b4_check_percent_code_qualifiers): New. A skeleton can use this to
7576 declare what %code qualifiers it supports and to complain if any other
7577 qualifiers were used in the grammar.
7578 * data/glr.cc: Update to use b4_user_code([b4_percent_code_requires])
7579 and b4_user_code([b4_percent_code_provides]) in place of
7580 b4_user_requires and b4_user_provides.
7581 * data/glr.c, data/lalr1.cc, data/push.c, data/yacc.c: Likewise.
7582 Add b4_user_code([b4_percent_code_top]) and
7583 b4_user_code([b4_percent_code]).
7584 Invoke b4_check_percent_code_qualifiers.
7585 * src/parse-gram.y (PERCENT_CODE_TOP, PERCENT_PROVIDES,
7586 PERCENT_REQUIRES): Remove.
7587 (grammar_declaration): Remove RHS's for %code-top, %provides, and
7588 %requires. Rewrite the %code RHS as the unqualified form defining the
7589 muscle b4_percent_code. Add another RHS for the qualified %code form,
7590 which defines muscles of the form b4_percent_code_QUALIFIER and the
7591 b4_used_percent_code_qualifiers muscle.
7592 * src/scan-gram.l (PERCENT_CODE_TOP, PERCENT_PROVIDES,
7593 PERCENT_REQUIRES): Remove.
7594 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update to use
7595 %code "requires" and %code "provides".
7596 * tests/input.at (Reject bad %code qualifiers): New.
7597
7598 2007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
7599
7600 Use the new code_props interface for destructors and printers.
7601 * src/symtab.h (symbol, semantic_type): Remove destructor_location and
7602 printer_location members, and change the type of the destructor and
7603 printer members to code_props.
7604 (symbol_destructor_set, symbol_destructor_get, symbol_printer_set,
7605 symbol_printer_get, semantic_type_destructor_set,
7606 semantic_type_printer_set, default_tagged_destructor_set,
7607 default_tagless_destructor_set, default_tagged_printer_set,
7608 default_tagless_printer_set): Use code_props in arguments and return
7609 types in place of char const * and location.
7610 (symbol_destructor_location_get, symbol_printer_location_get): Remove
7611 since the locations are now contained in the return of
7612 symbol_destructor_get and symbol_printer_get.
7613 * src/output.c (symbol_destructors_output, symbol_printers_output):
7614 Replace with...
7615 (symbol_code_props_output): ... this to eliminate duplicate code.
7616 (output_skeleton): Update to use symbol_code_props_output.
7617 * src/reader.c (symbol_should_be_used): Update use of
7618 symbol_destructor_get.
7619 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
7620 Update uses of the various _destructor_set and _printer_set functions.
7621 * src/symtab.c: (default_tagged_destructor_location,
7622 default_tagless_destructor_location, default_tagged_printer_location,
7623 default_tagless_printer_location): Remove since we...
7624 (default_tagged_destructor, default_tagless_destructor,
7625 default_tagged_printer, default_tagless_printer): ... change the type
7626 of these to code_props.
7627 (symbol_new, semantic_type_new, symbol_destructor_set,
7628 semantic_type_destructor_set, symbol_destructor_get,
7629 symbol_printer_set, semantic_type_printer_set, symbol_printer_get,
7630 symbol_check_alias_consistency, default_tagged_destructor_set,
7631 default_tagless_destructor_set, default_tagged_printer_set,
7632 default_tagless_printer_set): Update.
7633 (symbol_destructor_location_get, symbol_printer_location_get): Remove.
7634 (SYMBOL_CODE_PRINT): New similar to SYMBOL_ATTR_PRINT but for
7635 code_props members.
7636 (symbol_print): Use SYMBOL_CODE_PRINT.
7637
7638 2007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
7639
7640 Use the new code_props interface for rule actions.
7641 * src/symlist.h (symbol_list): Replace action, action_location, and
7642 used members with a code_props action_props member.
7643 * src/reader.c (symbol_should_be_used, grammar_rule_check,
7644 grammar_midrule_action, grammar_current_rule_merge_set,
7645 grammar_current_rule_symbol_append, packgram): Update.
7646 * src/scan-code.h (translate_rule_action): Remove, no longer used.
7647 * src/scan-code.l (handle_action_dollar): Update.
7648 (translate_rule_action): Remove, no longer used.
7649 * src/symlist.c (symbol_list_sym_new, symbol_list_syms_print): Update.
7650
7651 2007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
7652
7653 Use the new code_props interface in parse-gram.y.
7654 * src/parse-gram.y (prologue_declaration, braceless, epilogue.opt):
7655 Update all uses of translate_* functions to use the new code_props
7656 interface and to use gram_scanner_last_string_free and
7657 code_scanner_last_string_free where possible.
7658 (grammar_declaration): symbol_list_destructor_set and
7659 symbol_list_printer_set now perform the translation, so don't do it
7660 here. Use gram_scanner_last_string_free where possible.
7661 * src/scan-code.h, src/scan-code.l (translate_symbol_action,
7662 translate_code): Remove, no longer used.
7663 * src/symlist.h, src/symlist.c (symbol_list_destructor_set,
7664 symbol_list_printer_set): Perform code translation here rather than
7665 depending on the caller to do so.
7666
7667 * src/symlist.h (struct symbol_list): Correct some documentation typos.
7668 * src/scan-gram.h (gram_last_string): Remove declaration.
7669 * src/scan-gram.l (last_string): Declare it static.
7670
7671 2007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
7672
7673 Encapsulate code properties and related functionality for the various
7674 destructors, printers, and actions into a code_props structure and
7675 interface. This patch merely implements code_props in scan-code.h and
7676 scan-code.l. Future patches will rewrite other modules to use it.
7677 Discussed starting at
7678 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00020.html>.
7679 * src/location.h (EMPTY_LOCATION_INIT): Define so that it's easier to
7680 consistently initialize const structs that have an empty location
7681 field.
7682 * src/location.c (empty_location): Initialize with EMPTY_LOCATION_INIT
7683 to ensure consistency.
7684 * src/scan-code.h (code_props): New structure.
7685 (code_props_none_init, CODE_PROPS_NONE_INIT, code_props_none): New
7686 function, macro, and const global variable for initializing a
7687 code_props with no code.
7688 (code_props_plain_init, code_props_symbol_action_init,
7689 code_props_rule_action_init, code_props_translate_code): The rest of
7690 the new code_props functional interface. Among other things, the init
7691 functions set the code_props kind field so that
7692 code_props_translate_code will know whether to behave like
7693 translate_symbol_action, translate_rule_action, or translate_code.
7694 These old translate functions must remain until all other modules are
7695 updated to use the new code_props interface.
7696 (code_scanner_last_string_free): New function similar to
7697 gram_scanner_last_string_free.
7698 (code_scanner_free): Add documentation.
7699 * src/scan-code.l: Implement the new interface.
7700 (code_lex): Make it static, add a code_props* argument, and remove the
7701 rule argument.
7702 (last_string): New static global similar to the one in scan-gram.l.
7703 (SC_RULE_ACTION): Update to use the code_props* argument to code_lex
7704 instead of rule.
7705 (SC_SYMBOL_ACTION): For $$, set the is_value_used member of the
7706 code_props since Bison may one day use this information for destructors
7707 and printers.
7708 (<*><<EOF>>): Use STRING_FINISH so that last_string is set.
7709 (handle_action_dollar): Use symbol_list_n_get and set used flag
7710 directly since symbol_list_n_used_set is removed.
7711 (translate_action): Add a code_props* argument and remove the rule,
7712 action, and location arguments. Pass the code_props* on to code_lex.
7713 (translate_rule_action, translate_symbol_action, translate_code):
7714 Rewrite as wrappers around the new code_props interface.
7715 * src/symlist.h, src/symlist.c (symbol_list_n_used_set): Remove since
7716 it would eventually need to break the encapsulation of code_props.
7717
7718 2007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
7719
7720 * etc/.cvsignore: New.
7721
7722 2007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
7723
7724 Add maintainer-push-check to run maintainer-check using push parsing in
7725 place of pull parsing where available.
7726 * Makefile.am (maintainer-push-check): New.
7727 * data/bison.m4 (b4_use_push_for_pull_if): New.
7728 * data/push.c: Redefine b4_push_if and b4_use_push_for_pull_if
7729 appropriately based on their existing values.
7730 (yypush_parse): Don't print push-parser-specific diagnostics if push
7731 parsing is being used in place of pull parsing.
7732 * data/yacc.c: If push parsing should replace pull parsing, redirect to
7733 push.c.
7734 * src/output.c (prepare): Check BISON_USE_PUSH_FOR_PULL environment
7735 variable, and insert b4_use_push_for_pull_flag into muscles.
7736 * tests/Makefile.am (maintainer-push-check): New.
7737
7738 2006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
7739
7740 * data/push.c (yypush_parse): Set yynew = 1 at the end of a parse
7741 (whether successful or failed) so that yypush_parse can be invoked
7742 again to start a new parse using the same yypstate.
7743 * tests/torture.at (AT_DATA_STACK_TORTURE): For push mode, extend to
7744 check multiple yypull_parse invocations on the same yypstate. For pull
7745 mode, extend to check multiple yyparse invocations.
7746 (Exploding the Stack Size with Alloca): Extend to try with
7747 %push-pull-parser.
7748 (Exploding the Stack Size with Malloc): Likewise.
7749
7750 * tests/calc.at (Simple LALR Calculator): Don't specify
7751 %skeleton "push.c" since %push-pull-parser implies that now.
7752 * tests/headers.at (export YYLTYPE): Don't check for the push
7753 declarations. Otherwise, this test case can't be used to see if push
7754 mode can truly emulate pull mode.
7755 * tests/input.at (Torturing the Scanner): Likewise.
7756 * tests/local.at (AT_YACC_OR_PUSH_IF, AT_PUSH_IF): Remove.
7757 (AT_YYERROR_SEES_LOC_IF): Rather than AT_YACC_OR_PUSH_IF, use
7758 AT_YACC_IF, which now includes the case of push mode since %skeleton
7759 need not be used for push mode. This will be more intuitive once
7760 push.c is renamed to yacc.c.
7761
7762 2006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
7763
7764 For push mode, convert yyparse from a macro to a function, invoke yylex
7765 instead of passing a yylexp argument to yypull_parse, and don't
7766 generate yypull_parse or yyparse unless %push-pull-parser is declared.
7767 Discussed starting at
7768 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00163.html>.
7769 * data/bison.m4 (b4_pull_if): New.
7770 * data/c.m4 (b4_identification): Define YYPULL similar to YYPUSH.
7771 * data/push.c: Improve M4 quoting a little.
7772 (b4_generate_macro_args, b4_parenthesize): Remove.
7773 (yyparse): If there's a b4_prefix, #define this to b4_prefix[parse]
7774 any time a pull parser is requested.
7775 Don't #define this as a wrapper around yypull_parse. Instead, when
7776 both push and pull are requested, make it a function that does that
7777 same thing.
7778 (yypull_parse): If there's a b4_prefix, #define this to
7779 b4_prefix[pull_parse] when both push and pull are requested.
7780 Don't define this as a function unless both push and pull are
7781 requested.
7782 Remove the yylexp argument and hard-code yylex invocation instead.
7783 * etc/bench.pl.in (bench_grammar): Use %push-pull-parser instead of
7784 %push-parser.
7785 * src/getargs.c (pull_parser): New global initialized to true.
7786 * getargs.h (pull_parser): extern it.
7787 * src/output.c (prepare): Insert pull_flag muscle.
7788 * src/parse-gram.y (PERCENT_PUSH_PULL_PARSER): New token.
7789 (prologue_declaration): Set both push_parser and pull_parser = true for
7790 %push-pull-parser. Set push_parser = true and pull_parser = false for
7791 %push-parser.
7792 * src/scan-gram.l: Don't accept %push_parser as an alternative to
7793 %push-parser since there's no backward-compatibility concern here.
7794 Scan %push-pull-parser.
7795 * tests/calc.at (Simple LALR(1) Calculator): Use %push-pull-parser
7796 instead of %push-parser.
7797 * tests/headers.at (export YYLTYPE): Make yylex static, and don't
7798 prototype it in the module that calls yyparse.
7799 * tests/input.at (Torturing the Scanner): Likewise.
7800 * tests/local.at (AT_PUSH_IF): Check for %push-pull-parser as well.
7801
7802 2006-12-26 Joel E. Denny <jdenny@ces.clemson.edu>
7803
7804 Update etc/bench.pl. Optimize push mode a little (the yyn change
7805 deserves most of the credit).
7806 * Makefile.am (SUBDIRS): Add etc subdirectory.
7807 * configure.ac (AC_CONFIG_FILES): Add etc/bench.pl and etc/Makefile.
7808 * data/push.c (b4_declare_parser_state_variables): Move yyn, yyresult,
7809 yytoken, yyval, and yyloc declarations to...
7810 (yyparse or yypush_parse): ... here to improve performance. For
7811 yypush_parse invocations after the first, be sure to assign yyn its old
7812 value again.
7813 (yypstate_new): Don't bother initializing the yyresult field since the
7814 initial value isn't used.
7815 (yyn, yyresult, yytoken, yyval, yyloc): For each NAME in this list,
7816 remove the #define that, in push mode, set it to yyps->NAME.
7817 * etc/Makefile.am: New.
7818 * etc/bench.pl: Remove and build it instead from...
7819 * etc/bench.pl.in: ... this new file. Use @abs_top_builddir@ to invoke
7820 "tests/bison" from the build directory by default rather than just
7821 invoking "bison" from $PATH.
7822 (calc_grammar): Update push parser code: don't declare yylval globally,
7823 don't define yyparse_wrapper, and don't #define yyparse.
7824 (bench_grammar): Update to check all working combinations of yacc.c,
7825 push.c, impure, pure, pull, and push.
7826
7827 2006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
7828
7829 For push mode, add pull wrappers around yypush_parse.
7830 * data/push.c: (b4_generate_macro_args, b4_parenthesize): New macros.
7831 (yypull_parse): New function wrapping yypush_parse.
7832 (yyparse): New #define wrapping yypull_parse.
7833 * tests/calc.at (_AT_DATA_CALC_Y): Call yyparse even when %push-parser
7834 is declared.
7835 * tests/headers.at (export YYLTYPE): Make yylex global. For push mode,
7836 prototype yylex in the module that calls yyparse, and don't prototype
7837 yyparse there. Otherwise, the yyparse expansion won't compile.
7838 * tests/input.at (Torturing the Scanner): Likewise.
7839
7840 2006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
7841
7842 Enable push parsers to operate in impure mode. Thus, %push-parser no
7843 longer implies %pure-parser. The point of this change is to move
7844 towards being able to test the push parser code by running the entire
7845 test suite as if %push-parser had been declared.
7846 * data/push.c (yypush_parse): For impure mode, remove the
7847 yypushed_char, yypushed_val, and yypushed_loc arguments.
7848 Instead, declare these as local variables initialized to the global
7849 yychar, yylval, and yylloc.
7850 For the first yypush_parse invocation only, restore the initial values
7851 of these global variables when it's time to read a token since they
7852 have been overwritten.
7853 * src/parse-gram.y (prologue_declaration): Don't set pure_parser for
7854 %push-parser.
7855 * tests/calc.at (Simple LALR(1) Calculator): Always declare
7856 %pure-parser along with %push-parser since this test case was designed
7857 for pure push parsers.
7858 * tests/local.at (AT_PURE_OR_PUSH_IF): Remove unused.
7859 (AT_YACC_OR_PUSH_IF): New.
7860 (AT_YYERROR_SEES_LOC_IF): Fix enough that the test suite passes, but
7861 add a note that it's still wrong for some cases (as it has been for a
7862 while).
7863 (AT_PURE_LEX_IF): Use AT_PURE_IF instead of AT_PURE_OR_PUSH_IF since
7864 %push-parser no longer implies %pure-parser.
7865
7866 2006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
7867
7868 Remove some unnecessary differences between the pull parser code and
7869 the push parser code. This patch enables yynerrs in push mode.
7870 * data/push.c: Reformat M4 a little.
7871 (b4_yyerror_range): Remove and convert all uses to just yyerror_range.
7872 (b4_declare_scanner_communication_variables): Don't omit yynerrs just
7873 because push mode is on. Instead, if pure mode is on, move yynerrs
7874 to...
7875 (b4_declare_parser_state_variables): ... here.
7876 (yynerrs, yyerror_range): For push mode, #define each NAME in this list
7877 to yyps->NAME so it can be used in yypush_parse.
7878 (yypush_parse): Don't omit uses of yynerrs in push mode.
7879
7880 2006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
7881
7882 Fix bug such that the first pushed token's value and location are
7883 sometimes overwritten (sometimes by %initial-action) before being used.
7884 * data/push.c (yypush_parse): Rename arguments yynchar, yynlval, and
7885 yynlloc to yypushed_char, yypushed_val, and yypushed_loc for clarity.
7886 For the first yypush_parse invocation, initialize yychar to YYEMPTY to
7887 more closely mimic the pull parser logic.
7888 Don't copy the pushed token to yychar, yylval, and yylloc until it's
7889 time to read a token, which is after any initialization of yylval and
7890 yylloc.
7891 (gottoken): Rename label to...
7892 (yyread_pushed_token): ... for clarity and to avoid infringing on the
7893 user namespace.
7894
7895 2006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
7896
7897 Rearrange initialization of the parser state variables so that the
7898 skeleton doesn't have to have a copy for pull mode and another for push
7899 mode. This patch also fixes at least a bug such that yylloc was not
7900 initialized (with b4_location_initial_line and
7901 b4_location_initial_column) upon calling yypush_parse. However, that
7902 initialization now overwrites the first token's location;
7903 %initial-action assigning @$ already did the same thing, and both bugs
7904 will be fixed in a later patch.
7905 * data/push.c (b4_yyssa): Remove and convert all uses to just yyssa.
7906 (b4_declare_parser_state_variables): Remove initialization of yytoken,
7907 yyss, yyvs, yyls, and yystacksize.
7908 (yypstate_new): Remove initialization of some yypstate fields: yystate,
7909 yyerrstatus, yytoken, yyss, yyvs, yyls, yystacksize, yyssp, yyvsp, and
7910 yylsp.
7911 (yyssa, yyvsa, yylsa): For push mode, #define each NAME in this list to
7912 yyps->NAME so it can be used in yypush_parse.
7913 (yyparse or yypush_parse): For yypush_parse, don't print the
7914 "Starting parse" diagnostic for invocations after the first.
7915 Add initialization of yytoken, yyss, yyvs, yyls, and yystacksize; for
7916 yypush_parse, only do it for the first invocation.
7917 Allow yystate, yyerrstatus, yyssp, yyvsp, yylsp, and yylloc
7918 initialization to occur in yypush_parse but only on the first
7919 invocation.
7920
7921 2006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
7922
7923 * data/push.c: Add CPP guards around push parser declarations in both
7924 the header and the code file.
7925 In the code file, move the push parser declarations to the same place
7926 they appear in the header file.
7927 Clean up the M4 some, especially the inconsistent underquoting in
7928 some b4_c_function_def and b4_c_function_decl uses.
7929
7930 2006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
7931
7932 Encapsulate the push parser state variables into an M4 macro so the
7933 push skeleton doesn't have to list them again for pull mode's yyparse.
7934 For push mode, remove yypush_parse's local equivalents of these
7935 variables to eliminate unnecessary copying between the two sets at
7936 run-time. This patch also fixes at least a bug related to multiple
7937 %initial-action invocations in push mode.
7938 * data/push.c (b4_declare_parser_variables): Rename to...
7939 (b4_declare_scanner_communication_variables): ... this for clarity and
7940 update both uses.
7941 (b4_declare_yyparse_variables): Remove and move its contents to the one
7942 spot where it was invoked.
7943 (b4_declare_parser_state_variables): New macro containing the parser
7944 state variables required by push mode.
7945 (struct yypstate): Replace all fields but yynew with
7946 b4_declare_parser_state_variables.
7947 (yystate, yyn, yyresult, yyerrstatus, yytoken, yyss, yyssp, yyvs,
7948 yyvsp, yyls, yylsp, yystacksize, yyval, yyloc): For push mode, #define
7949 each NAME in this list to yyps->NAME so it can be used in yypush_parse.
7950 (yyparse or yypush_parse): For yyparse in pull mode, replace local
7951 parser state variable declarations with
7952 b4_declare_parser_state_variables.
7953 Don't initialize parser state variables when calling yypush_parse since
7954 yypstate_new already does that.
7955 Invoke the user's initial action only upon the first yypush_parse
7956 invocation.
7957 Remove all code that copies between the local parser state variables
7958 and the yypstate.
7959
7960 2006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
7961
7962 * data/push.c (union yyalloc): Rename yyss, yyvs, and yyls fields to
7963 prevent a name collision in a future patch where these names will
7964 sometimes be #define'd.
7965 (YYSTACK_RELOCATE): Add an argument to select a union yyalloc field
7966 since it no longer has the same name as the existing argument.
7967 (yyparse or yypush_parse): Update all uses of YYSTACK_RELOCATE.
7968
7969 2006-12-19 Paolo Bonzini <bonzini@gnu.org>
7970 and Joel E. Denny <jdenny@ces.clemson.edu>
7971
7972 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
7973 that the argument is case-insensitive, and there's no `=' here.
7974 For the %skeleton entry, mention that %language is better.
7975 (Bison Options): Likewise for --language and --skeleton. Move the
7976 --skeleton entry so that the `Tuning the parser' section is sorted
7977 alphabetically on long options.
7978 (C++ Bison Interface): Don't use the word skeleton. Don't explain the
7979 %language directive in detail here; cross-reference the %language
7980 documentation instead.
7981 (Calc++ Parser): Use `%require "@value{VERSION}"' rather than
7982 `%require "2.3b"' so that the example is always up-to-date.
7983 (Table of Symbols): Add entries for %language and %skeleton.
7984 * examples/extexi (normalize): Instead of replacing every %require
7985 argument with the current Bison version, just substitute for
7986 `@value{VERSION}'. This guarantees that we're testing what actually
7987 appears in the documentation.
7988 * examples/calc++/Makefile.am ($(calc_extracted)): Use `$(VERSION)'
7989 rather than `@VERSION@'.
7990
7991 2006-12-18 Paul Eggert <eggert@cs.ucla.edu>
7992
7993 * NEWS: Reword the %language news a bit, and put it earlier.
7994
7995 * src/getargs.c (skeleton_arg): Last arg is now location const *.
7996 Rewrite to simplify the logic.
7997 (language_argmatch): Likewise.
7998 (program_name): We now own this var.
7999 * src/getargs.h (struct bison_language): Use char[] rather than
8000 const char *.
8001
8002 * doc/bison.texinfo (Decl Summary, Bison Options): Don't claim
8003 Java is supported.
8004 * src/complain.c (program_name): Remove decl; no longer needed.
8005 * src/main.c (program_name): Remove; now belongs to getargs.
8006
8007 2006-12-18 Paolo Bonzini <bonzini@gnu.org>
8008
8009 * NEWS: Document %language.
8010
8011 * data/Makefile.am (dist_pkgdata_DATA): Add c-skel.m4, c++-skel.m4.
8012
8013 * data/c-skel.m4, data/c++-skel.m4: New files.
8014 * data/glr.c: Complain on push parsers.
8015
8016 * doc/bison.texinfo (C++ Parser Interface): Prefer %language
8017 over %skeleton.
8018 (Decl Summary): Document %language and %skeleton.
8019 (Command line): Document -L.
8020
8021 * examples/extexi: Rewrite %require directive.
8022 * examples/calc++/Makefile.am: Pass VERSION to extexi.
8023
8024 * src/files.c (compute_exts_from_gc): Look in language structure
8025 for .y extension.
8026 (compute_file_name_parts): Check whether .tab should be added.
8027 * src/getargs.c (valid_languages, skeleton_prio, language_prio):
8028 (language, skeleton_arg, language_argmatch): New.
8029 (long_options): Add --language.
8030 (getargs): Use skeleton_arg, add -L/--language.
8031 * src/getargs.h: Include location.h.
8032 (struct bison_language, language, skeleton_arg, language_argmatch): New.
8033 * src/output.c (prepare): Pick default skeleton from struct language.
8034 Don't dispatch C skeletons here.
8035 * src/parse-gram.y (PERCENT_LANGUAGE): New.
8036 (prologue_declaration): Add "%language" rule, use skeleton_arg.
8037 * src/scan-gram.l ("%language"): New rule.
8038
8039 * tests/calc.at: Test %skeleton and %language.
8040 * tests/local.at (AT_SKEL_CC_IF): Look for %language.
8041 (AT_GLR_IF): Look for %skeleton "glr.cc".
8042 (AT_LALR1_CC_IF, AT_GLR_CC_IF): Rewrite.
8043 (AT_YACC_IF): Reject %language.
8044
8045 2006-12-18 Paul Eggert <eggert@cs.ucla.edu>
8046
8047 * src/symtab.h (struct semantic_type): Remove the tag 'semantic_type',
8048 since it wasn't used; only the typedef name 'semantic_type' is needed.
8049 Also, omit trailing white space.
8050
8051 * bootstrap: Sync from coreutils.
8052 (gnulib_extra_files): Add build-aux/announce.gen.
8053 (slurp): Adjust .gitignore files like .cvsignore files.
8054 * build-aux/announce-gen: Remove from CVS, since bootstrap
8055 now creates this.
8056
8057 2006-12-16 Joel E. Denny <jdenny@ces.clemson.edu>
8058
8059 Make %push-parser imply %pure-parser. This fixes several bugs; see
8060 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00148.html>.
8061 * src/parse-gram.y (prologue_declaration): For %push-parser, also set
8062 pure_parser = true.
8063 * data/push.c: Don't bother testing b4_push_if when deciding whether
8064 to expand b4_declare_parser_variables globally.
8065 (yypush_parse): Likewise in here.
8066
8067 * data/push.c (yypush_parse): Add b4_parse_param to arguments.
8068 (yy_reduce_print): Reformat M4 for readability.
8069
8070 2006-12-15 Bob Rossi <bob@brasko.net>
8071 and Joel Denny <jdenny@ces.clemson.edu>
8072
8073 * data/push.c (yypstate): Add typedef, and update all uses of
8074 struct yypstate to just yypstate.
8075 * tests/calc.at (_AT_DATA_CALC_Y): Update here as well.
8076
8077 2006-12-14 Bob Rossi <bob@brasko.net>
8078
8079 * data/push.c (yypush_parse): Declare prototype regardless of
8080 %locations option.
8081
8082 2006-12-14 Bob Rossi <bob@brasko.net>
8083
8084 * data/push.c (yyparse): Remove the prototype and the #define when in
8085 push-parser mode.
8086
8087 2006-12-13 Bob Rossi <bob@brasko.net>
8088
8089 * data/push.c (yypstate_init): Rename to...
8090 (yypstate_new): ... this and use b4_c_function_def.
8091 (yypstate_delete): New.
8092 (yypush_parse): Change parameters yynval and yynlloc to be const.
8093 * tests/calc.at (_AT_DATA_CALC_Y): Use new yypstate_new and
8094 yypstate_delete functions.
8095
8096 2006-12-13 Joel E. Denny <jdenny@ces.clemson.edu>
8097
8098 * configure.ac (AC_PREREQ): Require Autoconf 2.61 because of our
8099 strange test case titles. Reported by Bob Rossi.
8100
8101 2006-12-13 Paul Eggert <eggert@cs.ucla.edu>
8102
8103 * TODO: Add pointer to Sylvain Schmitz's work on static detection
8104 of potential ambiguities in GLR grammers.
8105
8106 2006-12-12 Joel E. Denny <jdenny@ces.clemson.edu>
8107
8108 * tests/testsuite.at (AT_CHECK): When checking if $1 starts with
8109 `bison ', use m4_index instead of m4_substr since chopping up a string
8110 containing M4-special characters causes problems here.
8111
8112 Fix a couple of bugs related to special characters in user-specified
8113 file names, and make it easier for skeletons to compute output file
8114 names with the same file name prefix as Bison-computed output file
8115 names.
8116 * data/glr.cc, data/push.c, data/yacc.c: In @output, use
8117 b4_parser_file_name and b4_spec_defines_file instead of
8118 @output_parser_name@ and @output_header_name@, which are now redundant.
8119 * data/glr.c, data/lalr1.cc: Likewise. Also, in header #include's, use
8120 b4_parser_file_name, b4_spec_defines_file, and the new
8121 @basename(FILENAME@) instead of @output_parser_name@ and
8122 @output_header_name@, which inappropriately escaped the file names as
8123 C string literals.
8124 * src/files.c (all_but_ext): Remove static qualifier.
8125 (compute_output_file_names): Move `free (all_but_ext)' to...
8126 (output_file_names_free): ... here since all_but_ext is needed later.
8127 * src/files.h (all_but_ext): Extern.
8128 * src/muscle_tab.h (MUSCLE_INSERT_STRING_RAW): New macro that does
8129 exactly what MUSCLE_INSERT_STRING used to do.
8130 (MUSCLE_INSERT_STRING): Use MUSCLE_OBSTACK_SGROW so that M4-special
8131 characters are escaped properly.
8132 * src/output.c (prepare): Define muscle file_name_all_but_ext as
8133 all_but_ext.
8134 For pkgdatadir muscle, maintain previous functionality by using
8135 MUSCLE_INSERT_STRING_RAW instead of MUSCLE_INSERT_STRING. The problem
8136 is that b4_pkgdatadir is used inside m4_include in the skeletons, so
8137 digraphs would never be expanded. Hopefully no one has M4-special
8138 characters in his Bison installation path.
8139 * src/scan-skel.l: Don't parse @output_header_name@ and
8140 @output_parser_name@ anymore since they're now redundant.
8141 In @output, use decode_at_digraphs.
8142 Parse a new @basename command that invokes last_component.
8143 (decode_at_digraphs): New.
8144 (BASE_QPUTS): Remove unused.
8145 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): New macro.
8146 (Output file name): New tests.
8147
8148 2006-12-09 Joel E. Denny <jdenny@ces.clemson.edu>
8149
8150 Warn about output files that are generated by the skeletons and that
8151 conflict with other output files.
8152 * data/glr.c: Don't generate the header file here when glr.cc does.
8153 * src/files.c (file_names, file_names_count): New static globals.
8154 (compute_output_file_names): Invoke output_file_name_check for files
8155 not generated by the skeletons and remove existing checks.
8156 (output_file_name_check): New function that warns about conflicting
8157 output file names.
8158 (output_file_names_free): Free file_names.
8159 * src/files.h (output_file_name_check): Declare.
8160 * src/scan-skel.l: Invoke output_file_name_check for files generated by
8161 the skeletons.
8162 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): New.
8163 (Conflicting output files): New tests.
8164
8165 2006-12-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8166
8167 * doc/bison.texinfo: Fix a couple of typos.
8168
8169 2006-12-08 Bob Rossi <bob@brasko.net>
8170
8171 * data/push.c: (yypvarsinit, yypvars, struct yypvars, yypushparse):
8172 Rename to...
8173 (yypstate_init, yypstate, struct yypstate, yypush_parse): ... these and
8174 update all uses.
8175 (b4_yyssa, b4_yyerror_range, yypstate_init): Rename pv to yyps.
8176 (yypush_parse): Rename yypvars argument to yyps and remove redundant
8177 local pv.
8178 (yypstate_init, yypush_parse): Declare in Bison-generated header file.
8179 * tests/calc.at (_AT_DATA_CALC_Y): Use newly named functions.
8180
8181 2006-12-07 Bob Rossi <bob@brasko.net>
8182 and Joel Denny <jdenny@ces.clemson.edu>
8183
8184 * data/push.c (yypvarsinit): Change return type from void* to struct
8185 yypvars*. No longer cast to void* on return.
8186 (struct yypvars): Remove yylen since it need not be remembered between
8187 yypushparse invocations.
8188 (yypushparse): Don't copy between yylen and pv->yylen.
8189
8190 2006-12-05 Bob Rossi <bob@brasko.net>
8191
8192 * data/push.c (yychar_set, yylval_set, yylloc_set): Delete.
8193 (yypushparse): Add yynchar, yynlval, yynlloc parameters.
8194 (b4_declare_parser_variables): Do not declare yynerrs for push mode.
8195 (struct yypvars): Remove b4_declare_parser_variables.
8196 (yypvarsinit): Remove init code for removed variables.
8197 (global scope): Do not declare b4_declare_parser_variables if
8198 push or pure mode.
8199 (yypushparse): Add b4_declare_parser_variables.
8200 Init new local variables, and remove init code for removed
8201 yypvars variables.
8202 (yyparse): Delete.
8203 * tests/calc.at (_AT_DATA_CALC_Y): Call yypushparse for push mode
8204 and yyparse for other modes.
8205 (AT_CHECK_CALC_LALR): Added '%skeleton "push.c"' for push tests.
8206 * tests/local.at (AT_PUSH_IF, AT_PURE_OR_PUSH_IF): Added.
8207 (AT_YYERROR_SEES_LOC_IF): push-parser makes this false.
8208 (AT_PURE_LEX_IF): True if pure or push parser.
8209
8210 2006-12-05 Joel E. Denny <jdenny@ces.clemson.edu>
8211
8212 Document Yacc prologue alternatives and default %destructor's and
8213 %printer's as experimental. Don't mention Java yet. Discussed at
8214 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00002.html>.
8215 * NEWS (2.3a+): Say they're experimental. Remove any mention of Java.
8216 (2.3a): Annotate this entry to say the old forms of these features were
8217 also experimental.
8218 * doc/bison.texinfo (Prologue Alternatives, Freeing Discarded Symbols,
8219 Table of Symbols): Say they're experimental. Comment out any mention
8220 of Java (we'll want this back eventually).
8221
8222 2006-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
8223
8224 Support a file name argument to %defines. Deprecate `=' in
8225 %file-prefix, %name-prefix, and %output. Discussed at
8226 <http://lists.gnu.org/archive/html/help-bison/2006-09/msg00001.html>.
8227 * NEWS (2.3a+): Mention.
8228 * doc/bison.texinfo (Decl Summary, Table of Symbols): Add entry for new
8229 form of %defines, and remove `=' from entries for %file-prefix,
8230 %name-prefix, and %output.
8231 * src/parse-gram.y (prologue_declaration): Implement.
8232 * tests/calc.at (Simple LALR Calculator, Simple GLR Calculator, Simple
8233 LALR1 C++ Calculator, Simple GLR C++ Calculator): Remove the `=' from
8234 all but one occurrence of %name-prefix.
8235 * tests/headers.at (export YYLTYPE): Remove the `=' from %name-prefix.
8236 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Likewise.
8237 * tests/output.at (AT_CHECK_OUTPUT): Remove the `=' from all but one
8238 occurrence of each of %file-prefix and %output. Add check for %defines
8239 with argument.
8240 * tests/reduce.at (Useless Terminals, Useless Nonterminals,
8241 Useless Rules, Reduced Automaton, Underivable Rules, Empty Language):
8242 Remove the `=' from %output.
8243
8244 2006-11-21 Joel E. Denny <jdenny@ces.clemson.edu>
8245
8246 Don't escape $ in test case titles since Autoconf 2.61 now does that
8247 correctly.
8248 * tests/actions.at (Default %printer and %destructor are not for error
8249 or $undefined): Here.
8250 (Default %printer and %destructor are not for $accept): Here.
8251 * tests/input.at (Invalid $n and @n): Here.
8252
8253 2006-11-20 Joel E. Denny <jdenny@ces.clemson.edu>
8254
8255 Rename <!> to <>. Discussed starting at
8256 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00039.html>.
8257 * NEWS (2.3a+): Update.
8258 * doc/bison.texinfo (Freeing Discarded Symbols, Table of Symbols):
8259 Update.
8260 * src/parse-gram.y (TYPE_TAG_NONE, generic_symlist_item): Implement.
8261 * src/scan-gram.l (INITIAL): Implement.
8262 * src/symlist.c (symbol_list_default_tagless_new): Update comment.
8263 * src/symlist.h (symbol_list, symbol_list_default_tagless_new): Update
8264 comment.
8265 * tests/actions.at (Default tagless %printer and %destructor,
8266 Default tagged and per-type %printer and %destructor,
8267 Default %printer and %destructor are not for error or $undefined,
8268 Default %printer and %destructor are not for $accept,
8269 Default %printer and %destructor for mid-rule values): Update.
8270 * tests/input.at (Default %printer and %destructor redeclared,
8271 Unused values with default %destructor): Update.
8272
8273 2006-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
8274
8275 Don't let %prec take a nonterminal.
8276 * src/reader.c (grammar_current_rule_prec_set): Make the %prec symbol a
8277 token.
8278 * tests/input.at (%prec takes a token): New test checking that %prec
8279 won't take a nonterminal.
8280
8281 2006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
8282
8283 * tests/testsuite.at (AT_CHECK): Don't miss an exit value of 0 because
8284 it was double-quoted.
8285 * src/Makefile.am (YACC): Use --warnings=all,error so that Bison's own
8286 grammar is maintained with Bison's highest standards.
8287 * src/getargs.c: Fix some typos in Doxygen comments.
8288
8289 2006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
8290
8291 Fix memory leaks in scanners generated by at least Flex 2.5.9 and
8292 later. Reported by Paul Eggert in
8293 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00014.html>.
8294 * src/flex-scanner.h (yylex_destroy): Define for Flex before 2.5.9.
8295 * src/scan-code.l (translate_action): Don't bother invoking
8296 yy_delete_buffer (YY_CURRENT_BUFFER) before creating the first buffer.
8297 (code_scanner_free): Instead of invoking
8298 yy_delete_buffer (YY_CURRENT_BUFFER) directly, invoke yylex_destroy,
8299 which frees more.
8300 * src/scan-gram.l (gram_scanner_free): Likewise.
8301 * src/scan-skel.l (scan_skel): Likewise.
8302
8303 2006-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
8304
8305 * src/files.c (tr): Change return type to void.
8306 * src/muscle_tab.c (muscle_insert): Free storage in case muscle_grow
8307 has been called previously for the same key.
8308 (muscle_find): Return storage instead of value so that
8309 --enable-gcc-warnings doesn't produce warnings that the return discards
8310 const. aver that the value and storage are the same since storage
8311 could potentially be NULL when value is not.
8312 * tests/testsuite.at (AT_CHECK): Treat an unspecified exit value the
8313 same as 0.
8314
8315 2006-11-08 Paul Eggert <eggert@cs.ucla.edu>
8316
8317 * bootstrap.conf (excluded_files): Exclude m4/codeset.m4 (undoing
8318 the earlier change today), m4/intl.m4, m4/intldir.m4. This gives
8319 us a slightly cleaner distribution, and also works.
8320 * m4/.cvsignore: Add inline.m4, wint_t.m4 to accommodate recent
8321 gnulib changes.
8322
8323 2006-11-08 Joel E. Denny <jdenny@ces.clemson.edu>
8324 and Paul Eggert <eggert@cs.ucla.edu>
8325
8326 Don't let Bison leak memory except when it complains.
8327 * src/files.h (parser_file_name, spec_verbose_file, spec_graph_file):
8328 (spec_defines_file, dir_prefix): Now char *, not const char *,
8329 since they are freed.
8330 * src/files.c: Likewise.
8331 (all_but_ext, all_but_tab_ext, src_extension, header_extension):
8332 Likewise.
8333 (tr): Now operates in-place. All uses changed.
8334 (compute_exts_from_gf, compute_exts_from_src): Don't leak temporary
8335 values.
8336 (compute_file_name_parts, compute_output_file_names): Don't store
8337 read-only data in variables that will be freed.
8338 (compute_output_file_names): Free all_but_ext, all_but_tab_ext,
8339 src_extension, and header_extension.
8340 (output_file_names_free): New public function to free
8341 spec_verbose_file, spec_graph_file, spec_defines_file,
8342 parser_file_name, and dir_prefix.
8343 * src/getargs.c (getargs): Don't store read-only data in variables that
8344 will be freed.
8345 * src/main.c (main): Invoke output_file_names_free, code_scanner_free
8346 (which previously existed but was unused), and quotearg_free.
8347 * src/muscle_tab.h (muscle_insert): value arg is now a `char const *'.
8348 * src/muscle_tab.c: Likewise.
8349 (muscle_entry): Make the value char const *,
8350 and add a new storage member that is char * and can be freed.
8351 (muscle_entry_free): New private function.
8352 (muscle_init): Use it instead of free.
8353 (muscle_insert, muscle_grow): Update and use new storage member.
8354 (muscle_code_grow): Free the string passed to muscle_grow
8355 since it's not needed anymore.
8356 * src/parse-gram.y (%union): Make `chars' member a `char const *', and
8357 add a new `char *code' member.
8358 ("{...}"): Declare semantic type as code.
8359 * src/scan-code.h (translate_rule_action):
8360 (translate_symbol_action, translate_code, translate_action): Return
8361 `char const *' rather than `char *' since external code should not free
8362 these strings.
8363 * src/scan-code.l: Likewise.
8364 * src/scan-gram.l (<SC_BRACED_CODE>): Use val->code for BRACED_CODE,
8365 which is "{...}" in the parser.
8366 * tests/Makefile.am (maintainer-check-valgrind): Set
8367 VALGRIND_OPTS='--leak-check=full --show-reacheable=yes' before invoking
8368 Valgrind.
8369 * tests/calc.at (_AT_DATA_CALC_Y): fclose the FILE* so Valgrind doesn't
8370 complain.
8371 * tests/testsuite.at (AT_CHECK): Redefine so that running Bison and
8372 expecting a non-zero exit status sets --leak-check=summary and
8373 --show-reachable=no for Valgrind. Bison unabashedly leaks memory in
8374 this case, and we don't want to hear about it.
8375
8376 2006-11-08 Paul Eggert <eggert@cs.ucla.edu>
8377
8378 * bootstrap (runtime-po/Makevars): Derive from po/Makevars
8379 instead of from the template, to simplify configuration a bit.
8380 * bootstrap.conf (excluded_files): Don't exclude m4/codeset.m4
8381 and m4/wint_t.m4, as they are needed with the latest gnulib.
8382
8383 2006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
8384
8385 Disable unset/unused mid-rule value warnings by default, and recognize
8386 --warnings=midrule-values to enable them. Discussed starting at
8387 <http://lists.gnu.org/archive/html/help-bison/2006-10/msg00030.html>.
8388 * NEWS (2.3a+): Mention.
8389 * src/getargs.c, src/getargs.h (warnings_args, warnings_types, enum
8390 warnings): Add entry for midrule-values subargument.
8391 * src/reader.c (symbol_should_be_used): Don't return true just because
8392 the value is a set/used mid-rule value unless
8393 --warnings=midrule-values was specified.
8394 * tests/input.at (Unused values, Unused values before symbol
8395 declarations): Run tests with and without --warnings=midrule-values.
8396
8397 * src/reader.c (check_and_convert_grammar): Use symbol_list_free rather
8398 than LIST_FREE directly.
8399
8400 2006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
8401
8402 Finish implementing --warnings=error, which should not be implied by
8403 --warnings=all (or by its synonyms -W and --warnings without
8404 subarguments).
8405 * src/complain.c (set_warning_issued): New function to report that
8406 warnings are being treated as errors and to record an error if so.
8407 Invoke...
8408 (warn_at, warn): ... here.
8409 * src/getargs.c (warnings_args, warnings_types): Reorder so that
8410 "error - warnings are errors" does not appear above "all - all of the
8411 above".
8412 (getargs): For -W and --warnings without subarguments, don't let
8413 FLAGS_ARGMATCH set warnings_error in warnings_flag.
8414 * src/getargs.h (enum warnings): Unset warnings_error in warnings_all.
8415
8416 2006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
8417
8418 * src/getargs.c (flags_argmatch): Don't cause segmentation fault for
8419 empty subargument list. For example: `bison --warnings= parser.y'.
8420
8421 2006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
8422
8423 * data/push.c, data/yacc.c: Make sure there's a newline at the end of
8424 the parser header file so that gcc doesn't warn.
8425
8426 2006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
8427
8428 Split the default %destructor/%printer into two kinds: <*> and <!>.
8429 Discussed starting at
8430 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00060.html>.
8431 * NEWS (2.3a+): Mention.
8432 * doc/bison.texinfo (Freeing Discarded Symbols): Document this and the
8433 previous change today related to mid-rules.
8434 (Table of Symbols): Remove %symbol-default and add <*> and <!>.
8435 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): Remove.
8436 (TYPE_TAG_ANY): Add as <*>.
8437 (TYPE_TAG_NONE): Add as <!>.
8438 (generic_symlist_item): Remove RHS for %symbol-default and add RHS's
8439 for <*> and <!>.
8440 * src/scan-gram.l (PERCENT_SYMBOL_DEFAULT): Remove.
8441 (TYPE_TAG_ANY, TYPE_TAG_NONE): Add.
8442 * src/symlist.c (symbol_list_default_new): Split into tagged and
8443 tagless versions.
8444 (symbol_list_destructor_set, symbol_list_printer_set): Split
8445 SYMLIST_DEFAULT case into SYMLIST_DEFAULT_TAGGED and
8446 SYMLIST_DEFAULT_TAGLESS.
8447 * src/symlist.h: Update symbol_list_default*_new prototypes.
8448 (symbol_list.content_type): Split enum value SYMLIST_DEFAULT into
8449 SYMLIST_DEFAULT_TAGGED and SYMLIST_DEFAULT_TAGLESS.
8450 * src/symtab.c (default_destructor, default_destructor_location,
8451 default_printer, default_printer_location): Split each into tagged and
8452 tagless versions.
8453 (symbol_destructor_get, symbol_destructor_location_get,
8454 symbol_printer_get, symbol_printer_location_get): Implement tagged
8455 default and tagless default cases.
8456 (default_destructor_set, default_printer_set): Split each into tagged
8457 and tagless versions.
8458 * src/symtab.h: Update prototypes.
8459 * tests/actions.at (Default %printer and %destructor): Rename to...
8460 (Default tagless %printer and %destructor): ... this, and extend.
8461 (Per-type %printer and %destructor): Rename to...
8462 (Default tagged and per-type %printer and %destructor): ... this, and
8463 extend.
8464 (Default %printer and %destructor for user-defined end token): Extend.
8465 (Default %printer and %destructor are not for error or $undefined):
8466 Update.
8467 (Default %printer and %destructor are not for $accept): Update.
8468 (Default %printer and %destructor for mid-rule values): Extend.
8469 * tests/input.at (Default %printer and %destructor redeclared): Extend.
8470 (Unused values with default %destructor): Extend.
8471
8472 2006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
8473
8474 Don't apply the default %destructor/%printer to an unreferenced midrule
8475 value. Mentioned at
8476 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00104.html>.
8477 * src/symtab.c (dummy_symbol_get): Name all dummy symbols initially
8478 like $@n instead of just @n so that the default %destructor/%printer
8479 logic doesn't see them as user-defined symbols.
8480 (symbol_is_dummy): Check for both forms of the name.
8481 * src/reader.c (packgram): Remove the `$' from each midrule symbol
8482 name for which the midrule value is referenced in any action.
8483 * tests/actions.at (Default %printer and %destructor for mid-rule
8484 values): New test.
8485 * tests/regression.at (Rule Line Numbers, Web2c Report): Update output
8486 for change to dummy symbol names.
8487
8488 2006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
8489
8490 Warn about unset midrule $$ if the corresponding $n is used.
8491 * src/reader.c (symbol_should_be_used): Check midrule parent rule for
8492 $n usage.
8493 (packgram): Before invoking grammar_rule_check on any rule, make sure
8494 all actions have already been scanned in order to set `used' flags.
8495 Otherwise, checking that a midrule's $$ is set will not always work
8496 properly because the midrule check must forward-reference the midrule's
8497 parent rule.
8498 * tests/input.at (AT_CHECK_UNUSED_VALUES): Extend to check the new
8499 warning.
8500
8501 2006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
8502
8503 More improvements to the documentation of the prologue alternatives:
8504 * NEWS (2.3a+): Mention the new `Prologue Alternatives' section in the
8505 Bison manual.
8506 * doc/bison.texinfo (Prologue Alternatives): Correct some errors. Add
8507 some text to clarify the relative importance of the new directives and
8508 to show how these directives may be viewed as code labels.
8509
8510 2006-10-16 Joel E. Denny <jdenny@ces.clemson.edu>
8511
8512 Similar to the recently removed %before-header, add %code-top as the
8513 alternative to the pre-prologue. Mentioned at
8514 <http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00063.html>.
8515 Also, let the prologue alternatives appear in the grammar section.
8516 * src/parse-gram.y (PERCENT_CODE_TOP): New token.
8517 (prologue_declaration): Move the existing prologue alternatives to...
8518 (grammar_declaration): ... here and add %code-top.
8519 * src/scan-gram.l (PERCENT_CODE_TOP): New token.
8520
8521 Clean up and extend documentation for the prologue alternatives.
8522 * NEWS (2.3a+): Describe prologue alternatives.
8523 * doc/bison.texinfo (Prologue): Move discussion of prologue
8524 alternatives to...
8525 (Prologue Alternatives): ... this new section, and extend it to discuss
8526 all 4 directives in detail.
8527 (Table of Symbols): Clean up discussion of prologue alternatives and
8528 add %code-top.
8529
8530 2006-10-16 Juan Manuel Guerrero <juan.guerrero@gmx.de>
8531
8532 DJGPP specific issues.
8533
8534 * djgpp/config.bat: config.hin has been moved to lib. Adjust
8535 config.bat accordingly.
8536 * djgpp/config.sed: Adjust config.sed for the use of autoconf 2.60.
8537 * djgpp/config.site: Likewise.
8538
8539 2006-10-16 Paolo Bonzini <bonzini@gnu.org>
8540
8541 Replace %*-header with %provides, %requires, %code. See discussion at
8542 http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00002.html
8543
8544 * data/bison.m4 (b4_user_requires, b4_user_provides): New.
8545 (b4_user_start_header): Remove.
8546 * data/glr.c: Use new macros instead of b4_*start_header
8547 and b4_*end_header.
8548 * data/glr.cc: Likewise.
8549 * data/lalr1.cc: Likewise.
8550 * data/push.c: Likewise.
8551 * data/yacc.c: Likewise.
8552
8553 * doc/bison.texinfo: Remove %before-header, rename
8554 %{start,end,after}-header to %requires, %provides, %code.
8555
8556 * src/parse-gram.y: Likewise (also rename token names accordingly).
8557 * src/scan-gram.l: Likewise.
8558 * tests/actions.at: Likewise.
8559
8560 2006-10-14 Paul Eggert <eggert@cs.ucla.edu>
8561
8562 * lib/Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS).
8563 Problem reported by Joel E. Denny.
8564
8565 2006-10-14 Jim Meyering <jim@meyering.net>
8566
8567 (Sync from coreutils.)
8568 Work also when the working directory (with e.g. coreutils sources)
8569 is version controlled with git, rather than CVS.
8570 * bootstrap (CVS_only_file): Test for the existence of README-cvs,
8571 rather than CVS.
8572 In messages and comments, say e.g., "checked-out sources",
8573 rather than "CVS sources".
8574 (version_controlled_file): New function. Work for git as well as
8575 for CVS. Don't use grep's -q option.
8576 (slurp): Call it here, in place of CVS-specific code.
8577
8578 2006-10-14 Joel E. Denny <jdenny@ces.clemson.edu>
8579
8580 Fix testsuite for ./configure --enable-gcc-warnings:
8581 * configure.ac (gcc-warnings): Move -Wall before -Wno-sign-compare.
8582 Otherwise, gcc 4.1.0 (at least) warns about sign comparisons in
8583 __AT_CHECK_PRINTER_AND_DESTRUCTOR in tests/actions.at.
8584 * test/input.at (Torturing the Scanner): #include <stdlib.h> for abort.
8585 * test/regression.at (Diagnostic that expects two alternatives):
8586 Likewise.
8587
8588 2006-10-12 Paul Eggert <eggert@cs.ucla.edu>
8589
8590 * bootstrap.conf (gnulib_modules): Add config-h.
8591 * djgpp/subpipe.c: Include <config.h> unconditionally; don't
8592 worry about HAVE_CONFIG_H.
8593 * lib/abitset.c: Likewise.
8594 * lib/bitset.c: Likewise.
8595 * lib/bitset_stats.c: Likewise.
8596 * lib/bitsetv-print.c: Likewise.
8597 * lib/bitsetv.c: Likewise.
8598 * lib/ebitset.c: Likewise.
8599 * lib/get-errno.c: Likewise.
8600 * lib/lbitset.c: Likewise.
8601 * lib/subpipe.c: Likewise.
8602 * lib/timevar.c: Likewise.
8603 * lib/vbitset.c: Likewise.
8604 * lib/bitset.c: Include "bitset.h" first, to test interface.
8605 * lib/bitset_stats.c: Include "bitset_stats.h" first.
8606 * lib/bitsetv-print.c: Include "bitsetv-print.h" first.
8607 * lib/bitsetv.c: Include "bitsetv.h" first.
8608 * lib/get-errno.c: Include "get-errno.h" first.
8609 * m4/.cvsignore: Add config-h.m4.
8610 * tests/actions.at (Default %printer and %destructor for ...):
8611 Adjust expected line numbers in output to reflect removal of #if
8612 HAVE_CONFIG_H lines.
8613 * tests/glr-regression.at (Missed %merge type warnings when ...):
8614 Likewise.
8615 * tests/regression.at (Braced code in declaration in rules section):
8616 Likewise.
8617 * tests/atlocal.in (CPPFLAGS): Don't define HAVE_CONFIG_H.
8618 * tests/local.at (AT_DATA_GRAMMAR_PROLOGUE):
8619 Include <config.h> unconditionally.
8620
8621 * bootstrap: Sync from coreutils, as follows:
8622
8623 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
8624
8625 * bootstrap (symlink_to_gnulib): Fix bug: the dot_dots shell
8626 variable was sometimes used without being initialized. This
8627 messed up the installation of the INSTALL file in some cases.
8628
8629 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
8630
8631 * bootstrap (usage, main program, symlink_to_gnulib): Add option
8632 --copy. Inspired by a suggestion from Bruno Haible.
8633
8634 2006-10-03 Jim Meyering <jim@meyering.net>
8635
8636 * bootstrap: Undo last change to this file, since now gnulib-tool
8637 sticks with the automake default in generating dependencies.
8638
8639 2006-10-12 Paul Eggert <eggert@cs.ucla.edu>
8640
8641 * configure.ac: Use AC_PROG_CC_STDC; this is more modern than
8642 the old AC_PROG_CC / AM_PROG_CC_STDC combination.
8643
8644 * doc/bison.1: Add copyright notice.
8645
8646 * data/glr.c: Don't include <stdarg.h>; not used.
8647
8648 * NEWS: The -g and --graph options now output graphs in Graphviz
8649 DOT format, not VCG format.
8650 * doc/bison.1: Likewise.
8651 * doc/bison.texinfo (Understanding, Bison Options): Likewise.
8652 * THANKS: Add Satya Kiran Popuri, who proposed the initial version
8653 of this change in
8654 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00158.html>.
8655 * TODO: Remove Graphviz entry.
8656 * src/Makefile.am (bison_SOURCES): Add graphviz.c and graphviz.h;
8657 remove vcg.c, vcg.h, vcg_defaults.h.
8658 * src/vcg.c, src/vcg.h, src/vcg_defaults.h: Remove.
8659 * src/graphviz.c, src/graphviz.h: New files.
8660 * src/files.c (compute_output_file_names): Output .dot, not .vcg.
8661 * src/files.h: Make comment more generic.
8662 * src/main.c (main): Likewise.
8663 * src/print_graph.h: Likewise.
8664 * src/getargs.c (usage): Make usage description more generic.
8665 * src/print_graph.c: Include graphviz.h rather than vcg.h.
8666 (static_graph, fgraph): Remove. All uses changed to pass
8667 arguments instead of sharing a static var.
8668 (print_core, print_actions, print_state, print_graph):
8669 Output graphviz format rather than VCG format.
8670 * tests/.cvsignore: Remove *.vcg; add *.dot.
8671 * tests/output.at: Expect *.dot files, not *.vcg files.
8672
8673 * data/Makefile.am (dist_pkgdata_DATA): Add bison.m4; this
8674 accommodates the 2006-10-08 change.
8675
8676 2006-10-11 Bob Rossi <bob@brasko.net>
8677
8678 * data/push.c (yypushparse, yypvarsinit, yypvars): Wrap in b4_push_if.
8679 (b4_yyssa, b4_yyerror_range): New macros.
8680 (struct yypvars): Remove yyssa_ptr and yyerror_range_ptr fields.
8681 (yypvarsinit): Remove init of removed fields.
8682 (yypushparse): Remove use of removed fields; use new macros instead.
8683
8684 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
8685
8686 * data/push.c (yypushparse): Fix memory leak if yymsg is malloced
8687 in a push parser. Reindent slightly to match yacc.c better.
8688
8689 2006-10-11 Bob Rossi <bob@brasko.net>
8690
8691 * data/push.c (struct yypvars): Remove yymsgbuf, yymsgbuf_ptr, yymsg,
8692 yymsg_alloc fields.
8693 (yypvarsinit, yypushparse): Remove init of removed fields.
8694 (yypushparse): Use yymsgbuf instead of yymsgbuf_ptr.
8695
8696 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
8697
8698 * THANKS: Add Paolo Bonzini and Bob Rossi.
8699
8700 2006-10-08 Paolo Bonzini <bonzini@gnu.org>
8701
8702 * data/c.m4 (b4_copyright, b4_epilogue, b4_location_initial_column,
8703 b4_location_initial_line, p4_parse_param, b4_ints_in, b4_flag_if,
8704 b4_define_flag_if and uses, b4_basename, b4_syncline, b4_user_code,
8705 b4_define_user_cde and uses): Remove.
8706 (b4_comment, b4_prefix, b4_sync_start): New.
8707 * data/bison.m4: New file, with most of the content removed from c.m4.
8708 * src/muscle_tab.h: Use "do {...} while(0)" throughout.
8709 * src/output.c (output_skeleton): Pass bison.m4.
8710 (prepare): Pass glr_flag and nondeterministic_flag. Pass prefix
8711 only if specified.
8712
8713 2006-10-05 Paul Eggert <eggert@cs.ucla.edu>
8714
8715 Fix test failure reported by Tom Lane in
8716 <http://lists.gnu.org/archive/html/bug-bison/2006-10/msg00000.html>
8717 and try to make such failures easier to catch in the future.
8718 * data/glr.c (YYTRANSLATE): Don't check for nonpositive arg;
8719 that's now the caller's responsibility.
8720 (yyprocessOneStack, yyrecoverSyntaxError, yyparse):
8721 Set yychar = YYEOF if it's negative.
8722 * tests/actions.at (yylex): Abort if asked to read past EOF.
8723 * tests/conflicts.at (yylex): Likewise.
8724 * tests/cxx-type.at (yylex): Likewise.
8725 * tests/glr-regression.at (yylex): Likewise.
8726 * tests/input.at (yylex): Likewise.
8727 * tests/regression.at (yylex): Likewise.
8728 * tests/torture.at (yylex): Likewise.
8729
8730 2006-10-01 Paul Eggert <eggert@cs.ucla.edu>
8731
8732 Fix problems with translating English-language diagnostics.
8733 * bootstrap: Fix bug introduced in recent bootstrap changes, with
8734 respect to bison-runtime pot generation. The YY_ stuff
8735 wasn't being captured.
8736 * bootstrap.conf (XGETTEXT_OPTIONS_RUNTIME): New var.
8737 * po/POTFILES.in: Add src/location.c, src/scan-code.l.
8738 * runtime-po/POTFILES.in: Add data/push.c.
8739
8740 2006-09-29 Paul Eggert <eggert@cs.ucla.edu>
8741
8742 Merge bootstrap changes from coreutils.
8743
8744 2006-09-28 Jim Meyering <jim@meyering.net>
8745
8746 Automatically generated dependencies are important even
8747 when all of the sources in a directory come from gnulib.
8748 * bootstrap (gnulib_tool): Remove the "no-dependencies" automake
8749 option that gnulib-tool adds to what becomes our lib/gnulib.mk.
8750
8751 2006-09-23 Jim Meyering <jim@meyering.net>
8752
8753 * bootstrap (gnulib_tool_options): Add "--local-dir gl".
8754
8755 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
8756
8757 * bootstrap: Add support for --force.
8758 (usage): New function. Describe usage less tersely.
8759 (CVS_only_file): New var.
8760
8761 2006-09-21 Paul Eggert <eggert@cs.ucla.edu>
8762
8763 * data/push.c (YYPUSH_MORE): Make it an enum instead.
8764 (yypushparse): Use YYPUSH_MORE instead of the mystery constant.
8765 Adjust white space and comments to match GNU style better.
8766
8767 2006-09-20 Bob Rossi <bob@brasko.net>
8768
8769 * data/push.c (yyresult_get): Remove function.
8770 (YYPUSH_MORE): Add #define.
8771 (yypushparse): Modify return value.
8772
8773 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
8774
8775 * stamp-h.in: Remove; no longer needed.
8776 * .cvsignore: Replace autom4te.cache and config.cache with *.cache.
8777 Remove config.h, config.hin, intl (no longer created).
8778 * lib/.cvsignore: Add config.h, config.hin, configmake.h, inttypes.h,
8779 stamp-h1.
8780
8781 Sync bootstrap from coreutils, as follows:
8782
8783 2006-09-18 Paul Eggert <eggert@cs.ucla.edu>
8784
8785 * bootstrap (symlink_to_gnulib): New function.
8786 (cp_mark_as_generated): Use it, to prefer symlinks-to-gnulib
8787 to copies-of-gnulib.
8788 (cp_mark_as_generated, slurp, gnulib_files):
8789 Avoid making a copy if it's the same as the old version.
8790 (gnulib_files): Add support for this variable (used by Bison).
8791
8792 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
8793
8794 * src/getargs.c (usage): Rework to use conventions similar to
8795 coreutils, to make translation a bit easier and the code a bit
8796 smaller. Problem reported by Tim Van Holder.
8797
8798 2006-09-15 Paul Eggert <eggert@cs.ucla.edu>
8799
8800 Use some of gnulib's new modules, taken from coreutils.
8801
8802 * bootstrap: Sync from coreutils, except add support for gnulib_files.
8803 * bootstrap.conf: New file.
8804 (gnulib_modules): Add configmake, inttypes, unistd.
8805 (XGETTEXT_OPTIONS): Add complain, complain_at,
8806 fatal, fatal_at, warn, warn_at, unexpected_end.
8807 * configure.ac (AC_CONFIG_HEADERS): config.h is now in lib, not here.
8808 (gl_USE_SYSTEM_EXTENSIONS): Remove; gl_EARLY now does this.
8809 (gl_EARLY): Add.
8810 (AM_STDBOOL_H): Remove; gl_INIT now dows this.
8811 (gl_INIT): Add
8812 (GNULIB_AUTOCONF_SNIPPET): Remove.
8813 (AM_GNU_GETTEXT): Add; require formatstring macros since that's
8814 the pickiest.
8815 * lib/.cvsignore: Add inttypes_.h.
8816 * lib/Makefile.am: Include gnulib.mk first so we can append to it.
8817 (AM_CFLAGS): Add WERROR_CFLAGS, to be more like coreutils.
8818 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES): Remove
8819 no-longer-necessary initializations.
8820 (lib_SOURCES): Remove, replacing by libbison_a_SOURCES.
8821 * lib/subpipe.c: Include <unistd.h> unconditionally, now that we
8822 use the unistd module.
8823 * src/system.h: Likewise.
8824 * m4/.cvsignore: Remove *_gl.m4, gnulib.m4, inttypes_h.m4, uintmax_t.m4,
8825 ulonglong.m4. Add gettext.m4, gnulib-cache.m4, gnulib-comp.m4,
8826 gnulib-tool.m4, inttypes-h.m4, inttypes-pri.m4, inttypes.m4.
8827 * src/Makefile.am (DEFS): Remove, since configmake does this for us.
8828 (AM_CPPFLAGS): Remove -I../lib, since Automake does that for us.
8829 * src/system.h: Include inttypes.h unconditionally, now that we
8830 use the inttypes module. Don't bother to include stdint.h, since
8831 inttypes.h now does that for us.
8832 (LOCALEDIR): Remove, now that we use the configmake module.
8833 * src/getargs.c: Include configmake.h.
8834 * src/main.c: Likewise.
8835 * src/output.c: Likewise.
8836 * tests/atlocal.in (CPPFLAGS): Include from $abs_top_builddir/lib,
8837 not from $abs_top_builddir, since config.h moved.
8838
8839
8840 Port to GCC 2.95. First two problems reported by Michael Deutschmann in
8841 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00018.html>.
8842
8843 * src/parse-gram.y (symbol_declaration): Don't put statements
8844 before declarations; it's not portable to C89.
8845 * src/scan-code.l (handle_action_at): Likewise.
8846
8847 * src/scan-code.l: Always initialize braces_level; the old code
8848 left it uninitialized and therefore had undefined behavior.
8849
8850 Don't attempt to redefine 'assert', since it runs afoul of
8851 systems where standard headers (mistakenly) include <assert.h>.
8852 Instead, define and use our own alternative, called 'aver'.
8853 * src/reader.c: Don't include assert.h, since we no longer
8854 use assert.
8855 * src/scan-code.l: Likewise.
8856 * src/system.h (assert): Remove, replacing with....
8857 (aver): New function, taking a bool arg. All uses changed.
8858 * src/tables.c (pack_vector): Ensure that aver arg is bool,
8859 not merely an integer.
8860
8861 2006-09-15 Bob Rossi <bob@brasko.net>
8862
8863 Add support for push parsing. Based on the original work of
8864 Odd Arild Olsen <oao@fibula.no>.
8865 * data/Makefile.am (dist_pkgdata_DATA): Add push.c.
8866 * data/c.m4 (YYPUSH): New.
8867 (b4_push_if): New macro. Use it instead of #ifdef YYPUSH.
8868 * data/push.c: New file.
8869 * src/getargs.c (push_parser): New var.
8870 * src/getargs.h (push_parser): New declaration.
8871 * src/output.c (prepare): Add macro insertion of `push_flag'.
8872 * src/parse-gram.y (PERCENT_PUSH_PARSER): New token.
8873 (prologue_declaration): Parse %push-parser.
8874 * src/scan-gram.l: Scan new PERCENT_PUSH_PARSER token.
8875 * tests/calc.at (_AT_CHECK_CALC_ERROR): Add "Return" and "Now" to
8876 list of removed lines from the traces observed.
8877 (AT_CHECK_CALC_LALR): Added push parser tests.
8878
8879 2006-09-13 Paul Eggert <eggert@cs.ucla.edu>
8880
8881 * NEWS: Version 2.3a.
8882 * configure.ac (AC_INIT): Likewise.
8883
8884 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Remove
8885 "#define YYSTYPE int" that caused "make maintainer-check" to fail
8886 due to header ordering dependencies. I don't know why the #define
8887 was there.
8888
8889 Fix glr.cc and lalr1.cc's use of YYDEBUG so that there's zero
8890 runtime cost when YYDEBUG is not defined, and so that some tests
8891 that used to fail now work. Problem and initial suggestion by
8892 Paolo Bonzini.
8893 * data/c++.m4 (b4_parse_param_cons): Omit leading ','.
8894 * data/glr.cc (b4_parser_class_name):
8895 Initialize yycdebug_ only if YYDEBUG. Also, initialize yydebug_.
8896 (debug_level, set_debug_level): Affect yydebug_, not ::yydebug.
8897 (yydebug_) [YYDEBUG]: New member.
8898 (yycdebug_): Now defined only if YYDEBUG.
8899 * data/lalr1.cc (yydebug_, yycdebug_): Now defined only if YYDEBUG.
8900 (YYCDEBUG) [!YYDEBUG]: Don't use yydebug_ and yycdebug_.
8901 (b4_parser_class_name): Initialize yydebug_ and yycdebug_ only
8902 if YYYDEBUG.
8903 (debug_stream, set_debug_stream, debug_level, set_debug_level):
8904 Define only if YYDEBUG.
8905 * tests/calc.at (_AT_DATA_CALC_Y) [!YYDEBUG]: Omit call to
8906 set_debug_level.
8907 * tests/regression.at (_AT_DATA_DANCER_Y) [!YYDEBUG]: Likewise.
8908 * tests/calc.at (AT_CHECK_CALC_GLR_CC): Uncomment calls to
8909 AT_CHECK_CALC_GLR_CC that are working now.
8910
8911 2006-09-12 Paul Eggert <eggert@cs.ucla.edu>
8912
8913 * data/glr.cc (YYERROR_VERBOSE, YYTOKEN_TABLE): Remove.
8914 We don't need them in glr.cc, and glr.c defines them.
8915 Defining YYERROR_VERBOSE to 0 here breaks glr.c, since glr.c
8916 assumes that defining it to anything is the same as defining
8917 it to 1. Problem reported by Paolo Bonzini.
8918
8919 2006-09-12 Paolo Bonzini <bonzini@gnu.org> (tiny change)
8920
8921 * data/c.m4 (b4_null, b4_case): Define.
8922 * src/output.c (prepare_symbols): Use b4_null.
8923 (user_actions_output): Use b4_case.
8924
8925 2006-09-11 Paul Eggert <eggert@cs.ucla.edu>
8926
8927 * data/glr.c (b4_shared_declarations): Put start-header first,
8928 before any #includes that we generate, so that feature-test
8929 macros work. Problem reported by Michael Deutschmann in
8930 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00004.html>.
8931 * data/lalr1.cc: Likewise.
8932 * doc/bison.texinfo (Prologue): Document that feature-test macros
8933 should be defined before any Bison declarations.
8934 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Put defns
8935 that depend on location.hh after, not before, Bison decls, since
8936 we now include location.hh after the first user prologue.
8937
8938 * doc/bison.texinfo (Calc++ Parser): Fix memory leak reported by
8939 Sander Brandenburg in
8940 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00002.html>.
8941 Also, fix minor white space and comment issues.
8942 (Prologue): Mention that it's better to define feature-test macros
8943 before Bison declarations. Problem reported by Michael Deutschmann.
8944
8945 * README-cvs: Fix typo: "&" should be "&&". Problem reported
8946 by Jim Meyering.
8947 * m4/.cvsignore: Add argmatch.m4. Remove obstack.m4, strerror_r.m4.
8948 This adjusts to recent gnulib changes.
8949
8950 2006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
8951
8952 Finish implementation of per-type %destructor/%printer. Discussed
8953 starting at
8954 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>
8955 and
8956 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>.
8957 * NEWS (2.3+): Add a description of this feature to the default
8958 %destructor/%printer description.
8959 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise.
8960 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
8961 Invoke semantic_type_destructor_set or semantic_type_printer_set when a
8962 list node contains a semantic type.
8963 * src/symtab.c, src/symtab.h: Extend with a table that associates
8964 semantic types with their %destructor's and %printer's.
8965 (semantic_type_from_uniqstr, semantic_type_get,
8966 semantic_type_destructor_set, semantic_type_printer_set): New functions
8967 composing the public interface of that table.
8968 (symbol_destructor_get, symbol_destructor_location_get,
8969 symbol_printer_get, symbol_printer_location_get): If there's no
8970 per-symbol %destructor/%printer, look up the per-type before trying
8971 the default.
8972 * tests/actions.at (Per-type %printer and %destructor): New test case.
8973 * tests/input.at (Default %printer and %destructor redeclared):
8974 Extend to check that multiple occurrences of %symbol-default in a
8975 single %destructor/%printer declaration is an error.
8976 (Per-type %printer and %destructor redeclared, Unused values with
8977 per-type %destructor): New test cases.
8978
8979 2006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
8980
8981 Require default %destructor/%printer to be declared using
8982 %symbol-default instead of an empty symbol list, and start working on
8983 new per-type %destructor/%printer. Discussed at
8984 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00007.html>.
8985 * NEWS (2.3+): Add %symbol-default to example.
8986 * bison.texinfo (Freeing Discarded Symbols): Likewise.
8987 (Table of Symbols): Add entry for %symbol-default.
8988 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): New token.
8989 (generic_symlist, generic_symlist_item): New nonterminals for creating
8990 a list in which each item is a symbol, semantic type, or
8991 %symbol-default.
8992 (grammar_declaration): Use generic_symlist in %destructor and %printer
8993 declarations instead of symbols.1 or an empty list.
8994 (symbol_declaration, precedence_declaration, symbols.1): Update actions
8995 for changes to symbol_list.
8996 * src/reader.c: Update for changes to symbol_list.
8997 * src/scan-code.l: Likewise.
8998 * src/scan-gram.l: Scan new PERCENT_SYMBOL_DEFAULT token.
8999 * src/symlist.c, src/symlist.h: Extend such that a list node may
9000 represent a semantic type or a %symbol-default in addition to just an
9001 ordinary symbol. Add switched functions for setting %destructor's and
9002 %printer's.
9003 * tests/actions.at, tests/input.at: Add %symbol-default to all default
9004 %destructor/%printer declarations.
9005
9006 2006-08-23 Joel E. Denny <jdenny@ces.clemson.edu>
9007
9008 Whether the default %destructor/%printer applies to a particular symbol
9009 isn't a question of whether the user *declares* that symbol (in %token,
9010 for example). It's a question of whether the user by any means
9011 *defines* the symbol at all (by simply using a char token, for
9012 example). $end is defined by Bison whereas any other token with token
9013 number 0 is defined by the user. The error token is always defined by
9014 Bison regardless of whether the user declares it with %token, but we
9015 may one day let the user define error as a nonterminal instead.
9016 * NEWS (2.3+): Say "user-defined" instead of "user-declared".
9017 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise, and document
9018 the meaning of "user-defined".
9019 * tests/actions.at (Default %printer and %destructor for user-declared
9020 end token): Rename to...
9021 (Default %printer and %destructor for user-defined end token): ...
9022 this.
9023
9024 * src/symtab.c (symbol_destructor_get, symbol_printer_get): In the
9025 computation of whether to apply the default, don't maintain a list of
9026 every Bison-defined symbol. Instead, just check for a first character
9027 of '$', which a user symbol cannot have, and check for the error token.
9028
9029 2006-08-21 Joel E. Denny <jdenny@ces.clemson.edu>
9030
9031 Don't apply the default %destructor or %printer to the error token,
9032 $undefined, or $accept. This change fits the general rule that the
9033 default %destructor and %printer are only for user-declared symbols,
9034 and it solves several difficulties that are described in the new test
9035 cases listed below.
9036 * src/symtab.c (symbol_destructor_get, symbol_printer_get): Implement.
9037 * tests/actions.at (Default %printer and %destructor are not for error
9038 or $undefined, Default %printer and %destructor are not for $accept):
9039 New test cases.
9040
9041 2006-08-19 Joel E. Denny <jdenny@ces.clemson.edu>
9042
9043 Allow %start after the first rule.
9044 * src/reader.c (grammar_current_rule_begin): Don't set the start symbol
9045 when parsing the first rule.
9046 (check_and_convert_grammar): Search for it here after all grammar
9047 declarations have been parsed. Skip midrules, which have dummy LHS
9048 nonterminals.
9049 * src/symtab.c (symbol_is_dummy): New function.
9050 * src/symtab.h (symbol_is_dummy): Declare it.
9051 * tests/input.at (%start after first rule): New test.
9052
9053 2006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
9054
9055 Redo some of the previous commit: add back the ability to use
9056 non-aliased/undeclared string literals since it might be useful to
9057 those declaring %token-table.
9058 * src/reader.c (check_and_convert_grammar): Undo changes in previous
9059 commit: don't worry about complaints from symbols_pack.
9060 * src/symtab.c (symbol_new, symbol_class_set,
9061 symbol_check_alias_consistency): Undo changes in previous commit: count
9062 each string literal as a new symbol and token, assign it a symbol
9063 number, and don't complain about non-aliased string literals.
9064 (symbols_pack): Since symbol_make_alias still does not decrement symbol
9065 and token counts but does still set aliased tokens to the same number,
9066 symbol_pack_processor now leaves empty slots in the symbols array.
9067 Remove those slots.
9068 * tests/regression.at (Undeclared string literal): Remove test case
9069 added in previous commit since non-aliased string literals are allowed
9070 again.
9071 (Characters Escapes, Web2c Actions): Undo changes in previous commit:
9072 remove unnecessary string literal declarations.
9073 * tests/sets.at (Firsts): Likewise.
9074
9075 2006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
9076
9077 Don't allow an undeclared string literal, but allow a string literal to
9078 be used before its declaration.
9079 * src/reader.c (check_and_convert_grammar): Don't invoke packgram if
9080 symbols_pack complained.
9081 * src/symtab.c (symbol_new): Don't count a string literal as a new
9082 symbol.
9083 (symbol_class_set): Don't count a string literal as a new token, and
9084 don't assign it a symbol number since symbol_make_alias does that.
9085 (symbol_make_alias): It's not necessary to decrement the symbol and
9086 token counts anymore. Don't assume that an alias declaration occurs
9087 before any uses of the identifier or string, and thus don't assert that
9088 one of them has the highest symbol number so far.
9089 (symbol_check_alias_consistency): Complain if there's a string literal
9090 that wasn't declared as an alias.
9091 (symbols_pack): Bail if symbol_check_alias_consistency failed since
9092 symbol_pack asserts that every token has been assigned a symbol number
9093 although undeclared string literals have not.
9094 * tests/regression.at (String alias declared after use, Undeclared
9095 string literal): New test cases.
9096 (Characters Escapes, Web2c Actions): Declare string literals as
9097 aliases.
9098 * tests/sets.at (Firsts): Likewise.
9099
9100 2006-08-14 Joel E. Denny <jdenny@ces.clemson.edu>
9101
9102 In the grammar scanner, STRING_FINISH unclosed constructs and return
9103 them to the parser in order to improve error messages.
9104 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER,
9105 SC_BRACED_CODE, SC_PROLOGUE): Implement.
9106 * tests/input.at (Unclosed constructs): New test case.
9107 * tests/regression.at (Invalid inputs): Update now that unclosed %{ is
9108 seen.
9109
9110 * src/scan-gram.h, src/scan-gram.l (gram_last_braced_code_loc): Remove
9111 unused global.
9112
9113 2006-08-13 Joel E. Denny <jdenny@ces.clemson.edu>
9114
9115 Handle string aliases for character tokens correctly.
9116 * src/symtab.c (symbol_user_token_number_set): If the token has an
9117 alias, check and set its alias's user token number instead of its own,
9118 which is set to indicate the alias. Previously, every occurrence of
9119 the character token in the grammar overwrote that alias indicator with
9120 the character code.
9121 * tests/input.at (String aliases for character tokens): New test.
9122
9123 2006-08-12 Joel E. Denny <jdenny@ces.clemson.edu>
9124
9125 * src/parse-gram.y: Add `%expect 0' so we don't overlook conflicts.
9126
9127 2006-08-11 Paul Eggert <eggert@cs.ucla.edu>
9128
9129 * bootstrap: Put in need-ngettext argument to AM_GNU_GETTEXT,
9130 to prevent failures when building on older platforms.
9131 Check for autopoint failure.
9132 Set XGETTEXT_OPTIONS to values that check for C format strings,
9133 so that translators are warned about them (this also helps
9134 prevent core dumps).
9135
9136 * lib/subpipe.c (create_subpipe): Use new gnulib pipe_safer
9137 function, since it simplifies our code a bit.
9138
9139 * configure.ac (AC_ARG_ENABLE): Use -Wextra -Wno-sign-compare
9140 rather than -W, so we don't get bogus warnings about sign comparisons.
9141 Add -Wpointer-arith, since that warning is useful (it reports code
9142 that does not conform to C89 and that some compilers reject).
9143 * data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c: Undo latest change,
9144 since it's no longer needed.
9145
9146 2006-08-10 Joel E. Denny <jdenny@ces.clemson.edu>
9147
9148 Clean up scanners a bit.
9149 * src/flex-scanner.h (FLEX_NO_OBSTACK): New macro that blocks obstack
9150 definitions so gcc won't warn when obstack_for_string is unused.
9151 * src/scan-code.l: config.h and system.h are already #include'd by
9152 scan-code-c.c, so get rid of them here.
9153 * src/scan-gram.l: Likewise.
9154 * src/scan-skel.l: Likewise, and use flex-scanner.h without obstack
9155 definitions rather than duplicating the rest of it.
9156 * src/scan-gram-c.c, scan-skel-c.c: #include "system.h".
9157
9158 2006-08-09 Joel E. Denny <jdenny@ces.clemson.edu>
9159
9160 Suppress signed/unsigned comparison warnings for yycheck.
9161 * data/c.m4 (b4_safest_int_type): New macro.
9162 * data/glr.c, data/lalr1.cc: Wherever you compare yycheck[i] against
9163 a signed int type, cast it to b4_safest_int_type first.
9164 * data/yacc.c: Likewise.
9165 (b4_safest_int_type): Overwrite the one from c.m4 since b4_int_type is
9166 also overwritten.
9167
9168 2006-08-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
9169
9170 * doc/bison.texinfo: Fix some typos.
9171
9172 2006-08-02 Paul Eggert <eggert@cs.ucla.edu>
9173
9174 * m4/.cvsignore: Add inttypes_h.m4,lib-ld.m4, lib-prefix.m4,
9175 po.m4, stdint_h.m4, uintmax_t.m4, ulonglong.m4, warning.m4.
9176
9177 * bootstrap (gnulib_tool): Stop using --assume-autoconf;
9178 the latest gnulib does this a different way.
9179 (get_translations): Sharuzzaman Ahmat Raslan reported that the ms
9180 translation was patched, so stop omitting it.
9181
9182 2006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
9183
9184 Enable declaration of default %printer/%destructor. Make the parser
9185 use these for all user-declared grammar symbols for which the user does
9186 not declare a specific %printer/%destructor. Thus, the parser uses it
9187 for token 0 if the user declares it but not if Bison generates it as
9188 $end. Discussed starting at
9189 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>,
9190 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>,
9191 and
9192 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>.
9193 * NEWS (2.3+): Mention.
9194 * doc/bison.texinfo (Actions in Mid-Rule): It's no longer impossible to
9195 declare a %destructor for a mid-rule's semantic value. It's just
9196 impossible to declare one specific to it.
9197 (Freeing Discarded Symbols): Mention that @$ can be used in %destructor
9198 code. Describe default %destructor form.
9199 * src/parse-gram.y (grammar_declaration): Parse default
9200 %printer/%destructor declarations.
9201 * src/output.c (symbol_destructors_output): Use symbol_destructor_get
9202 and symbol_destructor_location_get rather than accessing the destructor
9203 and destructor_location members of struct symbol.
9204 (symbol_printers_output): Likewise but for %printer's.
9205 * src/reader.c (symbol_should_be_used): Likewise but for %destructor's
9206 again.
9207 * src/symtab.c (default_destructor, default_destructor_location,
9208 default_printer, default_printer_location): New static global
9209 variables to record the default %destructor and %printer.
9210 (symbol_destructor_get, symbol_destructor_location_get,
9211 symbol_printer_get, symbol_printer_location_get): New functions to
9212 compute the appropriate %destructor and %printer for a symbol.
9213 (default_destructor_set, default_printer_set): New functions to set the
9214 default %destructor and %printer.
9215 * src/symtab.h: Prototype all those new functions.
9216 * tests/actions.at (Default %printer and %destructor): New test to
9217 check that the right %printer and %destructor are called, that they're
9218 not called for $end, and that $$ and @$ work correctly.
9219 (Default %printer and %destructor for user-declared end token): New
9220 test to check that the default %printer and %destructor are called for
9221 a user-declared end token.
9222 * tests/input.at (Default %printer and %destructor redeclared, Unused
9223 values with default %destructor): New tests to check related grammar
9224 warnings and errors.
9225
9226 2006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
9227
9228 Clean up handling of %destructor for the end token (token 0).
9229 Discussed starting at
9230 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>
9231 and
9232 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00013.html>.
9233
9234 Make the skeletons consistent in how they pop the end token and invoke
9235 its %destructor.
9236 * data/glr.c (yyrecoverSyntaxError, yyparse): Don't pop the start
9237 state, which has token number 0, since this would invoke the
9238 %destructor for the end token.
9239 * data/lalr1.cc (yy::parser::parse): Don't check for the final state
9240 until after shifting the end token, or else it won't be popped.
9241 * data/yacc.c (yyparse): Likewise.
9242
9243 * data/glr.c (yyparse): Clear the lookahead after shifting it even when
9244 it's the end token. Upon termination, destroy an unshifted lookahead
9245 even when it's the end token.
9246 * data/lalr1.cc (yy::parser::parse): Likewise.
9247 * data/yacc.c (yyparse): Likewise.
9248
9249 * src/reader.c (packgram): Don't check rule 0. This suppresses unused
9250 value warnings for the end token when the user gives the end token a
9251 %destructor.
9252
9253 * tests/actions.at (Printers and Destructors): Test all the above.
9254
9255 2006-07-24 Paul Eggert <eggert@cs.ucla.edu>
9256
9257 Update to latest gnulib and gettext versions.
9258 * bootstrap (gnulib-modules): Remove hard-locale, stdio-safer.
9259 Add fopen-safer.
9260 (gnulib_files): Add m4/warning.m4. Don't worry about files
9261 overwritten by autopoint.
9262 Replace gt_INTL_SUBDIR_CORE with an empty body in m4/gettext_gl.m4.
9263 Suppress "id", "ms", "tr" translations for now, since gettext 0.15
9264 rejects them.
9265 Don't use autoreconf; instead, invoke autopoint etc. by hand,
9266 so that we can remove the intl files at a better time.
9267 (intl_files_to_remove): Remove aclocal.m4, since it gets
9268 rebuilt anyway. Remove m4/inttypes_h.m4, m4/inttypes.m4,
9269 m4/isc-posix.m4, m4/lib-ld.m4, m4/lib-prefix.m4, m4/po.m4,
9270 m4/stdint_h.m4, m4/uintmax_t.m4, m4/ulonglong.m4.
9271 Add m4/inttypes-h.m4, m4/lock.m4, m4/visibility.m4.
9272 Remove datarootdir hack; no longer needed.
9273 * configure.ac: Use gl_WARNING_CFLAGS rather than BISON_WARNING.
9274 (AM_GNU_GETTEXT_VERSION): Bump from 0.12 to 0.15.
9275 * lib/.cvsignore: Remove hard-locale.c, hard-locale.h, strdup.c,
9276 strdup.h.
9277 * m4/.cvsignore: Remove hard-locale.m4, strdup.m4.
9278 * m4/warning.m4: Remove from CVS, since we now use gnulib's version.
9279
9280 2006-07-20 Paul Eggert <eggert@cs.ucla.edu>
9281
9282 * bootstrap: Adjust to today's change to gnulib-tool by invoking
9283 it with --assume-autoconf='latest-stable'.
9284
9285 2006-07-13 Joel E. Denny <jdenny@ces.clemson.edu>
9286
9287 * src/parse-gram.y (grammar_declaration): Don't confuse Doxygen (at
9288 least 1.4.7 and 1.4.4) by putting a #line between `typedef union
9289 YYSTYPE' and `{'.
9290 * src/muscle_tab.h (muscle_grow): Replace the header comments with
9291 those from muscle_tab.c since the old ones are misleading.
9292
9293 2006-07-13 Akim Demaille <akim@epita.fr>
9294
9295 Support %define "KEY" {VALUE}.
9296 * src/scan-code.h, src/scan-code.l (translate_action)
9297 (translate_rule_action, translate_symbol_action, translate_code):
9298 Return char *, not const char *.
9299 * src/parse-gram.y (declaration): Rename as...
9300 (prologue_declaration): this.
9301 (string_content): Remove this nonterminal, use STRING.
9302 (braceless, content, content.opt): New nonterminal.
9303 Use them.
9304 (%define): Now accept content.opt, i.e., accept also BRACED_CODE
9305 as value.
9306 * src/scan-gram.l (getargs.h): Don't include it.
9307
9308 2006-07-12 Paul Eggert <eggert@cs.ucla.edu>
9309
9310 * data/lalr1.cc (YYCDEBUG): Use 'if (yydebug_) (*yycdebug_)'
9311 rather than a for-loop that declares a local bool variable. This
9312 should work around a compatibility problem with a Cray x1e C++
9313 compiler reported by Hung Nguyen in
9314 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00022.html>.
9315 The for-loop was introduced in the 2004-11-17 change but I don't
9316 know why it was needed.
9317
9318 2006-07-12 Akim Demaille <akim@epita.fr>
9319
9320 * data/c.m4: Comment changes.
9321
9322 2006-07-10 Akim Demaille <akim@lrde.epita.fr>
9323
9324 * src/complain.c (error_message, ERROR_MESSAGE): New.
9325 To factor...
9326 (fatal_at, fatal, warn_at, warn, complain_at, complain): these.
9327 * src/complain.h, src/complain.c (warning_issued): Remove, unused.
9328
9329 2006-07-09 Paul Eggert <eggert@cs.ucla.edu>
9330
9331 * NEWS: Instead of %union, you can define and use your own union type
9332 YYSTYPE if your grammar contains at least one <type> tag.
9333 Your YYSTYPE need not be a macro; it can be a typedef.
9334 * doc/bison.texinfo (Value Type, Multiple Types, Location Type):
9335 (Union Decl, Decl Summary): Document this.
9336 * data/glr.c (YYSTYPE): Implement this.
9337 * data/glr.cc (YYSTYPE): Likewise.
9338 * data/lalr1.cc (YYSTYPE): Likewise.
9339 * data/yacc.c (YYSTYPE): Likewise.
9340 * src/output.c (prepare): Output tag_seen_flag.
9341 * src/parse-gram.y (declaration, grammar_declaration):
9342 Use 'union_seen' rather than 'typed' to determine whether
9343 %union has been seen, since grammars can now be typed without
9344 %union.
9345 (symbol_declaration, type.opt, symbol_def):
9346 Keep track of whether a tag has been seen.
9347 * src/reader.c (union_seen, tag_seen): New vars.
9348 (typed): remove.
9349 * src/reader.h (union_seen, tag_seen, typed): Likewise.
9350 * src/scan-code.l (untyped_var_seen): New variable.
9351 (handle_action_dollar): Adjust to above changes.
9352 (handle_action_dollar, handle_action_at):
9353 Improve overflow checking for outlandish numbers.
9354 * tests/input.at (AT_CHECK_UNUSED_VALUES): Redo test to
9355 avoid new diagnostics generated by above changes.
9356 * tests/regression.at (YYSTYPE typedef): Add test to check
9357 for type tags without %union.
9358
9359 * src/symlist.c (symbol_list_length): Return int, not unsigned
9360 int, since callers expect int. This may need to get revisited
9361 once we have proper integer overflow checking.
9362
9363 * src/scan-gram.h (gram_scanner_cursor): Remove decl, since this
9364 object is now static.
9365
9366 * src/getargs.c (flags_argmatch): Return void, not int,
9367 to pacify ./configure --enable-gcc-warnings.
9368
9369 * src/flex-scanner.h (STRING_FREE): Don't use FLEX_PREFIX (last_string)
9370 since last_string is already defined to FLEX_PREFIX (last_string).
9371
9372 2006-07-09 Akim Demaille <akim@lrde.epita.fr>
9373
9374 Implement --warnings/-W.
9375 * src/getargs.c (report_argmatch, trace_argmatch): Remove,
9376 replaced by...
9377 (flags_argmatch, FLAGS_ARGMATCH): this new function and macro.
9378 Adjust callers.
9379 * src/getargs.h, src/getargs.c (warnings, warnings_flags)
9380 (warnings_args, warnings_types): New.
9381 (getargs, short_options, long_options): Accept -W/--warnings.
9382 Sort the options by alphabetical order, upper case letter right
9383 before its lower case.
9384
9385 2006-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
9386
9387 Change %merge result type clash warnings to errors. Discussed at
9388 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00026.html>.
9389 * src/reader.c (record_merge_function_type): Use complain_at.
9390 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
9391 declared later): Update test case results.
9392
9393 2006-07-09 Akim Demaille <akim@lrde.epita.fr>
9394
9395 * src/getargs.h, src/getargs.c: Swap --report and --trace handling
9396 to be in alphabetical order.
9397 (trace_args): Spelling fixes.
9398
9399 2006-07-09 Paul Eggert <eggert@cs.ucla.edu>
9400
9401 * data/yacc.c (YYID, yy_stack_print): Prefix local vars with "yy"
9402 so they don't collide with user-defined macros.
9403 (yy_stack_print): Don't assume that yytype_int16 promotes to int;
9404 this was never guaranteed, and now that we're using gnulib stdint,
9405 which defines int_fast16_t to long int, the problem is exposed.
9406
9407 2006-07-08 Paul Eggert <eggert@cs.ucla.edu>
9408
9409 * data/c.m4 (b4_basename): Simplify a bit, since we don't
9410 need the full POSIX semantics (and weren't implementing them
9411 anyway).
9412
9413 Adjust to Autoconf 2.60 and today's gnulib.
9414 * bootstrap (gnulib_modules): Add stdint.
9415 Remove special case for m4/onceonly_2_57.m4, since gnulib-tool
9416 no longer copies it.
9417 (intl_files_to_remove): Remove m4/longlong.m4 and m4/wchar_t.m4,
9418 since stdint needs the former and wcwidth (which is now required
9419 by mbswidth) needs the latter.
9420 Append 'datarootdir = @datarootdir@' to po/Makefile.in.in, to
9421 work around a compatibility glitch between gettext 0.14.6 and
9422 Autoconf 2.60.
9423 * configure.ac (AC_PREREQ): Require Autoconf 2.60.
9424 Do not check for uintptr_t, since new stdint module does the right
9425 thing.
9426 * lib/.cvsignore: Remove alloca.c, alloca.h, alloca_.h.
9427 Add stdint.h, stdint_.h, wcwidth.h.
9428 * m4/.cvsignore: Remove alloca.m4, onceonly.m4.
9429 Add absolute-header.m4, double-slash-root.m4, longlong.m4,
9430 stdint.m4, wchar_t.m4, wcwidth.m4.
9431 * src/files.c: Include <dirname.h> and <stdio-safer.h> in the
9432 usual order for ../lib/*.h files.
9433 (file_name_split): Use last_component, not base_name, to adjust
9434 to gnulib changes.
9435 * src/parse-gram.h: Include <strverscmp.h> in the usual order
9436 for ../lib/*.h files.
9437 (YYTYPE_INT16, YYTYPE_INT8, YYTYPE_UINT16, YYTYPE_UINT8):
9438 Define unconditionally, since we now assume the stdint module.
9439 * src/scan-skel.l: Include <dirname.h>.
9440 (BASE_QPUTS): Use last_component, not base_name.
9441 * src/system.h: Include <unlocked-io.h> in the usual order
9442 for ../lib/*.h files. Include <stdint.h> unconditionally,
9443 since we now use the stdint module.
9444 (uintptr_t): Declare if UINTPTR_MAX is not defined, not
9445 HAVE_UINTPTR_T, since we now use the stdint module.
9446 (base_name): Remove decl, since files now include <dirname.h>
9447 to get the decl.
9448
9449 2006-07-08 Akim Demaille <akim@lrde.epita.fr>
9450
9451 * data/c.m4 (b4_location_initial_column, b4_location_initial_line):
9452 New, default to 1.
9453 * data/yacc.c, data/glr.c, data/location.cc: Use them.
9454 * NEWS, doc/bison.texinfo: The initial column and line are 1 by
9455 default.
9456 * tests/calc.at: Adjust.
9457
9458 2006-07-08 Akim Demaille <akim@lrde.epita.fr>
9459
9460 * data/c.m4 (b4_basename): New.
9461 (b4_syncline): Also output the location of its invocation (from
9462 the skeleton).
9463 (b4_user_action, b4_define_user_action, b4_user_actions)
9464 (b4_user_initial_action, b4_user_post_prologue, b4_user_start_header)
9465 (b4_user_stype): New.
9466 * data/yacc.c, data/glr.c, data/lalr1.cc, data/glr.cc: Use them.
9467
9468 2006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
9469
9470 In the grammar file, the first column is 1 not 0 on the first line as
9471 on every other line.
9472 * src/parse-gram.y (%initial-action): Initialize @$ correctly.
9473 * tests/input.at (Torturing the Scanner): Update output.
9474
9475 * src/scan-gram.l (scanner_cursor): Declare it static.
9476
9477 2006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
9478
9479 In warnings, say "previous declaration" rather than "first
9480 declaration".
9481 * src/symtab.c (redeclaration): Do that here.
9482 * src/reader.c (record_merge_function_type): In the case of a result
9483 type clash, report the previous declaration rather than the very first
9484 one in the grammar file.
9485 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
9486 declared later): Add a third declaration to check this behavior.
9487 * tests/input.at (Incompatible Aliases): Update output.
9488
9489 2006-06-27 Akim Demaille <akim@epita.fr>
9490
9491 * doc/Doxyfile.in: New.
9492 * doc/Makefile.am: Use it.
9493 * src/lalr.h, src/symtab.h: Initial doxygenation.
9494
9495 2006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
9496
9497 Don't miss %merge result type warnings just because the LHS types are
9498 declared after the %merge. This continues the effort of the previous
9499 patch.
9500 * src/reader.c (get_merge_function): Don't set the merger type yet.
9501 (record_merge_function_type): New function for setting the merger type
9502 and checking for clashes.
9503 (grammar_current_rule_merge_set): Set the location of the %merge for
9504 the current rule.
9505 (packgram): Invoke record_merge_function_type for each rule now that
9506 all symbol type declarations have been parsed.
9507 * src/reader.h (merger_list.type_declaration_location): New member
9508 storing the location of the first %merge from which the type for this
9509 merging function was derived.
9510 * src/symlist.h (symbol_list.merger_declaration_location): New member
9511 storing the location of a rule's %merge, if any.
9512 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
9513 declared later): New test to catch the error fixed by the above patch.
9514
9515 2006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
9516
9517 Get action warnings (grammar_rule_check) right even when symbol
9518 declarations appear after the rules. Discussed at
9519 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00108.html>
9520 and
9521 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00151.html>.
9522 Don't mistake the type of $$ in a midrule to be that of its parent
9523 rule's $$.
9524 * src/reader.c (grammar_current_rule_end): Don't invoke
9525 grammar_rule_check yet since not all symbol declarations may have been
9526 parsed yet.
9527 (grammar_midrule_action): Likewise.
9528 Don't record whether the midrule's $$ has been used yet since actions
9529 haven't been translated yet.
9530 Record the midrule's parent rule and its RHS index within the parent
9531 rule.
9532 (grammar_current_rule_action_append): Don't translate the action yet
9533 since not all symbol declarations may have been parsed yet and, thus,
9534 warnings about types for $$, $n, @$, and @n can't be reported yet.
9535 (packgram): Translate the action and invoke grammar_rule_check now that
9536 all symbol declarations have been parsed.
9537 * src/scan-code.l (handle_action_dollar): Now that this is invoked
9538 after parsing the entire grammar file, the symbol list here in the case
9539 of a midrule is actually the midrule's empty RHS, so reference its
9540 parent rule's RHS where necessary.
9541 On the other hand, now that you can already know it's a midrule, you
9542 aren't forced to think $$ has the same type as its parent rule's $$.
9543 (handle_action_at): In the case of a midrule, reference the parent rule
9544 where necessary.
9545 * src/symlist.c (symbol_list_new): Initialize new midrule-related
9546 members.
9547 (symbol_list_length): Now that this is invoked after all rules have
9548 been parsed, a NULL symbol (rather than a NULL symbol list node)
9549 terminates a rule. symbol_list_print already does this correctly.
9550 * src/symlist.h (symbol_list.midrule_parent_rule,
9551 symbol_list.midrule_parent_rhs_index): New members so that midrules can
9552 remember their relationships with their parents.
9553 * tests/input.at (Type Clashes): Extend to catch the midrule $$ error
9554 fixed by the above patch.
9555 (_AT_UNUSED_VALUES_DECLARATIONS, AT_CHECK_UNUSED_VALUES): New m4 macros
9556 implementing...
9557 (Unused values): ... this old test case and...
9558 (Unused values before symbol declarations): ... this new test case.
9559 This one is the same as `Unused values' except that all symbol
9560 declarations appear after the rules in order to catch the rest of the
9561 errors fixed by the above patch.
9562
9563 2006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
9564
9565 More cleanup.
9566 * src/reader.c (current_rule): Declare it static since it's no longer
9567 used outside this file.
9568 (grammar_current_rule_action_append): Remove redundant arguments from
9569 translate_rule_action invocation.
9570 * src/reader.h (current_rule): Remove this unused extern.
9571 * src/scan-code.h (translate_rule_action): Remove redundant arguments.
9572 * src/scan-code.l (translate_rule_action): Likewise.
9573
9574 2006-06-25 Joel E. Denny <jdenny@ces.clemson.edu>
9575
9576 Clean up yesterday's patch.
9577 * parse-gram.y (rhs): Move grammar_midrule_action invocation from here
9578 to...
9579 * src/reader.c (grammar_current_rule_action_append): ... here for
9580 consistency with grammar_current_rule_symbol_append.
9581 * tests/regression.at (Braced code in declaration in rules section):
9582 Make yyerror and yylex static as usual.
9583
9584 2006-06-24 Joel E. Denny <jdenny@ces.clemson.edu>
9585
9586 Fix bug that mistakes braced code in a declaration in the rules section
9587 to be a rule action. Mentioned at
9588 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00105.html>.
9589 * src/scan-gram.l: Move midrule action detection from the start of the
9590 scanning of any braced code to...
9591 * src/parse-gram.y (rhs): ... the parsing of braced code as a rule
9592 action. For readability, use $2 and @2 rather than the equivalent
9593 global variables.
9594 * tests/regression.at (Braced code in declaration in rules section):
9595 New test to catch the error fixed by the above patch.
9596
9597 Work on code readability some.
9598 * src/scan-code.l (current_rule): Get rid of this misleading and
9599 redundant declaration: it's actually extern'ed in reader.h.
9600 (YY_DECL, code_lex, handle_action_dollar, handle_action_at,
9601 translate_action): Add a rule argument and use it instead of the global
9602 current_rule.
9603 (translate_rule_action): This already receives current_rule through an
9604 argument, so pass it on to translate_action instead of assigning
9605 current_rule to current_rule.
9606 (translate_symbol_action, translate_code): Pass rule = NULL to
9607 translate_action.
9608
9609 2006-06-23 Joel E. Denny <jdenny@ces.clemson.edu>
9610
9611 Rename %before-definitions to %start-header and %after-definitions to
9612 %end-header. Don't use these declarations to separate pre-prologue
9613 blocks from post-prologue blocks. Add new order-independent
9614 declarations %before-header and %after-header as alternatives to the
9615 traditional Yacc pre-prologue and post-prologue blocks. Discussed at
9616 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00110.html>.
9617 * NEWS (2.3+): Update for these changes.
9618 * data/glr.c (b4_before_definitions): Update to...
9619 (b4_start_header): ... this.
9620 (b4_after_definitions): Update to...
9621 (b4_end_header): ... this.
9622 * data/glr.cc: Likewise.
9623 * data/lalr1.cc: Likewise.
9624 * data/yacc.c: Likewise.
9625 * doc/bison.texinfo (The prologue): Update names, and replace remaining
9626 prologue blocks with %*-header declarations.
9627 (Calc++ Parser): Likewise.
9628 (Decl Summary): Update names.
9629 (Table of Symbols): Update description.
9630 * src/parse-gram.y (PERCENT_AFTER_DEFINITIONS): Update to...
9631 (PERCENT_END_HEADER): ... this.
9632 (PERCENT_BEFORE_DEFINITIONS): Update to...
9633 (PERCENT_START_HEADER): ... this.
9634 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
9635 (declaration): Update token names and m4 macro names.
9636 When parsing %end-header and %start-header, invoke translate_code
9637 before muscle_code_grow, and no longer set global booleans to remember
9638 whether these declarations have been seen.
9639 Parse new %after-header and %before-header.
9640 * src/reader.c (before_definitions, after_definitions): Remove.
9641 (prologue_augment): Accept a new bool argument to specify whether to
9642 augment the pre-prologue or post-prologue.
9643 * src/reader.h (before_definitions, after_definitions): Remove these
9644 extern's.
9645 (prologue_augment): Add new bool argument.
9646 * src/scan-gram.l (PERCENT_AFTER_DEFINITIONS): Update to...
9647 (PERCENT_END_HEADER): ... this.
9648 (PERCENT_BEFORE_DEFINITIONS): Update to...
9649 (PERCENT_START_HEADER): ... this.
9650 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
9651 * tests/actions.at (Printers and Destructors): Update names.
9652
9653 2006-06-22 Joel E. Denny <jdenny@ces.clemson.edu>
9654
9655 Add comparison operators for C++ location classes. Discussed at
9656 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00092.html>.
9657 * data/c++.m4 (b4_define_location_comparison): New boolean %define
9658 declaration indicating whether filename_type has an operator==. If
9659 filename_type is `std::string', it defaults to `1', `0' otherwise.
9660 * data/location.cc: Iff b4_define_location_comparison is `1', add
9661 operator== and operator!= for class position and for class location.
9662
9663 Some minor fixes.
9664 * src/scan-action.l: Remove unused file.
9665 * src/symtab.c (symbol_printer_set): Use printer_location not
9666 destructor_location.
9667 * src/symtab.h (struct symbol): Replace incorrect source comment for
9668 printer members.
9669 * tests/input.at (Incompatible Aliases): Update output with correct
9670 printer location.
9671
9672 2006-06-20 Joel E. Denny <jdenny@ces.clemson.edu>
9673
9674 Don't put the pre-prologue in the header file. For the yacc.c code
9675 file and the glr.c header and code files, move the pre-prologue before
9676 the token definitions. Add new %before-definitions and
9677 %after-definitions to declare code that will go in both the header file
9678 and code file. Discussed at
9679 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00000.html>,
9680 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00016.html>,
9681 and
9682 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00055.html>.
9683 * NEWS (2.3+): Describe these changes.
9684 * data/glr.c (b4_pre_prologue): Move from within to before...
9685 (b4_shared_declarations): ... this.
9686 Add new b4_before_definitions before b4_token_enums.
9687 Add new b4_after_definitions at the end.
9688 * data/glr.cc (b4_pre_prologue): Replace with...
9689 (b4_before_definitions): ... this in the header file.
9690 (b4_after_definitions): New near the end of the header file.
9691 * data/lalr1.cc (b4_pre_prologue): Move from the header file to the
9692 code file right before including the header file.
9693 (b4_before_definitions): New in the previous position of
9694 b4_pre_prologue in the header file.
9695 (b4_after_definitions): New near the end of the header file.
9696 * data/yacc.c: Clean up some m4 quoting especially in the header file.
9697 (b4_token_enums_defines): In the code file, move to right before
9698 YYSTYPE for consistency with the header file.
9699 (b4_before_definitions): New right before b4_token_enums_defines in
9700 both the header and code file.
9701 (b4_after_definitions): New right after YYLTYPE and yylloc in both the
9702 header and code file.
9703 * doc/bison.texinfo (Prologue): Show use of %before-definitions instead
9704 of prologues for %union dependencies.
9705 (Decl Summary): In %defines description, mention the effect of
9706 %before-definitions and %after-definitions on the header file.
9707 (Calc++ Parser): Forward declare driver in a %before-definitions rather
9708 than in the pre-prologue so that make check succeeds.
9709 (Table of Symbols): Add entries for %before-definitions and
9710 %after-definitions.
9711 * src/parse-gram.y (PERCENT_BEFORE_DEFINITIONS): New token for
9712 %before-definitions.
9713 (PERCENT_AFTER_DEFINITIONS): New token for %after-definitions.
9714 (declaration): Parse those declarations and append to
9715 b4_before_definitions and b4_after_definitions, respectively.
9716 * src/reader.c (before_definitions, after_definitions): New bools to
9717 track whether those declarations have been seen.
9718 (prologue_augment): Add to the post-prologue if %union,
9719 %before-definitions, or %after-definitions has been seen.
9720 * src/reader.h (before_definitions, after_definitions): New extern's.
9721 * src/scan-gram.l: Scan the new declarations.
9722 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Place the second
9723 prologue block in a %before-definitions or a %after-definitions based
9724 on whether the %union is declared.
9725 * tests/regression.at (Early token definitions with --yacc, Early token
9726 definitions without --yacc): Move tests for token definitions into the
9727 post-prologue since token names are no longer defined in the
9728 pre-prologue.
9729
9730 2006-06-20 Akim Demaille <akim@epita.fr>
9731
9732 * src/symtab.h, src/symtab.c (symbol_from_uniqstr): New.
9733 (symbol_get): Use it.
9734 * src/parse-gram.y: Use it.
9735
9736 2006-06-19 Joel E. Denny <jdenny@ces.clemson.edu>
9737
9738 * src/scan-gram.l: Remove unused declaration of last_string_1 so the
9739 build succeeds when configured with --enable-gcc-warnings.
9740
9741 2006-06-19 Paul Eggert <eggert@cs.ucla.edu>
9742
9743 * src/parse-gram.y (char_name): New function.
9744 (CHAR, STRING, string_content): For %printer, properly escape.
9745 (ID): Prefer fputs to fprintf.
9746 (id): Reindent to be consistent with other rules.
9747 Properly quote char.
9748
9749 The Translation Project changed its way of publishing translations
9750 to maintainers. I haven't received any responses to my request
9751 for supporting the old way, or for documenting the new way. I
9752 have modified 'bootstrap' to use screen scraping
9753 (in this case, HTML scraping). This is unreliable and inelegant,
9754 but I don't see any better way. Yuck.
9755 * bootstrap (TP_URL, WGET_COMMAND): New vars.
9756 (get_translations): New function, which uses HTML scraping to
9757 deduce locations of latest translations.
9758 Use this function to grab both bison and bison-runtime .po files.
9759 Don't bother priming the pump for the runtime-po domain any more,
9760 as it's now translated better than bison is.
9761
9762 2006-06-19 Akim Demaille <akim@epita.fr>
9763
9764 * src/scan-gram.l: No longer "parse" things after `%union' until
9765 `{'. Rather, return a single "%union" token.
9766 No longer make symbols: return strings, and leave the conversion
9767 to symbols to the parser.
9768 (SC_PRE_CODE, token_type): Remove.
9769 * src/parse-gram.y (%union): New field `character'.
9770 Sort tokens.
9771 (CHAR): New token.
9772 (ID, ID_COLON): Now that the scanner no longer makes them
9773 identifiers, adjust all uses to invoke symbol_get.
9774 (id_colon): New, wraps the conversion from string to symbol.
9775 (%union): Accept a possible union_name.
9776 (symbol): Now can be a char.
9777 * data/c.m4 (b4_union_name): Leave a default value.
9778 * data/glr.c, data/yacc.c: Use it.
9779
9780 2006-06-11 Joel E. Denny <jdenny@ces.clemson.edu>
9781
9782 For associating token numbers with token names for "yacc.c", don't use
9783 #define statements unless `--yacc' is specified; always use enum
9784 yytokentype. Most important discussions start at:
9785 <http://lists.gnu.org/archive/html/bison-patches/2005-09/msg00053.html>,
9786 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00052.html>,
9787 and
9788 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00043.html>.
9789 * NEWS (2.3+): Mention.
9790 * data/c.m4 (b4_yacc_if): New.
9791 (b4_token_enums_defines): Use b4_yacc_if to decide whether to add the
9792 token #define's.
9793 * doc/bison.texinfo (Bison Options): Describe the effect of `--yacc'
9794 on token name definitions.
9795 * src/getargs.c (usage): Capitalize `Yacc' in English.
9796 * src/output.c (prepare): Define b4_yacc_flag.
9797 * tests/regression.at (Early token definitions): Test that tokens names
9798 are defined before the pre-prologue not just before the post-prologue.
9799 Remove this test case and copy to...
9800 (Early token definitions with --yacc): ... this to test #define's.
9801 (Early token definitions without --yacc): ... and this to test enums.
9802
9803 2006-06-11 Paul Eggert <eggert@cs.ucla.edu>
9804
9805 * NEWS: Reword the post-2.3 change to not be so optimistic about
9806 removing the old "look-ahead" spelling.
9807 Update previous look-ahead/lookahead change reports.
9808 * REFERENCES: look-ahead -> lookahead (since that's
9809 what he actually wrote).
9810 * doc/refcard.tex: look ahead -> lookahead,
9811 look-ahead -> lookahead
9812
9813 2006-06-09 Joel E. Denny <jdenny@ces.clemson.edu>
9814
9815 For consistency, use `lookahead' instead of `look-ahead' or
9816 `look_ahead'. Discussed starting at
9817 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00049.html>
9818 and then at
9819 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00017.html>.
9820 * NEWS: For the next release, note the change to `--report'.
9821 * TODO, doc/bison.1: Update English.
9822 * doc/bison.texinfo: Update English.
9823 (Understanding Your Parser, Bison Options): Document as
9824 `--report=lookahead' rather than `--report=look-ahead'.
9825 * src/conflicts.c: Update English in comments.
9826 (lookahead_set): Rename from look_ahead_set.
9827 (flush_reduce): Rename argument look_ahead_tokens to lookahead_tokens.
9828 (resolve_sr_conflict): Rename local look_ahead_tokens to
9829 lookahead_tokens, and update other uses.
9830 (flush_shift, set_conflicts, conflicts_solve, count_sr_conflicts,
9831 count_rr_conflicts, conflicts_free): Update uses.
9832 * src/getargs.c (report_args): Move "lookahead" before alternate
9833 spellings.
9834 (report_types): Update uses.
9835 (usage): For `--report' usage description, state `lookahead' spelling
9836 rather than `look-ahead'.
9837 * src/getargs.h (report.report_lookahead_tokens): Rename from
9838 report_look_ahead_tokens.
9839 * src/lalr.c: Update English in comments.
9840 (compute_lookahead_tokens): Rename from compute_look_ahead_tokens.
9841 (state_lookahead_tokens_count): Rename from
9842 state_look_ahead_tokens_count.
9843 Rename local n_look_ahead_tokens to n_lookahead_tokens.
9844 (lookahead_tokens_print): Rename from look_ahead_tokens_print.
9845 Rename local n_look_ahead_tokens to n_lookahead_tokens.
9846 Update other uses.
9847 Update English in output.
9848 (add_lookback_edge, initialize_LA, lalr, lalr_free): Update uses.
9849 * src/print.c: Update English in comments.
9850 (lookahead_set): Rename from look_ahead_set.
9851 (print_reduction): Rename argument lookahead_token from
9852 look_ahead_token.
9853 (print_core, state_default_rule, print_reductions, print_results):
9854 Update uses.
9855 * src/print_graph.c: Update English in comments.
9856 (print_core): Update uses.
9857 * src/state.c: Update English in comments.
9858 (reductions_new): Update uses.
9859 (state_rule_lookahead_tokens_print): Rename from
9860 state_rule_look_ahead_tokens_print, and update other uses.
9861 * src/state.h: Update English in comments.
9862 (reductions.lookahead_tokens): Rename from look_ahead_tokens.
9863 (state_rule_lookahead_tokens_print): Rename from
9864 state_rule_look_ahead_tokens_print.
9865 * src/tables.c: Update English in comments.
9866 (conflict_row, action_row): Update uses.
9867 * tests/glr-regression.at
9868 (Incorrect lookahead during deterministic GLR,
9869 Incorrect lookahead during nondeterministic GLR): Rename
9870 print_look_ahead to print_lookahead.
9871 * tests/torture.at: Update English in comments.
9872 (AT_DATA_LOOKAHEAD_TOKENS_GRAMMAR): Rename from
9873 AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR.
9874 (Many lookahead tokens): Update uses.
9875 * data/glr.c: Update English in comments.
9876 * lalr1.cc: Likewise.
9877 * yacc.c: Likewise.
9878 * src/conflicts.h: Likewise.
9879 * src/lalr.h: Likewise.
9880 * src/main.c: Likewise.
9881 * src/output.c: Likewise.
9882 * src/parse-gram.c: Likewise.
9883 * src/tables.h: Likewise.
9884 * tests/calc.at: Likewise.
9885
9886 2006-06-08 Joel E. Denny <jdenny@ces.clemson.edu>
9887
9888 * src/flex-scanner.h (yytext): Remove stray `*/' in #define.
9889
9890 2006-06-07 Paul Eggert <eggert@cs.ucla.edu>
9891
9892 * TODO: Add request from Nelson H. F. Beebe to be able to install
9893 Bison without installing the yacc script.
9894
9895 2006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
9896
9897 * src/flex-scanner.h: For the sake of Flex 2.5.4, don't #define yyleng
9898 and yytext if they're already #define'd.
9899 * src/flex-scanner.h, src/location.h: Move #include "system.h" to...
9900 * src/scan-code-c.c: ... here.
9901 * src/scan-code.l, src/scan-gram.l: ... and here. Also #include
9902 <config.h>.
9903
9904 2006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
9905
9906 Get Bison to build again when configured with --enable-gcc-warnings.
9907 * src/location.c, src/location.h, src/main.c, src/scan-code.l: Add some
9908 missing #include's.
9909 * src/scan-code.l (handle_action_dollar, handle_action_at): Rename
9910 loc argument as it shadows a global.
9911 * src/scan-gram.l: Remove stray comma that prevents boundary_set
9912 invocation.
9913
9914 * src/.cvsignore: Add scan-code.c.
9915
9916 2006-06-07 Akim Demaille <akim@epita.fr>
9917
9918 * src/scan-gram.l: Move the "add a trailing ; to actions" code
9919 to...
9920 * src/scan-code.l: here.
9921 * tests/input.at (Torturing the Scanner): Fix another location
9922 error.
9923
9924 2006-06-07 Akim Demaille <akim@epita.fr>
9925
9926 * src/Makefile.am (BUILT_SOURCES): Fix the trailing backslash.
9927
9928 2006-06-06 Akim Demaille <akim@epita.fr>
9929
9930 Extract the parsing of user actions from the grammar scanner.
9931 As a consequence, the relation between the grammar scanner and
9932 parser is much simpler. We can also split "composite tokens" back
9933 into simple tokens.
9934 * src/gram.h (ITEM_NUMBER_MAX, RULE_NUMBER_MAX): New.
9935 * src/scan-gram.l (add_column_width, adjust_location): Move to and
9936 rename as...
9937 * src/location.h, src/location.c (add_column_width)
9938 (location_compute): these.
9939 Fix the column count: the initial column is 0.
9940 (location_print): Be robust to ending column being 0.
9941 * src/location.h (boundary_set): New.
9942 * src/main.c: Adjust to scanner_free being renamed as
9943 gram_scanner_free.
9944 * src/output.c: Include scan-code.h.
9945 * src/parse-gram.y: Include scan-gram.h and scan-code.h.
9946 Use boundary_set.
9947 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_INITIAL_ACTION)
9948 (PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Remove the {...} part,
9949 which is now, again, a separate token.
9950 Adjust all dependencies.
9951 Whereever actions with $ and @ are used, use translate_code.
9952 (action): Remove this nonterminal which is now useless.
9953 * src/reader.c: Include assert.h, scan-gram.h and scan-code.h.
9954 (grammar_current_rule_action_append): Use translate_code.
9955 (packgram): Bound check ruleno, itemno, and rule_length.
9956 * src/reader.h (gram_in, gram__flex_debug, scanner_cursor)
9957 (last_string, last_braced_code_loc, max_left_semantic_context)
9958 (scanner_initialize, scanner_free, scanner_last_string_free)
9959 (gram_out, gram_lineno, YY_DECL_): Move to...
9960 * src/scan-gram.h: this new file.
9961 (YY_DECL): Rename as...
9962 (GRAM_DECL): this.
9963 * src/scan-code.h, src/scan-code.l, src/scan-code-c.c: New.
9964 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
9965 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
9966 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
9967 Move these declarations, and...
9968 (obstack_for_string, STRING_GROW, STRING_FINISH, STRING_FREE):
9969 these to...
9970 * src/flex-scanner.h: this new file.
9971 * src/scan-gram.l (rule_length, rule_length_overflow)
9972 (increment_rule_length): Remove.
9973 (last_braced_code_loc): Rename as...
9974 (gram_last_braced_code_loc): this.
9975 Adjust to the changes of the parser.
9976 Move all the handling of $ and @ into...
9977 * src/scan-code.l: here.
9978 * src/scan-gram.l (handle_dollar, handle_at): Remove.
9979 (handle_action_dollar, handle_action_at): Move to...
9980 * src/scan-code.l: here.
9981 * src/Makefile.am (bison_SOURCES): Add flex-scanner.h,
9982 scan-code.h, scan-code-c.c, scan-gram.h.
9983 (EXTRA_bison_SOURCES): Add scan-code.l.
9984 (BUILT_SOURCES): Add scan-code.c.
9985 (yacc): Be robust to white spaces.
9986
9987 * tests/conflicts.at, tests/input.at, tests/reduce.at,
9988 * tests/regression.at: Adjust the column numbers.
9989 * tests/regression.at: Adjust the error message.
9990
9991 2006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
9992
9993 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
9994 Use Akim's wording from
9995 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00056.html>.
9996
9997 2006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
9998
9999 Between Bison releases, manually append `+' to the previous Bison
10000 release number, and use that as a signal to automatically print the
10001 ChangeLog's CVS Id keyword from --version. Discussed starting at
10002 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00028.html>.
10003 * ChangeLog: Add Id header.
10004 * configure.ac (AC_INIT): Append `+' to `2.3'.
10005 * src/.cvsignore: Add revision.c.
10006 * src/Makefile.am (bison_SOURCES): Add revision.c and revision.h.
10007 (BUILT_SOURCES): Add revision.c.
10008 (revision.c): New target rule. This file defines a new global variable
10009 named revision. It initializes it with either the Id from ChangeLog
10010 or, if VERSION doesn't contain `+', with the empty string.
10011 * src/getargs.c (version): Print the value of revision.
10012 * src/revision.h: Extern revision.
10013
10014 2006-06-05 Paul Eggert <eggert@cs.ucla.edu>
10015
10016 * NEWS: Version 2.3.
10017 * configure.ac (AC_INIT): Likewise.
10018
10019 2006-05-30 Paul Eggert <eggert@cs.ucla.edu>
10020
10021 * data/glr.c (YYRECOVERING): Define to be a function-like macro
10022 with no arguments, not as an object-like macro. This is for
10023 compatibility with data/yacc.c. Problem reported by John P. Hartmann in
10024 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00059.html>.
10025 * doc/bison.texinfo (Action Features, Error Recovery, Table of Symbols):
10026 Document this.
10027
10028 2006-05-30 Joel E. Denny <jdenny@ces.clemson.edu>
10029
10030 * src/getargs.c (usage): Back out yesterday's modification of the
10031 --help output so that we don't have to wait for translation before
10032 releasing 2.3.
10033
10034 2006-05-29 Paul Eggert <eggert@cs.ucla.edu>
10035
10036 * doc/bison.texinfo (Introduction): Don't say "GLR grammar".
10037 Problem reported by Akim Demaille.
10038
10039 2006-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
10040
10041 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
10042
10043 2006-05-26 Paul Eggert <eggert@cs.ucla.edu>
10044
10045 * data/yacc.c (yy_reduce_print): Omit trailing white space in
10046 generated source code. Problem reported by Frans Englich in
10047 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00049.html>.
10048
10049 2006-05-22 Paul Eggert <eggert@cs.ucla.edu>
10050
10051 * Makefile.maint (gzip_rsyncable, GZIP_ENV): Compute within the
10052 shell, not within 'make', so that 'make' by an ordinary builder
10053 (using GNU make) does not worry about configuring gzip. This also
10054 works around a bug reported independently by Keith Thompson and by
10055 Georg Schwarz, whereby gzip 1.2.4 --help would output usage on
10056 stderr rather than stdout, messing up the build logs.
10057
10058 2006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
10059
10060 * data/yacc.c (yyparse): Wrap the final return from yyparse inside YYID
10061 to make sure that YYID will never be unused. This fixes a 'make
10062 maintainer-check' failure caused by the recent changes to the 'Trivial
10063 grammars' test case, which caused g++ 4.1.0 to complain that YYID was
10064 not used.
10065 * data/glr.c (yyparse): Wrap yyparse's return inside YYID just in case.
10066
10067 2006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
10068
10069 * data/glr.c (yyresolveLocations): Remove bogus YYASSERT that the
10070 state before an empty RHS is always resolved here. Only the location
10071 of that state is guaranteed to be resolved, and that's enough. This
10072 fixes the remaining bug reported by Derek M. Jones in
10073 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
10074 * tests/glr-regression.at (Uninitialized location when reporting
10075 ambiguity): Test the above case.
10076 Also, the embedded comments in this test case claim it checks the case
10077 of an empty RHS that has inherited the initial location. However, the
10078 corresponding LHS was already resolved, so yyresolveLocations didn't
10079 actually have reason to modify it. Fix this by forcing
10080 nondeterministic operation at the beginning of the parse.
10081
10082 2006-05-20 Paul Eggert <eggert@cs.ucla.edu>
10083
10084 * data/c.m4 (b4_yy_symbol_print_generate):
10085 (b4_yy_symbol_print_generate): Use 'YYSTYPE const' rather than
10086 'const YYSTYPE', and similarly for YYLTYPE. This fixes one
10087 of the bugs reported today by Derek M Jones in
10088 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
10089 * doc/bison.texinfo (Value Type): Document that YYSTYPE must be
10090 defined to be a type name without parens or brackets.
10091 (Location Type): Similarly for YYLTYPE.
10092 * tests/regression.at (Trivial grammars): Put in a test for this
10093 bug that will be caught by 'make maintainer-check' (though not,
10094 alas, by 'make check' unless your compiler is picky).
10095
10096 2006-05-19 Paul Eggert <eggert@cs.ucla.edu>
10097
10098 * NEWS: Version 2.2.
10099 * configure.ac (AC_INIT): Likewise.
10100
10101 2006-05-17 Joel E. Denny <jdenny@ces.clemson.edu>
10102
10103 * data/glr.c (yyreportTree): Make room in yystates for the state
10104 preceding the RHS. This fixes the segmentation fault reported by Derek
10105 M. Jones in
10106 <http://lists.gnu.org/archive/html/help-bison/2006-05/msg00035.html>.
10107 (yyreportTree, yypdumpstack): Subtract 1 from yyrule before printing
10108 to the user. Reported for yyreportTree by Derek M. Jones later in the
10109 same thread.
10110 * THANKS: Add Derek M. Jones.
10111 Update my email address.
10112 Fix typo in Steve Murphy's name.
10113
10114 2006-05-14 Paul Eggert <eggert@cs.ucla.edu>
10115
10116 * data/glr.c (yyreportSyntaxError): Fix off-by-one error in
10117 checking against YYLAST that caused the parser to miss a potential
10118 alternative in its diagnostic.
10119 Problem reported by Maria Jose Moron Fernandez in
10120 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00024.html>.
10121 * data/lalr1.cc (yysyntax_error_): Likewise.
10122 * data/yacc.c (yysyntax_error): Likewise.
10123 * tests/regression.at (_AT_DATA_DANCER_Y): Use static array for
10124 tokens, in case we run into an older C compiler.
10125 (_AT_DATA_EXPECT2_Y, AT_CHECK_EXPECT2): New macros.
10126 Use them to check for the off-by-one error fixed above.
10127
10128 * data/yacc.c (yytnamerr): Fix typo: local var should be of type
10129 YYSIZE_T, not size_t.
10130 * tests/regression.at (Trivial grammars): New test, to catch
10131 the error fixed by the above patch.
10132
10133 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
10134
10135 * doc/bison.texinfo (C++ Bison Interface): Clarify the naming
10136 scheme.
10137 Reported by Steve Murphy.
10138
10139 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
10140
10141 * data/glr.cc, data/lalr1.cc: Using %defines is mandatory.
10142 * data/glr.cc: b4_location_flag is now b4_locations_flag.
10143
10144 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
10145
10146 Implement --trace=m4.
10147 * src/getargs.c (trace_types, trace_args): Accept trace_m4.
10148 * src/output.c (output_skeleton): When set, pass -dV to m4.
10149
10150 Factor the handling of flags in m4.
10151 * src/output.c (prepare): Rename the muscle names debug, defines,
10152 error_verbose to debug_flag, defines_flag, error_verbose_flag.
10153 * data/c.m4: Adjust.
10154 (_b4_define_flag_if, b4_define_flag_if, b4_defines_if): New.
10155 Use b4_define_flag_if to define other b4_FLAG_if macros.
10156 (b4_location_if): As a consequence, rename as...
10157 (b4_locations_if): this, for consistency.
10158 Adjust all the skeletons.
10159
10160 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
10161
10162 * etc/bench.pm: Shorten bench names.
10163
10164 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
10165
10166 * src/output.h, src/output.c (error_verbose): Move to...
10167 * src/getargs.h, src/getargs.c: here.
10168 Sort the flags.
10169 Adjust dependencies.
10170
10171 2006-05-13 Paul Eggert <eggert@cs.ucla.edu>
10172
10173 * data/c.m4 (b4_copyright): Put the special exception for Bison
10174 skeletons here, so we don't have to put it in each skeleton. All
10175 uses changed. Suggested by Akim Demaille. Also, wrap the
10176 copyright notice, in case it is longer than 80 columns. Replace
10177 comma by newline after title.
10178
10179 2006-05-11 Paul Eggert <eggert@cs.ucla.edu>
10180
10181 * doc/bison.texinfo (Calc++ Scanner): The flex behavior is an
10182 incompatibility, not a bug. Mention that it wasn't fixed as of
10183 flex 2.5.33.
10184
10185 2006-05-11 Akim Demaille <akim@lrde.epita.fr>
10186
10187 * examples/extexi: Enforce the precedence of concatenation over
10188 >>.
10189 Reported by Tommy Nordgren.
10190
10191 2006-05-11 Akim Demaille <akim@lrde.epita.fr>
10192
10193 * data/lalr1.cc (yytranslate_): Rename token as t to avoid clashes
10194 with the member "token".
10195 Reported by Martin Nylin.
10196
10197 2006-05-08 Paul Eggert <eggert@cs.ucla.edu>
10198
10199 * data/glr.c: Switch to Bison 2.2 special-exception language in
10200 the copyright notice. Use more-regular format for titles and
10201 copyright notices.
10202 * data/glr.cc: Likewise.
10203 * data/location.cc: Likewise.
10204 * data/yacc.cc: Likewise.
10205 * doc/bison.texinfo (Conditions): Document this.
10206 * NEWS: likewise. Upgrade version to 2.2.
10207
10208 2006-04-27 Akim Demaille <akim@lrde.epita.fr>
10209
10210 * data/glr.cc: Remove dead code.
10211
10212 2006-04-25 Paul Eggert <eggert@cs.ucla.edu>
10213
10214 * bootstrap: Comment out the AM_CPPFLAGS line, since we don't use
10215 that variable and the line breaks the bootstrap. Problem reported
10216 by Juan M. Guerrero.
10217
10218 2006-04-24 Akim Demaille <akim@lrde.epita.fr>
10219
10220 * doc/bison.texinfo (Multiple start-symbols): New.
10221
10222 2006-04-24 Akim Demaille <akim@lrde.epita.fr>
10223
10224 * etc/README, etc/bench.pl: New.
10225
10226 2006-04-03 Akim Demaille <akim@lrde.epita.fr>
10227
10228 * src/scan-gram.l: Be robust to BRACED_CODE appearing before any
10229 rule.
10230 Reported by Mickael Labau.
10231 * tests/input.at (Torturing the Scanner): Test it.
10232
10233 2006-03-16 Paul Eggert <eggert@cs.ucla.edu>
10234
10235 * doc/bison.texinfo (Decl Summary): Don't mention yylloc twice.
10236 Problem reported by Bob Rossi.
10237
10238 2006-03-13 Paul Eggert <eggert@cs.ucla.edu>
10239
10240 * doc/bison.texinfo: Remove @shorttitlepage stuff; it wasn't used
10241 and didn't really work.
10242 For the index, use @ifnotinfo, not @iftex.
10243 Minor cleanups of spacing and terminology.
10244
10245 2006-03-12 Akim Demaille <akim@lrde.epita.fr>
10246
10247 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Fix the definition
10248 of AT_NAME_PREFIX when %name-prefix is not used.
10249
10250 2006-03-12 Akim Demaille <akim@lrde.epita.fr>
10251
10252 Apply --prefix to C++ skeletons too: they change the namespace.
10253 The test suite already exercize these cases.
10254 * data/c++.m4 (b4_namespace): New.
10255 * data/lalr1.cc, data/glr.cc, data/location.cc: Use it instead of `yy'.
10256 * data/lalr1.cc (yytnameerr_): Move its definition into the namespace.
10257 * data/yacc.c, data/glr.c: Remove a useless `[]'.
10258 * doc/bison.texinfo: Document it.
10259 (Option Cross Key): Use @multitable in all formats. It looks
10260 nicer, even in TeX outputs.
10261 (Rules): Use the same code whatever the output type is.
10262 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS)
10263 (_AT_BISON_OPTION_POPDEFS): Support AT_NAME_PREFIX.
10264 * tests/calc.at: Use it, instead of hard coding `yy'.
10265
10266 2006-03-10 Akim Demaille <akim@lrde.epita.fr>
10267
10268 * TODO: Remove dead items.
10269
10270 2006-03-10 Akim Demaille <akim@lrde.epita.fr>
10271
10272 * doc/FAQ: Remove, merged into...
10273 * doc/bison.texinfo (FAQ): this.
10274 * doc/Makefile.am (EXTRA_DIST): Adjust.
10275
10276 2006-03-10 Akim Demaille <akim@lrde.epita.fr>
10277
10278 * data/c.m4 (b4_token_enum): Always define the enum of tokens,
10279 even if empty.
10280 * data/lalrl1.cc, data/glr.cc (parser::token_type): New.
10281 * doc/bison.texinfo (Calc++ Scanner): Use it.
10282
10283 2006-03-09 Paul Eggert <eggert@cs.ucla.edu>
10284
10285 Fix two nits reported by twlevo, plus one more that I discovered.
10286
10287 * src/assoc.h (assoc_to_string): Give a name to the arg, as
10288 this is the usual Bison style.
10289 * src/location.h (location_print): Likewise.
10290
10291 * src/reader.h (token_name): Likewise.
10292
10293 2006-03-08 Paul Eggert <eggert@cs.ucla.edu>
10294
10295 Fix some nits reported by twlevo.
10296 * doc/FAQ: Remove ancient Y2K FAQ, replacing it with "secure"
10297 and "POSIX". Use more-modern syntax for URLs. Mention C++
10298 and ask for Java. Don't hardwire OS version numbers. Add
10299 copyright notice.
10300 * m4/.cvsignore: Add unistd_h.m4, for latest gnulib.
10301 * src/conflicts.c (solved_conflicts_obstack): Now static.
10302
10303 2006-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
10304
10305 * doc/bison.texinfo (Introduction): Mention GLR and C++ as on the web
10306 page. Say "you can use it" not "you may use it" as on the web page;
10307 we're describing capabilities not granting permission.
10308
10309 2006-03-06 Paul Eggert <eggert@cs.ucla.edu>
10310
10311 * data/glr.c (yyresolveLocations): Rename local variables to avoid
10312 shadowing warnings. Use usual patter for iterating through RHS.
10313 * tests/glr-regression.at
10314 (Uninitialized location when reporting ambiguity):
10315 Modify yylex so that it uses its argument, rather than trying
10316 to rely on ARGSUSED (which doesn't work for gcc with warnings).
10317 const char -> char const.
10318
10319 * tests/Makefile.am ($(srcdir)/package.m4, maintainer-check-valgrind):
10320 Don't use tabs inside commands; it messes up 'ps'.
10321 Problem reported by twlevo.
10322
10323 2006-03-06 Joel E. Denny <jdenny@ces.clemson.edu>
10324
10325 * tests/glr-regression.at (Uninitialized location when reporting
10326 ambiguity): New test case.
10327 * data/glr.c (yyresolveLocations): New function, which uses
10328 YYLLOC_DEFAULT.
10329 (yyresolveValue): Invoke yyresolveLocations before reporting an
10330 ambiguity.
10331 * doc/bison.texinfo (Default Action for Locations): Note
10332 YYLLOC_DEFAULT's usage for ambiguity locations.
10333 (GLR Semantic Actions): Cross-reference those notes.
10334
10335 2006-03-04 Joel E. Denny <jdenny@ces.clemson.edu>
10336
10337 * tests/glr-regression.at (Leaked semantic values when reporting
10338 ambiguity): Remove unnecessary union and type declarations.
10339 (Leaked lookahead after nondeterministic parse syntax error): New test
10340 case.
10341 * data/glr.c (yyparse): Check for zero stacks remaining before
10342 attempting to shift the lookahead so that you don't lose it.
10343
10344 2006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
10345
10346 Avoid memory leaks by not invoking longjmp in yyreportAmbiguity.
10347 * tests/glr-regression.at (Leaked semantic values when reporting
10348 ambiguity): New test case.
10349 * data/glr.c (yyreportAmbiguity): Invoke yyyerror directly and return
10350 yyabort rather than invoking yyFail, which invokes longjmp. Remove the
10351 now unnecessary yystackp parameter.
10352 (yyresolveValue): Return yyreportAmbiguity's result. Now the necessary
10353 destructors can be called.
10354
10355 * tests/glr-regression.at: Don't invoke bison with `-t' unnecessarily
10356 in existing testcases.
10357
10358 2006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
10359
10360 Don't leak semantic values for parent RHS when a user action cuts the
10361 parser, and clean up related code a bit.
10362 * tests/glr-regression.at (Leaked merged semantic value if user action
10363 cuts parse): Rename to...
10364 (Leaked semantic values if user action cuts parse): ... this. Add check
10365 for leaked parent RHS values.
10366 * data/glr.c (yydestroyGLRState): In debugging output, distinguish
10367 between an unresolved state (non-empty chain of semantic options) and
10368 an incomplete one (signaled by an empty chain).
10369 (yyresolveStates): Document the interface. Move all manipulation of a
10370 successfully or unsuccessfully resolved yyGLRState to...
10371 (yyresolveValue): ... here so that yyresolveValue always leaves a
10372 yyGLRState with consistent data and thus is easier to understand.
10373 Remove the yyvalp and yylocp parameters since they are always just
10374 taken from the yys parameter. When reporting a discarded merged value
10375 in debugging output, note that it is incompletely merged. Document the
10376 interface.
10377 (yyresolveAction): If resolving any of the RHS states fails, destroy
10378 them all rather than leaking them. Thus, as long as user actions are
10379 written to clean up the RHS correctly, yyresolveAction always cleans up
10380 the RHS of a semantic option. Document the interface.
10381
10382 2006-02-27 Paul Eggert <eggert@cs.ucla.edu>
10383
10384 * data/glr.c (yyexpandGLRStack): Catch an off-by-one error that
10385 led to a segmentation fault in GNU Pascal. Problem reported
10386 by Waldek Hebisch.
10387
10388 2006-02-21 Joel E. Denny <jdenny@ces.clemson.edu>
10389
10390 * doc/bison.texinfo (Mid-Rule Actions): Explain how to bury a
10391 mid-rule action inside a nonterminal symbol in order to declare a
10392 destructor for its semantic value.
10393
10394 2006-02-16 Paul Eggert <eggert@cs.ucla.edu>
10395
10396 * data/yacc.c [(! defined yyoverflow || YYERROR_VERBOSE) && !
10397 YYSTACK_USE_ALLOCA && ! defined YYSTACK_ALLOC && defined
10398 __cplusplus && ! defined _STDLIB_H && !
10399 ((defined YYMALLOC || defined malloc) && (defined YYFREE ||
10400 defined free))]: Include <stdlib.h> rather than rolling our own
10401 declarations of malloc and free, to avoid problems with
10402 incompatible declarations (using 'throw') C++'s stdlib.h. This
10403 should fix Debian bug 340012
10404 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=340012>,
10405 reported by Guillaume Melquiond.
10406
10407 2006-02-13 Paul Eggert <eggert@cs.ucla.edu>
10408
10409 * NEWS: Clarify symbols versus types in unused-value warnings.
10410
10411 * configure.ac (AC_INIT): Bump version number.
10412
10413 2006-02-13 Paul Eggert <eggert@cs.ucla.edu>
10414
10415 * NEWS: Version 2.1a.
10416 * tests/headers.at (AT_TEST_CPP_GUARD_H): Declare yyerror and yylex,
10417 since C99 requires this.
10418
10419 2006-02-11 Paul Eggert <eggert@cs.ucla.edu>
10420
10421 * m4/c-working.m4: New file.
10422 * configure.ac (BISON_TEST_FOR_WORKING_C_COMPILER): Use it.
10423
10424 2006-02-10 Paul Eggert <eggert@cs.ucla.edu>
10425
10426 * Makefile.maint: Merge from coreutils.
10427
10428 2006-02-09 Paul Eggert <eggert@cs.ucla.edu>
10429
10430 More portability fixes for problems summarized by Nelson H. F. Beebe.
10431
10432 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Catch a
10433 configuration screwup "./configure CC=/opt/SUNWspro/bin/c89
10434 CFLAGS="-xarch=generic64" CXX=/opt/SUNWspro/bin/CC
10435 LDFLAGS="-xarch=generic64" with Sun C 5.7 on Solaris 10; this
10436 messes up because C++ code is compiled in 32-bit mode but linked
10437 in 64-bit mode.
10438
10439 2006-02-08 Paul Eggert <eggert@cs.ucla.edu>
10440
10441 More portability fixes for problems summarized by Nelson H. F. Beebe.
10442
10443 * doc/bison.texinfo (Calc++ Scanner): Work around a bug in flex
10444 2.5.31. This resembles the 2005-10-10 patch to src/scan-skel.l.
10445
10446 * examples/calc++/Makefile.am (check_PROGRAMS): Renamed from
10447 nodist_PROGRAMS, since we don't need to actually compile the
10448 example if we're just doing a plain 'make'. This avoids bothering
10449 the installer unnecessarily about problems due to weird C++
10450 compilers.
10451
10452 2006-02-06 Paul Eggert <eggert@cs.ucla.edu>
10453
10454 More portability fixes for problems summarized by Nelson H. F. Beebe.
10455
10456 * tests/headers.at (AT_TEST_CPP_GUARD_H): Use #include <...> rather
10457 than #include "...", and compile with -I'.'. The old method was
10458 not portable, according to Posix and the C standard, and it does
10459 not work with Sun C 5.7, where previous #line directives affect
10460 the working directory used in later #include "..." directives.
10461
10462 2006-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
10463
10464 Various DJGGP specific issues in /djgpp
10465
10466 2006-02-02 Paul Eggert <eggert@cs.ucla.edu>
10467
10468 More portability fixes for problems summarized by Nelson H. F. Beebe.
10469
10470 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check that
10471 '#include <map>' works and that you can apply ++ to iterators.
10472
10473 2006-02-01 Paul Eggert <eggert@cs.ucla.edu>
10474
10475 Work around portability problems summarized by Nelson H. F. Beebe in
10476 <http://lists.gnu.org/archive/html/bug-bison/2005-09/msg00021.html>.
10477
10478 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
10479 that '#include <string>' works.
10480
10481 * data/lalr1.cc (yytranslate_): No longer inline, to work around a
10482 porting problem to g++ 3.4.3 on Darwin 7.9.0, where g++ complained
10483 "warning: sorry: semantics of inline function static data `const
10484 unsigned char translate_table[262]' are wrong (you'll wind up with
10485 multiple copies)".
10486
10487 * lib/bbitset.h (struct bitset_vtable): Rename members not, and,
10488 or, xor to not_, and_, or_, and xor_, respectively. This works
10489 around a bug in GCC 3.4.3 on Irix 6.5, which apparently has a
10490 random system header somewhere that includes the equivalent of
10491 <iso646.h>.
10492
10493 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that "$CC
10494 -E" works; it apparently doesn't work with PathScale EKO Compiler
10495 Suite Version 2.0.
10496
10497 2006-01-30 Joel E. Denny <jdenny@ces.clemson.edu>
10498
10499 During deterministic GLR operation, user actions should be able to
10500 influence the parse by changing yychar. To make this easier to fix and
10501 to make glr.c easier to evolve in general, don't maintain yytoken in
10502 parallel with yychar; just compute yytoken when needed.
10503 * tests/glr-regression.at (Incorrect lookahead during deterministic
10504 GLR): Check that setting yychar in a user action has the intended
10505 effect.
10506 * data/glr.c (yyGLRStack): Remove yytokenp member.
10507 (yyclearin): Don't set *yytokenp.
10508 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Examine
10509 yychar rather than *yytokenp to determine the current lookahead.
10510 Compute yytoken locally when needed.
10511 (yyparse): Likewise. Remove the local yytoken that yytokenp used to
10512 point to.
10513
10514 * doc/bison.texinfo (Bison Options): Remove stray sentence fragment
10515 after `--report' documentation.
10516
10517 2006-01-30 Paul Eggert <eggert@cs.ucla.edu>
10518
10519 * src/parse-gram.y (grammar_declaration): Location of printer
10520 symbol is @1, not list->location. Bug reported by twlevo.
10521 * tests/input.at (Incompatible Aliases): Adjust to above change.
10522
10523 2006-01-29 Paul Eggert <eggert@cs.ucla.edu>
10524
10525 * tests/input.at (AT_CHECK_UNUSED_VALUES): Remove. Instead, do
10526 all the test at once. This makes the output easier to read in the
10527 normal case.
10528
10529 Fix a longstanding bug uncovered by bro-0.9a9/src/parse.y, which I
10530 got from <http://bro-ids.org/download.html>. The bug is that
10531 when two actions appeared in succession, the second one was
10532 scanned before the first one was added to the grammar rule
10533 as a midrule action. Bison then output the incorrect warning
10534 "parse.y:905.17-906.36: warning: unused value: $3".
10535 * src/parse-gram.y (BRACED_CODE, action): These are no longer
10536 associated with a value.
10537 (rhs): Don't invoke grammar_current_rule_action_append.
10538 (action): Invoke it here instead.
10539 * src/reader.c (grammar_midrule_action): Now extern.
10540 (grammar_current_rule_action_append): Don't invoke
10541 grammar_midrule_action; that is now the scanner's job.
10542 * src/reader.h (last_string, last_braced_code_loc):
10543 (grammar_midrule_action): New decls.
10544 * src/scan-gram.l (last_string): Now extern, sigh.
10545 (last_braced_code_loc): New extern variable.
10546 (<INITIAL>"{"): Invoke grammar_midrule_action if the current
10547 rule already has an action.
10548 (<SC_BRACED_CODE>"}"): Set last_braced_code_loc before returning.
10549 * tests/input.at (AT_CHECK_UNUSED_VALUES):
10550 Add some tests to check that the above changes fixed the bug.
10551
10552 2006-01-27 Paul Eggert <eggert@cs.ucla.edu>
10553
10554 * src/reader.c (symbol_should_be_used): Renamed from symbol_typed_p.
10555 All used changed. Check whether the symbol has a destructor,
10556 not whether it is typed.
10557 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add a destructor, so
10558 that the values are still reported as unused. All line numbers
10559 adjusted.
10560
10561 2006-01-23 Paul Eggert <eggert@cs.ucla.edu>
10562
10563 Work around a bug in bro 0.8, which underparenthesizes its
10564 definition of YYLLOC_DEFAULT.
10565 * data/glr.c: Change all uses of YYLLOC_DEFAULT to parenthesize
10566 their arguments.
10567 * data/lalr1.cc: Likewise.
10568 * data/yacc.cc: Likewise.
10569
10570 2006-01-22 Paul Eggert <eggert@cs.ucla.edu>
10571
10572 Work around a bug in Pike 7.0, and give the Pike folks a
10573 better way to override the usual int widths.
10574 * data/yacc.c (b4_int_type): Use yytype_uint8, etc., so that the
10575 user can override the types.
10576 (short): #undef, to work around a bug in Pike 7.0.
10577 (yytype_uint8, yytype_int8, yytype_uint16, yytype_int16): New types.
10578 (union yyalloc.yyss): Use yytype_int16 rather than short.
10579 All uses changed.
10580 (yysigned_char): Remove.
10581 * src/parse-gram.y (YYTYPE_UINT8, YYTYPE_INT8, YYTYPE_UINT16):
10582 (YYTYPE_INT16): New macros, to test the new facility in yacc.c.
10583 * tests/regression.at (Web2c Actions): Adjust to above changes.
10584
10585 * src/reader.c (check_and_convert_grammar): New function.
10586 (reader): Close the input file even if something went wrong during
10587 parsing. Minor file descriptor leak reported by twlevo.
10588
10589 * src/assoc.c (assoc_to_string): Use a default: abort (); case
10590 to pacify gcc -Wswitch-default.
10591 * src/scan-gram.l (adjust_location): Use a default: break; case
10592 to pacify gcc -Wswitch-default.
10593 * src/scan-skel.h (skel_get_lineno, skel_get_in, skel_get_out):
10594 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
10595 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
10596 Move these decls to scan-skel.l, since they don't need to be
10597 visible elsewhere.
10598 * src/scan-skel.l: Accept the above decls.
10599 (skel_lex): New decl, to pacify GCC when unpatched flex 2.5.31
10600 is used.
10601
10602 2006-01-21 Paul Eggert <eggert@cs.ucla.edu>
10603
10604 * Makefile.cfg (local-checks-to-skip): Add changelog-check,
10605 since we don't want to insist on a version number at the start
10606 of the changelog every time.
10607 * Makefile.maint: Sync from coreutils a bit better.
10608 (sc_trailing_blank): Renamed from sc_trailing_space.
10609 All uses changed.
10610 (sc_no_if_have_config_h, sc_require_config_h):
10611 (sc_prohibit_assert_without_use): New rules.
10612 (sc_obsolete_symbols): Don't catch Makefile.maint itself.
10613 (sc_dd_max_sym_length): Fix leading spaces in rule.
10614 (sc_system_h_headers): Prefix with @.
10615 (sc_useless_cpp_parens, m4-check): Output line numbers.
10616 (changelog-check): Allow version only in head.
10617 * data/c.m4: Use "defined FOO" instead of "defined (FOO)", to
10618 satisfy new Makefile.maint rule.
10619 * data/glr.c: Likewise.
10620 * data/glr.cc: Likewise.
10621 * data/lalr1.cc: Likewise.
10622 * data/yacc.c: Likewise.
10623 * lib/ebitsetv.c: Likewise.
10624 * lib/lbitset.c: Likewise.
10625 * lib/subpipe.c: Likewise.
10626 * lib/timevar.c: Likewise.
10627 * src/system.h: Likewise.
10628 * data/yacc.c (YYSTYPE): Don't generate trailing spaces in output.
10629 * djgpp/Makefile.maint: Add copyright notice.
10630 * djgpp/README.in: Likewise.
10631 * djgpp/config.bat: Likewise.
10632 * djgpp/config.site: Likewise.
10633 * djgpp/config_h.sed: Likewise.
10634 * djgpp/djunpack.bat: Likewise.
10635 * djgpp/config.sed: Fix copyright notice to match standard format.
10636 * djgpp/subpipe.h: Likewise.
10637 * lib/bitsetv-print.c: Likewise.
10638 * lib/bitsetv.c: Likewise.
10639 * lib/subpipe.h: Likewise.
10640 * lib/timevar.c: Likewise.
10641 * lib/timevar.h: Likewise.
10642 * djgpp/subpipe.c: Use standard recipe for config.h.
10643 * lib/abitset.c: Likewise.
10644 * lib/bitset.c: Likewise.
10645 * lib/bitset_stats.c: Likewise.
10646 * lib/bitsetv-print.c: Likewise.
10647 * lib/bitsetv.c: Likewise.
10648 * lib/ebitsetv.c: Likewise.
10649 * lib/get-errno.c: Likewise.
10650 * lib/lbitset.c: Likewise.
10651 * lib/subpipe.c: Likewise.
10652 * lib/timevar.c: Likewise.
10653 * lib/vbitset.c: Likewise.
10654 * tests/local.at: Likewise.
10655 * src/scan-gram.l: Don't include verify.h, since system.h does
10656 that for us.
10657 * .x-sc_require_config_h: New file.
10658 * .x-sc_unmarked_diagnostics: New file.
10659
10660 2006-01-20 Paul Eggert <eggert@cs.ucla.edu>
10661
10662 Be a bit more systematic about using 'abort'.
10663 * lib/abitset.c (abitset_test): Remove ATTRIBUTE_UNUSED; not needed.
10664 * lib/bitset.c (bitset_bytes, bitset_init, bitset_op4_cmp):
10665 Put 'default: abort ();' before some other case, to satisfy older
10666 pedantic compilers.
10667 * lib/bitset_stats.c (bitset_stats_init): Likewise.
10668 * lib/ebitset.c (ebitset_elt_find, ebitset_op3_cmp): Likewise.
10669 * lib/lbitset.c (lbitset_elt_find, lbitset_op3_cmp): Likewise.
10670 * src/conflicts.c (resolve_sr_conflict): Likewise.
10671 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str):
10672 (get_decision_str, get_orientation_str, get_node_alignment_str):
10673 (get_arrow_mode_str, get_crossing_type_str, get_view_str):
10674 (get_linestyle_str, get_arrowstyle_str): Likewise.
10675 * src/conflicts.c (resolve_sr_conflict):
10676 Use a default case rather than one for the one remaining enum
10677 value, to catch invalid enum values as well.
10678 * src/lalr.c (set_goto_map, map_goto):
10679 Prefer "assert (FOO);" to "if (!FOO) abort ();".
10680 * src/nullable.c (nullable_compute, token_definitions_output):
10681 Likewise.
10682 * src/reader.c (packgram, reader): Likewise.
10683 * src/state.c (transitions_to, state_new, state_reduction_find):
10684 Likewise.
10685 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias):
10686 (symbol_pack): Likewise.
10687 * src/tables.c (conflict_row, pack_vector): Likewise.
10688 * src/scan-skel.l (QPUTS): Remove unnecessary parens.
10689 (BASE_QPUTS, "@output ".*\n): Remove unnecessary asserts.
10690 * src/system.h: Don't include <assert.h>.
10691 (assert): New macro.
10692
10693 * doc/bison.texinfo (Prologue, Rules, Actions, Union Decl, Action Decl):
10694 (Destructor Decl, Parser Function, Pure Calling):
10695 Describe rules for braces inside C code more carefully.
10696
10697 2006-01-19 Paul Eggert <eggert@cs.ucla.edu>
10698
10699 Fix some porting glitches found by Nelson H. F. Beebe.
10700 * lib/abitset.c (abitset_resize): Rewrite to avoid warnings from
10701 compilers that don't understand that abort () does not return.
10702 * src/state.c (transitions_to): Likewise.
10703 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
10704 that '#include <cstdlib>' works.
10705 * src/system.h (INT8_MIN, INT16_MIN, INT32_MIN, INT8_MAX):
10706 (INT16_MAX, UINT8_MAX, INT32_MAX, UINT16_MAX, UINT32_MAX):
10707 #undef if ! defined __STDC_VERSION__ || __STDC_VERSION__ < 199901,
10708 for the benefit of some pre-C99 compilers.
10709
10710 * bootstrap: Undo changes to gnulib files that autoreconf made.
10711
10712 Minor fixups to get 'make maintainer-check' to work.
10713 * configure.ac: Don't use -Wnested-externs, as it's incompatible
10714 with the new verify.h implementation.
10715 * data/c.m4 (b4_yy_symbol_print_generate): YYUSE (yyoutput).
10716 * data/glr.c (YYUSE): Depend on __GNUC__ as well.
10717 * data/yacc.c (YYUSE): Likewise.
10718 * data/lalr1.cc (yysyntax_error_): YYUSE (yystate).
10719 * lib/subpipe.c (end_of_output_subpipe): The args are unused.
10720 * src/parse-gram.y (declaration): Don't pass a string constant
10721 to a function that expects char *, since GCC might complain
10722 about the constant value.
10723 * src/reader.c (symbol_typed_p): Add parens to pacify GCC.
10724 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): #undef yylloc and yylval
10725 before #defining them.
10726 * tests/glr-regression.at
10727 (Incorrectly initialized location for empty right-hand side in GLR):
10728 In yyerror, use the msg arg.
10729 (Corrupted semantic options if user action cuts parse):
10730 (Incorrect lookahead during deterministic GLR):
10731 (Incorrect lookahead during nondeterministic GLR):
10732 Don't name a local var 'index'; it shadows string.h's 'index'.
10733
10734 2006-01-19 Akim Demaille <akim@epita.fr>
10735
10736 * tests/calc.at (_AT_DATA_CALC_Y): Initialize the whole initial
10737 location, not just parts of it.
10738
10739 2006-01-18 Paul Eggert <eggert@cs.ucla.edu>
10740
10741 * NEWS: Document the fact that multiple %unions are now allowed.
10742 * doc/bison.texinfo (Union Decl): Likewise.
10743 * TODO: This feature is now implemented, so remove it from
10744 the wishlist.
10745
10746 * Makefile.maint: Merge with coreutils Makefile.maint.
10747 (CVS_LIST): Use build-aux version if available.
10748 (VERSION_REGEXP): New macro.
10749 (syntax-check-rules): Add sc_no_if_have_config_h,
10750 sc_prohibit_assert_without_use, sc_require_config_h,
10751 sc_useless_cpp_parens.
10752 (sc_obsolete_symbols): Check for O_NDELAY.
10753 (sc_dd_max_sym_length): Track coreutils.
10754 (sc_unmarked_diagnostics): Look in all files, not just *.c.
10755 (sc_useless_cpp_parens): New rule.
10756 (news-date-check): Look for version or today's date.
10757 (changelog-check): Don't require version number near head.
10758 (copyright-check): Use current year instead of hardwiring 2005.
10759 (my-distcheck): Depend on $(release_archive_dir)/$(prev-tgz).
10760 (announcement): Add --gpg-key-ID.
10761
10762 * djgpp/config.sed: Add copyright notice, and replace "filesystem"
10763 with "file system".
10764
10765 Avoid undefined behavior that addressed just before the start of an
10766 array. Problem reported by twlevo.
10767 * src/reader.c (packgram): Prepend a new sentinel before ritem.
10768 * src/lalr.c (build_relations): Rely on new sentinel.
10769 * src/gram.c (gram_free): Adjust to new sentinel.
10770
10771 2006-01-12 Joel E. Denny <jdenny@ces.clemson.edu>
10772
10773 * data/glr.c (yyGLRStateSet): Rename yylookaheadStatuses to
10774 yylookaheadNeeds. All uses updated.
10775 (yysplitStack): Rename local yynewLookaheadStatuses to
10776 yynewLookaheadNeeds.
10777 * data/glr-regression.at (Incorrect lookahead during nondeterministic
10778 GLR): In comments, change `lookahead status' to `lookahead need'.
10779
10780 2006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
10781
10782 * data/glr.c (yysplitStack): A little stylistic rewrite.
10783
10784 2006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
10785
10786 * data/glr.c (yyaddDeferredAction): Flesh out the comment.
10787
10788 2006-01-11 Joel E. Denny <jdenny@ces.clemson.edu>
10789
10790 * doc/bison.texinfo: Fix some typos.
10791 (GLR Semantic Actions): New subsection discussing special
10792 considerations because GLR semantic actions might be deferred.
10793 (Actions): Mention look-ahead usage of yylval.
10794 (Actions and Locations): Mention look-ahead usage of yylloc.
10795 (Special Features for Use in Actions): Add YYEOF entry and mention it
10796 in the yychar entry.
10797 In the yychar entry, remove mention of the local yychar case (pure
10798 parser) since this is irrelevant information when writing semantic
10799 actions and since it's already discussed in `Table of Symbols' where
10800 yychar is otherwise described as an external variable.
10801 In the yychar entry, don't call it the `current' look-ahead since it
10802 isn't when semantic actions are deferred.
10803 In the yychar and yyclearin entries, add note about deferred semantic
10804 actions.
10805 Add yylloc and yylval entries discussing look-ahead usage.
10806 (Look-Ahead Tokens): When discussing yychar, don't call it the
10807 `current' look-ahead, and do mention yylval and yylloc.
10808 (Error Recovery): Cross-reference `Action Features' when mentioning
10809 yyclearin.
10810 (Table of Symbols): In the yychar entry, don't call it the `current'
10811 look-ahead.
10812 In the yylloc and yylval entries, mention look-ahead usage.
10813
10814 2006-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
10815
10816 * tests/glr-regression.at: Update copyright year to 2006.
10817
10818 2006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
10819
10820 * data/glr.c (yyGLRStateSet): Add yybool* yylookaheadStatuses member to
10821 use during nondeterministic operation to track which stacks have
10822 actually needed the current lookahead.
10823 (yyinitStateSet, yyfreeStateSet, yyremoveDeletes, yysplitStack):
10824 Allocate, deallocate, resize, and otherwise shuffle space for
10825 yylookaheadStatuses in parallel with yystates member of yyGLRStateSet.
10826 (yysplitStack, yyprocessOneStack, yyparse): Set lookahead status
10827 appropriately during nondeterministic operation.
10828 (yySemanticOption): Add int yyrawchar, YYSTYPE yyval, and YYLTYPE yyloc
10829 members to store the current lookahead to be used by the deferred
10830 user action.
10831 (yyaddDeferredAction): Add size_t yyk parameter specifying the stack
10832 from which the RHS is taken. Set the lookahead members of the new
10833 yySemanticOption according to the lookahead status for stack yyk.
10834 (yyglrShiftDefer, yyglrReduce): Pass yyk parameter on to
10835 yyaddDeferredAction.
10836 (yyresolveAction): Set yychar, yylval, and yylloc to the lookahead
10837 members of yySemanticOption before invoking yyuserAction, and then set
10838 them back to their current values afterward.
10839 (yyparse): Set yychar = YYEMPTY where yytoken = YYEMPTY.
10840 (yyreportAmbiguity): Add /*ARGSUSED*/ to pacify lint.
10841 * tests/glr-regression.at: Remove `.' from the ends of recent test case
10842 titles for consistency.
10843 (Leaked merged semantic value if user action cuts parse): In order to
10844 suppress lint warnings, use arguments in merge function, and assign
10845 char value < 128 in main.
10846 (Incorrect lookahead during deterministic GLR): New test case.
10847 (Incorrect lookahead during nondeterministic GLR): New test case.
10848
10849 2006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
10850
10851 * data/c.m4 (b4_yy_symbol_print_generate): In yy_symbol_print, accept
10852 !yyvaluep as signal that no semantic value is available to print.
10853 * data/glr.c (yydestroyGLRState): If state is not resolved, don't try
10854 to print a semantic value.
10855
10856 2006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
10857
10858 * tests/glr-regression.at: For consistency with my newer test cases,
10859 don't thank myself.
10860
10861 2006-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
10862
10863 * data/glr.c (yyresolveValue): When merging semantic options, if at
10864 least one user action succeeds but a later one cuts the parse, then
10865 destroy the semantic value before returning rather than leaking it.
10866 (yyresolveStates): If a user action cuts the parse and thus
10867 yyresolveValue fails, ignore the (unset) semantic value rather than
10868 corrupting the yyGLRState, and empty the semantic options list since
10869 the user actions should have called all necessary destructors.
10870 Simplify code with YYCHK.
10871 * tests/glr-regression.at (Corrupted semantic options if user action
10872 cuts parse): New test case.
10873 (Undesirable destructors if user action cuts parse): New test case.
10874 Before applying any of this patch, this test case never actually failed
10875 for me... but only because the corrupted semantic options usually
10876 masked this bug.
10877 (Leaked merged semantic value if user action cuts parse): New test
10878 case.
10879
10880 2006-01-05 Akim Demaille <akim@epita.fr>
10881
10882 * src/reader.c, src/symlist.h, src/symlist.c: s/mid_rule/midrule/.
10883
10884 2006-01-04 Paul Eggert <eggert@cs.ucla.edu>
10885
10886 * data/c.m4 (b4_c_modern): New macro, with a new provision for
10887 _MSC_VER. Problem reported by Cenzato Marco.
10888 (b4_c_function_def): Use it.
10889 * data/yacc.c (YYMODERN_C): Remove. All uses replaced by
10890 b4_c_modern.
10891 (yystrlen, yystpcpy, yyparse): Use b4_c_function... macros rather
10892 than rolling our own.
10893
10894 2006-01-04 Akim Demaille <akim@epita.fr>
10895
10896 Also warn about non-used mid-rule values.
10897 * src/symlist.h, src/symlist.c (symbol_list): Add a mid_rule
10898 member.
10899 (symbol_list_new): Adjust.
10900 * src/reader.c (symbol_typed_p): New.
10901 (grammar_rule_check): Use it.
10902 (grammar_midrule_action): Bind a mid-rule LHS to its rule.
10903 Check its rule.
10904 * tests/input.at (AT_CHECK_UNUSED_VALUES): New.
10905 Use it.
10906 * tests/actions.at (Exotic Dollars): Adjust.
10907
10908 2006-01-04 Akim Demaille <akim@epita.fr>
10909
10910 * src/reader.c (grammar_midrule_action): If $$ is set in a
10911 mid-rule, move the `used' bit to its lhs.
10912 * tests/input.at (Unused values): New.
10913 * tests/actions.at (Exotic Dollars): Adjust: exp is not typed.
10914
10915 2006-01-03 Paul Eggert <eggert@cs.ucla.edu>
10916
10917 * doc/bison.texinfo (Bison Options): Say more accurately what
10918 --yacc does.
10919 * src/parse-gram.y (rules_or_grammar_declaration): Don't complain
10920 about declarations in the grammar when in Yacc mode, as POSIX does
10921 not require a diagnostic when the grammar uses extensions.
10922
10923 * src/reduce.c (reduce_grammar): Remove unnecessary cast to bool.
10924
10925 Warn about dubious constructions like "%token T T".
10926 Reported by twlevo.
10927 * src/symtab.h (struct symbol.declared): New member.
10928 * src/symtab.c (symbol_new): Initialize it to false.
10929 (symbol_class_set): New arg DECLARING, specifying whether
10930 this is a declaration that we want to warn about, if there
10931 is more than one of them. All uses changed.
10932
10933 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c:
10934 Allow multiple %union directives, whose contents concatenate.
10935 * src/parse-gram.y (grammar_declaration): Likewise.
10936 Use muscle_code_grow, so that we don't need stype_line any more.
10937 All uses changed.
10938
10939 * src/muscle_tab.c (muscle_grow): Fix comment.
10940
10941 * ChangeLog, data/c.m4, data/glr.c, data/glr.cc, data/location.cc:
10942 * data/yacc.c, src/getargs.c, src/output.c, tests/cxx-type.at:
10943 Update copyright year to 2006.
10944
10945 2006-01-03 Akim Demaille <akim@epita.fr>
10946
10947 Have glr.cc pass (some of) the calc.at tests.
10948 * data/glr.cc (b4_parse_param_orig): New.
10949 (b4_parse_param): Improve its definition, and bound it more
10950 clearly in the skeleton.
10951 (b4_epilogue): Append, instead of prepending, in order to keep
10952 #line consistency.
10953 Simplify the generation of auxiliary functions: locations and
10954 purity are mandated.
10955 (b4_global_tokens_and_yystype): Honor it.
10956 * data/location.cc (c++.m4): Don't include it.
10957 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Define AT_GLR_CC_IF
10958 and AT_SKEL_CC_IF.
10959 * tests/calc.at (AT_CHECK_CALC): Rely on AT_SKEL_CC_IF instead of
10960 AT_LALR1_CC_IF.
10961 Be sure to initialize the first position's filename.
10962 (AT_CHECK_CALC_LALR1_CC): Add %location and %defines, they are
10963 mandated anyway.
10964 (AT_CHECK_CALC_GLR_CC): New.
10965 Use it to exercise glr.cc as a lalr1.cc drop-in replacement.
10966
10967 2006-01-02 Akim Demaille <akim@epita.fr>
10968
10969 * src/output.c (output_skeleton): Don't hard wire the inclusion of
10970 c.m4.
10971 * data/c++.m4, data/glr.c, data/yacc.c: Include c.m4.
10972 * data/glr.cc: Do not include stack.hh.
10973
10974 2006-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
10975
10976 * data/glr.c: Reformat whitespace with tabs.
10977 (b4_lpure_formals): Remove this unused m4 macro.
10978 * tests/cxx-type.at: Reformat whitespace with tabs.
10979 (_AT_TEST_GLR_CXXTYPES): In union Node, rename node_info to nodeInfo
10980 since it's a member. Rename type to isNterm for clarity.
10981
10982 2005-12-29 Akim <akim@sulaco.local>
10983
10984 Let glr.cc catch up with symbol_value_print.
10985 * data/glr.cc (b4_yysymprint_generate): Replace by...
10986 (b4_yy_symbol_print_generate): this.
10987 (yy_symbol_print, yy_symbol_value_print): Declare them.
10988
10989 2005-12-28 Paul Eggert <eggert@cs.ucla.edu>
10990
10991 * src/location.h (boundary): Note that a line or column equal
10992 to INT_MAX indicates an overflow.
10993 * src/scan-gram.l: Include verify.h. Don't include get-errno.h.
10994 (rule_length_overflow, increment_rule_length, add_column_width):
10995 New functions.
10996 (<INITIAL>{id}, <SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'"):
10997 (<SC_BRACED_CODE>"}"):
10998 Use increment_rule_length rather than incrementing it by hand.
10999 (adjust_location, handle_syncline): Diagnose overflow.
11000 (handle_action_dollar, handle_action_at):
11001 Fix bug with monstrosities like $-2147483648.
11002 Remove now-unnecessary checks.
11003 (scan_integer): Verify assumptions and remove now-unnecessary checks.
11004 (convert_ucn_to_byte): Verify assumptions.
11005 (handle_syncline): New arg LOC. All callers changed.
11006 Don't store through a value derived from char const * pointer.
11007
11008 * src/reader.c (grammar_rule_check): Rewrite slightly to avoid
11009 GCC warnings.
11010
11011 2005-12-27 Paul Eggert <eggert@cs.ucla.edu>
11012
11013 * src/reader.c (grammar_midrule_action, grammar_symbol_append):
11014 Remove unnecessary forward static decls.
11015
11016 2005-12-27 Akim Demaille <akim@epita.fr>
11017
11018 * src/reader.c (grammar_current_rule_check): Also check that $$
11019 is used.
11020 Take the rule to check as argument, hence rename as...
11021 (grammar_rule_check): this.
11022 * src/reader.h, src/reader.c (grammar_rule_begin, grammar_rule_end):
11023 Rename as...
11024 (grammar_rule_begin, grammar_rule_end): these, for consistency.
11025 (grammar_midrule_action, grammar_symbol_append): Now static.
11026 * tests/torture.at (input): Don't rely on the default action
11027 being always performed.
11028 * tests/calc.at: "Set" $$ even when the action is "cut" with
11029 YYERROR or other.
11030 * tests/actions.at (Exotic Dollars): Instead of using unused
11031 values, check that the warning is issued.
11032
11033 2005-12-22 Paul Eggert <eggert@cs.ucla.edu>
11034
11035 * NEWS: Improve wording for unused-value warnings.
11036
11037 2005-12-22 Akim Demaille <akim@epita.fr>
11038
11039 * data/lalr1.cc, data/yacc.c, data/glr.c, data/c.m4
11040 (b4_yysymprint_generate): Rename as...
11041 (b4_yy_symbol_print_generate): this.
11042 Generate yy_symbol_print instead of yysymprint.
11043 Generate also yy_symbol_value_print, and use it.
11044
11045 2005-12-22 Akim Demaille <akim@epita.fr>
11046
11047 * NEWS: Warn about unused values.
11048 * src/symlist.h, src/symlist.c (symbol_list, symbol_list_new): Add
11049 a `used' member.
11050 (symbol_list_n_get, symbol_list_n_used_set): New.
11051 (symbol_list_n_type_name_get): Use symbol_list_n_get.
11052 * src/scan-gram.l (handle_action_dollar): Flag used symbols.
11053 * src/reader.c (grammar_current_rule_check): Check that values are
11054 used.
11055 * src/symtab.c (symbol_print): Accept 0.
11056 * tests/existing.at: Remove the type information.
11057 Empty the actions.
11058 Remove useless actions (beware of mid-rule actions: perl -000
11059 -pi -e 's/\s*\{\}(?=[\n\s]*[|;])//g').
11060 * tests/actions.at (Exotic Dollars): Use unused values.
11061 * tests/calc.at: Likewise.
11062 * tests/glr-regression.at (No users destructors if stack 0 deleted):
11063 Likewise.
11064
11065 * src/gram.c (rule_useful_p, rule_never_reduced_p): Use
11066 rule_useful_p.
11067
11068 2005-12-21 Paul Eggert <eggert@cs.ucla.edu>
11069
11070 Undo 2005-12-01 tentative license wording change. The wording is
11071 still being reviewed by the lawyers, and we don't want to wait for
11072 them before publishing a test release. For now, revert to the
11073 previous wording.
11074 * NEWS: Undo 2005-12-01 change.
11075 * data/glr.c: Revert to previous license wording.
11076 * data/glr.cc: Likewise.
11077 * data/lalr1.cc: Likewise.
11078 * data/location.cc: Likewise.
11079 * data/yacc.c: Likewise.
11080
11081 * NEWS: Reword %destructor vs YYABORT etc.
11082 * data/glr.c: Use American spacing, for consistency.
11083 * data/glr.cc: Likewise.
11084 * data/lalr1.cc: Likewise.
11085 * data/yacc.c: Likewise.
11086 * data/yacc.c: Reformat comments slightly.
11087 * doc/bison.texinfo: Replace "non-" with "non" when that makes sense,
11088 for consistency. Fix some spelling errors and reword recently-included
11089 text slightly.
11090 * tests/cxx-type.at: Cast results of malloc, for C++.
11091
11092 2005-12-21 Joel E. Denny <address@hidden>
11093
11094 * tests/cxx-type.at: Construct a tree, count the parents of shared
11095 nodes, and free each node once and only once. Previously, the memory
11096 for semantic values was leaked instead.
11097
11098 2005-12-21 Joel E. Denny <address@hidden>
11099
11100 * data/glr.c (struct yyGLRStack): If pure, add yyval and yyloc members.
11101 (yylval, yylloc): If pure, #define to yystackp->yyval and
11102 yystackp->yyloc similar to yychar and yynerrs.
11103 (yyparse): If pure, remove local yylval and yylloc. Add local
11104 yystackp to accommodate pure definitions of yylval and yylloc.
11105 (b4_lex_param, b4_lyyerror_args, b4_lpure_args): If pure, change
11106 yylvalp and yyllocp to &yylval and &yylloc.
11107 (nerrs, char, lval, lloc): If pure, add #define's for b4_prefix[]
11108 namespace. Previously, nerrs and char were missing, but lval and lloc
11109 weren't necessary.
11110 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Remove
11111 yylvalp and yyllocp parameters since, if pure, these are now always
11112 accessible through yystackp. If not pure, they are still accessible
11113 globally.
11114 * data/glr.c, data/yacc.c (YYLLOC_DEFAULT): Change `if (N)' to
11115 `if (YYID (N))' to pacify lint.
11116
11117 2005-12-21 Akim Demaille <akim@epita.fr>
11118
11119 YYACCEPT, YYERROR, and YYABORT, as user actions, should not
11120 destroy the RHS symbols of a rule.
11121 * data/yacc.c (yylen): Initialize to 0.
11122 Keep its value to the number of items to possibly shift.
11123 In particular, a regular successful parse that ends on YYFINAL by
11124 a (internal) YYACCEPT must not have yylen != 0.
11125 (yyerrorlab, yyreturn): Pop the RHS.
11126 Reorder a bit to emphasize the `shifting' bits of code.
11127 (YYPOPSTACK): Now accept a number of items to pop.
11128 * data/lalr1.cc: Likewise.
11129 * data/glr.c: Formatting changes.
11130 Use goto instead of fall through.
11131 * doc/bison.texinfo (Destructor Decl): Complete.
11132
11133 2005-12-20 Juan Manuel Guerrero <juan.guerrero@gmx.de>
11134
11135 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
11136 * djgpp/Makefile.maint: Fix PACKAGE variable computation.
11137 * djgpp/config.bat: Replace every occurence of the file name
11138 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
11139 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
11140 * djgpp/config.sed: Replace every occurence of the file name
11141 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
11142 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
11143 * djgpp/djunpack.bat: DJGPP specific file.
11144 * djgpp/fnchange.lst: DJGPP specific file.
11145 * djgpp/README.in: Add new information about how to unpack the bison
11146 source on MSDOS and other systems which have 8.3 file name restrictions
11147 using djunpack.bat and fnchange.lst.
11148
11149 2005-12-12 Paul Eggert <eggert@cs.ucla.edu>
11150
11151 * bootstrap (build_cvs_prefix): Remove; unused.
11152 (CVS_PREFIX): Adjust to yesterday's Savannah reorganization
11153 when getting gnulib.
11154
11155 2005-12-12 "Joel E. Denny" <jdenny@ces.clemson.edu>
11156
11157 * data/glr.c: Reorder typedef declarations for structs to match order
11158 of struct declarations.
11159 Rename yystack everywhere to yystackp except in yyparse where it's not
11160 a pointer.
11161 (yyglrShift): Change parameter YYSTYPE yysval to YYSTYPE* yyvalp for
11162 consistency.
11163 (yyis_table_ninf): Change 0 to YYID (0) to pacify lint.
11164 (yyreportSyntaxError): Add /*ARGSUSED*/ to pacify lint.
11165 (yyparse): Change while (yytrue) to while ( YYID (yytrue)) to pacify
11166 lint.
11167
11168 2005-12-09 Paul Eggert <eggert@cs.ucla.edu>
11169
11170 * tests/sets.at (Accept): Fix typos in regular expression used to
11171 sed out the final state number.
11172
11173 Work around portability problem on Solaris 10: flex-generated
11174 files include <stdio.h> before <config.h>, which messes up
11175 because the latter defines __EXTENSIONS__. Address the problem
11176 by creating two new little files that include <config.h> first,
11177 then include the flex-generated files. Rewrite everyone else
11178 to include <config.h> first, as well.
11179 * lib/timevar.c: Always include "config.h".
11180 * src/Makefile.am (bison_SOURCES): Replace scan-gram.l with
11181 scan-gram-c.c, and scan-skel.l with scan-skel-c.c.
11182 (EXTRA_bison_SOURCES): New macro.
11183 * src/scan-gram-c.c, src/scan-skel-c.c: New files.
11184 * src/system.h: Don't include config.h.
11185 * src/LR0.c: Include <config.h> first.
11186 * src/assoc.c: Likewise.
11187 * src/closure.c: Likewise.
11188 * src/complain.c: Likewise.
11189 * src/conflicts.c: Likewise.
11190 * src/derives.c: Likewise.
11191 * src/files.c: Likewise.
11192 * src/getargs.c: Likewise.
11193 * src/gram.c: Likewise.
11194 * src/lalr.c: Likewise.
11195 * src/location.c: Likewise.
11196 * src/main.c: Likewise.
11197 * src/muscle_tab.c: Likewise.
11198 * src/nullable.c: Likewise.
11199 * src/output.c: Likewise.
11200 * src/parse-gram.y: Likewise.
11201 * src/print.c: Likewise.
11202 * src/print_graph.c: Likewise.
11203 * src/reader.c: Likewise.
11204 * src/reduce.c: Likewise.
11205 * src/relation.c: Likewise.
11206 * src/state.c: Likewise.
11207 * src/symlist.c: Likewise.
11208 * src/symtab.c: Likewise.
11209 * src/tables.c: Likewise.
11210 * src/uniqstr.c: Likewise.
11211 * src/vcg.c: Likewise.
11212
11213 * src/parse-gram.y: Fix minor problems uncovered by lint.
11214 (current_lhs, current_lhs_location): Now static.
11215 (current_assoc): Remove unused variable.
11216
11217 Cleanups so that Bison-generated parsers have less lint.
11218 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate):
11219 Prepend /*ARGSUSED*/, for lint's sake.
11220 * data/glr.c (YYUSE): Properly parenthesize, and use an alternate
11221 definition if 'lint' is defined.
11222 (YYID): New macro (or function, if lint).
11223 All uses of /*CONSTCOND*/0 replaced by YYID(0).
11224 * data/yacc.c: Likewise.
11225 * data/glr.c (yyuserAction, yyuserMerge, yy_reduce_print):
11226 (yyrecoverSyntaxError): Prepend /*ARGSUSED*/.
11227 * data/glr.cc (YYLLOC_DEFAULT): Omit /*CONSTCOND*/ since this code
11228 is C++ only.
11229 * data/lalr1.cc (YYUSE): Just use a cast, since this code is C++ only.
11230 * data/yacc.c (YYSTACK_FREE) [defined YYSTACK_ALLOC]:
11231 Use YYID(0) rather than 0, for lint.
11232 (yystrlen): Rewrite to avoid lint warning about ptrdiff_t overflow.
11233 (yysyntax_error): Rewrite to avoid lint warnings about parenthesization.
11234
11235 2005-12-07 Paul Eggert <eggert@cs.ucla.edu>
11236
11237 * tests/glr-regression.at
11238 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
11239 Close memory leak reported by twlevo.
11240
11241 2005-12-06 "Joel E. Denny" <jdenny@ces.clemson.edu>
11242
11243 * data/glr.c (yyprocessOneStack, yyparse): Synchronize the shift for
11244 all stacks.
11245 (yyparse): Iterate another stack in order to call user destructors.
11246 * tests/glr-regression.at (No users destructors if stack 0 deleted):
11247 New test case.
11248 (Duplicated user destructor for lookahead): This test now is expected
11249 to succeed.
11250
11251 2005-12-01 Paul Eggert <eggert@cs.ucla.edu>
11252
11253 * NEWS: Document the following change.
11254 * data/yacc.c: Say "parser skeleton" rather than "file", since
11255 it's no longer just a file.
11256 * data/glr.c: Grant a special exception for C GLR parsers, that
11257 reads like the already-existing exception for C LALR(1) parsers.
11258 * data/glr.cc: Likewise.
11259 * data/lalr1.cc: Likewise.
11260 * data/location.cc: Likewise.
11261 * data/yacc.c: Reword the "written by" statement to clarify that
11262 it was the parser skeleton, not the entire output file.
11263 * data/glr.c: Written by Paul Hilfinger.
11264 * data/glr.cc: Written by Akim Demaille.
11265 * data/lalr1.cc: Likewise.
11266
11267 2005-11-18 Paul Eggert <eggert@cs.ucla.edu>
11268
11269 * data/yacc.c (yy_reduce_print, YY_REDUCE_PRINT):
11270 Fix typos in previous change that broke 'make check'.
11271 YY_REDUCE_PRINT cannot be a pseudo-varargs macro; that isn't
11272 supported in C.
11273 * tests/calc.at (_AT_CHECK_CALC,_AT_CHECK_CALC_ERROR):
11274 Don't check NUM-STDERR-LINES, since the output format is fluctuating.
11275 We can revert this once things settle down.
11276
11277 * src/conflicts.c (conflicts_print): Don't print file name twice
11278 when %expect fails because there were no conflicts.
11279 * doc/bison.texinfo (Expect Decl): Tighten up wording in previous
11280 change.
11281 * tests/conflicts.at (%expect not enough, %expect too much):
11282 (%expect with reduce conflicts): Adjust to new behavior.
11283
11284 2005-11-18 Akim Demaille <akim@epita.fr>
11285
11286 * src/conflicts.c (conflicts_print): Unsatisfied %expectation are
11287 errors.
11288 * NEWS: Document this.
11289 * doc/bison.texinfo (Expect Decl): Likewise.
11290
11291 2005-11-16 Akim Demaille <akim@epita.fr>
11292
11293 Generalize the display of semantic values and locations in traces.
11294 * data/glr.c (yy_reduce_print): Fix indices (again).
11295 * data/c++.m4 (b4_rhs_value, b4_rhs_location): Don't expect
11296 literal integers.
11297 * data/lalr1.cc (yyreduce_print): Rename as...
11298 (yy_reduce_print): this.
11299 Display values and locations.
11300 * data/yacc.c (yy_reduce_print): Likewise.
11301 (YY_REDUCE_PRINT): Adjust to pass the required arguments.
11302 (yysymprint): Move higher to be visible from yy_reduce_print).
11303 (yyparse): Adjust.
11304 * tests/calc.at: Adjust the expected length of the traces.
11305
11306 2005-11-14 Akim Demaille <akim@epita.fr>
11307
11308 * data/glr.c (yy_reduce_print): The loop was quite wrong: type are
11309 from 1 to N, while values and location start at 0.
11310 (b4_rhs_location, b4_rhs_value): Add parens around $1 and $2.
11311
11312 2005-11-14 Akim Demaille <akim@epita.fr>
11313
11314 * data/glr.c (yy_reduce_print): Fix the $ number.
11315
11316 2005-11-14 Akim Demaille <akim@epita.fr>
11317
11318 "Use" parse parameters.
11319 * data/c.m4 (b4_parse_param_for, b4_parse_param_use): New.
11320 * data/glr.c, data/glr.cc: Use them.
11321 * data/glr.c (YYUSE): Have a C++ definition that supports
11322 non-pointer types.
11323
11324 2005-11-14 Akim Demaille <akim@epita.fr>
11325
11326 * data/glr.c (yyexpandGLRStack): Declare only if defined.
11327
11328 2005-11-14 Akim Demaille <akim@epita.fr>
11329
11330 * data/glr.cc: New.
11331 * data/m4sugar/m4sugar.m4 (m4_prepend): New.
11332
11333 2005-11-12 Akim Demaille <akim@epita.fr>
11334
11335 Let position and location be PODs.
11336 * data/location.cc (position::initialize, location::initialize): New.
11337 (position::position, location::location): Define only if
11338 b4_location_constructors is defined.
11339 * data/lalr1.cc (b4_location_constructors): Define it for backward
11340 compatibility.
11341 * doc/bison.texinfo (Initial Action Decl): Use initialize.
11342
11343 2005-11-12 Akim Demaille <akim@epita.fr>
11344
11345 * data/lalr1.cc: Move the body of the ctor and dtor into the
11346 parser file (instead of the header).
11347 Wrap the implementations in a "namespace yy".
11348
11349 2005-11-12 Akim Demaille <akim@epita.fr>
11350
11351 Have glr.c include its header file when created.
11352 * data/glr.c (b4_shared_declarations): New.
11353 Output them verbatim in the parser if !%defines, otherwise
11354 output then in the header file, and include it instead.
11355
11356 2005-11-11 Akim Demaille <akim@epita.fr>
11357
11358 * data/glr.c: Comment changes.
11359
11360 2005-11-11 Akim Demaille <akim@epita.fr>
11361
11362 When yydebug, report semantic and location values for reductions.
11363 * data/glr.c (yy_reduce_print): Report the semantic values and the
11364 locations.
11365 (YY_REDUCE_PRINT): Adjust.
11366 (yyglrReduce): Use them.
11367 (b4_rhs_value, b4_rhs_location): Remove m4_eval invocations.
11368 * data/c.m4 (b4_yysymprint_generate): Specify the const arguments.
11369 * tests/calc.at (_AT_CHECK_CALC_ERROR): Remove the reduction
11370 traces.
11371
11372 2005-11-10 Akim Demaille <akim@epita.fr>
11373
11374 * data/glr.c (yynewGLRStackItem, YY_RESERVE_GLRSTACK): New.
11375 (yyaddDeferredAction, yyglrShift, yyglrShiftDefer): Use them.
11376 (yyexpandGLRStack, YYRELOC): Define only when YYSTACKEXPANDABLE.
11377
11378 2005-11-09 Albert Chin-A-Young <china@thewrittenword.com>
11379
11380 * m4/cxx.m4, examples/Makefile.am: Don't build
11381 examples/calc++ if no C++ compiler is available. (trivial change)
11382
11383 2005-11-09 Akim Demaille <akim@epita.fr>
11384
11385 * src/scan-skel.l: Use a couple of asserts.
11386
11387 2005-11-03 Akim Demaille <akim@epita.fr>
11388
11389 In some (weird) cases, the final state number is incorrect.
11390 Reported by Alexandre Duret-Lutz.
11391 * src/LR0.c (state_list_append): Remove the computation of
11392 final_state.
11393 (save_reductions): Do it here.
11394 (get_state): Alpha conversion.
11395 (generate_states): Use a for loop.
11396 * src/gram.h (item_number_is_rule_number)
11397 (item_number_is_symbol_number): New.
11398 * src/state.c: Use assert.
11399 * src/system.h: Include assert.h.
11400 * tests/sets.at (Accept): New.
11401
11402 2005-10-30 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
11403
11404 * data/glr.c (yyfill): Adjust comment.
11405 (yyresolveAction): Initialize default location properly
11406 for empty right-hand sides.
11407 (yydoAction): Ditto.
11408 Add comment explaining apparently dead code.
11409 * tests/glr-regression.at
11410 (Incorrectly initialized location for empty right-hand side in GLR):
11411 New test.
11412
11413 2005-10-30 Paul Eggert <eggert@cs.ucla.edu>
11414
11415 * bootstrap (cleanup_gnulib): New function. Use it to clean up
11416 gnulib when interrupted. This fixes some race conditions and
11417 works around some portability problems (one noted by Paul
11418 Hilfinger).
11419
11420 2005-10-22 Akim <akim@epita.fr>
11421
11422 * Makefile.cfg: Adjust to config -> build-aux.
11423 Reported by twledo.
11424
11425 2005-10-21 Akim Demaille <akim@epita.fr>
11426
11427 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Pass
11428 the %parse-params.
11429 * data/glr.c (YY_SYMBOL_PRINT, yydestroyGLRState): Adjust.
11430 * data/yacc.c (b4_Pure_if): Rename as...
11431 (b4_yacc_pure_if): this.
11432 (YY_SYMBOL_PRINT, yyparse): Adjust.
11433 * doc/bison.texinfo: Formatting changes.
11434
11435 2005-10-21 Akim Demaille <akim@epita.fr>
11436
11437 Finish the transition config -> build-aux.
11438 * configure.ac, Makefile.am: Use build-aux.
11439 * config/prev-version, config/announce-gen, config/Makefile.am:
11440 Move to...
11441 * build-aux/prev-version, build-aux/announce-gen,
11442 * build-aux/Makefile.am: here.
11443
11444 2005-10-14 Akim Demaille <akim@epita.fr>
11445
11446 * examples/calc++/test: Use set -x only when VERBOSE.
11447
11448 2005-10-13 Paul Eggert <eggert@cs.ucla.edu>
11449
11450 * NEWS: Bison now warns if it finds a stray `$' or `@' in an action.
11451 * src/scan-gram.l (<SC_BRACED_CODE>[$@]): Implement this.
11452
11453 2005-10-13 Akim Demaille <akim@epita.fr>
11454
11455 * src/scan-skel.l: Output the base name parts of the parser and
11456 header file names.
11457 * tests/output.at (AT_CHECK_OUTPUT): Support subdirectories, and
11458 additional checks.
11459 Use this to exercise C++ outputs in subdirs.
11460 Reported by Oleg Smolsky.
11461
11462 2005-10-12 Paul Eggert <eggert@cs.ucla.edu>
11463
11464 * data/c.m4 (b4_c_function_def): Look at __C99_FUNC__, not at
11465 __STDC_VERSION__, as IBM cc 7.0 doesn't define the latter either.
11466 Problem reported by John P. Hartmann.
11467 * data/yacc.c (YYMODERN_C): Likewise. Don't define if the user has
11468 already defined it.
11469
11470 2005-10-12 Akim Demaille <akim@epita.fr>
11471
11472 * src/parse-gram.y (version_check): Exit 63 to please missing
11473 (stands for "version mismatch).
11474 * tests/input.at, doc/bison.texinfo: Adjust.
11475
11476 2005-10-10 Paul Eggert <eggert@cs.ucla.edu>
11477
11478 Work around portability problems with Visual Age C compiler
11479 (xlc and xlC_r) reported by John P. Hartmann.
11480 * data/location.cc (initial_column, initial_line): Remove.
11481 All uses replaced by 0 and 1.
11482 * src/scan-gram.l (gram_wrap): Redefine to avoid bug in flex 2.5.31
11483 that xlc complains about.
11484 * src/scan-skel.l (skel_wrap): Likewise.
11485 * data/c.m4 (b4_c_function_def): Look at __STDC_VERSION__ as well
11486 as __STDC__.
11487 * data/yacc.c (YYMODERN_C): New macro, which also looks at
11488 __STDC_VERSION__. Use it everywhere instead of looking at
11489 __STDC__ and __cplusplus.
11490
11491 2005-10-10 Akim Demaille <akim@epita.fr>
11492
11493 * examples/calc++/test: Be quiet unless VERBOSE.
11494
11495 2005-10-05 Paul Eggert <eggert@cs.ucla.edu>
11496
11497 * data/c.m4 (yydestruct, yysymprint):
11498 Use YYUSE instead of casting to void.
11499 * data/glr.c (YYUSE): New macro.
11500 (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
11501 Use it instead of rolling our own.
11502 (YYLLOC_DEFAULT, YYCHK, YYDPRINTF, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
11503 (YYCHK1):
11504 Use /*CONSTCOND*/ to suppress lint warnings.
11505 * data/lalr1.cc (YYLLOC_DEFAULT, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
11506 (YY_STACK_PRINT): Use 'false' not '0'.
11507 (YYUSE): New macro.
11508 (yysymprint_, yydestruct_): Use it instead of rolling our own.
11509 * data/yacc.c (YYUSE): New macro.
11510 (YYCOPY, YYSTACK_RELOCATE, YYBACKUP, YYLLOC_DEFAULT):
11511 (YYDPRINTF, YY_SYMBOL_PRINT, YY_STACK_PRINT, YY_REDUCE_PRINT):
11512 (yyerrorlab): Use /*CONSTCOND*/ to suppress lint warnings.
11513
11514
11515 * data/m4sugar/m4sugar.m4 (_m4_map): New macro.
11516 (m4_map, m4_map_sep): Use it. Handle the empty list correctly.
11517
11518 2005-10-04 Paul Eggert <eggert@cs.ucla.edu>
11519
11520 Undo the parts of the unlocked-I/O change that substituted
11521 putc or puts for printf. This might hurt performance a bit,
11522 but some people prefer the printf style.
11523 * data/c.m4 (yysymprint): Prefer printf to puts and putc.
11524 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): Remove.
11525 All uses replaced by YYFPRINTF and YYDPRINTF.
11526 * data/yacc.c: Likewise.
11527 * lib/bitset.c (bitset_print): Likewise.
11528 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer printf to
11529 putc and puts.
11530 * lib/lbitset.c (debug_lbitset): Likewise.
11531 * src/closure.c (print_firsts, print_fderives): Likewise.
11532 * src/gram.c (grammar_dump): Likewise.
11533 * src/lalr.c (look_ahead_tokens_print): Likewise.
11534 * src/output.c (escaped_output): Likewise.
11535 (user_actions_output): Break apart two printfs.
11536 * src/parse-gram.y (%printer): Prefer printf to putc and puts.
11537 * src/reduce.c (reduce_print): Likewise.
11538 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
11539 * src/system.h: Include unlocked-io.h rathe than stdio.h.
11540
11541 * data/glr.c (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
11542 Use assignments rather than casts-to-void to suppress
11543 unused-variable warnings. This pacifies 'lint'.
11544 * data/lalr1.cc (yysymprint_, yydestruct_): Use a call to suppress
11545 unused-variable warnings.
11546
11547 2005-10-03 Juan Manuel Guerrero <juan.guerrero@gmx.de>
11548
11549 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
11550
11551 2005-10-02 Paul Eggert <eggert@cs.ucla.edu>
11552
11553 Use unlocked I/O for a minor performance improvement on hosts like
11554 GNU/Linux and Solaris that support unlocked I/O. The basic idea
11555 is to use the gnlib unlocked-io module, and to prefer putc and
11556 puts to printf when either will work (since the latter doesn't
11557 come in an unlocked flavor).
11558 * bootstrap (gnulib_modules): Add unlocked-io.
11559 * data/c.m4 (yysymprint): Prefer puts and putc to printf.
11560 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): New macros.
11561 Prefer them to YYFPRINTF and YYDPRINTF if either will do,
11562 and similarly for puts and putc and printf.
11563 * data/yacc.c: Likewise.
11564 * lib/bitset.c (bitset_print): Likewise.
11565 * lib/bitset.h [USE_UNLOCKED_IO]: Include unlocked-io.h.
11566 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer putc and puts
11567 to printf.
11568 * lib/lbitset.c (debug_lbitset): Likewise.
11569 * src/closure.c (print_firsts, print_fderives): Likewise.
11570 * src/gram.c (grammar_dump): Likewise.
11571 * src/lalr.c (look_ahead_tokens_print): Likewise.
11572 * src/output.c (escaped_output): Likewise.
11573 (user_actions_output): Coalesce two printfs.
11574 * src/parse-gram.y (%printer): Prefer putc and puts to printf.
11575 * src/reduce.c (reduce_print): Likewise.
11576 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
11577 * src/system.h: Include unlocked-io.h rather than stdio.h.
11578
11579 * data/lalr1.cc: Don't put an unmatched ' in a dnl comment, as
11580 this confuses xgettext.
11581
11582 2005-10-02 Akim Demaille <akim@epita.fr>
11583
11584 * bootstrap (gnulib_modules): Add strverscmp.
11585 * lib/.cvsignore: Add strverscmp.c, strverscmp.h.
11586 * m4/.cvsignore: Add strverscmp.m4.
11587 * src/parse-gram.y (%require): New token, new rule.
11588 (version_check): New.
11589 * src/scan-gram.l (%require): Adjust.
11590 * tests/input.at (AT_REQUIRE): New.
11591 Use it.
11592 * doc/bison.texinfo (Require Decl): New.
11593 (Calc++ Parser): Use %require.
11594
11595 2005-10-02 Akim Demaille <akim@epita.fr>
11596
11597 * data/location.cc: New.
11598
11599 2005-10-02 Paul Eggert <eggert@cs.ucla.edu>,
11600 Akim Demaille <akim@epita.fr>
11601
11602 Make sure -odir/foo.cc creates dir/location.hh etc.
11603 * src/files.h (spec_outfile, parser_file_name, spec_name_prefix)
11604 (spec_file_prefix, spec_verbose_file, spec_graph_file)
11605 (spec_defines_file): Now const.
11606 (dir_prefix): New.
11607 (short_base_name): Remove.
11608 * src/files.c: Adjust.
11609 (dirname.h): Include.
11610 (base_name): Don't prototype it.
11611 (finput): Remove, duplicates gram_in.
11612 (full_base_name, short_base_name): Replace by...
11613 (all_but_ext, all_but_tab_ext): these.
11614 (compute_base_names): Rename as...
11615 (compute_file_name_parts): this.
11616 Update to compute the new variables, including dir_prefix.
11617 Adjust dependencies.
11618 * src/output.c (prepare): Output them.
11619 * src/reader.c: Adjust to use gram_in, not finput.
11620 * src/scan-skel.l (@dir_prefix@): New.
11621
11622 2005-10-02 Juan Manuel Guerrero <juan.guerrero@gmx.de>
11623
11624 * lib/subpipe.c: New function end_of_output_subpipe() added
11625 to allow support for non-posix systems. This is a no-op function
11626 for posix systems.
11627
11628 * lib/subpipe.h: New function end_of_output_subpipe() added
11629 to allow support for non-posix systems. This is a no-op function
11630 for posix systems.
11631
11632 * src/output.c (output_skeleton): Use end_of_output_subpipe() to
11633 handle the lack of pipe/fork functionality on non-posix systems.
11634
11635 * djgpp/Makefile.maint: DJGPP specific file.
11636
11637 * djgpp/README.in: DJGPP specific file.
11638
11639 * djgpp/config.bat: DJGPP specific configuration file.
11640
11641 * djgpp/config.sed: DJGPP specific configuration file.
11642
11643 * djgpp/config.site: DJGPP specific configuration file.
11644
11645 * djgpp/config_h.sed: DJGPP specific configuration file.
11646
11647 * djgpp/subpipe.c: DJGPP specific replacement file for lib/subpipe.c.
11648
11649 * djgpp/subpipe.h: DJGPP specific replacement file for lib/subpipe.h.
11650
11651 2005-10-02 Akim Demaille <akim@epita.fr>
11652
11653 * data/location.cc: New, extract from...
11654 * data/lalr1.cc: here.
11655 (location.hh): Include it after the user prologue, in case the
11656 filename type is defined by the user.
11657 Forward declation location and position before the pre-prologue.
11658 (yyresult_): Rename as...
11659 (yyresult): this, it's a local variable, not an attribute.
11660 * data/Makefile.am (dist_pkgdata_DATA): Adjust.
11661
11662 2005-10-01 Akim Demaille <akim@epita.fr>
11663
11664 * examples/extexi: Restore the #line generation.
11665
11666 2005-09-30 Akim Demaille <akim@epita.fr>,
11667 Alexandre Duret-Lutz <adl@gnu.org>
11668
11669 Move the token type and YYSTYPE in the parser class.
11670 * data/lalr1.cc (stack.hh, location.hh): Include earlier.
11671 (parser::token): New, from the moved free definition of tokens.
11672 (parser::semantic_value): Now a full definition instead of an
11673 indirection to YYSTYPE.
11674 (b4_post_prologue): No longer included in the header file, but
11675 in the implementation file.
11676 * doc/bison.texi (C+ Language Interface): Update.
11677 * src/parse-gram.y: Support unary %define.
11678 * tests/actions.at: Define global_tokens_and_yystype for backward
11679 compatibility until we update the tests.
11680 * tests/calc.at: Idem.
11681 (first_line, first_column, last_line, last_column): Define for lalr1.cc
11682 to simplify the code.
11683
11684 2005-09-29 Paul Eggert <eggert@cs.ucla.edu>
11685
11686 Port to SunOS 4.1.4, which lacks strtoul and strerror.
11687 Ah, the good old days! Problem reported by Peter Klein.
11688 * bootstrap (gnulib_modules): Add strerror, strtoul.
11689 * lib/.cvsignore: Add strerror.c, strtol.c, strtoul.c
11690 * m4/.cvsignore: Add strerror.m4, strtol.m4, strtoul.m4.
11691
11692 2005-09-29 Akim Demaille <akim@epita.fr>
11693
11694 * data/c.m4 (b4_error_verbose_if): New.
11695 * data/lalr1.cc: Use it.
11696 (YYERROR_VERBOSE_IF): Remove.
11697 (yyn_, yylen_, yystate_, yynerrs_, yyerrstatus_): Remove as
11698 parser members, replaced by...
11699 (yyn, yylen, yystate, yynerss, yyerrstatus): these parser::parse
11700 local variables.
11701 (yysyntax_error_): Takes the state number as argument.
11702 (yyreduce_print_): Use the argument yyrule, not the former
11703 attribute yyn_.
11704
11705 2005-09-26 Paul Eggert <eggert@cs.ucla.edu>
11706
11707 * bootstrap (gnulib_modules): Add verify.
11708 * lib/.cvsignore: Add verify.h.
11709 * src/getargs.c: Use ARGMATCH_VERIFY rather than verify.
11710 * src/system.h (verify): Remove.
11711 Include verify.h instead.
11712 * src/tables.c (tables_generate): Use new API for 'verify'.
11713
11714 2005-09-21 Paul Eggert <eggert@cs.ucla.edu>
11715
11716 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Do not use
11717 local variables whose names begin with 'yy'.
11718 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
11719 Trivial changes from Joel E. Denny.
11720
11721 * bootstrap (gnulib_modules): Remove alloca. Bison doesn't need
11722 it itself.
11723 * src/main.c (main) [C_ALLOCA]: Don't flush alloca'ed memory; we
11724 don't use alloca any more.
11725
11726 * data/yacc.c [YYSTACK_USE_ALLOCA && !defined __GNUC__ && ! defined
11727 __BUILTIN_VA_ARG_INCR && ! defined _AIX && ! defined _MSC_VER &&
11728 defined _ALLOCA_H]: Don't include <stdlib.h>; not needed in this case.
11729 * tests/torture.at (Exploding the Stack Size with Alloca): Adjust
11730 to match yacc.c, to test more hosts.
11731
11732 2005-09-20 Paul Eggert <eggert@cs.ucla.edu>
11733
11734 * data/yacc.c (YYSIZE_T): Reindent to make it clearer. This
11735 doesn't affect behavior.
11736 (YYSTACK_ALLOC) [YYSTACK_USE_ALLOCA]: Improve support for
11737 Solaris, AIX, MSC.
11738 (_STDLIB_H): Renamed from YYINCLUDED_STDLIB_H. All uses changed.
11739 This works a bit better with glibc, if user code has already included
11740 stdlib.h.
11741 * doc/bison.texinfo (Bison Parser): Document that users can't
11742 arbitrarily use malloc and free for other purposes. Document
11743 that <alloca.h> and <malloc.h> might be included.
11744 (Table of Symbols): Under YYSTACK_USE_ALLOCA, Don't claim that the
11745 user must declare alloca.
11746
11747 * HACKING (release): Forwarn the Translation Project about
11748 stable releses.
11749
11750 2005-09-20 Akim Demaille <akim@epita.fr>
11751
11752 * data/glr.c: Use b4_token_enums, not b4_token_enums_defines.
11753
11754 2005-09-19 Paul Eggert <eggert@cs.ucla.edu>
11755
11756 * data/yacc.c (YYSIZE_MAXIMUM): New macro.
11757 (YYSTACK_ALLOC_MAXIMUM): Use it.
11758 (yysyntax_error): New function.
11759 (yyparse) [YYERROR_VERBOSE]: Don't leak memory indefinitely if
11760 multiple syntax errors are reported, and alloca is being used.
11761 Instead, reallocate buffers twice as big each time, so that
11762 we waste at most half the allocated memory. Start with a small
11763 (128-byte) buffer that will suffice in most cases anyway.
11764 Use yysyntax_error to do most of the work.
11765
11766 * doc/bison.texinfo (Error Reporting, Table of Symbols):
11767 yynerrs is the number of errors reported, not the number of
11768 errors encountered.
11769
11770 * tests/glr-regression.at (Duplicated user destructor for lookahead):
11771 Mark it as expected to fail.
11772 Cast result of malloc; problem reported by twlevo@xs4all.nl.
11773 * tests/actions.at, tests/calc.at, tests/glr-regression.at:
11774 Don't start user-code symbols with "yy", to avoid name space problems.
11775
11776 2005-09-19 Akim Demaille <akim@epita.fr>
11777
11778 Remove the traits, failed experiment.
11779 It never proved useful, and anyway because of the current
11780 definition, it was not possible to have several specialization of
11781 this traits, making it useless.
11782 * data/lalr1.cc (yy:traits): Remove.
11783 Inline its definitions in the parser class.
11784
11785 2005-09-19 Akim Demaille <akim@epita.fr>
11786
11787 * tests/atlocal.in (LIBS): Pass INTLLIBS to address failures on at
11788 least Mac OSX with a /usr/local install of gettext.
11789
11790 2005-09-19 Akim Demaille <akim@epita.fr>
11791
11792 * data/lalr1.cc (yyparse): Rename yylooka and yyilooka as yychar
11793 and yytoken for similarity with the other skeletons.
11794
11795 2005-09-19 Akim Demaille <akim@epita.fr>
11796
11797 * NEWS, configure.ac: update version number to 2.1a.
11798
11799 2005-09-16 Paul Eggert <eggert@cs.ucla.edu>
11800
11801 * NEWS: Version 2.1.
11802
11803 * NEWS: Remove notice of yytname change, since it was never in an
11804 official release.
11805 * data/glr.c (yydestroyGLRState): Rename local var to avoid shadowing
11806 diagnostic.
11807 * src/output.c (prepare): Likewise.
11808 * data/lalr1.cc (YYERROR_VERBOSE_IF): New macro.
11809 (yysyntax_error_): Use it to avoid GCC warning when YYERROR_VERBOSE
11810 is not defined. This is an awful hack, but it's enough for now.
11811 All callers changed.
11812 * tests/glr-regression-at (make_value): Args are const pointers now,
11813 to avoid GCC warning.
11814 (Duplicated user destructor for lookahead): New test. Currently
11815 skipped. It fails on my host but I'm not sure it'll always fail.
11816
11817 2005-09-16 Akim Demaille <akim@epita.fr>
11818
11819 * src/symtab.h (struct symbol): Declare the printer and destructor
11820 as const, to avoid accidental calls to free.
11821 (symbol_destructor_set, symbol_printer_set): Adjust.
11822 * src/symtab.c: Adjust.
11823
11824 2005-09-16 Akim Demaille <akim@epita.fr>
11825
11826 * data/c.m4 (b4_token_enums): New.
11827 (b4_token_defines): Rename as...
11828 (b4_token_enums_defines): this.
11829 (b4_token_defines): New, output only the #defines.
11830 * data/yacc.c, data/glr.c: Adjust.
11831 * data/lalr1.cc: Use b4_token_enums instead of b4_token_enums_defines.
11832 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Define
11833 as default values.
11834
11835 2005-09-16 Akim Demaille <akim@epita.fr>
11836
11837 * data/lalr1.cc (yylex_): Remove, inline its code.
11838 (yyreport_syntax_error_): Remove, replaced by...
11839 (yysyntax_error_): this which returns a string and leaves to the
11840 caller the call to the users' error function.
11841 (yylooka_, yyilooka_, yylval, yylloc, yyerror_range_, yyval, yyloc):
11842 Move from members of the parser object...
11843 (yylooka, yyilooka, yylval, yylloc, yyerror_range, yyval, yyloc):
11844 to local variables of the parse function.
11845
11846 2005-09-16 Akim Demaille <akim@epita.fr>
11847
11848 * doc/bison.texinfo (Calc++ Parser): Don't promote defining YYEOF
11849 since it's in Bison's name space.
11850
11851 2005-09-15 Paul Eggert <eggert@cs.ucla.edu>
11852
11853 * data/glr.c (yyresolveValue): Add default case to pacify
11854 gcc -Wswitch-default. Problem reported by twlevo@xs4all.nl.
11855
11856 * NEWS: Document when yyparse started to return 2.
11857 * doc/bison.texinfo (Parser Function): Document when yyparse
11858 returns 2.
11859
11860 * data/lalr1.cc: Revert part of previous change, as it's incompatible.
11861 (b4_filename_type): Renamed back from b4_file_name_type. All uses
11862 changed.
11863 (class position): file_name -> filename (reverting). All uses changed.
11864
11865 2005-09-14 Paul Eggert <eggert@cs.ucla.edu>
11866
11867 * examples/calc++/Makefile.am ($(calc_sources_generated)): Don't
11868 do anything if $@ exists. This reverts part of the 2005-07-07
11869 patch.
11870
11871 2005-09-11 Paul Eggert <eggert@cs.ucla.edu>
11872
11873 * Makefile.am (EXTRA_DIST): Do not distribute REFERENCES; it
11874 contains obsolete information and isn't worth distributing as a
11875 separate file anyway.
11876 * data/glr.c [defined YYSETJMP]: Don't include <setjmp.h>.
11877 (YYJMP_BUF, YYSETJMP, YYLONGJMP) [!defined YYSETJMP]: New macros.
11878 All uses of jmp_buf, setjmp, longjmp changed to use these instead.
11879 (yyparse): Abort if user code uses longjmp to throw an unexpected
11880 value.
11881
11882 2005-09-09 Paul Eggert <eggert@cs.ucla.edu>
11883
11884 * data/c.m4 (b4_identification): Define YYBISON_VERSION.
11885 Suggested by twlevo@xs4all.nl.
11886
11887 * data/glr.c (YYCHK1): Do not assume YYE is in range.
11888 This avoids a diagnostic from gcc -Wswitch-enum.
11889 Problem reported by twlevo@xs4all.nl.
11890
11891 * doc/bison.texinfo: Don't use "filename", as per GNU coding
11892 standards. Use "file name" or "file" or "name", depending on
11893 the context.
11894 (Invocation): The output of "bison hack/foo.y" goes to foo.tab.c,
11895 not to hack/foo.tab.c.
11896 (Calc++ Top Level): 2nd arg of main is not const.
11897 * data/glr.c: b4_filename -> b4_file_name.
11898 * data/lalr1.cc: Likewise. Also, b4_filename_type -> b4_file_name_type.
11899 All uses changed.
11900 (class position): filename -> file_name. All uses changed.
11901 * data/yacc.c: b4_filename -> b4_file_name.
11902 * lib/bitset.h: filename -> file_name in local vars.
11903 * lib/bitset_stats.c: Likewise.
11904 * src/files.c: Likewise.
11905 * src/scan-skel.l ("@output ".*\n): Likewise.
11906 * src/files.c (file_name_split): Renamed from filename_split.
11907 * src/muscle_tab.c (muscle_init): Output b4_file_name, not b4_filename.
11908
11909 2005-09-08 Paul Eggert <eggert@cs.ucla.edu>
11910
11911 * lib/.cvsignore: Add pipe-safer.c, stdio--.h, unistd--.h,
11912 to accommodate latest gnulib.
11913
11914 * tests/glr-regression.at (Duplicate representation of merged trees):
11915 Add casts to pacify g++. Problem reported by twlevo@xs4all.nl.
11916
11917 * bootstrap: Add comment as to why the AM_LANGINFO_CODESET hack is
11918 needed.
11919
11920 2005-08-26 Paul Eggert <eggert@cs.ucla.edu>
11921
11922 * data/glr.c (yydestroyGLRState): Renamed from yydestroyStackItem.
11923 All uses changed. Invoke user destructor after an error during a
11924 split parse (trivial change from Joel E. Denny).
11925
11926 * tests/glr-regression.at
11927 (User destructor after an error during a split parse): New test case.
11928 Problem reported by Joel E. Denny in:
11929 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00029.html
11930
11931 2005-08-25 Paul Eggert <eggert@cs.ucla.edu>
11932
11933 * README-cvs: Give URLs for recommended tools.
11934 Mention Gzip version problem, and bootstrapping issues.
11935 Remove troubleshooting section, as it's somewhat obsolete.
11936
11937 * bootstrap (no_cache): New var, to accommodate different wget
11938 variants. Use it instead of '-C off'. Problem reported by
11939 twlevo@xs4all.nl.
11940
11941 * data/glr.c (yydestroyStackItem): New function.
11942 (yyrecoverSyntaxError, yyreturn): Use it to improve quality of
11943 debugging information. Problem reported by Joel E. Denny.
11944
11945 2005-08-25 Akim Demaille <akim@epita.fr>
11946
11947 * tests/local.at (AT_COMPILE_CXX): Pass $LINKS too.
11948
11949 2005-08-24 Paul Eggert <eggert@cs.ucla.edu>
11950
11951 * data/glr.c (yyrecoverSyntaxError, yyreturn):
11952 Don't invoke destructor on unresolved entries.
11953 * tests/glr-regression.at
11954 (User destructor for unresolved GLR semantic value): New test case.
11955 Problem reported by Joel E. Denny in:
11956 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00016.html
11957
11958 2005-08-21 Paul Eggert <eggert@cs.ucla.edu>
11959
11960 * lib/.cvsignore: Remove realloc.c, strncasecmp.c, xstrdup.c.
11961 Add strnlen.c.
11962 * m4/.cvsignore: Remove codeset.m4, gettext.m4, lib-ld.m4,
11963 lib-prefix.m4, po.m4.
11964
11965 * data/glr.c (yyreturn): Use "Cleanup:" rather than "Error:"
11966 in yydestruct diagnostic, since it might not be an error.
11967 Problem reported by Joel Denny near end of
11968 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
11969 * data/lalr1.cc (yyerturn): Likewise.
11970 * data/yacc.c (yyreturn): Likewise.
11971 * tests/calc.at (_AT_CHECK_CALC_ERROR): Adjust to the above change.
11972
11973 * src/files.c: Remove obsolete FIXME comment.
11974
11975 * data/glr.c (YY_SYMBOL_PRINT): Append a newline, for consistency
11976 with the other templates, and to fix bogus run-on messages such
11977 as the one reported at the end of
11978 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
11979 All callers changed to avoid the newline.
11980 (yyprocessOneStack): Output two lines rather than one, to accommodate
11981 the above change. This changes the debug output format slightly.
11982
11983 * data/glr.c (yyresolveValue): Fix redundant parse tree problem
11984 reported by Joel E. Denny in
11985 <http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00004.html>
11986 (trivial change).
11987 * tests/glr-regression.at (Duplicate representation of merged trees):
11988 New test, from Joel E. Denny in:
11989 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00013.html>.
11990 * THANKS: Add Joel E. Denny.
11991
11992 * configure.ac (AC_INIT): Bump to 2.0c.
11993
11994 2005-07-24 Paul Eggert <eggert@cs.ucla.edu>
11995
11996 * NEWS: Version 2.0b.
11997
11998 * Makefile.am (SUBDIRS): Put examples before tests, so that
11999 "make check" doesn't finish with "All 1 tests passed".
12000
12001 * tests/regression.at (Token definitions): Don't rely on
12002 AT_PARSER_CHECK for data that contains backslashes. It currently
12003 uses 'echo', and 'echo' isn't portable if its argument contains
12004 backslashes. Problem found on OpenBSD 3.4. Also, do not assume
12005 that the byte '\0xff' is not printable in the C locale; it is,
12006 under OpenBSD 3.4 (!). Luckily, '\0x80' through '\0x9e' are
12007 not printable, so use '\0x81' to test.
12008
12009 * data/glr.c (YYOPTIONAL_LOC): Define even if it's not a recent
12010 version of GCC, since the macro is used with non-GCC compilers.
12011
12012 Fix core dump reported by Pablo De Napoli in
12013 <http://lists.gnu.org/archive/html/bug-bison/2005-07/msg00053.html>.
12014 * tests/regression.at (Invalid inputs with {}): New test.
12015 * src/parse-gram.y (token_name): Translate type before using
12016 it as an index.
12017
12018 * data/glr.c (ATTRIBUTE_UNUSED): Remove, since it infringes on
12019 the user's name space. All uses changed to __attribute__
12020 ((__unused__)).
12021 (yyFail, yyMemoryExhausted, yyreportAmbiguity):
12022 Add __attribute__ ((__noreturn__)).
12023
12024 * etc/clcommit: Remove. We weren't using it, and it failed
12025 "make maintainer-distcheck".
12026 * Makefile.maint: Merge from coreutils.
12027 (CVS_LIST, CVS_LIST_EXCEPT): New macros.
12028 (syntax-check-rules): Change list of rules as described below.
12029 (sc_cast_of_alloca_return_value, sc_dd_max_sym_length):
12030 (sc_file_system, sc_obsolete_symbols, sc_prohibit_atoi_atof):
12031 (sc_prohibit_jm_in_m4, sc_root_tests, sc_tight_scope):
12032 (sc_trailing_space): New rules.
12033 (sc_xalloc_h_in_src): Remove.
12034 (sc_cast_of_argument_to_free, sc_cast_of_x_alloc_return_value):
12035 (sc_space_tab, sc_error_exit_success, sc_changelog):
12036 (sc_system_h_headers, sc_sun_os_names, sc_unmarked_diagnostics):
12037 (makefile-check, po-check, author_mark_check):
12038 (makefile_path_separator_check, copyright-check):
12039 Use grep -n, to make it easier to find violations.
12040 Use CVS_LIST and CVS_LIST_EXCEPT.
12041 (header_regexp, h_re): Remove.
12042 (dd_c): New macro.
12043 (sc_dd_max_sym_length, .re-list, news-date-check): New rules.
12044 (my-distcheck): Use more-modern GCC flags.
12045 (signatures, %.asc): Remove.
12046 (rel-files, announcement): Remove signatures.
12047 Restore old updating code, even though we don't use it, so
12048 that we're the same as coreutils.
12049 (alpha, beta, major): Depend on news-date-check.
12050 Make the upload commands.
12051
12052 * data/c.m4, data/lalr1.cc, data/yacc.c: Normalize white space.
12053 * lib/abitset.h, lib/bbitset.h, lib/bitset.h: Likewise.
12054 * lib/bitset_stats.c, lib/ebitset.h, lib/lbitset.c: Likewise.
12055 * lib/libitset.h, lib/timevar.c, lib/vbitset.h: Likewise.
12056 * src/Makefile.am, src/gram.c, src/muscle_tab.h: Likewise.
12057 * src/parse-gram.y, src/system.h, src/tables.c, src/vcg.c: Likewise.
12058 * src/vcg_defaults.h, tests/cxx-type.at, tests/existing.at: Likewise.
12059 * tests/sets.at: Likewise.
12060
12061 * data/m4sugar/m4sugar.m4: Sync from Autoconf, except that
12062 we comment out the Autoconf version number.
12063 * doc/bison.texinfo (Calc++ Scanner): Don't use atoi, as
12064 it's error-prone and "make maintainer-distcheck" rejects it.
12065
12066 * lib/subpipe.c: Include <fcntl.h> without checking for HAVE_FCNTL_H.
12067 Indent calls to "error" to pacify "make maintainer-distcheck",
12068 when the calls are not intended to be translated.
12069 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't check for fcntl.h.
12070
12071 * src/Makefile.am (DEFS): Use +=, to pacify
12072 "make maintainer-distcheck".
12073 (bison_SOURCES): Add scan-skel.h.
12074 (sc_tight_scope): New rule, from coreutils.
12075
12076 * src/files.c (src_extension, header_extension):
12077 Now static, not extern.
12078 * src/getargs.c (short_options): Likewise.
12079 * src/muscle_tab.c (muscle_table): Likewise.
12080 * src/parse-gram.y (current_class, current_type, current_prec):
12081 Likewise.
12082 * src/reader.c (grammar_end, previous_rule_end): Likewise.
12083 * src/getargs.h: Redo comments to pacify "make maintainer-distcheck".
12084 * src/main.c (main): Cast bindtextdomain and textdomain calls to
12085 void, to avoid warning when NLS is disabled.
12086 * src/output.c: Include scan-skel.h.
12087 (scan_skel): Remove decl, since scan-skel.h does this.
12088 (output_skeleton):
12089 Indent calls to "error" to pacify "make maintainer-distcheck".
12090 * src/print_graph.c: Don't include <obstack.h>, as system.h does this.
12091 * src/reader.h (gram_end, gram_lineno): New decls to pacify
12092 "make maintainer-distcheck".
12093 * src/scan-skel.l (skel_lex, skel_get_lineno, skel_get_in):
12094 (skel_get_out, skel_get_leng, skel_get_text, skel_set_lineno):
12095 (skel_set_in, skel_set_out, skel_get_debug, skel_set_debug):
12096 (skel_lex_destroy, scan_skel): Move these decls to...
12097 * src/scan-skel.h: New file.
12098 * src/uniqstr.c (uniqstr_assert):
12099 Indent calls to "error" to pacify "make maintainer-distcheck".
12100
12101 * tests/Makefile.am ($(srcdir)/package.m4): Use $(VAR),
12102 not @VAR@.
12103
12104 * tests/torture.at: Revamp to avoid misuse of atoi that
12105 "make maintainer-distcheck" complained about.
12106
12107 * examples/extexi (message): Don't print a message more than once,
12108 and omit line-number decoration that makes Emacs compile think
12109 that informative messages are worth worrying about.
12110
12111 2005-07-22 Paul Eggert <eggert@cs.ucla.edu>
12112
12113 * configure.ac: Update version number.
12114
12115 * Makefile.am (SUBDIRS): Add examples; somehow this got removed
12116 accidentally.
12117 * examples/calc++/calc++-parser.yy: Remove from CVS, as it's
12118 autogenerated by the maintainer.
12119 * examples/calc++/.cvsignore: Add *.yy.
12120
12121 * lib/bitset.c (bitset_alloc): Don't cast xcalloc result.
12122 * lib/bitset_stats.c (bitset_stats_init): Likewise.
12123 * lib/bitsetv.c (bitsetv_alloc): Likewise.
12124
12125 * po/POTFILES.in: Add lib/xalloc-die.c; remove lib/xmalloc.c.
12126
12127 * src/relation.c (relation_transpose): Rewrite to avoid bogus complaint
12128 from maintainer-distcheck about casting the argument of 'free'.
12129
12130 * NEWS: Mention recent yytname changes.
12131 * THANKS: Add Anthony Heading, twlevo@xs4all.nl.
12132
12133 * bootstrap: For translations that have not yet been upgraded to
12134 the new runtime-po domain, prime the pump by extracting the
12135 relevant strings from the obsolete translations. This code can be
12136 removed once the bison-runtime domain has been translated by each
12137 team.
12138
12139 * src/scan-gram.l (<SC_PRE_CODE>.): Don't double-quote token names,
12140 now that token names are already quoted.
12141
12142 Fix problem reported by Anthony Heading.
12143 * data/glr.c (YYTOKEN_TABLE): New macro.
12144 (yytname): Define if YYTOKEN_TABLE.
12145 * data/yacc.c (YYTOKEN_TABLE, yytname): Likewise.
12146 * data/lalr1.cc (YYTOKEN_TABLE, yytname_): Likewise.
12147 (YYERROR_VERBOSE): Define the same way the other skeletons do.
12148 * src/output.c (prepare_symbols): Output token_table_flag.
12149
12150 2005-07-21 Paul Eggert <eggert@cs.ucla.edu>
12151
12152 * data/glr.c (yyinitGLRStack, yyreturn): Don't call malloc
12153 again if the first call fails.
12154
12155 * data/glr.c (yytnamerr): New function.
12156 (yyreportSyntaxError): Use it to dequote most string literals.
12157 * data/lalr1.c (yytname_): Renamed from yyname_, for compatibility
12158 with other skeletons. All uses changed.
12159 (yytnameerr_): New function.
12160 (yyreport_syntax_error): Use it to dequote most string literals.
12161 * data/yacc.c (yytnamerr): New function.
12162 (yyerrlab): Use it to decode most string literals.
12163 * doc/bison.texinfo (Decl Summary, Calling Convention):
12164 Clarify quoting convention of yytname.
12165 * src/output.c (prepare_symbols): Quote all names. This undoes
12166 the 2005-04-17 change, which is now accomplished (mostly) via
12167 changes in the parsers as described above.
12168 * tests/regression.at (Token definitions, Web2c Actions):
12169 Undo most 2005-04-17 change here, too.
12170
12171 2005-07-20 Paul Eggert <eggert@cs.ucla.edu>
12172
12173 Fix more problems reported by twlevo@xs4all.nl.
12174 * tests/cxx-type.at: Don't pipe output of ./types through sed to
12175 remove trailing spaces. This loses the exit status of ./types,
12176 and isn't needed since ./types shouldn't be emitting trailing
12177 spaces.
12178 * data/glr.c (yyreturn): Don't pop stack if yyinitStateSet failed,
12179 as the stack isn't valid in that case.
12180
12181 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
12182 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
12183 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
12184 Add declarations to pacify "gcc -Wmissing-prototypes" when flex 2.5.31
12185 is used.
12186 * src/scan-skel.l (skel_get_lineno, skel_get_in, skel_get_out):
12187 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
12188 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
12189 Likewise.
12190
12191 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Work even with
12192 overly-picky compilers that reject 'char *foo = "bar";'.
12193
12194 * src/symtab.c (SYMBOL_ATTR_PRINT, symbol_print): Direct output
12195 to FILE * parameter, not to stderr. This fixes a typo introduced
12196 in the 2005-07-12 change.
12197
12198 * lib/subpipe.c (create_subpipe): Rewrite slightly to avoid
12199 warnings from GCC 4.
12200
12201 * data/glr.c (yyexpandGLRStack, yyaddDeferredAction, yyexpandGLRStack):
12202 (yyglrShiftDefer, yysplitStack):
12203 Remove unused parameters b4_pure_formals. All uses changed.
12204 (yyglrShift): Remove unused parameters b4_user_formals.
12205 All uses changed.
12206 (yyglrReduce): Removed unused parameter yylocp. All uses changed.
12207
12208 2005-07-18 Paul Eggert <eggert@cs.ucla.edu>
12209
12210 Destructor cleanups and regularization among the three skeletons.
12211 * NEWS: Document the behavior changes.
12212 * data/glr.c (yyrecoverSyntaxError): Don't bother to pop the
12213 stack before failing, as the cleanup code will do it for us now.
12214 * data/lalr1.cc (yyerrlab): Likewise.
12215 * data/glr.c (yyparse): Pop everything off the stack before
12216 freeing it, so that destructors get called properly.
12217 * data/lalr1.cc (yyreturn): Likewise.
12218 * data/yacc.c (yyreturn): Pop and destroy the start symbol, too.
12219 This is more consistent.
12220 * doc/bison.texinfo (Destructor Decl): Mention more reasons
12221 why destructors might be called. 1.875 -> 2.1.
12222 (Destructor Decl, Decl Summary, Table of Symbols):
12223 Some English-language cleanups for %destructor.
12224 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
12225 Add output line for destructor of start symbol.
12226 * tests/calc.at (AT_CHECK_CALC): Add one to line counts,
12227 because of that same extra output line.
12228
12229 * NEWS: Document minor wording changes in diagnostics of
12230 Bison-generated parsers.
12231 * data/glr.c (yyMemoryExhausted): Renamed from yyStackOverflow.
12232 Remove unused formals. All uses changed.
12233 (yyreportAmbiguity): "ambiguity detected" -> "syntax is ambiguous".
12234 (yyparse): Rename yyoverflowlab to yyexhaustedlab.
12235 * data/yacc.c (yyparse): "parser stack overflow" -> "memory exhausted".
12236 Rename yyoverflowab to yyexhaustedlab.
12237 When memory exhaustion occurs during syntax-error reporting,
12238 report it separately rather than in a single diagnostic; this
12239 eases translation.
12240 * doc/bison.texinfo (Memory Management): Renamed from Stack Overflow.
12241 (Memory Exhausted): Renamed from Parser Stack Overflow.
12242 Revamp wording slightly to prefer "memory exhaustion".
12243 * tests/actions.at: "parser stack overflow" -> "memory exhausted".
12244
12245 * data/c.m4 (b4_yysymprint_generate): Use YYFPRINTF, not fprintf.
12246
12247 Add i18n support to the GLR skeleton. Partially fix the C++
12248 skeleton; a C++ expert needs to finish this. Remove debugging
12249 msgids; there's little point to having them translated, since they
12250 can be understood only by someone who can read the
12251 (English-language) source code.
12252
12253 Generate runtime-po/bison-runtime.pot automatically, so that we
12254 don't have to worry about garbage getting in that file. We'll
12255 make sure after the next official release that old msgids don't
12256 get lost. See
12257 <http://lists.gnu.org/archive/html/bison-patches/2005-07/msg00119.html>.
12258
12259 * runtime-po/Makefile.in.in, runtime-po/bison-runtime.pot: Remove.
12260 Now auto-generated.
12261 * PACKAGING: Don't claim that Gawk, GCC, Perl use this method yet.
12262 Fix typos in explanations of the runtime file.
12263 * bootstrap: Change gettext keyword from YYI18N to YY_.
12264 Use standard Makefile.in.in in runtime-po, since we'll arrange
12265 for backward-compatible bison-runtime.po files in a different way.
12266 * data/glr.c (YY_): New macro, from yacc.c.
12267 (yyuserAction, yyreportAmbiguity, yyreportSyntaxError, yyparse):
12268 Translate messages intended for users.
12269 (yyreportSyntaxError): Change "virtual memory" to "memory" to match
12270 the wording in the other skeletons. We don't know that the memory
12271 is virtual.
12272 * data/lalr1.cc (YY_): Renamed from _. All uses changed.
12273 Use same method that yacc.c uses.
12274 Don't translate debugging messages.
12275 (yy::yyreport_syntax_error): Put in a FIXME for the i18n stuff;
12276 it doesn't work (yet), and requires C++ expertise to fix.
12277 * data/yacc.c (YY_): Renamed from YY18N. All uses changed.
12278 Move defn to a more logical place, to be consistent with other
12279 skeletons.
12280 Don't translate debugging messages.
12281 Don't assume line numbers fit in unsigned int; use unsigned long fmts.
12282 * doc/bison.texinfo: Mention <libintl.h>. Change glibc cross reference
12283 to gettext cross reference. Add indexing terms. Mention YYENABLE_NLS.
12284 * runtime-po/POTFILES.in: Add data/glr.c, data/lalr1.cc.
12285
12286 Fix yyerror / yylex test glitches noted by twlevo@xs4all.nl.
12287 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Have yyerror return
12288 void, not int.
12289 * tests/glr-regression.at (Badly Collapsed GLR States):
12290 Likewise.
12291 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
12292 yylex should return 0 at EOF rather than aborting.
12293
12294 Improve tests for stack overflow in GLR parser.
12295 Problem reported by twlevo@xs4all.nl.
12296 * data/glr.c (struct yyGLRStack): Remove yyerrflag member.
12297 All uses removed.
12298 (yyStackOverflow): Just longjmp, but with value 2 so that caller
12299 can handle the problem.
12300 (YYCHK1): Use goto (a la yacc.c) rather than setting a flag.
12301 (yyparse): New local variable yyresult to record the result.
12302 Use result of setjmp to set it, rather than storing itinto
12303 struct.
12304 (yyDone): Remove label.
12305 (yyacceptlab, yyabortlab, yyoverflowlab, yyreturn): New labels,
12306 to mimic yacc.c. Do not discard lookahead if it's EOF (possible
12307 if YYABORT is used).
12308 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Exit with
12309 yyparse status; put status > 1 into diagnostic.
12310 Check that status==2 works.
12311 * tests/calc.at, tests/cxx-type.at, tests/glr-regression.at:
12312 Use exit status 3 for failure to open (which shouldn't happen).
12313
12314 2005-07-17 Paul Eggert <eggert@cs.ucla.edu>
12315
12316 * tests/conflicts.at (%nonassoc and eof): Don't exit with status
12317 1 on syntax error; just let yyparse do its thing.
12318 * tests/glr-regression.at (Badly Collapsed GLR States): Likewise.
12319 * tests/torture.at (AT_DATA_STACK_TORTURE): Likewise.
12320 (Exploding the Stack Size with Alloca):
12321 (Exploding the Stack Size with Malloc):
12322 Expect exit status 2, not 1, since the parser is supposed to blow
12323 its stack. Problem reported by twlevo@xs4all.nl.
12324
12325 * data/glr.c (yyparse): Don't assume that the initial calls
12326 to YYMALLOC succeed; in that case, yyparse incorrectly returned 0.
12327 Print a stack-overflow message and fail instead.
12328 Initialize the line-number information before creating the stack,
12329 so that the stack-overflow message can report line zero safely.
12330
12331 2005-07-14 Paul Eggert <eggert@cs.ucla.edu>
12332
12333 Fix problems reported by twlevo@xs4all.nl.
12334 * data/glr.c (YYSTACKEXPANDABLE): Don't define if already defined.
12335 (yyuserMerge): Provide a default case if b4_mergers is empty.
12336 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Define YYSTACKEXPANDABLE.
12337 * tests/glr-regression.at
12338 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
12339 Add casts to pacify C++ compilers.
12340 * tests/glr-regression.at (Improper merging of GLR delayed action
12341 sets): Declare yylex before using it.
12342 * tests/Makefile.am (maintainer-check-g++): Fix a stray
12343 $(GXX) that escaped the renaming of GXX to CXX. Remove bogus
12344 test for valgrind; valgrind is independent of g++.
12345 (maintainer-check-posix): Add _POSIX2_VERSION=200112, to check
12346 for compatibility with POSIX 1003.1-2001 (if running coreutils).
12347 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Port to stricter C++.
12348 Use a destructor, so that we can expand the stack. Change
12349 YYSTYPE to char * so that we can free it. Cast result of malloc.
12350
12351 2005-07-13 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
12352
12353 * data/glr.c (yyuserAction): Fix uninitialized variable that caused
12354 a valgrind failure. Problem reported by twlevo@xs4all.nl.
12355
12356 2005-07-13 Paul Eggert <eggert@cs.ucla.edu>
12357
12358 * PACKAGING: New file, suggested by Bruno Haible and taken from
12359 similar wording in gettext's PACKAGING file.
12360 * NEWS: Mention PACKAGING.
12361 * Makefile.am (EXTRA_DIST): Add PACKAGING.
12362
12363 2005-07-12 Paul Eggert <eggert@cs.ucla.edu>
12364
12365 * NEWS: Document recent i18n improvements.
12366 * bootstrap: Get runtime translations into runtime-po.
12367 Create runtime-po files automatically, if possible.
12368 * configure.ac: Invoke BISON_I18N, so that we eat our own dog food.
12369 * data/yacc.c: Rewrite inclusion of <libintl.h> so that ENABLE_NLS
12370 does not infringe on the user's name space.
12371 (YYENABLE_NLS): Renamed from ENABLE_BISON_NLS.
12372 * doc/bison.texinfo (Internationalization): Revamp the English
12373 and Texinfo syntax a bit, to try to make it clearer.
12374 (Bison Options, Option Cross Key): Mention --print-localedir.
12375 * m4/bison-i18n.m4 (BISON_I18N): Rename ENABLE_BISON_NLS to
12376 YYENABLE_NLS. Quote a bit more.
12377 * runtime-po/.cvsignore: New file.
12378 * runtime-po/Makefile.in.in (mostlyclean): Remove *.old.pot.
12379 * runtime-po/Rules-quot: Remove; now created by bootstrap.
12380 * runtime-po/quot.sed: Likewise.
12381 * runtime-po/boldquot.sed: Likewise.
12382 * runtime-po/en@quot.header: Likewise.
12383 * runtime-po/en@boldquot.header: Likewise.
12384 * runtime-po/insert-header.sin: Likewise.
12385 * runtime-po/remove-potcdate.sin: Likewise.
12386 * runtime-po/Makevars: Likewise.
12387 * runtime-po/LINGUAS: Likewise.
12388 * runtime-po/de.po: Likewise; we will rely on the translation project
12389 to maintain this, so "bootstrap" should get it.
12390 * src/getarg.c (PRINT_LOCALEDIR_OPTION): Let the C compiler determine
12391 its value.
12392 * src/main.c (main): Bind the bison-runtime domain, too.
12393
12394 2005-07-12 Bruno Haible <bruno@clisp.org>
12395
12396 * data/yacc.c: Include <libintl.h> when NLS is enabled.
12397 (YYI18N): Renamed from _. Use dgettext when NLS is enabled.
12398 * po/POTFILES.in: Remove autogenerated file src/parse-gram.c.
12399 * runtime-po: New directory.
12400 * runtime-po/Makefile.in.in: New file, copied from po/, with modified
12401 $(DOMAIN).pot-update rule, so that old messages are never dropped.
12402 * runtime-po/Rules-quot: New file, copied from po/.
12403 * runtime-po/quot.sed: Likewise.
12404 * runtime-po/boldquot.sed: Likewise.
12405 * runtime-po/en@quot.header: Likewise.
12406 * runtime-po/en@boldquot.header: Likewise.
12407 * runtime-po/insert-header.sin: Likewise.
12408 * runtime-po/remove-potcdate.sin: Likewise.
12409 * runtime-po/Makevars: New file.
12410 * runtime-po/POTFILES.in: New file.
12411 * runtime-po/LINGUAS: New file.
12412 * runtime-po/bison-runtime.pot: New file.
12413 * runtime-po/de.po: New file.
12414 * m4/bison.m4: New file.
12415 * Makefile.am (SUBDIRS): Add runtime-po.
12416 (aclocaldir, aclocal_DATA): New variables.
12417 * configure.ac: Add AC_CONFIG_FILES of runtime-po/Makefile.in.
12418 Define aclocaldir.
12419 * src/getargs.c (usage): Document --print-localedir option.
12420 (PRINT_LOCALEDIR_OPTION): New enum item.
12421 (long_options): Add --print-localedir option.
12422 (getargs): Handle --print-localedir option.
12423 * doc/bison.texinfo (Bison Parser): Remove paragraph about _().
12424 (Internationalization): New section.
12425
12426 2005-07-12 Akim Demaille <akim@epita.fr>
12427
12428 * src/symtab.h, src/symtab.c (symbol_print): Swap the arguments,
12429 for consistency with the rest of the code.
12430 * src/symlist.h, src/symlist.c (symbol_list_print): Ditto.
12431 Add separators.
12432
12433 2005-07-12 Akim Demaille <akim@epita.fr>
12434
12435 * src/parse-gram.y: Use %printer instead of YYPRINT.
12436
12437 2005-07-12 Akim Demaille <akim@epita.fr>
12438
12439 * src/symtab.h, src/symtab.c (symbol_print): New.
12440 * src/symlist.h, src/symlist.c (symbol_list_print): New.
12441 * src/symlist.c (symbol_list_n_type_name_get): Report the culprit.
12442
12443 2005-07-12 Akim Demaille <akim@epita.fr>
12444
12445 * data/glr.c (b4_syncline): Fix (swap) the definitions of
12446 b4_at_dollar and b4_dollar_dollar.
12447
12448 2005-07-11 Paul Eggert <eggert@cs.ucla.edu>
12449
12450 * doc/bison.texinfo (Mystery Conflicts): Add reference to DeRemer
12451 and Pennello's paper.
12452
12453 2005-07-09 Paul Eggert <eggert@cs.ucla.edu>
12454
12455 * data/yacc.c (yyparse): Undo previous patch. Instead,
12456 set yylsp[0] and yyvsp[0] only if the initial action
12457 sets yylloc and yylval, respectively.
12458
12459 * data/yacc.c (yyparse): In the initial action, set
12460 yylsp[0] and yyvsp[0] rather than yylloc and yylval.
12461 This avoids the use of undefined variables if the initial
12462 action does not set yylloc and/or yylval.
12463
12464 2005-07-07 Paul Eggert <eggert@cs.ucla.edu>
12465
12466 * examples/calc++/calc++-driver.cc, examples/calc++/calc++-driver.hh:
12467 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc:
12468 Remove from CVS. These files are automatically generated.
12469 * examples/extexi: Clarify that this file is now part of Bison,
12470 not GNU M4, and that it works with any POSIX-compatible Awk.
12471 * examples/calc++/Makefile.am (run_extexi): Remove; not used.
12472 ($(calc_extracted)): Renamed from $(calc_sources_extracted),
12473 so that we also get calc++-parser.yy. Geneate it.
12474 Use $(AWK), not gawk, since any conforming Awk will do.
12475 Put comment before action, since older 'make' can't handle comment
12476 in action.
12477 $(BUILT_SOURCES): List all built sources, not just some of them.
12478 $(MAINTAINERCLEANFILES): Remove *.stamp, and all built sources.
12479 $($(srcdir)/calc++-parser.stamp): Work even if POSIXLY_CORRECT.
12480 $($(calc_sources_generated)): Remove unnecessary test for existence
12481 of target. (This had a shell syntax error anyway; a stray "x".)
12482 (calc_extracted): List $(srcdir)/calc++-parser.yy, not
12483 calc++-parser.yy.
12484 * examples/.cvsignore, examples/calc++/.cvsignore: New files.
12485
12486 * bootstrap (gnulib_modules): Add gettext, now that it's no longer
12487 implied by the other modules.
12488
12489 2005-07-06 Akim Demaille <akim@epita.fr>
12490
12491 Bind examples/calc++ to the package.
12492 * examples/calc++/Makefile: Remove, replaced by...
12493 * examples/calc++/Makefile.am: ... this new file.
12494 * examples/calc++/test: Remove input.
12495 * examples/calc++/compile: Remove.
12496 * examples/Makefile.am: New.
12497 * configure.ac, Makefile.am: Adjust.
12498 * doc/Makefile.am (clean-local): New, for more recent texi2dvis.
12499
12500 2005-07-05 Paul Eggert <eggert@cs.ucla.edu>
12501
12502 * data/glr.c (yyFail): Drastically simplify; since the format argument
12503 never had any % directives, we can simply pass it to yyerror.
12504 (yyparse): Use "t a; a=b;" rather than "t a = b;" when a will
12505 be modified later, as that is the usual style in glr.c.
12506 Problems reported by Paul Hilfinger.
12507
12508 Rewrite GLR parser to catch more buffer overrun, storage exhaustion,
12509 and size overflow errors.
12510 * data/glr.c: Include <stdio.h> etc. after user prolog, not before,
12511 in case the user prolog sets feature-test macros like _GNU_SOURCE.
12512 (YYSIZEMAX): New macro.
12513 (yystpcpy): New function, taken from yacc.c.
12514 (struct yyGLRStack.yyspaceLeft): Now size_t, not int.
12515 (yyinitGLRStack, yyfreeGLRstack): Remove unnecessary forward decls,
12516 so that we don't have to maintain their signatures.
12517 (yyFail): Check for buffer overflow, by using vsnprintf rather
12518 than vsprintf. Allocate a bigger buffer if possible.
12519 Report an error if buffer allocation fails.
12520 (yyStackOverflow): New function.
12521 (yyinitStateSet, yyinitGLRStack): Return a boolean indicating whether
12522 the initialization was successful. It might fail if storage was
12523 exhausted.
12524 (yyexpandGLRStack): Add more checks for storage allocation failure.
12525 Use yyStackOverflow to report failures.
12526 (yymarkStackDeleted, yyglrShift, yyglrShiftDefer, yydoAction):
12527 (yysplitStack, yyprocessOneStack, yyparse, yypstack):
12528 Don't assume stack number fits in int.
12529 (yysplitStack): Check for storage allocation failure.
12530 (yysplitStack, yyprocessOneStack): Add pure_formals, so that we
12531 can print diagnostics on storage allocation failure. All callers
12532 changed.
12533 (yyresolveValue): Use yybool for boolean.
12534 (yyreportSyntaxError): Check for size-calculation overflow.
12535 This code is taken from yacc.c.
12536 (yyparse): Check for storage allocation errors when allocating
12537 the initial stack.
12538
12539 2005-07-05 Akim Demaille <akim@epita.fr>
12540
12541 Extract calc++ from the documentation.
12542 * doc/bison.texinfo (Calc++): Add the extraction marks.
12543 * examples/extexi: New, from the aborted GNU Programming 2E.
12544 Separate the different paragraph of a file with empty lines.
12545 * examples/Makefile: Use it to extract the whole calc++ example.
12546
12547 2005-06-24 Akim Demaille <akim@epita.fr>
12548
12549 * doc/bison.texinfo (C++ Parser Interface): Use defcv to define
12550 class typedefs.
12551
12552 2005-06-22 Akim Demaille <akim@epita.fr>
12553
12554 * doc/bison.texinfo (C++ Language Interface): First stab.
12555 (C++ Parsers): Remove.
12556
12557 2005-06-22 Akim Demaille <akim@epita.fr>
12558
12559 * data/lalr1.cc (yylex_): Honor %lex-param.
12560
12561 2005-06-22 Akim Demaille <akim@epita.fr>
12562
12563 Start a set of simple examples.
12564 * examples/calc++/Makefile, examples/calc++/calc++-driver.cc,
12565 * examples/calc++/calc++-driver.hh,
12566 * examples/calc++/calc++-parser.yy,
12567 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc,
12568 * examples/calc++/compile, examples/calc++/test: New.
12569
12570 2005-06-09 Paul Eggert <eggert@cs.ucla.edu>
12571
12572 * data/yacc.c (malloc, free) [defined __cplusplus]: Wrap inside
12573 extern "C" {}. This fixes a problem reported by Paul Hilfinger,
12574 which stems from the 2005-05-27 patch.
12575
12576 2005-06-06 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
12577
12578 * data/glr.c: Modify treatment of unused parameters to permit use
12579 of g++ (which doesn't allow __attribute__ ((unused)) for parameters).
12580
12581 2005-05-30 Paul Eggert <eggert@cs.ucla.edu>
12582
12583 Fix infringement on user name space reported by Janos Zoltan Szabo.
12584 * data/yacc.c (yyparse): strlen -> yystrlen.
12585
12586 2005-05-30 Akim Demaille <akim@epita.fr>
12587
12588 * data/lalr1.cc (_): New.
12589 Translate the various messages.
12590
12591 2005-05-27 Paul Eggert <eggert@cs.ucla.edu>
12592
12593 Fix infringement on user name space reported by Bruno Haible.
12594 * data/yacc.c (YYSIZE_T): Define first, so that later decls can use it.
12595 Prefer GCC's __SIZE_TYPE__ if available, so that we don't infringe on
12596 the user's name space.
12597 (alloca): Include <stdlib.h> to get it, if it's not built in.
12598 (YYMALLOC, YYFREE): Define only if needed.
12599 (malloc, free): Declare, but only if needed, as this infringes on
12600 the user name space.
12601
12602 2005-05-25 Paul Eggert <eggert@cs.ucla.edu>
12603
12604 Fix BeOS, FreeBSD, MacOS porting problems reported by Bruno Haible.
12605 * lib/bitset.c (bitset_print): Don't assume size_t can be printed
12606 with %d format.
12607 * lib/ebitset.c (min, max): Undef before defining.
12608 * lib/vbitset.c (min, max): Likewise.
12609 * lib/subpipe.c (create_subpipe): Save local variables in case
12610 vfork clobbers them.
12611
12612 2005-05-24 Bruno Haible <bruno@clisp.org>
12613
12614 * tests/synclines.at (AT_SYNCLINES_COMPILE): Add support for the
12615 error message syntax used by gcc-4.0.
12616
12617 2005-05-23 Paul Eggert <eggert@cs.ucla.edu>
12618
12619 * README: Mention m4 1.4.3. Remove obsolete advice about
12620 Sun Forte Developer 6 update 2, VMS, and MS-DOS.
12621
12622 * bootstrap: Remove workaround for problem I encountered with
12623 gettext 0.14.1; it seems to be fixed now.
12624
12625 2005-05-22 Paul Eggert <eggert@cs.ucla.edu>
12626
12627 * NEWS: Version 2.0a.
12628
12629 * src/files.c: Include "stdio-safer.h"; this fixes a typo in
12630 the previous change.
12631
12632 Various maintainer cleanups.
12633 * .cvsignore: Add a.exe, a.out, b.out,, conf[0-9]*, confdefs*,
12634 conftest*, for benefit of CVS commands run at the same time as
12635 "configure". Add build-aux, since "bootstrap" now creates it and
12636 its subfiles.
12637 * Makefile.cfg (move_if_change): Remove.
12638 * Makefile.maint: Remove the update stuff; we now use "bootstrap".
12639 (ftp-gnu, www-gnu, move_if_change, local_updates, update):
12640 (po_repo, do-po-update, po-update, wget_files, get-targets):
12641 (config.guess-url_prefix, config.sub-url_prefix):
12642 (ansi2knr.c-url_prefix, texinfo.tex-url_prefix):
12643 (standards.texi-url_prefix, make-stds.texi-url_prefix, taget, url):
12644 ($(get-targets), cvs-files, automake_repo, wget-update, cvs-update):
12645 Remove.
12646 * configure.ac (AC_CONFIG_AUX_DIR): Change from config to build-aux;
12647 this is now the recommended name.
12648 * config/.cvsignore: Remove config.guess, config.rpath, config.sub,
12649 depcomp, install-sh, mdate-sh, missing, mkinstalldirs, texinfo.tex,
12650 ylwrap. These files now go into build-aux.
12651 * config/move-if-change: Remove.
12652 * config/prev-version.txt: Bump from 1.75 to 2.0.
12653
12654 * bootstrap: Add stdio-safer, unistd-safer modules.
12655 Remove m4/glibc2.m4 (introduced by latest gnulib, but
12656 we don't need it).
12657 * lib/.cvsignore: Add dup-safer.c, fd-safer.c,
12658 fopen-safer.c, stdio-safer.h, unistd-safer.h.
12659 * lib/subpipe.c: Include "unistd-safer.h".
12660 (create_subpipe): Make sure all the newly-created
12661 file descriptors are > 2, so that diagnostics don't
12662 get sent down them (which might cause Bison to hang, in theory).
12663 * m4/.cvsignore: Add stdio-safer.m4, unistd-safer.m4.
12664 * src/files.c (xfopen): Use fopen_safer, not fopen.
12665
12666 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Port
12667 yesterday's yacc.c fix.
12668
12669 2005-05-21 Paul Eggert <eggert@cs.ucla.edu>
12670
12671 * data/glr.c, data/lalr1.cc: Update copyright date.
12672
12673 Fix a destructor bug reported by Wolfgang Spraul in
12674 <http://lists.gnu.org/archive/html/bug-bison/2005-05/msg00042.html>.
12675 * data/yacc.c (yyabortlab): Don't call destructor, and
12676 don't set yychar to EMPTY.
12677 (yyoverflowlab): Don't call destructor.
12678 (yyreturn): Call destructor, if yychar is neither YYEOF nor YYEMPTY.
12679 * tests/calc.at (AT_CHECK_CALC): Expect one fewer output lines,
12680 since we no longer output the message "discarding lookahead token
12681 end of input ()".
12682
12683 2005-05-20 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
12684
12685 * data/glr.c (YY_SYMBOL_PRINT): Don't print newline at end to
12686 fix a small glitch in debugging output.
12687 (yyprocessOneStack, yyrecoverSyntaxError, yyparse): Print newline
12688 after YY_SYMBOL_PRINT where needed.
12689
12690 (struct yyGLRState): Add some comments.
12691 (struct yySemanticOption): Add some comments.
12692 (union yyGLRStackItem): Add comment.
12693
12694 (yymergeOptionSets): Correct this to properly perform the union,
12695 avoiding infinite reported by Michael Rosien.
12696 Update comment.
12697
12698 * tests/glr-regression.at: Add test for GLR merging error reported
12699 by M. Rosien.
12700
12701 2005-05-13 Paul Eggert <eggert@cs.ucla.edu>
12702
12703 * COPYING, ChangeLog, GNUmakefile, HACKING, Makefile.am,
12704 Makefile.cfg, Makefile.maint, NEWS, README, README-alpha,
12705 README-cvs, TODO, bootstrap, configure.ac, data/Makefile.am,
12706 data/README, data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c,
12707 data/m4sugar/m4sugar.m4, doc/Makefile.am, doc/bison.texinfo,
12708 doc/fdl.texi, doc/gpl.texi, doc/refcard.tex, lib/Makefile.am,
12709 lib/abitset.c, lib/abitset.h, lib/bbitset.h, lib/bitset.c,
12710 lib/bitset.h, lib/bitset_stats.c, lib/bitset_stats.h,
12711 lib/bitsetv-print.c, lib/bitsetv-print.h, lib/bitsetv.c,
12712 lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/get-errno.c,
12713 lib/get-errno.h, lib/lbitset.c, lib/lbitset.h, lib/libiberty.h,
12714 lib/main.c, lib/subpipe.c, lib/subpipe.h, lib/timevar.c,
12715 lib/timevar.def, lib/timevar.h, lib/vbitset.c, lib/vbitset.h,
12716 lib/yyerror.c, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4, m4/timevar.m4,
12717 m4/warning.m4, src/LR0.c, src/LR0.h, src/Makefile.am, src/assoc.c,
12718 src/assoc.h, src/closure.c, src/closure.h, src/complain.c,
12719 src/complain.h, src/conflicts.c, src/conflicts.h, src/derives.c,
12720 src/derives.h, src/files.c, src/files.h, src/getargs.c,
12721 src/getargs.h, src/gram.c, src/gram.h, src/lalr.c, src/lalr.h,
12722 src/location.c, src/location.h, src/main.c, src/muscle_tab.c,
12723 src/muscle_tab.h, src/nullable.c, src/nullable.h, src/output.c,
12724 src/output.h, src/parse-gram.c, src/parse-gram.h,
12725 src/parse-gram.y, src/print.c, src/print.h, src/print_graph.c,
12726 src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c,
12727 src/reduce.h, src/relation.c, src/relation.h, src/scan-gram.l,
12728 src/scan-skel.l, src/state.c, src/state.h, src/symlist.c,
12729 src/symlist.h, src/symtab.c, src/symtab.h, src/system.h,
12730 src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h,
12731 src/vcg.c, src/vcg.h, src/vcg_defaults.h, tests/Makefile.am,
12732 tests/actions.at, tests/c++.at, tests/calc.at, tests/conflicts.at,
12733 tests/cxx-type.at, tests/existing.at, tests/glr-regression.at,
12734 tests/headers.at, tests/input.at, tests/local.at, tests/output.at,
12735 tests/reduce.at, tests/regression.at, tests/sets.at,
12736 tests/synclines.at, tests/testsuite.at, tests/torture.at:
12737 Update FSF postal mail address.
12738
12739 2005-05-11 Paul Eggert <eggert@cs.ucla.edu>
12740
12741 * tests/local.at (AT_COMPILE_CXX): Treat LDFLAGS like AT_COMPILE does.
12742 Problem reported by Ralf Menzel.
12743
12744 2005-05-01 Paul Eggert <eggert@cs.ucla.edu>
12745
12746 * tests/actions.at: Test that stack overflow invokes destructors.
12747 From Marcus Holland-Moritz.
12748 * data/yacc.c (yyerrlab): Move the code that destroys the stack
12749 from here....
12750 (yyreturn): to here. That way, destructors are called properly
12751 even if the stack overflows, or the user calls YYACCEPT or
12752 YYABORT. Stack-overflow problem reported by Marcus Holland-Moritz.
12753 (yyoverflowlab): Destroy the lookahead.
12754
12755 2005-04-24 Paul Eggert <eggert@cs.ucla.edu>
12756
12757 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): Add more-descriptive comment.
12758
12759 2005-04-17 Paul Eggert <eggert@cs.ucla.edu>
12760
12761 * NEWS: Bison-generated C parsers no longer quote literal strings
12762 associated with tokens.
12763 * src/output.c (prepare_symbols): Don't escape strings,
12764 since users don't want to see C escapes.
12765 * tests/calc.at (AT_CHECK_CALC): Adjust to lack of quotes
12766 in diagnostics.
12767 * tests/input.at (Torturing the Scanner): Likewise.
12768 * tests/regression.at (Token definitions, Web2c Actions): Likewise.
12769
12770 2005-04-16 Paul Eggert <eggert@cs.ucla.edu>
12771
12772 * tests/torture.at (AT_INCREASE_DATA_SIZE): Skip the test if
12773 the data size is known to be too small and we can't increase it.
12774 This works around an HP-UX 11.00 glitch reported by Andrew Benham.
12775
12776 2005-04-15 Paul Eggert <eggert@cs.ucla.edu>
12777
12778 * src/parse-gram.y: Include quotearg.h.
12779 (string_as_id): Quote $1 before using it as a key, since the
12780 lexer no longer quotes it for us.
12781 (string_content): Don't strip quotes, since lexer no longer
12782 quotes it for us.
12783 * src/scan-gram.l: Include quotearg.h.
12784 ("\""): Omit quote.
12785 ("'"<SC_ESCAPED_CHARACTER>): Quote symbol before using it as
12786 a key, since the rest of the lexer doesn't quote it.
12787 * src/symtab.c (symbol_get): Don't quote symbol; caller does it now.
12788 * tests/regression.at (Token definitions): Check for backslashes
12789 in token strings.
12790
12791 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): New macro.
12792 (YYSIZE_T): Define to unsigned long int when using an older compiler.
12793 (yyparse): Revamp code to generate long syntax error message, to
12794 make it easier to translate, and to avoid problems with arithmetic
12795 overflow. Change "virtual memory" to "memory" in diagnostic, since
12796 we don't know whether the memory is virtual.
12797
12798 2005-04-13 Paul Eggert <eggert@cs.ucla.edu>
12799
12800 * NEWS: Bison-generated C parsers now use the _ macro to
12801 translate strings.
12802 * data/yacc.c (_) [!defined _]: New macro.
12803 All English strings wrapped inside this macro.
12804 * doc/bison.texinfo (Bison Parser): Document _.
12805 * po/POTFILES.in: Include src/parse-gram.c, since it now
12806 includes translateable strings that parse-gram.y doesn't.
12807
12808 2005-04-12 Paul Eggert <eggert@cs.ucla.edu>
12809
12810 * src/symtab.c (symbol_make_alias): Call symbol_type_set,
12811 reverting the 2004-10-11 change to this function.
12812 (symbol_check_alias_consistency): Don't call symbol_type_set
12813 if the type name is already correct.
12814 * tests/input.at (Typed symbol aliases): New test, from Tim Van Holder.
12815
12816 2005-03-25 Paul Eggert <eggert@cs.ucla.edu>
12817
12818 * tests/regression.at (Token definitions): Don't use a token named
12819 c, as that generates a "#define c ..." that runs afoul of buggy
12820 stdlib.h that uses the identifier c as a member of struct
12821 drand48_data. Problem reported by Horst Wente.
12822
12823 2005-03-21 Paul Eggert <eggert@cs.ucla.edu>
12824
12825 * bootstrap: Change translation URL from
12826 http://www2.iro.umontreal.ca/~gnutra/po/maint/bison/ to
12827 http://www.iro.umontreal.ca/translation/maint/bison/ to avoid
12828 redirection glitches. Problem reported by twlevo@xs4all.nl.
12829
12830 2005-03-20 Paul Eggert <eggert@cs.ucla.edu>
12831
12832 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Don't put options
12833 after operands; POSIX says this isn't portable for the c99 command.
12834
12835 2005-03-18 Paul Eggert <eggert@cs.ucla.edu>
12836
12837 * tests/glr-regression.at (glr-regr2a.y): Try to dump core
12838 immediately if a data overrun has occurred; this may help us track
12839 down what may be a spurious failure on MacOS.
12840
12841 2005-03-17 Paul Eggert <eggert@cs.ucla.edu>
12842
12843 Respond to problems reported by twlevo@xs4all.nl.
12844
12845 * bootstrap: Use "trap - 0" rather than the unportable "trap 0".
12846
12847 * src/vcg.h: Comment fix.
12848 * src/vcg_defaults.h: Parenthesize macro bodies to make them safe.
12849 (G_CMAX): Change to -1 instead of INT_MAX.
12850
12851 * data/yacc.c (yyparse): Omit spaces before #line.
12852
12853 2005-03-15 Paul Eggert <eggert@cs.ucla.edu>
12854
12855 * src/tables.c (state_number_to_vector_number): Put it inside an
12856 "#if 0", since it's not currently used. Problem reported by
12857 Roland McGrath.
12858
12859 2005-03-06 Paul Eggert <eggert@cs.ucla.edu>
12860
12861 * src/output.c (escaped_output): Renamed from
12862 escaped_file_name_output, since we now use it for symbol tags as
12863 well. All uses changed.
12864 (symbol_destructors_output, symbol_printers_output):
12865 Escape symbol tags too.
12866 Problem reported by Matyas Forstner in
12867 <http://lists.gnu.org/archive/html/bug-bison/2005-03/msg00009.html>.
12868
12869 * src/muscle_tab.c (muscle_code_grow): Don't quote numbers; it's
12870 not needed.
12871 * src/output.c (user_actions_output, token_definitions_output,
12872 symbol_destructors_output, symbol_printers_output): Likewise.
12873 * src/reader.c (prologue_augment): Likewise.
12874 * src/scan-gram.l (handle_action_dollar, handle_action_at): Likewise.
12875
12876 * src/vcg.c (output_edge): Don't quote linestyle arg.
12877 Problem reported by twlevo@xs4all.nl.
12878
12879 2005-02-28 Paul Eggert <eggert@cs.ucla.edu>
12880
12881 * doc/bison.texinfo (Semantic Tokens): Fix scoping problem in
12882 example, reported by Derek M Jones. Also, make the example even
12883 more outrageous, to better illustrate how bad the problem is.
12884
12885 2005-02-24 Paul Eggert <eggert@cs.ucla.edu>
12886
12887 * doc/bison.texinfo (Mfcalc Symtab): Correct the prototype for
12888 putsym. Typo reported by Sebastian Piping.
12889
12890 2005-02-23 Paul Eggert <eggert@cs.ucla.edu>
12891
12892 * doc/bison.texinfo (Language and Grammar): some -> same
12893 (Epilogue): int he -> in the
12894 Typos reported by Sebastian Piping via Justin Pence.
12895
12896 2005-02-07 Paul Eggert <eggert@cs.ucla.edu>
12897
12898 * tests/glr-regression.at (Improper handling of embedded actions
12899 and dollar(-N) in GLR parsers): Renamed from "Improper handling of
12900 embedded actions and $-N in GLR parsers", work around an Autoconf bug
12901 with dollar signs in test names.
12902 * tests/input.at (Invalid dollar-n): Renamed from "Invalid \$n",
12903 for a similar reason.
12904
12905 2005-01-28 Paul Eggert <eggert@cs.ucla.edu>
12906
12907 * src/vcg.c (output_graph): G_VIEW -> normal_view in case someone
12908 wants to redefine G_VIEW.
12909
12910 2005-01-27 Paul Eggert <eggert@cs.ucla.edu>
12911
12912 * src/vcg.c (get_view_str): Remove case for normal_view.
12913 Problem reported by twlevo@xs4all.nl.
12914
12915 2005-01-24 Paul Eggert <eggert@cs.ucla.edu>
12916
12917 * configure.ac (O0CFLAGS, O0CXXFLAGS): Fix quoting bug.
12918 Problem reported by twlevo@xs4all.nl.
12919
12920 * doc/bison.texinfo: Change @dircategory from "GNU programming
12921 tools" to "Software development". Requested by Richard Stallman
12922 via Karl Berry.
12923
12924 2005-01-23 Paul Eggert <eggert@cs.ucla.edu>
12925
12926 * tests/c++.at (AT_CHECK_DOXYGEN): Don't use options after operands.
12927 Problem reported by twlevo@xs4all.nl.
12928
12929 2005-01-21 Paul Eggert <eggert@cs.ucla.edu>
12930
12931 * data/yacc.c (YYCOPY, yystpcpy, yyparse): Remove "register"
12932 keyword; it's not needed with modern compilers, and it doesn't
12933 affect correctness with older compilers. Suggested by
12934 twlevo@xs4all.nl.
12935
12936 2005-01-17 Paul Eggert <eggert@cs.ucla.edu>
12937
12938 * data/glr.c (yyuserAction): Add "default: break;" case to pacify
12939 gcc -Wswitch-default.
12940 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
12941 * data/yacc.c (yyparse): Likewise.
12942
12943 2005-01-12 Paul Eggert <eggert@cs.ucla.edu>
12944
12945 * src/system.h (OUTPUT_EXT, TAB_EXT): Define only if not defined
12946 already. Let config.h define any nonstandard values.
12947
12948 2005-01-10 Paul Eggert <eggert@cs.ucla.edu>
12949
12950 * tests/calc.at (_AT_DATA_CALC_Y): Use alarm (100), not alarm (10),
12951 for the benefit of slower hosts. Problem reported by
12952 Nelson H. F. Beebe.
12953
12954 2005-01-07 Paul Eggert <eggert@cs.ucla.edu>
12955
12956 * data/yacc.c (yyparse): Pacify non-GCC compilers about yyerrorlab
12957 being defined and not used.
12958 * data/lalr1.cc (yyparse): Likewise.
12959 Use "if (false)" rather than "if (0)".
12960
12961 2005-01-05 Paul Eggert <eggert@cs.ucla.edu>
12962
12963 * TODO: Mention that we should allow NUL bytes in tokens.
12964
12965 2005-01-02 Paul Eggert <eggert@cs.ucla.edu>
12966
12967 * src/scan-skel.l (<<EOF>>): Don't close standard output.
12968 Problem reported by Hans Aberg.
12969
12970 2005-01-01 Paul Eggert <eggert@cs.ucla.edu>
12971
12972 * src/getargs.c (version): Happy new year; update overall
12973 program copyright date from 2004 to 2005.
12974
12975 * src/scan-skel.l ("@output ".*\n): Don't close standard output.
12976 Problem reported by Hans Aberg.
12977 * tests/output.at (AT_CHECK_OUTPUT): New arg SHELLIO.
12978 (Output file names.): Add a test for the case when standard output
12979 is closed.
12980
12981 2004-12-26 Paul Eggert <eggert@cs.ucla.edu>
12982
12983 * doc/bison.texinfo (@copying): Update FDL version number to 1.2,
12984 to fix an oversight in the Bison 2.0 manual.
12985
12986 2004-12-25 Paul Eggert <eggert@cs.ucla.edu>
12987
12988 * NEWS: Version 2.0. Reformat the existing news items since
12989 1.875, so that related items are grouped together.
12990 * configure.ac (AC_INIT): Bump version to 2.0.
12991 * src/parse-gram.c, src/parse-gram.h: Regenerate with 2.0.
12992
12993 * tests/torture.at (Exploding the Stack Size with Alloca): Set
12994 YYSTACK_USE_ALLOCA to 1 if __GNUC__ or alloca are defined;
12995 otherwise, we're not testing alloca. Unfortunately there's no
12996 simple way to consult HAVE_ALLOCA here.
12997
12998 * data/lalr1.cc (yydestruct_): Pacify unused variable warning
12999 for yymsg, too.
13000
13001 * src/LR0.c (new_itemsets): Use memset rather than zeroing by
13002 hand. This avoids a warning about comparing int to size_t when
13003 GCC warnings are enabled.
13004
13005 2004-12-22 Paul Eggert <eggert@cs.ucla.edu>
13006
13007 * NEWS: Bison-generated parsers no longer default to using the
13008 alloca function (when available) to extend the parser stack, due
13009 to widespread problems in unchecked stack-overflow detection.
13010 * data/glr.c (YYMAXDEPTH): Remove undef when zero. It's the user's
13011 responsibility to set it to a positive value. This lets the user
13012 specify a value that is not a preprocessor constant.
13013 * data/yacc.c (YYMAXDEPTH): Likewise.
13014 (YYSTACK_ALLOC): Define only if YYSTACK_USE_ALLOCA is nonzero.
13015 * doc/bison.texinfo (Stack Overflow): YYMAXDEPTH no longer needs
13016 to be a compile-time constant. However, explain the constraints on it.
13017 Also, explain the constraints on YYINITDEPTH.
13018 (Table of Symbols): Explain that alloca is no longer the default.
13019 Explain the user's responsibility if they define YYSTACK_USE_ALLOCA
13020 to 1.
13021
13022 * doc/bison.texinfo (Location Default Action): Mention that n must
13023 be zero when k is zero. Suggested by Frank Heckenbach.
13024
13025 2004-12-22 Akim Demaille <akim@epita.fr>
13026
13027 * data/lalr1.cc (parser::token_number_type, parser::rhs_number_type)
13028 (parser::state_type, parser::semantic_type, parser::location_type):
13029 Private, not public.
13030 (parser::parse): Return ints, not bool.
13031 Returning a bool introduces a problem: 0 corresponds to false, and
13032 it seems weird to return false on success. Returning true changes
13033 the conventions for yyparse.
13034 Alternatively we could return void and send an exception.
13035 There is no clear consensus (yet?).
13036 (state_stack, semantic_stack, location_stack): Rename as...
13037 (state_stack_type, semantic_stack_type, location_stack_type): these.
13038 Private, not public.
13039 * tests/c++.at: New.
13040 * tests/testsuite.at, tests/Makefile.am: Adjust.
13041
13042 2004-12-21 Akim Demaille <akim@epita.fr>
13043
13044 * data/lalr1.cc (parser::parse): Return a bool instead of an int.
13045
13046 2004-12-21 Akim Demaille <akim@epita.fr>
13047
13048 Don't impose std::string for filenames.
13049
13050 * data/lalr1.cc (b4_filename_type): New.
13051 (position::filename): Use it.
13052 (parser.hh): Move the inclusion of stack.hh and location.hh below
13053 the user code, so that needed headers for the filename type can be
13054 included first.
13055 Forward declare them before the user code.
13056 * tests/Makefile.am (check-local, installcheck-local): Pass
13057 TESTSUITEFLAGS to the TESTSUITE.
13058
13059 2004-12-20 Akim Demaille <akim@epita.fr>
13060
13061 Use more STL like names: my_class instead of MyClass.
13062
13063 * data/lalr1.cc (LocationStack, LocationType, RhsNumberType)
13064 (SemanticStack, SemanticType, StateStack, StateType)
13065 (TokenNumberType, Stack, Slice, Traits, Parser::location)
13066 (Parser::value): Rename as...
13067 (location_stack, location_type, rhs_number_type, semantic_stack)
13068 (semantic_type, state_stack, state_type, token_number_type, stack)
13069 (slice, traits, parser::yylloc, parser::yylval): these.
13070
13071 * tests/calc.at, tests/regression.at, tests/actions.at: Adjust.
13072
13073 2004-12-19 Paul Eggert <eggert@cs.ucla.edu>
13074
13075 * data/glr.c (YYLLOC_DEFAULT): Use GNU spacing conventions.
13076 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
13077
13078 2004-12-17 Paul Eggert <eggert@cs.ucla.edu>
13079
13080 Remove uses of 'short int' and 'unsigned short int'. This raises
13081 some arbitrary limits. It uses more memory but nowadays that's
13082 not much of an issue.
13083
13084 This change does not affect the generated parsers; that's a different
13085 task, as some users will want to conserve memory there.
13086
13087 Ideally we should use size_t to represent all object counts, and
13088 something like ptrdiff_t to represent signed differences of object
13089 counts; but that will require more code-cleanup than I have the
13090 time to do right now.
13091
13092 * src/LR0.c (allocate_itemsets, new_itemsets, save_reductions):
13093 Use size_t, not int or short int, to count objects.
13094 * src/closure.c (nritemset, closure): Likewise.
13095 * src/closure.h (nritemset, closure): Likewise.
13096 * src/nullable.c (nullable_compute): Likewise.
13097 * src/print.c (print_core): Likewise.
13098 * src/print_graph.c (print_core): Likewise.
13099 * src/state.c (state_compare, state_hash): Likewise.
13100 * src/state.h (struct state): Likewise.
13101 * src/tables.c (default_goto, goto_actions): Likewise.
13102
13103 * src/gram.h (rule_number, rule): Use int, not short int.
13104 * src/output.c (prepare_rules): Likewise.
13105 * src/state.h (state_number, STATE_NUMBER_MAXIMUM, transitions,
13106 errs, reductions): Likewise.
13107 * src/symtab.h (symbol_number, SYMBOL_NUMBER_MAXIMUM, struct symbol):
13108 Likewise.
13109 * src/tables.c (vector_number, tally, action_number,
13110 ACTION_NUMBER_MINIMUM): Likewise.
13111 * src/output.c (muscle_insert_short_int_table): Remove.
13112
13113 2004-12-17 Akim Demaille <akim@epita.fr>
13114
13115 * data/lalr1.cc: Extensive Doxygenation.
13116 (error_): Rename as...
13117 (error): this, since it is visible to the user.
13118 Adjust callers.
13119 (Parser::message): Now an automatic variable from...
13120 (Parser::yyreport_syntax_error_): here.
13121 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust to
13122 Parser::error.
13123 * tests/input.at: Escape $.
13124
13125 2004-12-16 Paul Eggert <eggert@cs.ucla.edu>
13126
13127 * data/glr.c (b4_lhs_value, b4_rhs_value, b4_rhs-location):
13128 Parenthesize rhs to avoid obscure problems with mistakes like
13129 "foo$$bar = foo$1bar;". Problem reported by twlevo at xs4all.
13130 * data/lalr1.cc (b4_lhs_value, b4_rhs_value, b4_lhs_location,
13131 b4_rhs_location): Likewise.
13132 * data/yacc.c (b4_lhs_value, b4_rhs_value, b4_lhs_location,
13133 b4_rhs_location): Likewise.
13134
13135 2004-12-16 Akim Demaille <akim@epita.fr>
13136
13137 * data/lalr1.cc (yyreport_syntax_error_): Catch up with glr.c and
13138 yacc.c: be sure to stay within yycheck_.
13139 * tests/actions.at: Re-enable C++ tests.
13140
13141 2004-12-16 Akim Demaille <akim@epita.fr>
13142
13143 * src/print_graph.c (print_graph): Remove layoutalgorithm uses for
13144 real.
13145
13146 2004-12-16 Akim Demaille <akim@epita.fr>
13147
13148 Use #define to handle the %name-prefix.
13149
13150 * data/glr.c, data/yacc.c: Comment changes.
13151 * data/lalr1.cc (yylex): Use #define to select the name of yylex,
13152 so that one can refer to yylex in the parser file, and have it
13153 renamed, as is the case with other skeletons.
13154
13155 2004-12-16 Akim Demaille <akim@epita.fr>
13156
13157 Move lalr1.cc internals into yy*.
13158
13159 * data/lalr1.cc (semantic_stack_, location_stack_, state_stack_)
13160 (semantic_stack_, location_stack_, pact_, pact_ninf_, defact_)
13161 (pgoto_, defgoto_, table_, table_ninf_, check_, stos_, r1_, r2_)
13162 (name_, rhs_, prhs_, rline_, token_number_, eof_, last_, nnts_)
13163 (empty_, final_, terror_, errcode_, ntokens_)
13164 (user_token_number_max_, undef_token_, n_, len_, state_, nerrs_)
13165 (looka_, ilooka_, error_range_, nerrs_):
13166 Rename as...
13167 (yysemantic_stack_, yylocation_stack_, yystate_stack_)
13168 (yysemantic_stack_, yylocation_stack_, yypact_, yypact_ninf_)
13169 (yydefact_, yypgoto_, yydefgoto_, yytable_, yytable_ninf_)
13170 (yycheck_, yystos_, yyr1_, yyr2_, yyname_, yyrhs_, yyprhs_)
13171 (yyrline_, yytoken_number_, yyeof_, yylast_, yynnts_, yyempty_)
13172 (yyfinal_, yyterror_, yyerrcode_, yyntokens_)
13173 (yyuser_token_number_max_, yyundef_token_, yyn_, yylen_, yystate_)
13174 (yynerrs_, yylooka_, yyilooka_, yyerror_range_, yynerrs_):
13175 these.
13176
13177 2004-12-15 Paul Eggert <eggert@cs.ucla.edu>
13178
13179 Fix some problems reported by twlevo at xs4all.
13180 * src/symtab.c (symbol_new): Report an error if the input grammar
13181 contains too many symbols. This is better than calling abort() later.
13182 * src/vcg.h (enum layoutalgorithm): Remove. All uses removed.
13183 (struct node, struct graph):
13184 Rename member expand to stretch. All uses changed.
13185 (struct graph): Remove member layoutalgorithm. All uses removed.
13186 * src/vcg.c (get_layoutalgorithm_str): Remove. All uses removed.
13187 * src/vcg_defaults.h (G_STRETCH): Renamed from G_EXPAND.
13188 All uses changed.
13189 (N_STRETCH): Rename from N_EXPAND. All uses changed.
13190
13191 2004-12-15 Akim Demaille <akim@epita.fr>
13192
13193 * data/lalr1.cc: Normalize /** \brief ... */ to ///.
13194 Add more Doxygen comments.
13195 (symprint_, stack_print_, reduce_print_, destruct_, pop)
13196 (report_syntax_error_, translate_): Rename as...
13197 (yysymprint_, yystack_print_, yyreduce_print_, yydestruct_)
13198 (yypop_, yyreport_syntax_error_, yytranslate_): this.
13199
13200 2004-12-15 Akim Demaille <akim@epita.fr>
13201
13202 * data/lalr1.cc (lex_): Rename as...
13203 (yylex_): this.
13204 Move the trace here.
13205 Take the %name-prefix into account.
13206 Reported by Alexandre Duret-Lutz.
13207
13208 2004-12-15 Akim Demaille <akim@epita.fr>
13209
13210 Simplify the C++ parser constructor.
13211
13212 * data/lalr1.cc (debug_): Rename as...
13213 (yydebug_): so that the parser's internals are always in the yy*
13214 pseudo namespace.
13215 Adjust uses.
13216 (b4_parse_param_decl): Remove the leading comma as it is now only
13217 called as unique argument list.
13218 (Parser::Parser): Remove the constructor accepting a location and
13219 an initial debugging level.
13220 Remove from the other ctor the argument for the debugging level.
13221 (debug_level_type, debug_level, set_debug_level): New.
13222
13223 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust
13224 constructor calls.
13225
13226 2004-12-15 Akim Demaille <akim@epita.fr>
13227
13228 Remove b4_root related material: failure experiment
13229 (which goal was to allow to derive from a class).
13230
13231 * data/lalr1.cc (b4_root, b4_param, b4_constructor): Remove
13232 definitions and uses.
13233
13234 2004-12-14 Paul Eggert <eggert@cs.ucla.edu>
13235
13236 * data/glr.c (struct yyGLRStack): yyerror_range now has 3 items,
13237 not 2, since it's not portable to subtract 1 from the start of an
13238 array. The new item 0 is never set or used. All uses changed.
13239
13240 (yyrecoverSyntaxError): Use YYLLOC_DEFAULT instead of assuming
13241 the default definition of YYLLOC_DEFAULT. Problem reported
13242 by Frank Heckenbach.
13243
13244 2004-12-12 Paul Eggert <eggert@cs.ucla.edu>
13245
13246 * data/glr.c (YYRHSLOC): Don't have two definitions, one for
13247 the normal case and one for the error case. Just use the
13248 first one uniformly. Problem reported by Frank Heckenbach.
13249 (YYLLOC_DEFAULT): Use the conventions of yacc.c, so we can
13250 use exactly the same macro in both places.
13251 (yyerror_range): Now of type yyGLRStackItem, not YYLTYPE,
13252 so that the normal-case YYRHSLOC works for the error case too.
13253 All uses changed.
13254 * data/yacc.c (YYRHSLOC): New macro, taken from glr.c.
13255 (YYLLOC_DEFAULT): Use the same macro as glr.c.
13256 * doc/bison.texinfo (Location Default Action): Don't claim that
13257 we have an array of locations. Use the same macro for both glr
13258 and lalr parsers. Mention YYRHSLOC. Mention what happens when
13259 the index is 0.
13260
13261 2004-12-10 Paul Eggert <eggert@cs.ucla.edu>
13262
13263 * HACKING: Update email addresses to send announcements to.
13264
13265 * configure.ac (AC_INIT): Bump version to 1.875f.
13266
13267 2004-12-10 Paul Eggert <eggert@cs.ucla.edu>
13268
13269 * NEWS: Version 1.875e.
13270 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875e.
13271
13272 * src/scan-skel.l: Include "complain.h", for "fatal".
13273
13274 * src/relation.h (relation_print, relation_digraph):
13275 Relation sizes are of type relation_node, not size_t (this is
13276 merely a doc fix, since the two types are equivalent).
13277 (relation_transpose): Relation sizes are of type relation_node,
13278 not int.
13279 * src/relation.c: Likewise.
13280 (top, infinity): Now of type relation_node, not int.
13281 (traverse, relation_transpose): Use relation_node, not int.
13282
13283 * data/glr.c (yyuserAction, yyrecoverSyntaxError): Mark args
13284 with ATTRIBUTE_UNUSED if they're not used, to avoid GCC warning.
13285 (yyparse): Remove unused local introduced in 2004-10-25 patch.
13286
13287 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): New arg
13288 specifying whether the test should be skipped. Use it tp
13289 specify that the [%defines %skeleton "lalr1.cc"] tests currently
13290 fail on some hosts, and should be skipped.
13291
13292 2004-12-08 Paul Eggert <eggert@cs.ucla.edu>
13293
13294 * src/system.h (CALLOC, MALLOC, REALLOC): Remove. All callers
13295 changed to use xcalloc, xnmalloc, xnrealloc, respectively,
13296 unless otherwise specified below.
13297
13298 * src/LR0.c (allocate_itemsets): Use xnmalloc, not xcalloc,
13299 to allocate kernel_base, kernel_items, kernel_size, since
13300 they needn't be initialized to 0.
13301 (allocate_storgae): Likewise, for shiftset, redset, shift_symbol.
13302 * src/closure.c (new_closure): Likewise, for itemset.
13303 * src/derives.c (derives_compute): Likewise, for delts, derives, q.
13304 * src/lalr.c (set_goto_map): Likewise, for temp_map.
13305 (initialize_F): Likewise, for reads, edge, reads[i], includes[i].
13306 (build_relations): Likewise for edge, states1, includes.
13307 * src/nullable.c (nullable_compute): Likewise, for squeue, relts.
13308 * src/reader.c (packgram): Likewise, for ritem, rules.
13309 * src/reduce.c (nonterminals_reduce): Likewise for nontermmap.
13310 * src/relation.c (relation_digraph): Likewise for VERTICES.
13311 (relation_transpose): Likewise for new_R, end_R.
13312 * src/symtab.c (symbols_token_translations_init): Likewise for
13313 token_translations.
13314 * src/tables.c (save_row): Likewise for froms, tos, conflict_tos.
13315 (token_actions): Likewise for yydefact, actrow, conflrow,
13316 conflict_list.
13317 (save_column): Likewise for froms[symno], tos[symno].
13318 (goto_actions): Likewise for state_count.
13319 (pack_table): Likewise for base, pos, check.
13320 (tables_generate): Likewise for width.
13321
13322 * src/LR0.c (set_states): Don't reuse kernel_size and kernel_base
13323 for initial core. Just have a separate core, so we needn't worry
13324 about whether kernel_size and kernel_base are initialized.
13325
13326 * src/LR0.c (shift_symbol, redset, shiftset, kernel_base,
13327 kernel_size, kernel_items): Remove unnecessary initialization.
13328 * src/conflicts.c (conflicts): Likewise.
13329 * src/derives.c (derives): Likewise.
13330 * src/muscle_tablc (muscle_insert): Likewise.
13331 * src/relation.c (relation_digraph): Likewise.
13332 * src/tables.c (froms, tos, conflict_tos, tally, width, actrow, order,
13333 conflrow, conflict_table, conflict_list, table, check):
13334 Likewise.
13335
13336 * src/closure.c (new_closure): Arg is of type unsigned int, not int.
13337 This is because all callers pass unsigned int.
13338 * src/closure.h (new_closure): Likewise.
13339
13340 * src/lalr.c (initialize_F): Initialize reads[i] in all cases.
13341 (build_relations): Initialize includes[i] in all cases.
13342 * src/reader.c (packgram): Always initialize rules[ruleno].prec
13343 and rules[ruleno].precsym. Initialize members in order.
13344 * src/relation.c (relation_transpose): Always initialize new_R[i]
13345 and end_R[i].
13346 * src/table.c (conflict_row): Initialize 0 at end of conflict_list.
13347
13348 * src/output.c (prepare_actions): Pass 0 instead of conflict_list[0];
13349 conflict_list[0] was always 0, but now it isn't initialized.
13350
13351 * src/table.c (table_grow): When conflict_table grew, the grown
13352 area wasn't cleared. Fix this.
13353
13354 * lib/.cvsignore: Add strdup.c, strdup.h.
13355 * m4/.cvsignore: Add strdup.m4.
13356
13357 2004-12-07 Paul Eggert <eggert@cs.ucla.edu>
13358
13359 * src/lalr.h (GOTO_NUMBER_MAXIMUM): New macro.
13360 * src/lalr.c (set_goto_map): Don't allow ngotos to equal
13361 GOTO_NUMBER_MAXIMUM, since we occasionally compute
13362 ngotos + 1 without checking for overflow.
13363 (build_relations): Use END_NODE, not -1, to denote end of edges.
13364 * src/lalr.c (set_goto_map, map_goto, initialize_F, add_loopback_edge,
13365 build_relations): Use goto_number, not int, for goto numbers.
13366 * src/tables.c (save_column, default_goto): Likewise.
13367
13368 2004-11-23 Akim Demaille <akim@epita.fr>
13369
13370 * data/lalr1.cc (YYSTYPE): Define it as is done for C, instead
13371 of #defining from yystype.
13372 Don't typedef yystype, C++ does not need it.
13373 This lets it possible to forward declare it as union.
13374
13375 2004-11-23 Paul Eggert <eggert@cs.ucla.edu>
13376
13377 * bootstrap (gnulib_modules): Add extensions.
13378 Problem reported by Jim Meyering.
13379
13380 2004-11-22 Paul Eggert <eggert@cs.ucla.edu>
13381
13382 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c,
13383 src/lalr.c, src/nullable.c, src/relation.c, src/scan-skel.l,
13384 src/system.h, src/tables.c: XFREE -> free, to accommodate
13385 recent change to gnulib xalloc.h.
13386 Problem reported by Jim Meyering.
13387
13388 2004-11-17 Akim Demaille <akim@epita.fr>
13389
13390 * data/lalr1.cc (symprint_): Use cdebug_ to avoid warnings.
13391
13392 2004-11-17 Akim Demaille <akim@epita.fr>,
13393 Alexandre Duret-Lutz <adl@gnu.org>
13394
13395 * data/lalr1.cc (Parser::yycdebug_): New, a pointer, to allow
13396 changes.
13397 (YYCDEBUG): Adjust.
13398 Use it instead of cdebug_.
13399 (Parser::debug_stream, Parser::set_debug_stream): New.
13400 (Parser::symprint_): Define cdebug_ for temporary backward
13401 compatibility.
13402 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use
13403 debug_stream ().
13404
13405 2004-11-17 Akim Demaille <akim@epita.fr>
13406
13407 * data/lalr1.cc (Parser:print_): Remove, use %printer instead.
13408 * tests/regression.at (_AT_DATA_DANCER_Y): Adjust.
13409 * tests/calc.at (_AT_DATA_CALC_Y): Ditto.
13410 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
13411
13412 2004-10-27 Paul Eggert <eggert@cs.ucla.edu>
13413
13414 * data/glr.c (yyloc_default): Remove; not used.
13415 Problem reported by Frank Heckenbach.
13416
13417 2004-10-25 Akim Demaille <akim@epita.fr>
13418
13419 * data/glr.c (YYRHSLOC): Move its definition next to its uses.
13420 Introduce another definition to address simple location arrays.
13421 (yyGLRStack): New member: yyerror_range.
13422 (yyrecoverSyntaxError, yyparse): Update it.
13423 (yyrecoverSyntaxError): Use it when shifting the error token to
13424 have an accurate range, equivalent to the one computed by both
13425 yacc.c and lalr1.cc.
13426 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Change its yylex so
13427 that column numbers start at column 0, as per GNU Coding
13428 Standards, the others tests, and the doc.
13429 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT_WITH_LOC):
13430 Adjust to the above change (first column is 0).
13431 And adjust the location of the "<error>", now covering the whole
13432 line.
13433
13434 2004-10-22 Akim Demaille <akim@epita.fr>
13435 and Paul Eggert <eggert@cs.ucla.edu>
13436
13437 Remove some arbitrary limits on goto numbers and relations.
13438 * src/lalr.c (goto_map, ngotos, from_state, to_state): Omit
13439 initial values, since they're never used.
13440 (set_goto_map): ngotos is now unsigned, so test for overflow
13441 by seeing whether it wraps around to zero.
13442 * src/lalr.h (goto_number): Now size_t, not short int.
13443 (GOTO_NUMBER_MAXIMUM): Remove.
13444 * src/relation.c (relation_print, traverse, relation_transpose):
13445 Check for END_NODE rather than looking at sign.
13446 * src/relation.h (END_NODE): New macro.
13447 (relation_node): Now size_t, not short int.
13448
13449 2004-10-22 Paul Eggert <eggert@cs.ucla.edu>
13450
13451 * doc/bison.texinfo (Language and Grammar): In example, "int" is a
13452 keyword, not an identifier. Problem reported by Baron Schwartz in
13453 <http://lists.gnu.org/archive/html/bug-bison/2004-10/msg00017.html>.
13454
13455 2004-10-11 Akim Demaille <akim@epita.fr>
13456
13457 * src/symtab.c (symbol_check_alias_consistency): Also check
13458 type names, destructors, and printers.
13459 Reported by Alexandre Duret-Lutz.
13460 Recode the handling of associativity and precedence in terms
13461 of symbol_precedence_set.
13462 Accept no redeclaration at all, not even equal to the previous
13463 value.
13464 (redeclaration): New.
13465 Use it to factor redeclaration complaints.
13466 (symbol_make_alias): Don't set the type of the alias, let
13467 symbol_check_alias_consistency do it as for other features.
13468 * src/symtab.h (symbol): Add new member prec_location, and
13469 type_location.
13470 * src/symtab.c (symbol_precedence_set, symbol_type_set): Set them.
13471 * tests/input.at (Incompatible Aliases): New.
13472
13473 2004-10-09 Paul Eggert <eggert@cs.ucla.edu>
13474
13475 .cvsignore fixes to accommodate gnulib changes,
13476 and the practice of naming build directories "_build".
13477 * .cvsignore: Add "_*". Sort.
13478 * lib/.cvsignore: Add getopt_.h, xalloc-die.c.
13479 * m4/.cvsignore: Add "*_gl.m4".
13480
13481 2004-10-06 Akim Demaille <akim@epita.fr>
13482
13483 * src/parse-gram.y (add_param): Fix the truncation of trailing
13484 spaces.
13485
13486 2004-10-05 Akim Demaille <akim@epita.fr>
13487
13488 In Bison 1.875's yacc.c, YYLLOC_DEFAULT was called regardless
13489 whether the reducion was empty or not. This leaves room to
13490 improve the use of YYLLOC_DEFAULT in such a case.
13491 lalr1.cc is still experimental, so changing this is acceptable.
13492 And finally, there are probably not many users who changed the
13493 handling of locations in GLR, so changing is admissible too.
13494
13495 * data/glr.c, data/lalr1.cc, data/yacc.c (YYLLOC_DEFAULT): On an
13496 empty reduction, set @$ to an empty location ending the previously
13497 stacked symbol.
13498 Adjust uses to make sure the code is triggered on empty
13499 reductions.
13500 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust the
13501 expected output: empty reductions have empty locations.
13502
13503 2004-09-29 Akim Demaille <akim@epita.fr>
13504
13505 * data/lalr1.cc: Move towards a more standard C++ coding style
13506 for templates: Class < T > -> Class<T>.
13507
13508 2004-09-29 Akim Demaille <akim@epita.fr>
13509
13510 * data/lalr1.cc: Reinstall the former ctor, for sake of
13511 compatibility, but warn it will be removed.
13512 Move towards a more standard C++ coding style (i.e., type *var ->
13513 type* var).
13514
13515 2004-09-27 Paul Eggert <eggert@cs.ucla.edu>
13516
13517 * src/parse-gram.y (add_param): Rewrite to avoid strchr,
13518 since it's less likely to work if NULs are involved in the future.
13519
13520 2004-09-27 Akim Demaille <akim@epita.fr>
13521
13522 * data/yacc.c (YY_LOCATION_PRINT): Fix its default declaration.
13523
13524 2004-09-27 Akim Demaille <akim@epita.fr>
13525
13526 * data/lalr1.cc (b4_parse_param_decl_1): New.
13527 (b4_parse_param_decl): Use it to have different names between attribute
13528 and argument names.
13529 (b4_cc_constructor_call): Likewise.
13530
13531 2004-09-24 Akim Demaille <akim@epita.fr>
13532
13533 * src/parse-gram.y (add_param): Strip the leading and trailing
13534 blanks from a formal argument declaration.
13535 (YY_LOCATION_PRINT): New.
13536
13537 2004-09-24 Akim Demaille <akim@epita.fr>
13538
13539 * data/c.m4 (b4_yysymprint_generate): Move the YYINPUT invocation
13540 after the location.
13541
13542 2004-09-24 Akim Demaille <akim@epita.fr>
13543
13544 * doc/bison.texinfo (Table of Symbols): Sort.
13545
13546 2004-09-21 Akim Demaille <akim@epita.fr>
13547
13548 * data/yacc.c, data/glr.c (b4_at_dollar, b4_dollar_dollar): Remove
13549 the useless parentheses.
13550 Suggested by Paul Eggert.
13551
13552 2004-09-20 Akim Demaille <akim@epita.fr>
13553
13554 Let the initial-action act on the look-ahead, and use it for the
13555 "initial push" (corresponding to an hypothetical beginning-of-file).
13556 And let lalr1.cc honor %initial-action.
13557
13558 * doc/bison.texinfo (Initial Action Decl): Clarify, and add an
13559 example.
13560 * data/lalr1.cc (Parser::initlocation_): Remove, bad experiment.
13561 (Parser::Parser): Remove the ctor that used to initialize it.
13562 (Parser::parse): Like in the other skeletons, issue the "starting
13563 parse" message before any action.
13564 Honor %initial-action.
13565 Initialize the stacks with the lookahead.
13566 * data/yacc.c: Let $$ and @$ in %initial-action designate the
13567 look-ahead.
13568 Push them in the stacks.
13569 * tests/actions.at, tests/calc.at: Adjust the C++ ctor invocations.
13570
13571 2004-09-20 Akim Demaille <akim@epita.fr>
13572
13573 * doc/bison.texinfo (Initial Action Decl): New.
13574
13575 2004-09-20 Akim Demaille <akim@epita.fr>
13576
13577 * data/yacc.c (YY_LOCATION_PRINT): Use YYLTYPE_IS_TRIVIAL as a
13578 clearer criterion to define it.
13579 (parse): Initialize the initial location when YYLTYPE_IS_TRIVIAL.
13580 When reducing on an empty RHS, use the latest stacked location as
13581 location.
13582 yylloc is not always available.
13583 * data/glr.c: Likewise.
13584 Also, honor initial-actions.
13585
13586 2004-09-20 Akim Demaille <akim@epita.fr>
13587
13588 * data/yacc.c (YY_LOCATION_PRINT): New.
13589 Define when we know YYLTYPE's structure, i.e., when the default
13590 YYLLOC_DEFAULT is used.
13591 * data/c.m4 (b4_yysymprint_generate): Use it.
13592 * data/lalr1.cc (YYLLOC_DEFAULT): Stop relying on the initial
13593 value of the result.
13594 (error_start_): Replace with...
13595 (error_range_): this location array.
13596 This allows to replace code relying on the implementation of
13597 locations by portable code.
13598 * data/yacc.c (yylerrsp): Replace with...
13599 (yyerror_range): this.
13600 Every time a token is popped, update yyerror_range[0], to have an
13601 accurate location for the error token.
13602 * data/glr.c (YY_LOCATION_PRINT): New.
13603 (yyprocessOneStack): Fix an invocation of YY_SYMBOL_PRINT:
13604 deference a pointer.
13605 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): No longer
13606 report the location in %printers.
13607
13608 * src/scan-skel.l: Instead of abort, report error messages to ease
13609 understanding skeleton scanning failures.
13610
13611 2004-09-16 Akim Demaille <akim@epita.fr>
13612
13613 * data/lalr1.cc (Stack::Iterator, Stack::ConstIterator): Rename as...
13614 (iterator, const_iterator): these, to be more in the C++ spirit.
13615 Also, return reverse iterators so that when displaying the stack
13616 we display its bottom first.
13617 (Parser::stack_print_, Parser::reduce_print_): Match the messages
13618 from yacc.c.
13619 We should probably use vector here though.
13620
13621 2004-09-16 Akim Demaille <akim@epita.fr>
13622
13623 Have more complete shift traces.
13624
13625 * data/yacc.c, data/lalr1.c, data/glr.c: Use YY_SYMBOL_PRINT
13626 to report Shifts instead of ad hoc YYDPRINTF invocations,
13627 including for the error token.
13628 * data/lalr1.cc (symprint_): Output the location.
13629 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): In C++, don't
13630 output the location within the %printer.
13631 Activate GLR tests, at least to make sure they compile properly.
13632 They still don't pass though.
13633 * tests/calc.at: Adjust expect verbose output, since now "Entering
13634 state..." is on a different line than the "Shifting" message.
13635
13636 2004-09-08 Akim Demaille <akim@epita.fr>
13637
13638 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Move the
13639 Bison directive from the Bison file to the invocation of this
13640 macro, so that these directives are passed to
13641 AT_BISON_OPTION_PUSHDEFS to get correct help macros.
13642 Use these helping macros (e.g., AT_LOC, AT_VAL and so forth).
13643 Move the AT_SETUP/AT_CLEANUP outside, to report as test title
13644 the extra Bison directives instead of the whole series.
13645 Change the grammar so that there are recoverable errors, and
13646 unrecoverable errors. Now we can have the parser give up before
13647 consuming the whole input. As a result we now can observe that
13648 the lookahead is freed when needed.
13649 Change the parser source to parse argv[1] instead of a hard coded
13650 string.
13651 Simplify yylex, and give a value and location to EOF.
13652 Simplify some invocations of AT_CHECK_PRINTER_AND_DESTRUCTOR that
13653 passed directives already coded in the file.
13654 Add some tests to check the location of "error".
13655 For some tests, the C++ parser is correct, and not yacc.c.
13656 For other tests, they provide different, but unsatisfying, values,
13657 so keep the C++ value so that at least one parser is "correct"
13658 according to the test suite.
13659 (Actions after errors): Remove, this is subsumed by the
13660 AT_CHECK_PRINTER_AND_DESTRUCTOR series.
13661
13662 2004-09-06 Akim Demaille <akim@epita.fr>
13663
13664 * data/lalr1.cc: Adjust the indentation of the labels.
13665 (Parser::pop): New.
13666 Use it.
13667
13668 2004-09-06 Akim Demaille <akim@epita.fr>
13669
13670 * data/yacc.cc, data/glr.cc (yydestruct): Accept an additional
13671 argument, an informative message.
13672 Call YY_SYMBOL_PRINT.
13673 Adjust all callers: integrate the associated YY_SYMBOL_PRINT.
13674 * data/lalr1.cc (destruct_): Likewise.
13675 In addition, no longer depend on b4_yysymprint_generate and
13676 b4_yydestruct_generate to generate these functions, do it "by
13677 hand".
13678
13679 2004-09-03 Akim Demaille <akim@epita.fr>
13680
13681 * data/glr.c, data/lalr1.cc, data/yacc.c: When YYABORT was
13682 invoked, yydestruct the lookahead.
13683 * tests/calc.at (Calculator $1): Update the expected lengths of
13684 traces: there is an added line for the discarded lookahead.
13685 * doc/bison.texinfo (Destructor Decl): Some rewording.
13686 Define "discarded" symbols.
13687
13688 2004-09-02 Akim Demaille <akim@epita.fr>
13689
13690 * data/lalr1.cc (translate_, destruct_): No reason to be static.
13691
13692 2004-09-02 Akim Demaille <akim@epita.fr>
13693
13694 * data/glr.c, yacc.c (YYDSYMPRINT): Remove, not used.
13695 (YYDSYMPRINTF): Rename as...
13696 (YY_SYMBOL_PRINT): this.
13697 * data/lalr1.cc (YY_SYMBOL_PRINT): New, modeled after the previous
13698 two.
13699 Use it instead of direct symprint_ calls.
13700 (yybackup): Tweak the "Now at end of input" case to match yacc.c's
13701 one.
13702
13703 2004-09-02 Akim Demaille <akim@epita.fr>
13704
13705 * data/lalr1.cc (b4_yysymprint_generate): New.
13706 (symprint_): New member function, defined when YYDEBUG.
13707 Use it consistently instead of token/nterm debugging output by
13708 hand.
13709 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust
13710 %printer calls to use cdebug_ when using lalr1.cc.
13711
13712 2004-08-30 Florian Krohm <florian@edamail.fishkill.ibm.com>
13713
13714 * data/glr.c: Guard the declarations of yypstack and yypdumpstack
13715 with #ifdef YYDEBUG.
13716
13717 2004-08-26 Akim Demaille <akim@epita.fr>
13718
13719 * doc/bison.texinfo (Implementing Loops): Rename as...
13720 (Implementing Gotos/Loops): this.
13721
13722 2004-08-13 Paul Eggert <eggert@cs.ucla.edu>
13723
13724 Adjust to latest gnulib.
13725 * bootstrap (gnulib_modules): Add xalloc-die.
13726 Set LC_ALL=C so that file names sort consistently.
13727 Prefer the gnulib copies of gettext.m4, glibc21.m4,
13728 inttypes_h.m4, lib-ld.m4, lib-prefix.m4, po.m4, stdint_h.m4,
13729 uintmax_t.m4, ulonglong.m4.
13730 (intl_files_to_remove): Add gettext.m4, lib-ld.m4, lib-prefix.m4,
13731 po.m4 since we are now using _gl.m4 instead.
13732
13733 2004-08-10 Florian Krohm <florian@edamail.fishkill.ibm.com>
13734
13735 * src/scan-action.l: Remove. Scanning of semantic actions is
13736 handled in scan-gram.l.
13737
13738 2004-08-07 Florian Krohm <florian@edamail.fishkill.ibm.com>
13739
13740 * src/scan-gram.l (handle_syncline): Use uniqstr_new not xstrdup.
13741
13742 * src/location.h (struct): The file member is a uniqstr.
13743 (equal_boundaries): Use UNIQSTR_EQ for comparison.
13744
13745 2004-07-22 Paul Eggert <eggert@cs.ucla.edu>
13746
13747 Fix bug with non-%union parsers that have printers or destructors,
13748 which led to a Bison core dump. Reported by Peter Fales in
13749 <http://lists.gnu.org/archive/html/bug-bison/2004-07/msg00014.html>.
13750
13751 * data/c.m4 (b4_symbol_actions): Don't assume %union was used.
13752 * data/lalr1.cc (yystype) [defined YYSTYPE]: Define to YYSTYPE,
13753 not to our own type.
13754 * src/output.c (symbol_destructors_output, symbol_printers_output):
13755 Don't assume %union.
13756 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR,
13757 AT_CHECK_PRINTER_AND_DESTRUCTOR): New argument
13758 UNION-FLAG. All callers changed.
13759 (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't assume %union.
13760 Use type char, not unsigned int, when declaring an array of char;
13761 this lets us remove a cast.
13762 (Printers and Destructors): Add non-%union test cases.
13763
13764 2004-06-21 Paul Eggert <eggert@cs.ucla.edu>
13765
13766 * doc/bison.texinfo: Minor editorial changes, mostly to the new
13767 GLR writeups. E.g., avoid frenchspacing and the future tense,
13768 change "lookahead" to "look-ahead", and change "wrt" to "with
13769 respect to".
13770
13771 2004-06-21 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
13772
13773 * doc/bison.texinfo (Merging GLR Parses, Compiler Requirements):
13774 New sections, split off from the GLR Parsers section. Put the new
13775 Simple GLR Parser near the start of the GLR section, for clarity.
13776 Rewrite connective text.
13777
13778 2004-06-21 Frank Heckenbach <frank@g-n-u.de>
13779
13780 * doc/bison.texinfo (Simple GLR Parsers): New section.
13781
13782 2004-06-21 Paul Eggert <eggert@cs.ucla.edu>
13783
13784 * NEWS, TODO, doc/bison.texinfo:
13785 Use "look-ahead" instead of "lookahead", to be consistent.
13786 * REFERENCES: Fix incorrect reference to DeRemer and Pennello,
13787 while we're fixing "look-ahead".
13788 * src/conflicts.c (shift_set): Renamed from shiftset.
13789 (look_ahead_set): Renamed from lookaheadset.
13790 * src/print.c: Likewise.
13791 * src/getargs.c (report_args): Add "look-ahead" as the new canonical
13792 name for "lookahead".
13793 (report_types, usage): Likewise.
13794 * src/getargs.h (report_look_ahead_tokens): Renamed from
13795 report_lookaheads.
13796 * src/lalr.c (compute_look_ahead_tokens): Renamed from
13797 compute_lookaheads.
13798 (state_look_ahead_tokens_count): Renamed from state_lookaheads_count.
13799 (look_ahead_tokens_print): Renamed from lookaheads_print.
13800 * src/state.c (state_rule_look_ahead_tokens_print): Renamed from
13801 state_rule_lookaheads_print.
13802 * src/state.h: Likewise.
13803 (reductions.look_ahead_tokens): Renamed from lookaheads.
13804 * tests/torture.at (AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR): Renamed from
13805 AT_DATA_LOOKAHEADS_GRAMMAR.
13806
13807 2004-06-03 Paul Eggert <eggert@cs.ucla.edu>
13808
13809 * README: Update location of patched M4 distribution.
13810
13811 2004-05-30 Albert Chin-A-Young <china@thewrittenword.com>
13812
13813 Don't assume the C++ compiler takes the same arguments as the C compiler
13814 (trivial change).
13815 * configure.ac (O0CXXFLAGS): New var.
13816 * tests/atlocal.in (CXXFLAGS): Use it.
13817
13818 2004-05-29 Paul Eggert <eggert@cs.ucla.edu>
13819
13820 Fix some "make check" problems with C++ reported by
13821 Albert Chin-A-Young for Tru64 C++ in this thread:
13822 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00049.html
13823
13824 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check for std::cerr.
13825 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
13826 Output to a .cc file for C++, not to a .c file.
13827 * tests/calc.at (AT_CHECK_CALC): Likewise.
13828 * tests/regression.at (AT_CHECK_DANCER): Likewise.
13829 * tests/local.at (AT_COMPILE_CXX): Default to OUTPUT.cc, not OUTPUT.c.
13830
13831 2004-05-28 Albert Chin-A-Young <china@thewrittenword.com>
13832
13833 * tests/calc.at, tests/actions.at: Workaround for SGI
13834 C++ compiler. (trivial change)
13835
13836 2004-05-27 Paul Eggert <eggert@cs.ucla.edu>
13837
13838 Spent a few hours checking out which prerequisite versions the
13839 current sources actually require. I went all the way back to
13840 Gettext 0.10.40, Automake 1.4, and Autoconf 2.57 and investigated
13841 a seemingly endless set of combinations of versions more recent
13842 than that. The bottom line is that the current sources require
13843 fairly recent versions of the build tools, and it'll be some work
13844 to change this.
13845 * configure.ac (AC_PREREQ): Increase from 2.58 to 2.59.
13846 (AM_INIT_AUTOMAKE): Increase from 1.7 to 1.8.
13847 (AM_GNU_GETTEXT_VERSION): Increase from 0.11.5 to 0.12.
13848 Add comments explaining why those particular versions are
13849 currently needed.
13850
13851 * src/parse-gram.y (lloc_default): Rewrite to avoid compiler bug
13852 in SGI MIPSpro 7.4.1m. Problem reported by Albert Chin-A-Young in
13853 <http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00037.html>.
13854
13855 * configure.ac (AC_PREREQ): Bump to 2.58, since 2.57 doesn't work
13856 (it fails with a Autoconf-without-aclocal-m4 diagnostic).
13857
13858 2004-05-26 Paul Eggert <eggert@cs.ucla.edu>
13859
13860 * configure.ac (AM_GNU_GETTEXT_VERSION): Lower it from 0.14.1 to
13861 0.11.5. Suggested by Bruno Haible.
13862 * bootstrap: Remove gettext version checking.
13863
13864 * doc/bison.texinfo (Decl Summary): Also mention that %union
13865 can depend on prerequisite types. Problem reported by Tim
13866 Van Holder.
13867
13868 2004-05-25 Paul Eggert <eggert@cs.ucla.edu>
13869
13870 * README: Mention GNU m4 1.4 bugs and Akim's patched version.
13871 * README-alpha: Don't tell people not to package this.
13872
13873 * bootstrap: Don't assume $(...) works; use `...` instead.
13874 Problem reported by Paul Hilfinger. Also, diagnose non-GNU
13875 gettext better.
13876
13877 * doc/bison.texinfo (Decl Summary, Bison Options): Clarify what's
13878 put into the -d output file, and mention what to do if YYSTYPE is
13879 defined as a macro.
13880
13881 2004-05-24 Paul Eggert <eggert@cs.ucla.edu>
13882
13883 Undo change made earlier today: it caused autopoint to not bring
13884 in ABOUT-NLS. Ouch. Instead, substitute our own diagnostic for
13885 autopoint's.
13886
13887 * bootstrap: Check that gettext version matches what's in
13888 configure.ac. Warn users to ignore robots.txt ERROR 404.
13889 * bootstrap: Undo today's earlier change (logged below).
13890 * configure.ac (AM_GNU_GETTEXT_VERSION): Likewise.
13891
13892 The gettext version checking is causing more trouble than it's
13893 curing; remove it. Problem reported by Paul Hilfinger.
13894
13895 * bootstrap: Issue a warning that one can expect a message
13896 'AM_GNU_GETTEXT is used, but not AM_GNU_GETTEXT_VERSION'.
13897 * configure.ac (AM_GNU_GETTEXT_VERSION): Remove.
13898
13899 2004-05-23 Paul Eggert <eggert@cs.ucla.edu>
13900
13901 Ensure that the C++ compiler used for testing actually works on a
13902 simple test program; if not, skip the C++-related tests. Problem
13903 reported by Vin Shelton in:
13904 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00026.html
13905
13906 * m4/cxx.m4: New file.
13907 * configure.ac (BISON_TEST_FOR_WORKING_CXX_COMPILER): Add.
13908 * tests/atlocal.in (BISON_CXX_WORKS): Add.
13909 * tests/local.at (AT_COMPILE_CXX): Use it.
13910
13911 2004-05-21 Paul Eggert <eggert@cs.ucla.edu>
13912
13913 * data/glr.c (yylloc): Output this macro even if locations are not
13914 being generated, as the GLR parser needs it even in that case.
13915 Problem reported by Troy A. Johnson
13916 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=195946>.
13917
13918 * configure.ac (AC_INIT): Update to 1.875e.
13919
13920 2004-05-21 Paul Eggert <eggert@cs.ucla.edu>
13921
13922 * NEWS: Version 1.875d.
13923 * configure.ac (AC_INIT): Likewise.
13924 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875d.
13925
13926 * configure.ac (--enable-gcc-warnings): Do not enable -Wshadow,
13927 -Wmissing-prototypes, or -Wstrict-prototypes for C++. The current
13928 lalr1.cc runs afoul of the first, and the last two are no longer
13929 supported by GCC 3.4.0.
13930 * README: Mention GNU m4 1.4 or later; mention m4 patches.
13931 * HACKING: Use ./bootstrap, not "make update" to import foreign files.
13932
13933 2004-05-06 Paul Eggert <eggert@cs.ucla.edu>
13934
13935 * src/muscle_tab.c (hash_muscle): Accept and return size_t, not
13936 unsigned int, for compatibility with latest gnulib hash module.
13937 * src/state.c (state_hash, state_hasher): Likewise.
13938 * src/symtab.c (hash_symbol, hash_symbol_hasher): Likewise.
13939 * src/uniqstr.c (hash_uniqstr): Likewise.
13940
13941 2004-05-03 Paul Eggert <eggert@cs.ucla.edu>
13942
13943 * NEWS: Unescaped newlines are no longer allowed in char & strings.
13944
13945 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER,
13946 SC_CHARACTER,SC_STRING>): Reject unescaped newlines in
13947 character and string literals.
13948 (unexpected_end): New function.
13949 (unexpected_eof): Use it.
13950 (unexpected_newline): New function.
13951 (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>): Coalesce duplicate
13952 actions.
13953
13954 * NEWS: Document %expect-rr.
13955
13956 * bootstrap (--gnulib-srcdir=*, --cvs-user=*):
13957 Fix typo by replacing $1 with $option.
13958 Remove more 'intl'-related files.
13959 Don't DEFUN AM_INTL_SUBDIR twice.
13960
13961 * lib/.cvsignore: Add strndup.h. Remove memchr.c, memcmp.c,
13962 memrchr.c, strcasecmp.c, strchr.c, strrchr.c, strspn.c, strtol.c,
13963 strtoul.c.
13964 * m4/.cvsignore: Add exitfail.m4, extensions.m4, gnulib.m4,
13965 hard-locale.m4, mbstate_t.m4, strerror_r.m4, strndup.m4,
13966 xstrndup.m4. Remove glibc21.m4, intdiv0.m4, inttypes-pri.m4,
13967 inttypes.m4, inttypes_h.m4, isc-posix.m4, lcmessage.m4,
13968 stdint_h.m4, uintmax_t.m4, ulonglong.m4.
13969 * src/.cvsignore: Add *.output.
13970
13971 * src/parse-gram.y: Put copyright notice inside %{ %} so it
13972 gets copied to the output file.
13973
13974 2004-04-28 Paul Eggert <eggert@twinsun.com>
13975
13976 Get files from the gnulib and po repositories, instead of relying
13977 on them being in our CVS. Upgrade to latest versions of gnulib
13978 and Automake.
13979
13980 * Makefile.am (SUBDIRS): Remove m4; Automake now does m4.
13981 * bootstrap: Bootstrap from gnulib and po repositories.
13982 Much of this code was stolen from GNU diff and GNU tar's bootstrap.
13983 * README-cvs: Document these changes. Remove version numbers from
13984 mentions of build tools, since they change so often. Mention Flex.
13985
13986 * configure.ac (AC_CONFIG_MACRO_DIR): Add, with m4 as arg.
13987 (gl_USE_SYSTEM_EXTENSIONS): Add.
13988 (AC_GNU_SOURCE, AC_AIX, AC_MINIX):
13989 Remove; no longer needed, as gl_USE_SYSTEM_EXTENSIONS
13990 does this for us.
13991 (AC_ISC_POSIX): Remove; we no longer support this
13992 ancient OS, as it gets in the way of latest Autoconf & gnulib.
13993 (AC_HEADER_STDC): Remove: we now assume C89 or better.
13994 (AC_CHECK_HEADERS_ONCE): Use instead of AC_CHECK_HEADERS.
13995 Do not check for C89 headers, except for locale.h which is used
13996 by the Yacc library and must port to K&R hosts.
13997 (AC_CHECK_FUNCS_ONCE): Use instead of AC_CHECK_FUNCS.
13998 Do not check for C89 functions, except for setlocale which is
13999 used by the Yacc library.
14000 (AC_CHECK_DECLS, AC_REPLACE_FUNCS): Remove; no longer needed.
14001 (gl_DIRNAME, gl_ERROR, gl_FUNC_ALLOCA, gl_FUNC_MEMCHR,
14002 gl_FUNC_MEMRCHR, gl_FUNC_STPCPY, gl_FUNC_STRNLEN, gl_FUNC_STRTOL,
14003 gl_GETOPT, gl_HASH, gl_MBSWIDTH, gl_OBSTACK, gl_QUOTE,
14004 gl_QUOTEARG, gl_XALLOC, jm_FUNC_GLIBC_UNLOCKED_IO, jm_FUNC_MALLOC,
14005 AM_GNU_GETTEXT): Remove; now done by:
14006 (GNULIB_AUTOCONF_SNIPPET): Add. "bootstrap" builds this for us.
14007 (AC_CONFIG_FILES): Remove m4/Makefile, as Automake now does this
14008 for us.
14009
14010 * lib/Makefile.am: Include gnulib.mk, built for us by "bootstrap".
14011 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES):
14012 Define to empty, as gnulib.mk will do the rest for us.
14013 ($(libbison_a_OBJECTS), stdbool.h): Remove, as gnulib.mk does this
14014 for us.
14015 (libbison_a_SOURCES): Define to $(lib_SOURCES) now.
14016 (lib_SOURCES): New symbol, containing only the non-gnulib libs.
14017
14018 * src/files.c: Include gnulib's xstrndup.h.
14019
14020 * src/system.h (MALLOC): Use xnmalloc, for better overflow checking.
14021 (REALLOC): Use xnrealloc, for likewise.
14022 (xstrndup, stpcpy): Remove decls, as gnulib does this for us now.
14023 (strnlen, memrchr): Remove decls; functions no longer used.
14024 Include <stpcpy.h>.
14025
14026 * config/depcomp, config/install-sh, lib/alloca.c, lib/argmatch.c,
14027 lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
14028 lib/error.c, lib/error.h, lib/getopt.c, lib/getopt.h,
14029 lib/getopt1.c, lib/gettext.h, lib/hash.c, lib/hash.h,
14030 lib/malloc.c, lib/mbswidth.c, lib/mbswidth.h, lib/memchr.c,
14031 lib/memcmp.c, lib/memrchr.c, lib/obstack.c, lib/obstack.h,
14032 lib/quote.c, lib/quote.h, lib/quotearg.c, lib/quotearg.h,
14033 lib/realloc.c, lib/stdbool_.h, lib/stpcpy.c, lib/strcasecmp.c,
14034 lib/strchr.c, lib/strncasecmp.c, lib/strnlen.c, lib/strrchr.c,
14035 lib/strspn.c, lib/strtol.c, lib/strtoul.c, lib/unlocked-io.h,
14036 lib/xalloc.h, lib/xmalloc.c, lib/xstrdup.c, lib/xstrndup.c,
14037 m4/Makefile.am, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
14038 m4/error.m4, m4/getopt.m4, m4/hash.m4, m4/malloc.m4,
14039 m4/mbrtowc.m4, m4/mbswidth.m4, m4/memchr.m4, m4/memcmp.m4,
14040 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/prereq.m4,
14041 m4/quote.m4, m4/quotearg.m4, m4/realloc.m4, m4/stdbool.m4,
14042 m4/stpcpy.m4, m4/strnlen.m4, m4/strtol.m4, m4/strtoul.m4,
14043 m4/unlocked-io.m4, m4/xalloc.m4, po/LINGUAS, po/Makefile.in.in,
14044 po/Makevars, po/da.po, po/de.po, po/es.po, po/et.po, po/fr.po,
14045 po/hr.po, po/id.po, po/it.po, po/ja.po, po/ms.po, po/nl.po,
14046 po/pt_BR.po, po/ro.po, po/ru.po, po/sv.po, po/tr.po:
14047 Remove, as these files are now generated automatically
14048 by bootstrap or automake.
14049
14050 * po/ChangeLog: Remove: all but one entry was a duplicate
14051 of this file, and I moved that 2000-11-02 entry here.
14052
14053 * config/.cvsignore: Add Makefile, depcomp, install-sh.
14054 * lib/.cvsignore: Add alloca.c, alloca.h, alloca_.h, argmatch.c,
14055 argmatch.h, basename.c, dirname.c, dirname.h, error.c, error.h,
14056 exit.h, exitfail.c, exitfail.h, getopt.c, getopt.h, getopt1.c,
14057 getopt_int.h, gettext.h, gnulib.mk, hard-locale.c, hard-locale.h,
14058 hash.c, hash.h, malloc.c, mbswidth.c, mbswidth.h, memchr.c,
14059 memcmp.c, memrchr.c, obstack.c, obstack.h, quote.c, quote.h,
14060 quotearg.c, quotearg.h, realloc.c, stdbool_.h, stpcpy.c, stpcpy.h,
14061 strcasecmp.c, strchr.c, stripslash.c, strncasecmp.c, strndup.c,
14062 strnlen.c, strrchr.c, strspn.c, strtol.c, strtoul.c,
14063 unlocked-io.h, xalloc.h, xmalloc.c, xstrdup.c, xstrndup.c,
14064 xstrndup.h.
14065 * m4/.cvsignore: Remove Makefile, Makefile.in. Add alloca.m4,
14066 dirname.m4, dos.m4, error.m4, getopt.m4, hash.m4, mbrtowc.m4,
14067 mbswidth.m4, obstack.m4, onceonly.m4, quote.m4, quotearg.m4,
14068 stdbool.m4, stpcpy.m4, strnlen.m4, unlocked-io.m4, xalloc.m4.
14069 * po/.cvsignore: Add *.po, LINGUAS, Makefile.in.in, Makevars.
14070 * src/.cvsignore: Remove *_.c.
14071
14072
14073 * Makefile.maint (GZIP_ENV): Don't use --rsyncable if gzip doesn't
14074 support it. (The latest stable gzip doesn't.)
14075
14076 2004-04-27 Paul Eggert <eggert@twinsun.com>
14077
14078 * data/lalr1.cc (Parser::stos_) [! YYDEBUG]: Define even in this
14079 case, as stos_ is now used by destructors due to the 2004-02-09
14080 change.
14081
14082 Remove more K&R C support.
14083 * lib/libiberty.y (PARAMS): Remove. All uses removed.
14084 * lib/subpipe.c (errno): Remove decl.
14085 Include <stdlib.h> unconditionally.
14086 (EXIT_FAILURE): Remove macro.
14087 * src/complain.c (vfprintf, strerror): Remove.
14088 * src/system.h: Include limits.h, stdlib.h, string.h, locale.h
14089 unconditionally.
14090 (EXIT_FAILURE, EXIT_SUCCESS, setlocale): Remove defns.
14091 Use latest Autoconf recommendations for including inttypes.h, stdint.h.
14092 (strchr, strspn, memchr): Remove decls.
14093 * tests/calc.at (_AT_DATA_CALC_Y): Include stdlib.h, string.h
14094 unconditionally. Do not declare perror.
14095 * tests/conflicts.at (%nonassoc and eof): Include stdlib.h
14096 unconditionally.
14097
14098 * src/complain.c (_): Remove useless defn, as system.h defines this.
14099
14100 * lib/bitset.h (__INT_TO_PTR): Remove; workaround no longer needed
14101 with latest obstack.h.
14102 * lib/ebitset.c (ebitset_elt_alloc): Don't bother to cast args
14103 to procedure types, as obstack.h now does that for us.
14104 * lib/lbitset.c (lbitset_elt_alloc): Likewise.
14105
14106 * lib/subpipe.h [HAVE_SYS_TYPES_H]: Include <sys/types.h>,
14107 so that this include file can stand alone.
14108 * lib/subpipe.c: Do not include <sys/types.h>, as subpipe.h
14109 does this now. Include subpipe.h first after config.h, to
14110 test whether it can stand alone.
14111
14112 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't
14113 declare yyerror when using lalr.cc, as GCC 3.4.0 warns about the
14114 unused declaration.
14115
14116 * tests/synclines.at (%union synch line): Put a dummy member in
14117 the union, because empty unions aren't allowed in C. Caught
14118 by GCC 3.4.0.
14119
14120 2004-04-13 Jim Meyering <jim@meyering.net>
14121
14122 * src/conflicts.c (conflicts_print): Correct format string typo:
14123 use `%%' to produce literal `%'. (trivial change)
14124
14125 2004-03-30 Paul Eggert <eggert@twinsun.com>
14126
14127 * src/getargs.c (version): Update copyright year to 2004.
14128
14129 * data/c.m4 (b4_int_type): Use 'short int' rather than
14130 'short', and similarly for 'long', 'unsigned', etc.
14131 * data/glr.c (YYTRANSLATE, yyconfl, yySymbol, yyItemNum,
14132 yygetLRActions, yyprocessOneStack, yyrecoverSyntaxError,
14133 yy_yypstack, yydumpstack): Likewise.
14134 * data/lalr1.cc (user_token_number_max_, user_token_number_max_,
14135 translate_, seq_, [], pop, Slice, range_, operator+, operator+=):
14136 Likewise.
14137 * data/yacc.c (b4_int_type, yyss, YYSTACK_BYTES, yysigned_char,
14138 yy_stack_print, yyparse): Likewise.
14139 * doc/bison.texinfo (Prologue, Multiple Types): Likewise.
14140 * lib/bbitset.h (bitset_word, BITSET_WORD_BITS): Likewise.
14141 * lib/bitset.c (bitset_print): Likewise.
14142 * lib/bitset_stats.c (bitste_log_histogram_print): Likewise.
14143 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
14144 * lib/bitsetv.c (bitsetv_dump): Likewise.
14145 * lib/ebitset.c (EBITSET_ELT_BITS, ebitset_elt_alloc): Likewise.
14146 * lib/lbitset.c (LBITSET_ELT_BITS, lbitset_elt_alloc, debug_lbitset):
14147 Likewise.
14148 * src/LR0.c (allocate_itemsets): Likewise.
14149 * src/gram.h (rule_number, rule): Likewise.
14150 * src/lalr.h (goto_number): Likewise.
14151 * src/nullable.c (nullable_compute): Likewise.
14152 * src/output.c (prepare_rules): Likewise.
14153 * src/relation.c (relation_print, relation_digraph): Likewise.
14154 * src/relation.h (relation_node): Likewise.
14155 * src/state.h (state_number, transitions, errs, reductions,
14156 struct state): Likewise.
14157 * src/symtab.h (symbol_number, struct symbol): Likewise.
14158 * src/tables.c (vector_number, tally, action_number,
14159 default_goto, goto_actions): Likewise.
14160 * tests/existing.at (GNU Cim Grammar): Likewise.
14161 * tests/regression.at (Web2c Actions): Likewise.
14162
14163 * src/output.c (muscle_insert_short_int_table): Renamed from
14164 muscle_insert_short_table. All uses changed.
14165
14166 2004-03-25 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
14167
14168 * src/parse-gram.y: Define PERCENT_EXPECT_RR.
14169 (declaration): Replace expected_conflicts with expected_sr_conflicts.
14170 Add %expect-rr rule.
14171
14172 * src/scan-gram.l: Recognize %expect-rr.
14173
14174 * src/conflicts.h (expected_sr_conflicts): Rename from
14175 expected_conflicts.
14176 (expected_rr_conflicts): Declare.
14177
14178 * src/conflicts.c (expected_sr_conflicts): Rename from
14179 expected_conflicts.
14180 (expected_rr_conflicts): Define.
14181 (conflicts_print): Check r/r conflicts against expected_rr_conflicts
14182 for GLR parsers.
14183 Use expected_sr_conflicts in place of expected_conflicts.
14184 Warn if expected_rr_conflicts used in non-GLR parser.
14185
14186 * doc/bison.texinfo: Add documentation for %expect-rr.
14187
14188 2004-03-08 Paul Eggert <eggert@gnu.org>
14189
14190 Add support for hex token numbers. Suggested by Odd Arild Olsen in
14191 <http://lists.gnu.org/archive/html/bison-patches/2004-03/msg00000.html>.
14192
14193 * NEWS: Document hexadecimal tokens, no NUL bytes, %destructor
14194 in lalr1.cc.
14195 * doc/bison.texinfo (Token Decl): Add hexadecimal token numbers.
14196 * src/scan-gram.l (scan_integer): New function.
14197 ({int}): Use it.
14198 (0[xX][0-9abcdefABCDEF]+): New pattern, to support hex numbers.
14199 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>, \\x[0-9abcdefABCDEF]+,
14200 handle_action_dollar, handle_action_at, convert_ucn_to_byte):
14201 Say "long int", not "long", for uniformity with GNU style.
14202
14203 2004-02-25 Paul Eggert <eggert@twinsun.com>
14204
14205 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Ignore stdout from
14206 compilers. This fixes a problem with Intel's C++ compiler being
14207 chatty, reported by Guido Trentalancia in
14208 <http://lists.gnu.org/archive/html/bug-bison/2004-02/msg00030.html>.
14209
14210 2004-02-09 Alexandre Duret-Lutz <adl@gnu.org>
14211
14212 Support %destructor and merge error locations in lalr1.cc.
14213
14214 * data/lalr1.cc (b4_cxx_destruct_def): New macro.
14215 (Parser::stos_): Define unconditionally.
14216 (Parser::destruct_): New method. Generate its body with
14217 b4_yydestruct_generate.
14218 (Parser::error_start_): New attribute.
14219 (Parser::parse) <yyerrlab, yyerrlab1>: Call destruct_ on erroneous
14220 token which are discarded.
14221 (Parser::parse) <yyerrlab, yyerrorlab, yyerrlab1>: Update
14222 error_start_ when erroneous token are discarded.
14223 (Parser::parse) <yyerrlab1>: Compute the location of the error
14224 token so that it covers all the discarded tokens.
14225 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust so
14226 it can be called with `%skeleton "lalr1.cc"', and do that.
14227
14228 2004-02-02 Paul Eggert <eggert@twinsun.com>
14229
14230 * src/Makefile.am (AM_CPPFLAGS): New macro. It mentions
14231 $(top_srcdir)/lib and ../lib. This fixes a bug reported
14232 by Paul Hilfinger; the old INCLUDES value didn't mention ../lib.
14233 There's no need to mention top_builddir since Automake does that
14234 for us.
14235 (INCLUDES): Remove, as Automake says it's obsolescent.
14236 Contents migrated into AM_CPPFLAGS as described above.
14237 * lib/Makefile.am (INCLUDES): Remove; obsolescent.
14238
14239 2004-01-14 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
14240
14241 * data/glr.c (yytokenName): Bullet-proof against YYEMPTY token.
14242 (yyreportSyntaxError): Handle case where lookahead token is
14243 YYEMPTY.
14244
14245 2004-01-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14246
14247 * data/glr.c: Put casts on uses of YYREALLOC and YYMALLOC so that
14248 resulting parsers are compilable with C++.
14249
14250 2003-12-23 Paul Eggert <eggert@twinsun.com>
14251
14252 * config/depcomp, config/install-sh: Sync with Automake 1.8.
14253 * src/output.c (output_skeleton): Rename local var.
14254 * tests/input.at (Torturing the Scanner): Don't use \x0 or \0 in
14255 Bison tokens, as this runs afoul of the 2003-10-07 change that
14256 disallowed NUL bytes in character constants or string literals.
14257
14258 * tests/local.at: Require Autoconf 2.59's Autotest.
14259 * tests/testsuite.at: Don't include local.at, since we now assume
14260 Autoconf 2.59 or later. Autoconf 2.59 had some problems with
14261 including it.
14262 * tests/Makefile.am ($(TESTSUITE)): Remove warning about ignoring
14263 multiple inclusion warnings.
14264
14265 2003-12-02 Akim Demaille <akim@epita.fr>
14266
14267 * doc/bison.texinfo (How Can I Reset the Parser): More about start
14268 conditions.
14269 From Bruno Haible.
14270
14271 2003-11-18 Alexandre Duret-Lutz <adl@gnu.org>
14272
14273 * doc/bison.texinfo (Bison Options): Escape `@' in `$@'.
14274
14275 2003-10-07 Paul Eggert <eggert@twinsun.com>
14276
14277 * tests/Makefile.am (clean-local): Don't run 'testsuite --clean'
14278 if testsuite doesn't exist.
14279
14280 * doc/bison.texinfo (Symbols): NUL bytes are not allowed in string
14281 literals, unfortunately.
14282 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
14283 Complain about NUL bytes in character constants or string literals.
14284
14285 2003-10-05 Paul Eggert <eggert@twinsun.com>
14286
14287 * NEWS: Don't document %no-default-prec, as it's still
14288 too experimental.
14289 * doc/bison.texinfo: Document %no-default-prec only if
14290 the defaultprec flag is set. Normally it's not.
14291
14292 2003-10-04 Paul Eggert <eggert@twinsun.com>
14293
14294 * data/glr.c (b4_rhs_value, b4_rhs_location): Yield a
14295 non-modifiable lvalue, instead of a modifiable one.
14296 * doc/bison.texinfo (Actions): Document that $$ can
14297 be assigned to. Do not claim that $$ and $N are
14298 array element references: user code should not rely on this.
14299
14300 2003-10-01 Paul Eggert <eggert@twinsun.com>
14301
14302 * src/parse-gram.h (PERCENT_NO_DEFAULT_PREC): New token.
14303 (grammar_declaration): Use it.
14304 * src/scan-gram.l: New token %no-default-prec.
14305 * tests/conflicts.at: Revamp tests to use %no-default-prec.
14306 * NEWS, doc/bison.texinfo: Document the above.
14307
14308 2003-10-01 Akim Demaille <akim@epita.fr>
14309
14310 VCG no longer supports long_straight_phase.
14311
14312 * src/vcg.c, src/vcg.h: Remove the handling of long_straight_phase.
14313 * src/print_graph.c (print_graph): Adjust.
14314
14315 2003-09-30 Frank Heckenbach <frank@g-n-u.de>
14316 and Paul Eggert <eggert@twinsun.com>
14317
14318 * doc/bison.texinfo (Decl Summary, Contextual Precedence,
14319 Table of Symbols): Document %default-prec.
14320 * src/parse-gram.y (PERCENT_DEFAULT_PREC): New token.
14321 (grammar_declaration): Set default_prec on %default-prec.
14322 * src/scan-gram.l (%default-prec): New token.
14323 * src/reader.h (default_prec): New flag.
14324 * src/reader.c: Likewise.
14325 (packgram): Handle it.
14326 * tests/conflicts.at (%default-prec without %prec,
14327 %default-prec with %prec, %default-prec 1): New tests.
14328
14329 2003-09-30 Paul Eggert <eggert@twinsun.com>
14330
14331 * tests/testsuite.at: Include local.at, not input.at, fixing
14332 a typo in the 2003-08-25 patch.
14333
14334 2003-08-27 Akim Demaille <akim@epita.fr>
14335
14336 * data/lalr1.cc (yyparse) [__GNUC__]: "Use" yyerrorlab to pacify
14337 GCC warnings.
14338
14339 2003-08-26 Akim Demaille <akim@epita.fr>
14340
14341 * config/announce-gen (print_changelog_deltas): Neutralize "<#" as
14342 "<\#" to avoid magic from Gnus when posting parts of this script.
14343
14344 2003-08-26 Akim Demaille <akim@epita.fr>
14345
14346 * data/lalr1.cc (Parser::report_syntax_error_): New, extracted from
14347 (Parser::parse): here.
14348 Adjust: nerrs and errstatus is now replaced by...
14349 (Parser::nerrs_, Parser::errstatus_): New.
14350
14351 2003-08-25 Akim Demaille <akim@epita.fr>
14352
14353 * config/announce-gen, Makefile.cfg: New.
14354 * Makefile.am: Adjust.
14355 * GNUmakefile, Makefile.maint: Update from CVS Autoconf, but
14356 keeping local WGET and WGETFLAGS modifications from Paul Eggert.
14357
14358 2003-08-25 Akim Demaille <akim@epita.fr>
14359
14360 When reducing initial empty rules, Bison parser read an initial
14361 location that is not defined. This results in garbage, and that
14362 affects Bison's own parser. Therefore we need (i) to extend Bison
14363 to support a means to initialize this location, and (ii) to use
14364 this CVS Bison to fix CVS Bison's parser.
14365
14366 * src/reader.h, reader.c (epilogue_augment): Remove, replace
14367 with...
14368 * src/muscle_tab.h, src/muscle_tab.c (muscle_code_grow): this.
14369 * src/parse-gram.y: Adjust.
14370 (%initial-action): New.
14371 (%error-verbose): Since we require CVS Bison, there is no reason
14372 not to use it.
14373 * src/scan-gram.l: Adjust.
14374 * src/Makefile.am (YACC): New, to make sure we use our own parser.
14375 * data/yacc.c (yyparse): Use b4_initial_action.
14376
14377 2003-08-25 Akim Demaille <akim@epita.fr>
14378
14379 * doc/bison.texinfo: Don't promote stdout for error messages.
14380
14381 2003-08-25 Akim Demaille <akim@epita.fr>
14382
14383 * data/lalr1.cc (Parser::reduce_print_): Remove unused yyi.
14384 From Alexandre Duret-Lutz.
14385
14386 2003-08-25 Akim Demaille <akim@epita.fr>
14387
14388 Version 1.875c.
14389
14390 2003-08-25 Akim Demaille <akim@epita.fr>
14391
14392 * data/lalr1.cc (Parser::stack_print_, YY_STACK_PRINT): New.
14393 Use them.
14394
14395 2003-08-25 Akim Demaille <akim@epita.fr>
14396
14397 * data/lalr1.cc (Parser::reduce_print_): New.
14398 Use it.
14399
14400 2003-08-25 Akim Demaille <akim@epita.fr>
14401
14402 Have lalr1.cc catch with Paul Eggert's patch to fix the infinite
14403 error recovery loops. This patch is based on
14404 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00000.html>.
14405 Also, augment the similarity between lalr1.cc and yacc.c.
14406 Note: the locations of error recovery rules are not correct yet.
14407
14408 * data/lalr1.cc: Comment changes to augment the similarity between
14409 lalr1.cc and yacc.c.
14410 (YYERROR): Goto to yyerrorlab, not yyerrlab1.
14411 (yyerrlab1): Remove, but where it used to be (now the bottom part of
14412 yyerrlab), when hitting EOF, pop the whole stack here instead of
14413 merely falling thru the default error handling mechanism.
14414 (yyerrorlab): New label, with the old contents of YYERROR,
14415 plus the following change: pop the stack of rhs corresponding
14416 to the production that invoked YYERROR. That is how Yacc
14417 behaves (required by POSIX).
14418 * tests/calc.at (AT_CHECK_CALC_LALR1_CC): No longer expected to
14419 fail.
14420
14421 2003-08-25 Akim Demaille <akim@epita.fr>
14422
14423 Tune local.at so that people can "autom4te -l autotest calc.at -o
14424 calc" for instance, to extract a sub test suite.
14425
14426 * tests/testsuite.at: Move the initialization, Autotest version
14427 requirement, and AT_TESTED invocation into...
14428 * tests/local.at: here.
14429 * tests/testsuite.at: Include it for compatibility with Autoconf
14430 2.57.
14431 * tests/Makefile.am ($(TESTSUITE)): Report that the warning should
14432 be ignore.
14433
14434 2003-08-04 Paul Eggert <eggert@twinsun.com>
14435
14436 Rework code slightly to avoid gcc -Wtraditional warnings.
14437 * data/glr.c (yyuserMerge): Return void, not YYSTYPE.
14438 The returned value is now stored in *YY0. All callers changed.
14439 * src/output.c (merge_output): Adjust to the above change.
14440
14441 2003-07-26 Paul Eggert <eggert@twinsun.com>
14442
14443 * data/glr.c (YYASSERT): New macro.
14444 (yyfillin, yydoAction, yyglrReduce, yysplitStack,
14445 yyresolveStates, yyprocessOneStack):
14446 Use `YYASSERT (FOO);' rather than `if (! (FOO)) abort ();'.
14447 Derived from a suggestion by Frank Heckenbach.
14448
14449 2003-07-25 Paul Eggert <eggert@twinsun.com>
14450
14451 * data/glr.c (yyglrReduce): Don't use C89 string concatenation,
14452 for portability to K&R C (after ansi2knr, presumably). See
14453 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>
14454 by Frank Heckenbach, though I have omitted the structure-initialization
14455 part of his glr-knr.diff patch since I recall that the Portable
14456 C Compiler didn't require that change.
14457
14458 Let the user specify how to allocate and free memory.
14459 Derived from a suggestion by Frank Heckenbach in
14460 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>.
14461 * data/glr.c (YYFREE, YYMALLOC, YYREALLOC): New macros.
14462 All uses of free, malloc, realloc changed to use these macros,
14463 and unnecessary casts removed.
14464 * data/yacc.c (YYFREE, YYMALLOC): Likewise.
14465
14466 2003-07-06 Matthias Mann <MatthiasMann@gmx.de>
14467
14468 * data/lalr1.cc (operator<<(std::ostream&, const Position&)):
14469 use s.empty() rather than s == "" to test for empty string; see
14470 <http://lists.gnu.org/archive/html/bison-patches/2003-07/msg00003.html>
14471 (trivial change)
14472
14473 2003-06-25 Akim Demaille <akim@epita.fr>
14474
14475 * config/depcomp, config/install-sh: Update from masters.
14476
14477 2003-06-20 Paul Eggert <eggert@twinsun.com>
14478
14479 * data/glr.c (YYLLOC_DEFAULT): Parenthesize arguments as needed,
14480 and return properly parenthesized result.
14481 * data/lalar1.cc (YYLLOC_DEFAULT): Likewise.
14482 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
14483 Remove unnecessary parentheses from uses.
14484 * doc/bison.texinfo (Location Default Action): Describe the
14485 conventions for parentheses.
14486
14487 2003-06-19 Paul Eggert <eggert@twinsun.com>
14488
14489 * data/glr.c (yyremoveDeletes, yy_reduce_print, yyglrReduce,
14490 yyreportTree): Do not assume that size_t is the same width as int,
14491 when printing sizes. Print sizes using an unsigned format.
14492 Problem reported by Frank Heckenbach in
14493 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00035.html>.
14494
14495 Port to Forte Developer 7 C compiler.
14496 * data/glr.c (struct YYLTYPE): If locations are not being used,
14497 declare a single dummy member, as empty structs do not conform
14498 to the C standard.
14499 (YYERROR, YYBACKUP): Do not use "do { ...; return foo; } while (0)";
14500 the Forte Developer 7 C compiler complains that end-of-loop
14501 code is not reached.
14502
14503 2003-06-17 Paul Eggert <eggert@twinsun.com>
14504
14505 * lib/libiberty.h (PARAMS): Spell argument as Args, not as X, to
14506 avoid warnings from picky compilers about redefinition of PARAMS.
14507
14508 2003-06-17 Paul Eggert <eggert@twinsun.com>
14509
14510 Version 1.875b.
14511
14512 * NEWS: Document 1.875b.
14513
14514 * lib/bbitset.h: Do not include config.h; that's the includer's job.
14515 Do not include <sys/types.h>; shouldn't be needed on a C89 host.
14516 * lib/bitset.h (bitset_compatible_p): Indent as per GNU standard.
14517 Don't use 'index' in comments, as it's a builtin fn on some hosts.
14518 * lib/bitset_stats.c: Include gettext.h unconditionally, as
14519 per recent gettext manual's suggestion.
14520 * lib/ebitset.c (ebitset_resize, ebitset_unused_clear):
14521 Use prototypes, not old-style definitions.
14522 * lib/lbitset.c (lbitset_unused_clear): Likewise.
14523 * lib/vbitset.c (vbitset_resize, vbitset_ones, vbitset_zero,
14524 vbitset_empty_p, vbitset_copy1, vbitset_not, vbitset_equal_p,
14525 vbitset_subset_p, vbitset_disjoint_p, vbitset_and, vbitset_and_cmp,
14526 vbitset_andn, vbitset_andn_cmp, vbitset_or, vbitset_or_cmp,
14527 vbitset_xor, vbitset_xor_cmp, vbitset_and_or, vbitset_and_or_cmp,
14528 vbitset_andn_or, vbitset_andn_or_cmp, vbitset_or_and,
14529 vbitset_or_and_cmp, vbitset_copy): Likewise.
14530
14531 * lib/libiberty.h: Do not include config.h; that's the includer's job.
14532 Do not include <stdlib.h>.
14533 (PARAMS): Define unconditionally for C89.
14534 (ATTRIBUTE_NORETURN): Remove.
14535 (ATTRIBUTE_UNUSED): Define unconditionally.
14536
14537 Upgrade to 2003-06-08 libbitset, submitted by Michael Hayes in:
14538 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00005.html>
14539 * lib/Makefile.am (bitsets_sources): Add vbitset.c, vbitset.h.
14540 * lib/vbitset.c, lib/vbitset.h: New files.
14541 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
14542 lib/bitset_stats.c, lib/ebitset.c, lib/lbitset.c: Import
14543 from libbitset.
14544
14545 * doc/bison.texinfo (How Can I Reset the Parser): Renamed from
14546 `How Can I Reset @code{yyparse}', since texinfo does not allow
14547 arbitrary @ in node names.
14548
14549 * m4/Makefile.am (EXTRA_DIST): Add the following files, which
14550 shouldn't be needed according to the gettext 0.12.1 documentation
14551 but which seem to be needed anyway: codeset.m4 glibc21.m4
14552 intdiv0.m4 inttypes-pri.m4 inttypes.m4 inttypes_h.m4 isc-posix.m4
14553 lcmessage.m4 nls.m4 po.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4.
14554 * po/Makefile.in.in: Upgrade to gettext 0.12.1 version.
14555
14556 * lib/.cvsignore: Add stdbool.h.
14557 * m4/.cvsignore: Add nls.m4, po.m4.
14558
14559 Upgrade to CVS gnulib.
14560 * stdbool_.h: File renamed from stdbool.h.in.
14561 * configure.ac (AM_STDBOOL_H): Invoke this instead of
14562 AC_HEADER_STDBOOL.
14563 (AM_GNU_GETTEXT): Put brackets around args, as latest manual suggests.
14564 (AM_GNU_GETTEXT_VERSION): Update to 0.12.1.
14565 * lib/Makefile.am (EXTRA_DIST): Add stdbool_.h.
14566 (MOSTLYCLEANFILES): New var.
14567 ($(libbison_a_OBJECTS)): Depend on $(STDBOOL_H).
14568 (stdbool.h): New rule.
14569 * lib/dirname.c, lib/dirname.h, lib/hash.c, lib/hash.h,
14570 lib/malloc.c, lib/obstack.h, lib/quote.c, lib/realloc.c,
14571 lib/strcasecmp.c, lib/xalloc.h, m4/alloca.m4, m4/onceonly.m4,
14572 m4/quote.m4: Upgrade to today's gnulib.
14573
14574 * tests/calc.at (AT_CHECK_CALC): New option EXPECTED-TO-FAIL.
14575 (AT_CHECK_CALC_LALR1_CC): Use it, since the C++ LALR parser fails
14576 the tests right now.
14577 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Ensure yylex and
14578 yyerror are declared before use; C99 requires this.
14579
14580 2003-06-09 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14581
14582 * data/glr.c (YYERROR): Update definition to reset yyerrState to 0
14583 first.
14584 (yyrecoverSyntaxError): Correct the logic for setting and testing
14585 yyerrState.
14586 Correct comment on handling EOF.
14587 Allow states with only a default reduction, rather than failing
14588 (I can't quite reconstruct why these were not allowed before).
14589
14590 Fixes to avoid problem that $-N rules in GLR parsers can cause
14591 buffer overruns, corrupting state.
14592
14593 * src/output.c (prepare_rules): Output max_left_semantic_context
14594 definition.
14595 * src/reader.h (max_left_semantic_context): New variable declaration.
14596 * src/scan-gram.l (max_left_semantic_context): Define.
14597 (handle_action_dollar): Update max_left_semantic_context.
14598 * data/glr.c (YYMAXLEFT): New definition.
14599 (yydoAction): Increase size of yyrhsVals by YYMAXLEFT.
14600 (yyresolveAction): Ditto.
14601
14602 Fixes to problems with location handling in GLR parsers reported by
14603 Frank Heckenbach (2003/06/05).
14604
14605 * data/glr.c (YYLTYPE): Make trivial if locations not used.
14606 (YYRHSLOC): Add parentheses, and define only if locations used.
14607 (YYLLOC_DEFAULT): Add parentheses, and give trivial definition if
14608 locations not used.
14609 (yyuserAction): Use YYLLOC_DEFAULT to set *yylocp.
14610 (yydoAction): Remove redundant initialization of *yyvalp and *yylocp.
14611
14612 * tests/cxx-type.at: Exercise location information; update tests
14613 to differentiate output with and without locations.
14614 Remove forward declarations of yylex and yyerror---caused errors
14615 because default YYLTYPE not yet defined.
14616 Change semantic actions to compute strings, rather than printing
14617 them directly (to test proper passing of semantics values). Change
14618 output to prefix notation and update test data and expected results.
14619 (yylex): Track locations.
14620 (stmtMerge): Return value rather than printing, and include arguments
14621 in value.
14622
14623 2003-06-03 Paul Eggert <eggert@twinsun.com>
14624
14625 Avoid warnings generated by GCC 2.95.4 when Bison is
14626 configured with --enable-gcc-warnings.
14627 * data/lalr1.cc (yy::]b4_parser_class_name[::parse,
14628 yy::]b4_parser_class_name[::translate_,
14629 yy::Stack::operator[] (unsigned),
14630 yy::Stack::operator[] (unsigned) const,
14631 yy::Slice::operator[] (unsigned),
14632 yy::Slice::operator[] (unsigned) const):
14633 Rename local vars to avoid warnings.
14634 * tests/glr-regression.at (Improper handling of embedded actions
14635 and $-N in GLR parsers): Remove unused local variable from yylex.
14636 * tests/regression.at (_AT_DATA_DANCER_Y): Declare yylex to take
14637 (void) as arg when not pure, since we now assume C89 when building
14638 Bison. Pacify GCC by using parameter.
14639
14640 2003-06-02 Paul Eggert <eggert@twinsun.com>
14641
14642 * data/lalr1.cc (yy::Position::lines, yy::Position::columns,
14643 yy::Location::lines, yy::Location::columns): Rename arguments
14644 to avoid shadowing; this removes a warning generated by GCC 3.3.
14645
14646 2003-06-01 Paul Eggert <eggert@twinsun.com>
14647
14648 Don't pass C-only warning optins (e.g., -Wmissing-declarations)
14649 to g++, as GCC 3.3 complains if you do it.
14650 * configure.ac (WARNING_CXXFLAGS): New subst. Set it to
14651 everything that WARNING_CFLAGS has, except omit warnings
14652 not suitable for C++.
14653 (AC_PROG_CXX): Use this instead of AC_CHECK_PROGS([CXX], [g++]).
14654 * tests/atlocal.in (CXXFLAGS): New var.
14655 * tests/local.at (AT_COMPILE_CXX): Use it instead of CFLAGS.
14656
14657 Fix a GLR parser bug I reported in February; see
14658 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00008.html>.
14659 The problem was that GLR parsers did not conform to the C standard,
14660 because actions like { $1 = $2 + $3; } expanded to expressions
14661 that invoked YYFILL in separate subexpressions, and YYFILL assigned
14662 to a local variable. The C standard says that expressions
14663 like (var = f ()) + (var = f ()) have undefined behavior.
14664 Another problem was that GCC sometimes issues warnings that
14665 yyfill and its parameters are unused.
14666
14667 * data/glr.c (yyfillin): Renamed from the old yyfill. Mark
14668 as possibly unused.
14669 (yyfill): New function.
14670 (YYFILL): Use it.
14671 (yyuserAction): Change type of yynormal to bool, so that it matches
14672 the new yyfill signature. Mark it as possibly unused.
14673
14674
14675 Follow up on a bug I reported in February, where a Bison-generated
14676 parser can loop. Provide a test case and a fix for yacc.c. I
14677 don't have a fix for lalr1.cc or for glr.c, unfortunately.
14678 The original bug report is in:
14679 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00044.html>
14680
14681 * data/yacc.c (YYERROR): Now just 'goto yyerrorlab', since the
14682 macro's size was becoming unwieldy.
14683 (yyerrlab): Do not discard an empty lookahead symbol, as this
14684 might destroy garbage.
14685 (yyerrorlab): New label, with the old contents of YYERROR,
14686 plus the following change: pop the stack of rhs corresponding
14687 to the production that invoked YYERROR. That is how Yacc
14688 behaves, and POSIX requires this behavior.
14689 (yyerrlab1): Use YYPOPSTACK instead of its definiens.
14690 * tests/calc.at (_AT_DATA_CALC_Y): Include unistd.h if available.
14691 Define 'alarm' to do nothing if unistd.h is not available.
14692 Add a new rule "exp: '-' error;" to test the above change to
14693 data/yacc.c. Use 'alarm' to abort any test taking longer than
14694 10 seconds, as it's probably looping.
14695 (AT_CHECK_CALC): Test recovery from error in new grammar rule.
14696 Also, the new yacc.c generates two fewer diagnostics for an
14697 existing test.
14698
14699 2003-05-24 Paul Eggert <eggert@twinsun.com>
14700
14701 * data/glr.c (YYSTACKEXPANDABLE): Do not evaluate
14702 YYSTYPE_IS_TRIVIAL or YYSTYPE_IS_TRIVIAL unless they are defined.
14703 This fixes a problem reported by John Bowman when the Compaq/HP
14704 Alpha cxx compiler happy (e.g. using cxx -D__USE_STD_IOSTREAM
14705 -ansi -Wall -gall).
14706 * data/yacc.c (union yyalloc): Likewise.
14707 (YYCOPY): Do not evaluate __GNUC__ unless it is defined.
14708
14709 Switch from 'int' to 'bool' where that makes sense.
14710
14711 * lib/abitset.c (abitset_test, abitset_empty_p, abitset_equal_p,
14712 abitset_subset_p, abitset_disjoint_p, abitset_and_cmp,
14713 abitset_andn_cmp, abitset_or_cmp, abitset_xor_cmp, abitset_and_or,
14714 abitset_and_or_cmp, abitset_andn_or_cmp, abitset_or_and_cmp):
14715 Return or accept bool, not int. All callers changed.
14716 * lib/bbitset.h: (bitset_toggle_, bitset_copy_, bitset_and_or_cmp_,
14717 bitset_andn_or_cmp_, bitset_or_and_cmp_): Likewise.
14718 * lib/bitset.c (bitset_only_set_p, bitset_print, bitset_toggle_,
14719 bitset_copy_, bitset_op4_cmp, bitset_and_or_cmp_, bitset_andn_or_cmp_,
14720 bitset_or_and_cmp_): Likewise.
14721 * lib/bitset.h (bitset_test, bitset_only_set_p): Likewise.
14722 * lib/bitset_stats.c (bitset_stats_print, bitset_stats_toggle,
14723 bitset_stats_test, bitset_stats_empty_p, bitset_stats_disjoint_p,
14724 bitset_stats_equal_p, bitset_stats_subset_p, bitset_stats_and_cmp,
14725 bitset_stats_andn_cmp, bitset_stats_or_cmp, bitset_stats_xor_cmp,
14726 bitset_stats_and_or_cmp, bitset_stats_andn_or_cmp,
14727 bitset_stats_or_and_cmp): Likewise.
14728 * lib/ebitset.c (ebitset_elt_zero_p, ebitset_equal_p, ebitset_copy_cmp,
14729 ebitset_test, ebitset_empty_p, ebitset_subset_p, ebitset_disjoint_p,
14730 ebitset_op3_cmp, ebitset_and_cmp, ebitset_andn_cmp, ebitset_or_cmp,
14731 ebitset_xor_cmp): Likewise.
14732 * lib/lbitset.c (lbitset_elt_zero_p, lbitset_equal_p, lbitset_copy_cmp,
14733 lbitset_test, lbitset_empty_p, lbitset_subset_p, lbitset_disjoint_p,
14734 lbitset_op3_cmp, lbitset_and_cmp, lbitset_andn_cmp, lbitset_or_cmp,
14735 lbitset_xor_cmp): Likewise.
14736 * lib/bbitset.h: Include <stdbool.h>.
14737 (struct bitset_vtable): The following members now return bool, not
14738 int: toggle, test, empty_p, disjoint_p, equal_p, subset_p,
14739 and_cmp, andn_cmp, or_cmp, xor_cmp, and_or_cmp, andn_or_cmp,
14740 or_and_cmp).
14741 * src/conflicts.c (count_rr_conflicts): Likewise.
14742 * lib/bitset_stats.h (bitset_stats_enabled): Now bool, not int.
14743 All uses changed.
14744 * lib/ebitset.c (ebitset_obstack_init): Likewise.
14745 * lib/lbitset.c (lbitset_obstack_init): Likewise.
14746 * src/getargs.c (debug_flag, defines_flag, locations_flag,
14747 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
14748 graph_flag): Likewise.
14749 * src/getargs.h (debug_flag, defines_flag, locations_flag,
14750 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
14751 graph_flag): Likewise.
14752 * src/output.c (error_verbose): Likewise.
14753 * src/output.h (error_verbose): Likewise.
14754 * src/reader.c (start_flag, typed): Likewise.
14755 * src/reader.h (typed): Likewise.
14756 * src/getargs.c (LOCATIONS_OPTION): New constant.
14757 (long_options, getargs): Use it.
14758 * src/lalr.c (build_relations): Use bool, not int.
14759 * src/nullable.c (nullable_compute): Likewise.
14760 * src/print.c (print_reductions): Likewise.
14761 * src/tables.c (action_row, pack_vector): Likewise.
14762 * src/muscle_tab.h (MUSCLE_INSERT_BOOL): New macro.
14763 * src/output.c (prepare): Use it.
14764 * src/output.c (token_definitions_output,
14765 symbol_destructors_output, symbol_destructors_output): Use string,
14766 not boolean integer, to keep track of whether to output separator.
14767 * src/print_graph.c (print_core): Likewise.
14768 * src/state.c (state_rule_lookaheads_print): Likewise.
14769
14770 * config/install-sh: Sync from automake 1.7.5.
14771
14772 2003-05-14 Paul Eggert <eggert@twinsun.com>
14773
14774 * src/parse-gram.y (rules_or_grammar_declaration): Require a
14775 semicolon after a grammar declaration, in the interest of possible
14776 future changes to the Bison input language.
14777 Do not allow a stray semicolon at the start of the grammar.
14778 (rhses.1): Allow one or more semicolons after any rule, including
14779 just before "|" as required by POSIX.
14780 * tests/input.at (Torturing the Scanner): Add tests for ";|" in a
14781 grammar.
14782
14783 2003-05-14 Alexandre Duret-Lutz <adl@gnu.org>
14784
14785 %parse-param support for lalr1.cc.
14786
14787 * data/lalr1.cc (b4_parse_param_decl, b4_parse_param_cons,
14788 b4_cc_constructor_calls, b4_cc_constructor_call,
14789 b4_parse_param_vars, b4_cc_var_decls, b4_cc_var_decl): New m4
14790 definitions.
14791 (yy::b4_parser_class_name::b4_parser_class_name): Take extra
14792 parse-param arguments.
14793 (yy::b4_parser_class_name): Declare instance variables to
14794 hold parse-param arguments.
14795 * tests/calc.at: s/value/semantic_value/ because value clashes
14796 with a member of yy::b4_parser_class_name. Adjust C++ code
14797 to handle %parse-param. Enable %parse-param test in C++.
14798
14799 2003-05-12 Paul Eggert <eggert@twinsun.com>
14800
14801 * doc/bison.texinfo (How Can I Reset @code{yyparse}): Reword the
14802 English a bit. Fix fclose typo. Change "const char" to "char
14803 const", and use ANSI C rather than K&R for "main". Suggest
14804 YY_FLUSH_BUFFER over yyrestart (as that is what Flex recommends)
14805 and suggest yy_switch_to_buffer.
14806
14807 2003-05-05 Paul Eggert <eggert@twinsun.com>
14808
14809 * lib/bitset.h (__INT_TO_PTR): Define to a value that presumes
14810 C89. This avoids a diagnostic on compilers that define __STDC__
14811 to 0, fixing a problem with Tru64 cc reported by Martin Mokrejs in
14812 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
14813
14814 2003-05-03 Paul Eggert <eggert@twinsun.com>
14815
14816 * lib/bitset.h (BITSET_FOR_EACH, BITSET_FOR_EACH_REVERSE):
14817 Do not overrun array bounds.
14818 This should fix a bug reported today by Olatunji Oluwabukunmi in
14819 <http://lists.gnu.org/archive/html/bug-bison/2003-05/msg00004.html>.
14820
14821 2003-04-29 Akim Demaille <akim@epita.fr>
14822
14823 * src/gram.h, src/gram.c (pure_parser, glr_parser): Move to...
14824 * src/getargs.c, src/getargs.h: here, as bool, not int.
14825 (nondeterministic_parser): New.
14826 * src/parse-gram.y, src/scan-gram.l: Support
14827 %nondeterministic-parser.
14828 * src/output.c (prepare): Use nondeterministic_parser instead
14829 of glr_parser where appropriate.
14830 * src/tables.c (conflict_row, action_row, save_row)
14831 (token_actions, token_actions, pack_vector): Ditto.
14832
14833 2003-04-29 Akim Demaille <akim@epita.fr>
14834
14835 * doc/bison.texinfo (C++ Parsers, Implementing Loops): New.
14836
14837 2003-04-29 Akim Demaille <akim@epita.fr>
14838
14839 * tests/calc.at: Also test yacc.c and glr.c (but not lalr1.cc yet)
14840 with %pure-parser and %locations to exercise the patch from Yakov
14841 Markovitch below.
14842
14843 2003-04-28 Tim Van Holder <tim.van.holder@pandora.be>
14844
14845 * data/yacc.c: (b4_lex_param): Corrected for the case where
14846 %lex-param is provided and %pure-parser isn't.
14847
14848 2003-04-27 Paul Eggert <eggert@twinsun.com>
14849
14850 Avoid gcc -Wundef warnings reported by Gerald Pfeifer in
14851 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00044.html>.
14852 * data/yacc.c (YYSTACK_ALLOC): Don't evaluate YYSTACK_USE_ALLOCA
14853 if it is not defined.
14854 (YYMAXDEPTH): Don't evaluate YYMAXDEPTH if it is not defined.
14855
14856 2003-04-26 Paul Eggert <eggert@twinsun.com>
14857
14858 * data/lalr1.cc (yy::Parser::pact_ninf_, yy::Parser::table_ninf_):
14859 Declare to be of type suitable for the ninf value itself, not of
14860 type suitable for the corresponding table, since the latter might
14861 be unsigned but the ninf value might be negative. This fixes a
14862 bug reported by Alexandre Duret-Lutz in
14863 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00017.html>.
14864
14865 * configure.ac (AC_FUNC_ERROR_AT_LINE): Remove, since gl_ERROR
14866 invokes it. We shouldn't invoke it twice because it will attempt
14867 to put error.o in the archive twice. This fixes a glitch reported
14868 by Martin Mokrejs in
14869 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
14870
14871 2003-04-21 Paul Eggert <eggert@twinsun.com>
14872
14873 * m4/error.m4: Update from Bruno Haible's 2003-04-14 patch
14874 to gnulib.
14875
14876 2003-04-21 Yakov Markovitch <Markovitch@iso.ru>
14877
14878 * data/glr.c (yyexpandGLRStack) [!YYSTACKEXPANDABLE]:
14879 Fix obvious typo that results in uncompilable GLR parsers
14880 when both %pure-parser and %locations are used. (trivial change)
14881
14882 2003-04-17 Paul Eggert <eggert@twinsun.com>
14883
14884 * src/scan-gram.l: Add %option nounput, since we no longer use unput.
14885 (unexpected_eof): Renamed from unexpected_end_of_file, for brevity.
14886 Do not insert the expected token via unput, as this runs afoul
14887 of a POSIX-compatibility bug in flex 2.5.31.
14888 All uses changed to BEGIN the parent state,
14889 since we no longer insert the expected token via unput.
14890 * tests/regression.at (Invalid inputs): Remove cascaded diagnostic
14891 that is no longer emitted after the above change.
14892
14893 * src/conflicts.c (set_conflicts): Resolve all conflicts, not just
14894 the first one. This change is from Paul Hilfinger, and it fixes
14895 regression reported by Werner Lemberg in
14896 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
14897
14898 (resolve_sr_conflict): Don't invoke state_errs_set
14899 unless one or more tokens have been explicitly made errors.
14900 Otherwise, the above change causes Bison to abort.
14901
14902 * tests/existing.at (GNU pic Grammar): New test case, taken from
14903 Lemberg's email.
14904
14905 2003-03-31 Akim Demaille <akim@epita.fr>
14906
14907 * doc/Makefile.am (AM_MAKEINFOFLAGS): Don't split the info file.
14908
14909 2003-03-31 Akim Demaille <akim@epita.fr>
14910
14911 * src/output.c (prepare_symbols): Avoid trailing spaces in the
14912 output.
14913
14914 2003-03-31 Akim Demaille <akim@epita.fr>
14915
14916 * doc/bison.texinfo (Strings are Destroyed): s/losses/loses/.
14917 From Paul Hilfinger.
14918
14919 2003-03-29 Akim Demaille <akim@epita.fr>
14920
14921 * m4/error.m4: Do not put under dynamic conditions some code which
14922 expansion is under static control.
14923
14924 2003-03-29 Akim Demaille <akim@epita.fr>
14925
14926 * doc/bison.texinfo (How Can I Reset @code{yyparse}): New.
14927
14928 2003-03-29 Akim Demaille <akim@epita.fr>
14929
14930 * doc/bison.texinfo (Strings are Destroyed): New.
14931
14932 2003-03-13 Paul Eggert <eggert@twinsun.com>
14933
14934 * .cvsignore: Add configure.lineno.
14935 * src/.cvsignore: Add yacc.
14936 * tests/.cvsignore: Add testsuite.log.
14937 * doc/fdl.texi: Sync with latest FSF version.
14938
14939 2003-03-12 Paul Eggert <eggert@twinsun.com>
14940
14941 * scan-gram.l (YY_USER_INIT): Initialize code_start, too.
14942 (<INITIAL><<EOF>>, <SC_PRE_CODE><<EOF>>): Set *loc to the scanner
14943 cursor, instead of leaving it undefined. This fixes a bug
14944 reported by Tim Van Holder in
14945 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00023.html>.
14946 * tests/input.at (Torturing the Scanner): Test the scanner on
14947 an empty input file, which was Tim Van Holder's test case.
14948
14949 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): When checking whether
14950 <sys/resource.h> can be included, include sys/time.h and
14951 sys/times.h first, if available. This works around the SunOS
14952 4.1.4 porting bug reported by Bruce Becker in
14953 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00018.html>.
14954
14955 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't
14956 AC_CHECK_HEADERS([sys/wait.h]), as this interferes with
14957 AC_HEADER_SYS_WAIT.
14958
14959 Merge changes from gnulib. This was prompted because the CVS
14960 snapshot didn't build on Solaris 7 due to strnlen problems.
14961
14962 These changes need to be merged back into gnulib:
14963 * lib/hash.c: Include <stdbool.h> unconditionally.
14964 * m4/onceonly.m4 (m4_quote): New macro.
14965 (AC_CHECK_HEADERS_ONCE, AC_CHECK_FUNCS_ONCE, AC_CHECK_DECLS_ONCE):
14966 Quote AC_FOREACH variable-expansions properly.
14967 The 2003-01-03 obstack.h change also needs merging.
14968 {end of changes requiring merging}
14969
14970 * lib/stdbool.h.in, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
14971 m4/getopt.m4, m4/hash.m4, m4/malloc.m4, m4/memchr.m4,
14972 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/quote.m4,
14973 m4/quotearg.m4, m4/realloc.m4, m4/stpcpy.m4, m4/strnlen.m4,
14974 m4/strtol.m4, m4/strtoul.m4, m4/unlocked-io.m4, m4/xalloc.m4:
14975 New files, imported from gnulib.
14976 * m4/Makefile.am (EXTRA_DIST): Add the new m4/*.m4 files mentioned
14977 above.
14978
14979 * lib/mbswidth.c, m4/error.m4, m4/mbrtowc.m4, m4/mbswidth.m4,
14980 m4/memcmp.m4, m4/prereq.m4, m4/stdbool.m4: Update to current
14981 gnulib sources.
14982
14983 * configure.ac (gl_DIRNAME, gl_GETOPT, gl_HASH, gl_QUOTE, gl_XALLOC):
14984 Add.
14985 (gl_ERROR): New, replacing jm_PREREQ_ERROR.
14986 (gl_FUNC_ALLOCA): New, replacing AC_FUNC_ALLOCA.
14987 (gl_FUNC_STPCPY): New, replacing AC_REPLACE_FUNCS(stpcpy).
14988 (gl_FUNC_STRNLEN): New, replacing AC_FUNC_STRNLEN.
14989 (gl_MBSWIDTH): New, replacing jm_PREREQ_MBSWIDTH.
14990 (gl_OBSTACK): New, replacing AC_FUNC_OBSTACK.
14991 (gl_QUOTEARG): New, replacing jm_PREREQ_QUOTEARG.
14992 (jm_FUNC_GLIBC_UNLOCKED_IO, gl_FUNC_STPCPY, gl_FUNC_STRTOL): New.
14993 (jm_FUNC_MALLOC): New, replacing AC_FUNC_MALLOC.
14994 (jm_FUNC_REALLOC): New, replacing AC_FUNC_REALLOC.
14995 (jm_PREREQ_ARGMATCH): Remove.
14996 (AC_REPLACE_FUNCS): Remove memchr, memrchr, stpcpy, strtol, strtoul.
14997 * lib/Makefile.am (libbison_a_SOURCES): Add argmatch.c, argmatch.h.
14998
14999 * src/system.h: Include <stdbool.h> unconditionally.
15000
15001 * lib/bbitset.h: Include <limits.h> unconditionally. We have been
15002 assuming at least C89 in the bitset code for some time now.
15003
15004 2003-03-03 Akim Demaille <akim@epita.fr>
15005
15006 * ro.po: New.
15007
15008 2003-03-02 Akim Demaille <akim@epita.fr>
15009
15010 * doc/bison.texinfo (Table of Symbols): Reactivate the
15011 documentation for %lex-param, and %parse-param.
15012
15013 2003-03-02 Akim Demaille <akim@epita.fr>
15014
15015 * data/yacc.c, data/glr.c, data/lal1.cc: Use similar code to
15016 generate verbose error messages.
15017 Use the number of tokens as an upper bound in yytname, as it
15018 cannot be a non terminal.
15019
15020 2003-03-02 Akim Demaille <akim@epita.fr>
15021
15022 * tests/regression.at (_AT_DATA_DANCER_Y): Fix the expected error
15023 message.
15024
15025 2003-03-02 Akim Demaille <akim@epita.fr>
15026
15027 * tests/regression.at (_AT_DATA_DANCER_Y, AT_CHECK_DANCER): New.
15028 Use them to exercise yycheck overrun.
15029 Based on Andrew Suffield's grammar.
15030
15031 2003-03-02 Akim Demaille <akim@epita.fr>
15032
15033 Create tests/local.at for Bison generic testing macros.
15034
15035 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Move to...
15036 * tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS):
15037 This new file.
15038 * tests/calc.at (AT_CHECK_CALC): Adjust.
15039 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR)
15040 (AT_COMPILE, AT_COMPILE_CXX, AT_PARSER_CHECK): Move to...
15041 * tests/local.at: here.
15042 (AT_COMPILE_CXX): Tags the tests using it as c++.
15043 Ignore the test if CXX is not functional.
15044
15045 2003-03-01 Paul Eggert <eggert@twinsun.com>
15046
15047 * src/scan-gram.l (code_start): Initialize it to scanner_cursor,
15048 not loc->end, since loc->end might contain garbage and this leads
15049 to undefined behavior on some platforms.
15050 (id_loc, token_start): Use (IF_LINTed) initial values that do not
15051 depend on *loc, so that the reader doesn't give the the false
15052 impression that *loc is initialized.
15053 (<INITIAL>"%%"): Do not bother setting code_start, since its value
15054 does not survive the return.
15055
15056 2003-03-01 Akim Demaille <akim@epita.fr>
15057
15058 * src/scan-gram.l (code_start): Always initialize it when entering
15059 into yylex, as SC_EPILOGUE is activated *before* the corresponding
15060 yylex invocation. An alternative would be making it static, but
15061 then it starts with the second %%'s beginning, instead of its end.
15062
15063 2003-02-28 Paul Eggert <eggert@twinsun.com>
15064
15065 * lib/mbswidth.c: Include <wchar.h> before "mbswidth.h", to work
15066 around a UnixWare 7.1.1 porting bug reported by John Hughes in
15067 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00030.html>.
15068
15069 2003-02-26 Paul Eggert <eggert@twinsun.com>
15070
15071 * README: Mention compiler bug in Sun Forte Developer 6 update 2.
15072 Remove Sequent/Pyramid discussion (nobody uses them any more).
15073 Merge VMS and MS-DOS discussion; these ports may well be dead
15074 but let's keep mentioning them for now. Put <> around email
15075 addresses. Add copyright notice.
15076
15077 2003-02-24 Paul Eggert <eggert@twinsun.com>
15078
15079 * data/glr.c (yy_reduce_print): yylineno -> yylno,
15080 to avoid collision with flex use of yylineno.
15081 Problem reported by Bruce Lilly in
15082 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00016.html>.
15083 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
15084 * data/yacc.c (yy_reduce_print): Likewise.
15085
15086 * config/depcomp: Sync with Automake 1.7.3.
15087
15088 2003-02-21 Akim Demaille <akim@epita.fr>
15089
15090 * data/lalr1.cc: Use temporary variables instead of casts to
15091 change integer types.
15092 Suggested by Paul Eggert.
15093
15094 2003-02-21 Akim Demaille <akim@epita.fr>
15095
15096 * doc/bison.texinfo: Use "location" consistently to refer to @n,
15097 to avoid confusions with lalr1.cc's notion of Position.
15098 Suggested by Paul Eggert.
15099
15100 2003-02-20 Akim Demaille <akim@epita.fr>
15101
15102 * data/lalr1.cc (position.hh): Make sure "columns" never pushes
15103 before initial_columns.
15104 (location.hh): Use consistent variable names when defining the
15105 operator<<.
15106 Use "last" so that we subtract from Positions, not from unsigned.
15107
15108 2003-02-20 Akim Demaille <akim@epita.fr>
15109
15110 * data/lalr1.cc (position.hh): New subfile, including the extended
15111 and Doxygen'ed documentation of class Position.
15112 (location.hh): Use it.
15113 Document a` la Doxygen.
15114 With the help of Benoit Perrot.
15115
15116 2003-02-20 Akim Demaille <akim@epita.fr>
15117
15118 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Define
15119 AT_YACC_IF.
15120 Redefine AT_YYERROR_SEES_LOC_IF using it.
15121 (_AT_DATA_CALC_Y): Don't declare yyerror when lalr1.cc, as it is
15122 not defined.
15123 Don't use the location in yy::Parser::error_ and
15124 yy::Parser::print_ when not %locations.
15125 Activate more lalr1.cc tests.
15126
15127 2003-02-19 Akim Demaille <akim@epita.fr>
15128
15129 * data/lalr1.cc: When displaying a line number, be sure to make it
15130 an int.
15131
15132 2003-02-19 Akim Demaille <akim@epita.fr>
15133
15134 * data/lalr1.cc (b4_stack_depth_init, yy::Parser::initdepth_):
15135 Remove, useless.
15136 (YYABORT, YYACCEPT, YYERROR): New.
15137 * tests/calc.at: Renable the lalr1.cc test.
15138
15139 2003-02-19 Akim Demaille <akim@epita.fr>
15140
15141 * tests/calc.at (AT_CHECK_CALC): Check different scenarios of
15142 error recovery, mixing with/without pops and discarding of the
15143 lookahead.
15144 Exercise YYERROR.
15145 Disable the lalr1.cc tests as currently it doesn't support YYERROR.
15146
15147 2003-02-17 Paul Eggert <eggert@twinsun.com>
15148
15149 * tests/atlocal.in (LDFLAGS, LIBS): New vars.
15150 * tests/testsuite.at (AT_COMPILE): Use them.
15151 This fixes the testsuite problem reported by Robert Lentz in
15152 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00011.html>.
15153
15154 2003-02-12 Paul Eggert <eggert@twinsun.com>
15155
15156 * data/yacc.c (yyerrlab) [YYERROR_VERBOSE]:
15157 Avoid subscript error in yycheck. Bug reported by Andrew Suffield in
15158 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00003.html>.
15159 * data/glr.c (yyreportSyntaxError) [YYERROR_VERBOSE]: Likewise.
15160 Check for malloc failure, for consistency with yacc.c.
15161 (yytname_size): Remove, for consistency with yacc.c.
15162
15163 The bug still remains in data/lalr1.cc, as I didn't have time
15164 to fix it there.
15165
15166 2003-02-06 Akim Demaille <akim@epita.fr>
15167
15168 * configure.ac (GXX): Rename as...
15169 (CXX): this, to keep the original Autoconf semantics.
15170 Require 2.57.
15171 * data/lalr1.cc: Fix b4_copyright invocations.
15172 If YYDEBUG is not defined, don't depend upon name_ being defined.
15173 (location.hh): Include string and iostream.
15174 (Position::filename): New member.
15175 (Position::Position ()): New.
15176 (operator<< (Position)): New.
15177 (operator- (Position, int)): New.
15178 (Location::first, Location::last): Rename as...
15179 (Location::begin, Location::end): these, to mock the conventional
15180 iterator names.
15181 (operator<< (Location)): New.
15182 * tests/atlocal.in (CXX): New.
15183 * tests/testsuite.at (AT_COMPILE_CXX): New.
15184 * tests/calc.at (_AT_DATA_CALC_Y): Adjust yyerror to report the
15185 locations in a more synthetic way.
15186 (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF is positive if
15187 lalr1.cc is used.
15188 Adjust the C locations to match those from Emacs: first column is
15189 column 0.
15190 Change all the expected results.
15191 Conform to the GCS: simplify the locations when applicable.
15192 (LOC, VAL, YYLLOC_FORMAL, YYLLOC_ARG, USE_YYLLOC, LEX_FORMALS)
15193 (LEX_ARGS, USE_LEX_ARGS, LEX_PRE_FORMALS, LEX_PRE_ARGS): Replace
15194 these CPP macros with the m4 macros new defined by...
15195 (AT_CHECK_PUSHDEFS): this, i.e.:
15196 (AT_LALR1_CC_IF, AT_PURE_LEX_IF, AT_LOC, AT_VAL, AT_LEX_FORMALS)
15197 (AT_LEX_ARGS, AT_USE_LEX_ARGS, AT_LEX_PRE_FORMALS, AT_LEX_PRE_ARGS)
15198 New macros.
15199 (AT_CHECK_POPDEFS): Undefine them.
15200 (AT_CHECK_CALC_LALR1_CC): New.
15201 Use it for the first lalr1.cc test.
15202
15203 2003-02-04 Akim Demaille <akim@epita.fr>
15204
15205 * data/lalr1.cc (YYLLOC_DEFAULT): Fix its definition: be based on
15206 Location as is defined.
15207
15208 2003-02-04 Akim Demaille <akim@epita.fr>
15209
15210 * data/lalr1.cc: If YYDEBUG is not defined, don't depend upon
15211 name_ being defined.
15212
15213 2003-02-03 Paul Eggert <eggert@twinsun.com>
15214
15215 * src/gram.h (start_symbol): Remove unused decl.
15216
15217 Use more-consistent naming conventions for local vars.
15218
15219 * src/derives.c (derives_compute): Change type of local var from
15220 int to rule_number.
15221 * src/gram.c (grammar_rules_partial_print): Likewise.
15222 * src/print.c (print_core): Likewise.
15223 * src/reduce.c (reduce_grammar_tables): Likewise.
15224
15225 * src/gram.c (grammar_dump): Change name of item_number *
15226 local var from r to rp.
15227 * src/nullable.c (nullable_compute): Likewise.
15228
15229 * src/gram.h (ISTOKEN, ISVAR): Use i, not s, for int var.
15230
15231 * src/gram.h (symbol_number_as_item_number): Use sym, not s,
15232 for symbol or symbol_number var.
15233 * src/reader.c (grammar_start_symbol_set): Likewise.
15234 * src/reader.h (grammar_start_symbol_set, grammar_symbol_append):
15235 Likewise.
15236 * src/state.c (transitions_to): Likewise.
15237 * src/state.h: Likewise.
15238 * src/tables.c (symbol_number_to_vector_number): Likewise.
15239
15240 * src/muscle_tab.h (MUSCLE_OBSTACK_SGROW): Use p, not s, for
15241 char * var.
15242
15243 * src/parse-gram.y (lloc_default): Use loc, not r, for YYLTYPE
15244 var.
15245
15246 * src/scan-gram.l (no_cr_read): Use bytes_read, not s, for size
15247 var.
15248
15249 * src/system.h (xstrndup, strchr, strspn, strnlen, memchr, memrchr):
15250 Use str, not s, for char * var. Use ch, not c, for character var.
15251 Use size for size var.
15252
15253 * src/uniqstr.c (uniqstr_new, uniqstr_assert): Use str, not s, for
15254 char * var.
15255 (uniqstr_print, uniqst_print_processor): Use ustr, not s, for
15256 uniqstr var.
15257 * src/uniqstr.h: Likewise.
15258
15259 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
15260 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
15261 get_node_alignment_str, get_arrow_mode_str, get_crossing_type_str,
15262 get_view_str, get_linestyle_str, get_arrowstyle_str): Rename
15263 param to have same name as that of enum, so that we don't use
15264 "s" to stand for a non-state.
15265
15266 2003-02-02 Akim Demaille <akim@epita.fr>
15267
15268 * src/scan-skel.l: Scan more than one inert character per yylex
15269 invocation.
15270
15271 2003-02-01 Paul Eggert <eggert@twinsun.com>
15272
15273 Version 1.875a.
15274
15275 * po/LINGUAS: Add ms.
15276
15277 2003-01-30 Akim Demaille <akim@epita.fr>
15278
15279 * doc/Makefile.am (CLEANFILES): Add bison.fns for distcheck.
15280
15281 2003-01-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15282
15283 * tests/cxx-type.at: Correct apparent typo in Bison input: $$ instead
15284 of $1.
15285
15286 Changes in response to error report by S. Eken: GLR mode does not
15287 handle negative $ indices or $ indices in embedded rules correctly.
15288 See <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00076.html>.
15289
15290 * data/glr.c (b4_rhs_value): Change to use YYFILL macro.
15291 (b4_rhs_location): Ditto.
15292 (yyfill): New function to copy from stack tree into array
15293 incrementally.
15294 (yyuserAction): Modify to allow incremental move of semantic values
15295 to rhs array when in GLR mode.
15296 Define YYFILL to use in user-defined actions to fill semantic array
15297 as needed.
15298 Remove dummy use of yystack, as there is now a guaranteed use.
15299 (yydoAction): Modify to allow incremental move of semantic values
15300 to rhs array when in GLR mode.
15301 (yyresolveAction): Ditto.
15302 (yyglrShiftDefer): Update comment.
15303 (yyresolveStates): Use X == NULL for pointers, not !X.
15304 (yyglrReduce): Ditto.
15305 (yydoAction): Ditto
15306
15307 * tests/glr-regr1.at: Rename to ...
15308 * tests/glr-regression.at: Add new regression test for the problems
15309 described above (adapted from S. Eken).
15310 Update copyright notice.
15311 * tests/testsuite.at: Rename glr-regr1.at to glr-regression.at.
15312 * tests/Makefile.am: Ditto.
15313
15314 2003-01-28 Paul Eggert <eggert@twinsun.com>
15315
15316 * data/lalr1.cc: Do not use @output_header_name@ unless
15317 b4_defines_flag is set. This fixes two bugs reported by
15318 Tim Van Holder in
15319 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00071.html>
15320 and <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00073.html>.
15321
15322 2003-01-21 Paul Eggert <eggert@twinsun.com>
15323
15324 * data/yacc.c (YYERROR): Move code from yyerrlab1 to here, so that
15325 we don't need to worry about yyerrlab1 being reported as an
15326 "unused label" by non-GCC C compilers. The downside is that if
15327 locations are used then a couple of statements are duplicated each
15328 time YYERROR is invoked, but the upside is that the warnings
15329 should vanish.
15330 (yyerrlab1): Move code to YERROR.
15331 (yyerrlab2): Remove. Change uses back to yyerrlab1.
15332 This reverts some of the 2002-12-27 change.
15333
15334 2003-01-17 Paul Eggert <eggert@twinsun.com>
15335
15336 * src/output.c (symbol_printers_output): Fix typo that led
15337 to core dump. Problem reported by Antonio Rus in
15338 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00058.html>.
15339
15340 2003-01-13 Akim Demaille <akim@epita.fr>,
15341 Quoc Peyrot <chojin@lrde.epita.fr>,
15342 Robert Anisko <anisko_r@lrde.epita.fr>
15343
15344 * data/lalr1.cc (parse::yyerrlab1): When popping the stack, stop
15345 when the stacks contain one element, as the loop would otherwise
15346 free the last state, and then use the top state (the one we just
15347 popped). This means that the initial elements will not be freed
15348 explicitly, as is the case in yacc.c; it is not a problem, as
15349 these elements have fake values.
15350
15351 2003-01-11 Paul Eggert <eggert@twinsun.com>
15352
15353 * NEWS: %expect-violations are now just warnings, reverting
15354 to Bison 1.30 and 1.75 behavior. This fixes the GCC 3.2
15355 bootstrapping problem reported by Matthias Klose; see
15356 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00053.html>.
15357 * src/conflicts.c (conflicts_print): Likewise.
15358 * tests/conflicts.at (%expect not enough, %expect too much,
15359 %expect with reduce conflicts): Likewise.
15360 * doc/bison.texinfo (Expect Decl): Document this. Also mention
15361 that the warning is enabled if the number of conflicts changes
15362 (not necessarily increases).
15363
15364 * src/getargs.c (version): Update copyright year.
15365
15366 2003-01-09 Akim Demaille <akim@epita.fr>
15367
15368 * src/Makefile.am, lib/Makefile.am: Use $(VAR) instead of @VAR@.
15369
15370 2003-01-08 Paul Eggert <eggert@twinsun.com>
15371
15372 * Makefile.maint (WGETFLAGS):
15373 New macro, containing "-C off" to disable proxy caches.
15374 All uses of $(WGET) changed to $(WGET) $(WGETFLAGS).
15375 (rel-check): Use $(WGET) instead of wget.
15376
15377 2003-01-06 Paul Eggert <eggert@twinsun.com>
15378
15379 * doc/bison.texinfo (Generalized LR Parsing): Add a reference to
15380 the GLR paper of Scott, Johnstone and Hussain.
15381
15382 2003-01-04 Paul Eggert <eggert@twinsun.com>
15383
15384 * configure.ac (AC_ARG_ENABLE): Add --disable-yacc.
15385 (YACC_SCRIPT, YACC_LIBRARY): New vars to AC_SUBST.
15386 * lib/Makefile.am (lib_LIBRARIES): liby.a -> @YACC_LIBRARY@.
15387 (EXTRA_LIBRARIES): New var, for liby.a.
15388 * src/Makefile.am (bin_SCRIPTS): yacc -> @YACC_SCRIPT@.
15389 (EXTRA_SCRIPTS): New var, for yacc.
15390
15391 * data/yacc.c (yyerrlab1): Omit attribute if __cplusplus is defined,
15392 since GNU C++ (as of 3.2.1) does not allow attributes on labels.
15393 Problem reported by Nelson H. F. Beebe.
15394
15395 2003-01-03 Paul Eggert <eggert@twinsun.com>
15396
15397 * lib/obstack.h (__INT_TO_PTR) [__STDC__]: Cast result to
15398 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
15399 when compiling Bison 1.875's `bitset bset = obstack_alloc
15400 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
15401
15402 * src/scan-skel.l (QPUTS): Omit redundant `;' from macro definition.
15403 ([^@\n]): Renamed from [^@\n]+ so that the token buffer does not
15404 grow to a huge size with typical invocation.
15405
15406 * lib/hash.c (_Bool, bool, false, true, __bool_true_false_are_defined):
15407 Use the pattern recommended by Autoconf 2.57, except also protect
15408 against double-definition.
15409 * src/system.h: Likewise.
15410 Portability issues reported by Nelson H. F. Beebe.
15411
15412 * data/glr.c (yybool): Renamed from bool, to avoid collisions in C.
15413 All uses changed. Provide a definition in both C and C++.
15414 (yytrue, yyfalse): Define even if defined (__cplusplus).
15415
15416 * lib/bitset_stats.c (bitset_stats_list): Remove unused var.
15417 Reported by Nelson H. F. Beebe.
15418
15419 * src/scan-skel.l ("@oline@"): Output lineno+1, not lineno.
15420
15421 2003-01-02 Paul Eggert <eggert@twinsun.com>
15422
15423 * data/yacc.c (yyerrlab1): Append `;' after attribute, to
15424 pacify the buggy "smart preprocessor" in MacOS 10.2.3.
15425 Bug reported by Nelson H. F. Beebe.
15426
15427 2003-01-01 Paul Eggert <eggert@twinsun.com>
15428
15429 * Version 1.875.
15430
15431 2002-12-30 Paul Eggert <eggert@twinsun.com>
15432
15433 * src/scan-gram.l (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>","):
15434 Moved here from...
15435 (<INITIAL>","): Here. This causes stray "," to be treated
15436 more uniformly.
15437
15438 * src/scan-gram.l (<SC_BRACED_CODE>"}"): Output ";" before the
15439 last brace in braced code when not in Yacc mode, for compatibility
15440 with Bison 1.35. This resurrects the 2001-12-15 patch to
15441 src/reader.c.
15442
15443 * src/reader.h (YYDECL): Use YYSTYPE, not its deprecated alias
15444 yystype. This follows up the 2002-12-24 YYSTYPE bug fix.
15445
15446 2002-12-28 Paul Eggert <eggert@twinsun.com>
15447
15448 * src/symtab.c (symbol_make_alias): Set type of SYMVAL to be
15449 that of SYM's type. This fixes Debian bug 168069, reported by
15450 Thomas Olsson.
15451
15452 2002-12-28 Paul Eggert <eggert@twinsun.com>
15453
15454 Version 1.75f.
15455
15456 Switch back to the Yacc style of conflict reports, undoing some
15457 of the 2002-07-30 change.
15458 * doc/bison.texinfo (Understanding): Use Yacc style for
15459 conflict reports. Also, use new way of locating rules.
15460 * src/conflicts.c (conflict_report):
15461 Renamed from conflict_report_yacc, removing the old
15462 'conflict_report'. Translate the entire conflict report at once,
15463 so that we don't assume that "," has the same interpretation in
15464 all languages.
15465 (conflicts_output): Use Yacc-style conflict report for each state,
15466 instead of our more-complicated style.
15467 (conflicts_print): Use Yacc-style conflict report, except print
15468 the input file name when not emulating Yacc.
15469 * tests/conflicts.at (Unresolved SR Conflicts, Defaulted
15470 Conflicted Reduction, %expect not enough, %expect too much,
15471 %expect with reduce conflicts): Switch to Yacc-style conflict reports.
15472 * tests/existing.at (GNU Cim Grammar): Likewise.
15473 * tests/glr-regr1.at (Badly Collapsed GLR States): Likewise.
15474
15475 * src/complain.c (warn_at, warn, complain_at, complain, fatal_at,
15476 fatal): Don't invoke fflush; it's not needed and it might even be
15477 harmful for stdout, as stdout might not be open.
15478 * src/reduce.c (reduce_print): Likewise.
15479
15480 2002-12-27 Paul Eggert <eggert@twinsun.com>
15481
15482 Fix a bug where error locations were not being recorded correctly.
15483 This problem was originally reported by Paul Hilfinger in
15484 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00086.html>.
15485
15486 * data/yacc.c (yyparse): New local var yylerrsp, to record the
15487 top of the location stack's error locations.
15488 (yyerrlab): Set it. When discarding a token, push its location
15489 onto yylerrsp so that we don't lose track of the error's end.
15490 (yyerrlab1): Now is only the target of YYERROR, so that we can
15491 properly record the location of the action that failed. For GCC
15492 2.93 and later, insert an __attribute__ ((__unused__)) to avoid
15493 GCC warning about yyerrlab1 being unused if YYERROR is unused.
15494 (yyerrlab2): New label, which yyerrlab now falls through to.
15495 Compute the error's location by applying YYLLOC_DEFAULT to
15496 the locations of all the symbols that went into the error.
15497 * doc/bison.texinfo (Location Default Action): Mention that
15498 YYLLOC_DEFAULT is also invoked for syntax errors.
15499 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
15500 Error locations include the locations of all the tokens that were
15501 discarded, not just the last token.
15502
15503 2002-12-26 Paul Eggert <eggert@twinsun.com>
15504
15505 * src/files.c: Include quote.h.
15506 (compute_output_file_names): Warn if we detect conflicting
15507 outputs to the same file. This should catch the misunderstanding
15508 exemplified by Debian Bug 165349, reported by Bruce Stephens..
15509
15510 * src/conflicts.c (conflicts_print): If the user specifies
15511 "%expect N", report an error if there are any reduce/reduce
15512 conflicts. This is what the manual says should happen.
15513 This fixes Debian bug 130890, reported by Anthony DeRobertis.
15514 * tests/conflicts.at (%expect with reduce conflicts): New test.
15515
15516 Don't use m4_include on relative file names, as it doesn't work as
15517 desired if there happens to be a file with that name under ".".
15518
15519 * m4sugar/version.m4: Remove; it was included but it wasn't used.
15520 * data/Makefile.am (dist_m4sugar_DATA): Remove m4sugar/version.m4.
15521 * data/m4sugar/m4sugar.m4: Don't include m4sugar/version.m4.
15522 * data/glr.c, data/lalr1.cc, data/yacc.c: Don't include c.m4.
15523 * src/output.c (output_skeleton): Use full path names when
15524 specifying a file to include; don't rely on include path, as
15525 it's unreliable when the working file contains a file with
15526 that name.
15527
15528 2002-12-25 Paul Eggert <eggert@twinsun.com>
15529
15530 Remove obsolete references to bison.simple and bison.hairy.
15531 Problem mentioned by Aubin Mahe in
15532 <http://lists.gnu.org/archive/html/help-bison/2002-12/msg00010.html>.
15533 * data/glr.c: Comment fix.
15534 * doc/bison.1: Remove references. Also, mention "yacc".
15535
15536 * src/getargs.c (getargs) [MSDOS]: Don't assume optarg != NULL
15537 with -g option.
15538
15539 * src/parse-gram.y (declaration): Use enum "report_states" rather
15540 than its numeric value 1.
15541
15542 * src/scan-skel.l ("@output ".*\n): Close any old yyout before
15543 opening a new one. This fixes Debian bug 165349, reported by
15544 Bruce Stephens.
15545
15546 2002-12-24 Paul Eggert <eggert@twinsun.com>
15547
15548 Version 1.75e.
15549
15550 * Makefile.maint (cvs-update): Don't assume that the shell
15551 supports $(...), as Solaris sh doesn't.
15552
15553 * src/parse-gram.y (lloc_default): Remove test for empty
15554 nonterminals at the end, since it didn't change the result.
15555
15556 2002-12-24 Paul Eggert <eggert@twinsun.com>
15557
15558 If the user does not define YYSTYPE as a macro, Bison now declares it
15559 using typedef instead of defining it as a macro. POSIX requires this.
15560 For consistency, YYLTYPE is also declared instead of defined.
15561
15562 %union directives can now have a tag before the `{', e.g., the
15563 directive `%union foo {...}' now generates the C code
15564 `typedef union foo { ... } YYSTYPE;'; this is for Yacc compatibility.
15565 The default union tag is `YYSTYPE', for compatibility with Solaris 9
15566 Yacc. For consistency, YYLTYPE's struct tag is now `YYLTYPE'
15567 instead of `yyltype'.
15568
15569 `yystype' and `yyltype' are now obsolescent macros instead of being
15570 typedefs or tags; they are no longer documented and will be
15571 withdrawn in a future release.
15572
15573 * data/glr.c (b4_location_type): Remove.
15574 (YYSTYPE): Renamed from yystype.
15575 (YYSTYPE_IS_DECLARED): New macro, used to prevent double-typedef.
15576 (struct YYLTYPE): Renamed from struct yyltype.
15577 (YYLTYPE): Renamed from yyltype.
15578 (yyltype, yystype): New (and obsolescent) macros,
15579 for backward compatibility.
15580 * data/yacc.c: Likewise.
15581
15582 * data/yacc.c (YYSTYPE): Declare as union YYSTYPE if the user
15583 does not specify a union tag. This is for compatibility with
15584 Solaris 9 yacc.
15585
15586 * src/parse-gram.y (add_param): 2nd arg is now char * not char
15587 const *, since it is now modified by stripping surrounding { }.
15588 (current_braced_code): Remove.
15589 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_UNION,
15590 PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Change names to include
15591 trailing " {...}". Now of type <chars>.
15592 (grammar_declaration): Adjust to bundled tokens.
15593 (code_content): Remove; stripping is now done by add_param.
15594 (print_token_value): Print contents of bundled tokens.
15595 (token_name): New function.
15596
15597 * src/reader.h (braced_code, current_braced_code): Remove.
15598 (token_name): New decl.
15599
15600 * src/scan-gram.l (handle_dollar, handle_at): Now takes int
15601 token_type, not braced_code code_kind. All uses changed.
15602 (SC_PRE_CODE): New state, for scanning after a keyword that
15603 has (or usually has) an immediately-following braced code.
15604 (token_type): New local var, to keep track of which token type
15605 to return when scanning braced code.
15606 (<INITIAL>"%destructor", <INITIAL>"%lex-param",
15607 <INITIAL>"%parse-param", <INITIAL>"%printer",
15608 <INITIAL>"%union"): Set token type and BEGIN SC_PRE_CODE
15609 instead of returning a token type immediately.
15610 (<INITIAL>"{"): Set token type.
15611 (<SC_BRACED_CODE>"}"): Use it.
15612 (handle_action_dollar, handle_action_at): Now returns bool
15613 indicating success. Fail if ! current_rule; this prevents a core dump.
15614 (handle_symbol_code_dollar, handle_symbol_code_at):
15615 Remove; merge body into caller.
15616 (handle_dollar, handle_at): Complain in invalid contexts.
15617
15618 * NEWS, doc/bison.texinfo: Document the above.
15619 * NEWS: Fix years and program names in copyright notice.
15620
15621 2002-12-17 Paul Eggert <eggert@twinsun.com>
15622
15623 * NEWS, doc/bison.texinfo (Parser Function, Pure Calling, Error
15624 Reporting, Table of Symbols): Omit mentions of %lex-param and
15625 %parse-param from the documentation for now.
15626
15627 2002-12-15 Paul Eggert <eggert@twinsun.com>
15628
15629 Undo most of the 2002-11-12 yychar -> yytoken patch, as it broke
15630 GCC 3.2.1 (which depends on yychar == YYEMPTY when there is no
15631 lookahead symbol, and which sets yychar in parser actions) and it
15632 disagreed with the Bison documentation. Bug
15633 reported by Andrew Walrond.
15634
15635 * data/yacc.c (YYTRANSLATE): Don't check for negative argument,
15636 as the caller now does that.
15637 (yyclearin, YYBACKUP, yyparse): Use yychar, not yytoken.
15638 (YYEMPTY): Parenthesize right hand side, since others use it.
15639 (yyparse): Don't assume that our generated code is the only code
15640 that sets yychar.
15641
15642 2002-12-13 Paul Eggert <eggert@twinsun.com>
15643
15644 Version 1.75d.
15645
15646 POSIX requires a "yacc" command.
15647 * src/Makefile.am (bin_SCRIPTS): New macro, for yacc.
15648 (MOSTLYCLEANFILES): Add yacc.
15649 (yacc): New rule.
15650 * doc/bison.texinfo (Invocation, Bison Options): Mention yacc
15651 as an alias for bison y.
15652
15653 * po/LINGUAS: Add da.
15654
15655 * src/getargs.c (__GNU_LIBRARY__) [lint]: Define to work around
15656 problem with latest <getopt.h>.
15657 (HACK_FOR___GNU_LIBRARY___PROTOTYPE): New macro.
15658
15659 * doc/fdl.texi: Upgrade to 1.2.
15660 * lib/alloca.c, lib/error.c, lib/getopt.c, lib/getopt.h
15661 lib/getopt1.c, lib/gettext.h, lib/memrchr.c, lib/obstack.c,
15662 lib/obstack.h, lib/strnlen.c, lib/unlocked-io.h: Sync with
15663 gnulib.
15664 * config/install-sh: Sync with autotools.
15665
15666 Fix a bad interaction with flex 2.5.23 reported by Bruce Lilly in
15667 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
15668 * data/yacc.c (YYLTYPE, struct yyltype): Do not define unless
15669 locations are requested.
15670 (union yyalloc): Do not depend on YYLTYPE_IS_TRIVIAL unless
15671 locations are requested.
15672
15673 2002-12-12 Paul Eggert <eggert@twinsun.com>
15674
15675 Remove unportable casts and storage allocation tricks.
15676 While we're at it, remove almost all casts, since they
15677 usually aren't needed and are a sign of trouble.
15678
15679 * configure.ac (AC_CHECK_TYPES): Check for uintptr_t.
15680
15681 * src/derives.c (derives_compute): Do not subtract NTOKENS from
15682 the pointer DSET returned by malloc; this isn't portable.
15683 Instead, always use DSET[i - NTOKENS] rather than DSET[i].
15684 Similarly for DERIVES.
15685 * src/lalr.c (set_goto_map): Likewise, for GOTO_MAP and TEMP_MAP.
15686 * src/nullable.c (nullable_compute): Likewise, for RSETS and NULLABLE.
15687 * src/reduce.c (reduce_grammar_tables): Likewise, for nontermmap
15688
15689 * src/derives.c (derives_compute): Do not bother invoking
15690 int_of_rule_number, since rule numbers are integers.
15691
15692 * src/files.c (concat2, tr, compute_base_name): Use xmalloc (N)
15693 rather than XMALLOC (char, N).
15694
15695 * src/files.c (filename_split): Rewrite to avoid cast.
15696
15697 * src/gram.h (symbol_number_as_item_number,
15698 item_number_as_symbol_number, rule_number_as_item_number,
15699 item_number_as_rule_number):
15700 Now inline functions rather than macros, to avoid casts.
15701 * src/state.h (state_number_as_int): Likewise.
15702 * src/tables.c (state_number_to_vector_number,
15703 symbol_number_to_vector_number): Likewise.
15704
15705 * src/gram.h (int_of_rule_number): Remove; no longer used.
15706
15707 * src/lalr.c (add_lookback_edge): Use malloc rather than calloc,
15708 since the resulting storage is always stored into.
15709
15710 * src/main.c (alloca) [C_ALLOCA]: Add decl here, the only place
15711 where it's needed.
15712
15713 * src/muscle_tab.c (muscle_m4_output):
15714 Now inline. Return bool, not int.
15715 * src/state.c (state_compare): Likewise.
15716 * src/symtab.c (symbol_check_defined,
15717 symbol_check_alias_consistency, symbol_pack, symbol_translation,
15718 hash_compare_symbol, hash_symbol):
15719 Likewise.
15720 * src/uniqstr.c (uniqstr_print): Likewise.
15721 * src/muscle_tab.c (muscle_m4_output_processor):
15722 New function, to avoid casts.
15723 * src/state.c (state_comparator, stage_hasher): Likewise.
15724 * src/symtab.c (symbol_check_defined_processor,
15725 symbol_check_alias_consistency_processor, symbol_pack_processor,
15726 symbol_translation_processor, hash_symbol_comparator,
15727 hash_symbol_hasher): Likewise.
15728 * src/uniqstr.c (uniqstr_print_processor): Likewise.
15729 * src/muscle_tab.c (muscles_m4_output):
15730 Use new functions instead of casting old functions unportably.
15731 * src/state.c (state_hash_new): Likewise.
15732 * src/symtab.c (symbols_new, symbols_do, symbols_check_defined,
15733 symbols_token_translations_init):
15734 Likewise.
15735 * src/uniqstr.c (uniqstrs_new, hash_initialize, uniqstrs_do): Likewise.
15736
15737 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): Use long local
15738 var instead of casting to long, to avoid casts.
15739 (prepare_states): Use MALLOC rather than alloca, so that we don't
15740 have to worry about alloca.
15741 * src/state.c (state_hash_lookup): Likewise.
15742
15743 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>"'"): Use unsigned char
15744 local var instead of casting to unsigned char, to avoid casts.
15745
15746 * src/state.c (TRANSITIONS_ALLOC, ERRS_ALLOC, REDUCTIONS_ALLOC,
15747 STATE_ALLOC): Remove.
15748 (transitions_new, errs_new, reductions_new, state_new): Use malloc
15749 rather than calloc, and use offsetof to avoid allocating slightly
15750 too much storage.
15751 (state_new): Initialize all members.
15752
15753 * src/state.c (state_hash): Use unsigned accumulator, not signed.
15754
15755 * src/symtab.c (symbol_free): Remove; unused.
15756 (symbol_get): Remove cast in lhs of assignment.
15757 (symbols_do): Now static. Accept generic arguments, not
15758 hashing-related ones.
15759
15760 * src/symtab.h: (NUMBER_UNDEFINED): Remove unnecessary cast.
15761 (symbol_processor): Remove.
15762 (symbols_do): Remove decl; now static.
15763
15764 * src/system.h (alloca): Remove; decl no longer needed.
15765 (<stddef.h>): Include, for offsetof.
15766 (<inttypes.>, <stdint.h>): Include if available.
15767 (uintptr_t): New type, if system lacks it.
15768 (CALLOC, MALLOC, REALLOC): New macros.
15769 All uses of XCALLOC, XMALLOC, and XREALLOC changed to use these
15770 new macros.
15771
15772 * src/tables.c (table_size): Now int, to pacify GCC.
15773 (table_grow, table_ninf_remap): Use signed table size.
15774 (save_row): Don't bother initializing locals when not needed.
15775 (default_goto, goto_actions, pack_vector): Remove unnecessary casts.
15776 * src/uniqstr.c (hash_compare_uniqstr): Likewise.
15777
15778 * src/vcg.h: Correct misspellings.
15779
15780 * src/vcg_defaults.h (G_CMAX): Now INT_MAX.
15781
15782
15783 * src/getargs.c (getargs): Don't assume EOF == -1.
15784
15785 2002-12-09 Paul Eggert <eggert@twinsun.com>
15786
15787 Change identifier spellings to avoid collisions with names
15788 that are reserved by POSIX.
15789
15790 Don't use names ending in _t, since POSIX reserves them.
15791 For consistency, remove _e and _s endings -- they're weren't
15792 needed to remove ambiguity. All uses changed.
15793 * src/uniqstr.h (uniqstr): Renamed from uniqstr_t, which in
15794 turn was just renamed from struniq_t.
15795 * src/uniqstr.c (uniqstr_processor): Renamed from struniq_processor,
15796 which in turn was just renamed from struniq_processor_t.
15797 (hash_compare_uniqstr): Renamed from hash_compare_struniq, which
15798 in turn was renamed from hash_compare_struniq_t.
15799 * src/LR0.c (struct state_list): Renamed from struct state_list_s.
15800 (state_list): Renamed from state_list_t.
15801 * src/assoc.h (assoc): Renamed from assoc_t.
15802 * src/conflicts.c (enum conflict_resolution): Renamed from
15803 enum conflict_resolution_e.
15804 * src/derives.c (struct rule_list): Renamed from struct rule_list_s.
15805 (rule_list): Renamed from rule_list_t.
15806 * src/getargs.h (enum trace): Renamed from enum trace_e.
15807 (enum report): Renamed from enum report_e.
15808 * src/gram.h (item_number): Renamed from item_number_t.
15809 (rule_number): Renamed from rule_number_t.
15810 (struct rule_s): Remove the "rule_s" part; not used.
15811 (rule): Renamed from rule_t.
15812 (rule_filter): Renamed from rule_filter_t.
15813 * src/lalr.c (struct goto_list): Renamed from struct goto_list_s.
15814 (goto_list): Renamed from goto_list_t.
15815 * src/lalr.h (goto_number): Renamed from goto_number_t.
15816 * src/location.h (location): Renamed from location_t.
15817 * src/muscle_tab.c (muscle_entry): Renamed from muscle_entry_t,
15818 and moved here from:
15819 * src/muscle_tab.h (muscle_entry_t): here.
15820 * src/nullable.c (struct rule_list): Renamed from struct rule_list_s.
15821 (rule_list): Renamed from rule_list_t.
15822 * src/print_graph.c (static_graph): Renamed from graph.
15823 * src/reader.h (braced_code): Renamed from braced_code_t.
15824 Remove brace_code_e tag.
15825 * src/relation.h (relation_node): Renamed from relation_node_t.
15826 (relation_nodes): Renamed from relation_nodes_t.
15827 (relation): Renamed from relation_t.
15828 * src/state.h (state_number): Renamed from state_number_t.
15829 (struct state): Renamed from struct state_s.
15830 (state): Renamed from state_t.
15831 (transitions): Renamed from transitions_t. Unused (and
15832 misspelled) transtion_s tag removed.
15833 (errs): Renamed from errs_t. Unused errs_s tag removed.
15834 (reductions): Renamed from reductions_t. Unused tag
15835 reductions_s removed.
15836 * src/symlist.h (symbol_list): Renamed from symbol_list_t.
15837 (struct symbol_list): Renamed from struct symbol_list_s.
15838 * src/symtab.h (symbol_number): Renamed from symbol_number_t.
15839 (struct symbol): Renamed from struct symbol_s.
15840 (symbol): Renamed from symbol_t.
15841 * src/tables.c (vector_number): Renamed from vector_number_t.
15842 (action_number): Renamed from action_t.
15843 * src/tables.h (base_number): Renamed from base_t.
15844 * src/vcg.h (enum color): Renamed from enum color_e.
15845 (enum textmode): Renamed from enum textmode_e.
15846 (enum shape): Renamed from enum shape_e.
15847 (struct colorentry): Renamed from struct colorentry_s.
15848 (struct classname): Renamed from struct classname_s.
15849 (struct infoname): Renamed from struct infoname_s.
15850 (enum layoutalgorithm): Renamed from enum layoutalgorithm_e.
15851 (enum decision): Renamed from enum decision_e.
15852 (enum orientation): Renamed from enum orientation_e.
15853 (enum alignment): Renamed from enum alignment_e.
15854 (enum arrow_mode): Renamed from enum arrow_mode_e.
15855 (enum crossing_type): Renamed from enum crossing_type_e.
15856 (enum view): Renamed from enum view_e.
15857 (struct node): Renamed from struct node_s.
15858 (node): Renamed from node_t.
15859 (enum linestyle): Renamed from enum linestyle_e.
15860 (enum arrowstyle): Renamed from enum arrowstyle_e.
15861 (struct edge): Renamed from struct edge.
15862 (edge): Renamed from edge_t.
15863 (struct graph): Renamed from struct graph_s.
15864 (graph): Renamed from graph_t.
15865 * tests/calc.at (_AT_DATA_CALC_Y, Simple LALR Calculator):
15866 Rename value_t -> value.
15867 * tests/input.at (Torturing the Scanner): Rename value_t -> value,
15868 value_t_as_yystype -> value_as_yystype.
15869
15870 Don't include <errno.h> in the mainstream code, since it
15871 reserves E[A-Z0-9]* and we want to use symbols like 'EQUALS'.
15872 * lib/get-errno.c, lib/get-errno.h: New files.
15873 * lib/Makefile.am (libbison_a_SOURCES): Add get-errno.h,
15874 get-errno.c.
15875 * src/files.c (xfopen, xfclose): Use get_errno instead of errno.
15876 * src/output.c (output_skeleton): Likewise.
15877 * src/scan-gram.l (<INITIAL>{int}): Use set_errno and get_errno
15878 instead of errno.
15879 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>\\x[0-9abcdefABCDEF]+):
15880 Likewise.
15881 (handle_action_dollar, handle_action_at): Likewise.
15882 * src/system.h: Do not include <errno.h>.
15883 (TAB_EXT): Renamed from EXT_TAB.
15884 (OUTPUT_EXT): Renamed from EXT_OUTPUT.
15885
15886 Avoid str[a-z]*, since <string.h> reserves that name space.
15887 Change all instances of "struniq" in names to "uniqstr", and
15888 likewise for "STRUNIQ" and "UNIQSTR".
15889 * src/uniqstr.c: Renamed from src/struniq.c.
15890 * src/uniqstr.h: Renamed from src/struniq.h.
15891 * src/Makefile.am (bison_SOURCES): Adjust to these renamings.
15892 * src/files.c (strsuffix): Remove; unused.
15893 (concat2): Renamed from stringappend. Now static.
15894 * src/files.h (strsuffix, stringappend): Remove; unused.
15895 * src/parse-gram.y (<chars>): Renamed from <string>.
15896 (<uniqstr>): Renamed from <struniq>.
15897 * src/scan-gram.l (obstack_for_string): Renamed from string_obstack.
15898 * src/vcg.h (struct node_s.expand): Renamed from struct node_s.stretch.
15899 (struct graph_s.expand): Renamed from struct graph_s.stretch.
15900 * src/vcg_defaults.h (G_EXPAND): Renamed from G_STRETCH.
15901 (G_LONG_STRAIGHT_PHASE): Renamed from G_STRAIGHT_PHASE.
15902 (N_EXPAND): Renamed from N_STRETCH.
15903
15904 Avoid *_MAX and *_MIN, since <limits.h> reserves that name space.
15905 * data/yacc.c (YYSTACK_GAP_MAXIMUM): Renamed from YYSTACK_GAP_MAX.
15906 * src/gram.h (ITEM_NUMBER_MAX, ITEM_NUMBER_MIN, RULE_NUMBER_MAX):
15907 Remove; unused.
15908 * src/lalr.h (GOTO_NUMBER_MAXIMUM): Renamed from GOTO_NUMBER_MAX.
15909 * src/state.h (STATE_NUMBER_MAXIMUM): Renamed from STATE_NUMBER_MAX.
15910 * src/symtab.h (SYMBOL_NUMBER_MAXIMUM): Renamed from SYMBOL_NUMBER_MAX.
15911 * src/tables.c (VECTOR_NUMBER_MAX, VECTOR_NUMBER_MIN): Remove; unused.
15912 (BASE_MAXIMUM): Renamed from BASE_MAX.
15913 (BASE_MINIMUM): Renamed from BASE_MIN.
15914 (ACTION_MAX): Remove; unused.
15915 (ACTION_NUMBER_MINIMUM): Renamed from ACTION_MIN.
15916 Unnecessary casts removed from above defines.
15917
15918
15919 Fix misspelling in names.
15920 * src/vcg.h (enum_alignment_e): Renamed from enum_alignement_e.
15921 * src/vcg_defaults.h (G_NODE_ALIGNMENT): Renamed from
15922 G_NODE_ALIGNEMENT.
15923
15924
15925 * lib/timevar.c (timevar_report): Renamed from time_report,
15926 for consistency with other names.
15927 * lib/timevar.h (timevar_report): New decl.
15928 * src/system.h (time_report): Remove; decl is now in lib/timevar.h.
15929
15930
15931 Sort include-file uses.
15932
15933 Reorder all include files under src to be in the order "system.h".
15934 then the ../lib include files in angle brackets (alphabetized),
15935 then the . include files in double-quotes (alphabetized). Fix
15936 dependency breakages encountered in this process, as follows:
15937 * src/closure.h, src/derives.h, src/state.h: Include "gram.h".
15938 * src/complain.c: Don't include stdlib.h, string.h _LIBC stuff.
15939 * src/state.h: Include "symtab.h".
15940
15941 2002-12-08 Paul Eggert <eggert@twinsun.com>
15942
15943 * data/glr.c, data/lalr1.cc, data/yacc.c: Do not use __file__,
15944 since this causes problems when __file__ contains character
15945 sequences like "@" that are treated specially by src/scan-skel.l.
15946 Instead, just use the file's basename. This fixes the bug
15947 reported by Martin Mokrejs in
15948 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00007.html>.
15949
15950 2002-12-06 Paul Eggert <eggert@twinsun.com>
15951
15952 Add support for rules that do not have trailing semicolons, as
15953 POSIX requires. Improve the quality of locations in Bison
15954 diagnostics.
15955
15956 * src/location.c: Include <quotearg.h>.
15957 (empty_location): Now const.
15958 (location_print): New function. Follow the recommendation of the
15959 GNU Coding Standards for locations that span file boundaries.
15960 * src/location.h: Do not include <quotearg.h>; no longer needed.
15961 (boundary): New type.
15962 (location_t): Use it. This allows locations to span file boundaries.
15963 All member uses changed: file -> start.file or end.file (as needed),
15964 first_line -> start.line, first_column -> start.column,
15965 last_line -> end.line, last_column -> end.column.
15966 (equal_boundaries): New function.
15967 (LOCATION_RESET, LOCATION_STEP): Remove.
15968 (LOCATION_PRINT): Remove. All callers changed to use location_print.
15969 (empty_location): Now const.
15970 (location_print): New decl.
15971 * src/parse-gram.y (lloc_default): New function, which handles
15972 empty locations more accurately.
15973 (YYLLOC_DEFAULT): Use it.
15974 (%token COLON): Remove.
15975 (%token ID_COLON): New token.
15976 (rules): Use it.
15977 (declarations, rules): Remove trailing semicolon.
15978 (declaration, rules_or_grammar_declaration):
15979 Allow empty (";") declaration.
15980 (symbol_def): Remove empty actions; no longer needed.
15981 (rules_or_grammar_declaration): Remove trailing semicolon.
15982 (semi_colon.opt): Remove.
15983 * src/reader.h: Include location.h.
15984 (scanner_cursor): New decl.
15985 * src/reduce.c (nonterminals_reduce): Use warn_at rather than
15986 rolling our own.
15987 * src/scan-gram.l (YY_USER_INIT): Initialize scanner_cursor instead
15988 of *loc.
15989 (STEP): Remove. No longer needed, now that adjust_location does
15990 the work. All uses removed.
15991 (scanner_cursor): New var.
15992 (adjust_location): Renamed from extend_location. It now sets
15993 *loc and adjusts the scanner cursor. All uses changed.
15994 Don't bother testing for CR.
15995 (handle_syncline): Remove location arg; now updates scanner cursor.
15996 All callers changed.
15997 (unexpected_end_of_file): Now accepts start boundary of token or
15998 comment, not location. All callers changed. Update scanner cursor,
15999 not the location.
16000 (SC_AFTER_IDENTIFIER): New state.
16001 (context_state): Renamed from c_context. All uses changed.
16002 (id_loc, code_start, token_start): New local vars.
16003 (<INITIAL,SC_AFTER_IDENTIFIER>): New initial context. Move all
16004 processing of Yacc white space and equivalents here.
16005 (<INITIAL>{id}): Save id_loc. Begin state SC_AFTER_IDENTIFIER
16006 instead of returning ID immediately, since we need to search for
16007 a subsequent colon.
16008 (<INITIAL>"'", "\""): Save token_start.
16009 (<INITIAL>"%{", "{", "%%"): Save code_start.
16010 (<SC_AFTER_IDENTIFIER>): New state, looking for a colon.
16011 (<SC_YACC_COMMENT>, <SC_COMMENT>, <SC_LINE_COMMENT>):
16012 BEGIN context_state at end, not INITIAL.
16013 (<SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'",
16014 <SC_BRACED_CODE>"}", <SC_PROLOGUE>"%}", <SC_EPILOGUE><<EOF>>):
16015 Return correct token start.
16016 (<SC_BRACED_CODE,SC_PROLOGUE,SC_EPILOGUE>): Save start boundary when
16017 the start of a character, string or multiline comment is found.
16018 * tests/conflicts.at (S/R in initial, Defaulted Conflicted
16019 Reduction): Adjust reported locations to match the more-precise
16020 results now expected.
16021 * tests/input.at (Invalid $n, Invalid @n, Type Clashes): Likewise.
16022 * tests/reduce.at (Useless Rules, Reduced Automaton,
16023 Underivable Rules): Likewise.
16024 * tests/regression.at (Invalid inputs): No longer `expecting ";"
16025 or "|"' now that so many other tokens are allowed by the new grammar.
16026
16027 * src/complain.h (current_file): Remove duplicate decl;
16028 current_file is now owned by files.h.
16029 * src/complain.c, src/scan-gram.l: Include files.h.
16030
16031 2002-12-06 Paul Eggert <eggert@twinsun.com>
16032
16033 * data/glr.c (yy_reduce_print): Don't assume that yyrline[yyrule]
16034 promotes to int; it might be unsigned int.
16035 * data/yacc.c (yy_reduce_print): Likewise.
16036
16037 * doc/bison.texinfo (Table of Symbols): YYERROR_VERBOSE should
16038 be #defined in the prologue, not in the Bison declarations.
16039 This fixes Debian Bug 102878, reported by Shaul Karl.
16040
16041 2002-12-02 Paul Eggert <eggert@twinsun.com>
16042
16043 * configure.ac (AC_REPLACE_FUNCS): Add strtoul.
16044 * lib/strtoul.c: New file, from gnulib.
16045 This fixes a porting bug reported by Peter Klein in
16046 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00000.html>.
16047
16048 2002-11-30 Paul Eggert <eggert@twinsun.com>
16049
16050 * src/scan-gram.l (no_cr_read, extend_location): Move to epilogue,
16051 and put only a forward declaration in the prologue. This is for
16052 consistency with the other scanner helper functions.
16053
16054 Type clashes now generate warnings, not errors, since it
16055 appears that POSIX may allow some grammars with type clashes.
16056 * src/reader.c (grammar_current_rule_check): Warn about
16057 type clashes instead of complaining.
16058 * tests/input.at (Type Clashes): Expect warnings, not complaints.
16059
16060 Add Yacc library, since POSIX requires it.
16061 * doc/bison.texinfo (Yacc Library): New node. Regenerate top menu.
16062 * lib/Makefile.am (lib_LIBRARIES, liby_a_SOURCES): New macros.
16063 * lib/main.c, lib/yyerror.c: New files.
16064
16065 gram_error can be static; it need not be extern.
16066 * src/reader.h (gram_error): Remove decl.
16067 * src/parse-gram.y (gram_error): Now static. Add static decl.
16068 (print_token_value): Omit parameter names from forward decl,
16069 for consistency.
16070
16071 2002-11-29 Paul Eggert <eggert@twinsun.com>
16072
16073 * doc/bison.texinfo: Emphasize that yylex and yyerror must
16074 be declared before being used. E.g., one should typically
16075 declare them in the prologue. Use GNU coding style in examples.
16076 Put "const" consistently after the type it modifies. Mention
16077 that C99 supports "inline". Mention that yyerror traditionally
16078 returns "int".
16079
16080 %parse-param and %lex-param now take just one argument, the
16081 declaration; the argument name is deduced from the declaration.
16082
16083 * doc/bison.texinfo (Parser Function, Pure Calling, Error
16084 Reporting, Table of Symbols): Document this.
16085 * src/parse-gram.y (add_param): New function.
16086 (COMMA): Remove.
16087 (declaration): Implement new rule for %parse-param and %lex-param.
16088 * src/scan-gram.l: "," now elicits a warning, rather than being
16089 a token; this is more compatible with byacc.
16090 * tests/calc.at (Simple LALR Calculator): Adopt new convention.
16091
16092 2002-11-27 Paul Eggert <eggert@twinsun.com>
16093
16094 Rename identifiers to avoid real and potential collisions.
16095
16096 * data/c.m4 (b4_yysymprint_generate): yyout -> yyoutput,
16097 to avoid collision with lex macro described by Bruce Lilly in
16098 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
16099 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
16100 * doc/bison.texinfo (Prologue, Tracing): yyprint -> print_token_value.
16101 * src/parse-gram.y (print_token_value): Renamed from yyprint.
16102 All uses changed.
16103 (YYPARSE_PARAM, YYLEX_PARAM, yycontrol): Remove. All uses changed.
16104 The name "yycontrol" violates the name space rules, and this stuff
16105 wasn't being used anyway.
16106 (input): Remove action; this stuff wasn't being used.
16107 (gram_error): Rename local variable yylloc -> loc.
16108 * src/reader.h (struct gram_control_s, gram_control_t): Remove.
16109 (YY_DECL): Don't use "yy" at start of local variables.
16110 All uses changed, e.g., yylloc -> loc.
16111 * src/scan-gram.l (STEP): Renamed from YY_STEP. All uses changed.
16112 (STRING_GROW): Renamed from YY_OBS_GROW. All uses changed.
16113 (STRING_FINISH): Renamed from YY_OBS_FINISH. All uses changed.
16114 (STRING_FREE): Renamed from YY_OBS_FREE. All uses changed.
16115
16116 * src/parse-gram.y (gram_error): loc is now const *.
16117 * src/reader.h (gram_error): Likewise.
16118
16119 2002-11-24 Paul Eggert <eggert@twinsun.com>
16120
16121 Version 1.75c.
16122
16123 * tests/actions.at (Actions after errors): Use an output format
16124 more similar to that of the Printers and Destructors test.
16125 Test the position of the ';' token too.
16126 (Printers and Destructors): Likewise.
16127 (Printers and Destructors: %glr-parser): Remove for now, to avoid
16128 unnecessarily alarming people when the test fails.
16129
16130 * data/yacc.c (yyerrlab1): Move this label down, so that the
16131 parser does not discard the lookahead token if the user code
16132 invokes YYERROR. This change is required for POSIX conformance.
16133
16134 * lib/error.c: Sync with gnulib.
16135
16136 2002-11-22 Paul Eggert <eggert@twinsun.com>
16137
16138 * lib/quotearg.c, lib/quotearg.h: Sync with gnulib.
16139 * lib/mbswidth.c, lib/mbswidth.h: Likewise.
16140 * lib/xmalloc.c: Likewise.
16141
16142 2002-11-20 Paul Eggert <eggert@twinsun.com>
16143
16144 * lib/argmatch.c, lib/argmatch.h: Sync with gnulib.
16145
16146 2002-11-20 Paul Eggert <eggert@twinsun.com>
16147
16148 Avoid use of <assert.h>, as the GNU Coding Standards hint that one
16149 should use `if (! x) abort ();' rather than `assert (x);', and
16150 anyway it's one less thing to worry about configuring.
16151
16152 * data/glr.c, lib/hash.c, src/system.h: Do not include <assert.h>.
16153 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise,
16154 and replace all instances of assert with abort.
16155 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
16156 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Likewise.
16157
16158 * data/glr.c (yydoAction, yyglrReduce, yysplitStack, yyresolveStates,
16159 yyresolveAction, yyprocessOneStack): Use abort rather than assert.
16160 * lib/hash.c (hash_lookup, hash_get_first, hash_get_next,
16161 hash_find_entry, hash_rehash, hash_insert): Likewise.
16162 * src/conflicts.c (resolve_sr_conflict): Likewise.
16163 * src/lalr.c (set_goto_map, map_goto): Likewise.
16164 * src/nullable.c (nullable_compute): Likewise.
16165 * src/output.c (prepare_rules, token_definitions_output): Likewise.
16166 * src/reader.c (packgram, reader): Likewise.
16167 * src/state.c (state_new, state_free, state_transitions_set,
16168 state_reduction_find): Likewise.
16169 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias,
16170 symbol_pack): Likewise.
16171 * src/tables.c (conflict_row, pack_vector): Likewise.
16172 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
16173 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
16174 get_node_alignement_str, get_arrow_mode_str, get_crossing_type_str,
16175 get_view_str, get_linestyle_str, get_arrowstyle_str): Likewise.
16176
16177 * lib/argmatch.h (ARRAY_CARDINALITY): Do not bother to #undef.
16178 (ARGMATCH_CONSTRAINT): New macro.
16179 (ARGMATCH_ASSERT): Use it.
16180
16181 * src/system.h (verify): New macro.
16182 * src/getargs.c (trace_argmatch, report_argmatch): Use verify
16183 rather than assert.
16184 * src/tables.c (tables_generate): Likewise.
16185
16186 * src/struniq.c (struniq_assert): Now returns void, and aborts
16187 if the assertion is false.
16188 (struniq_assert_p): Remove.
16189 * src/struniq.h: Likewise.
16190
16191 2002-11-18 Paul Eggert <eggert@twinsun.com>
16192
16193 * data/glr.c (yygetLRActions): Replace `yyindex' with
16194 `yytable[yyindex]' to fix typo introduced in my 2002-11-09 patch.
16195 This fixes the regression with Sun ONE Studio 7 cc that I reported in
16196 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00077.html>.
16197
16198 2002-11-18 Akim Demaille <akim@epita.fr>
16199
16200 * doc/bison.texinfo (Tracing): `yyprint' shouldn't prepend a
16201 space.
16202 From Tim Van Holder.
16203
16204 2002-11-17 Paul Eggert <eggert@twinsun.com>
16205
16206 Pacify Sun ONE Studio 7 lint. Also, rename "ParseError"
16207 to "SyntaxError" for consistency with my 2002-11-15 change.
16208
16209 * data/glr.c (YYDPRINTF, YYDSYMPRINT, YYDSYMPRINTF) [!YYDEBUG]: Do
16210 not define to {}, since this breaks the common use of `YYDPRINTF
16211 ((...));' if a single statement is desired (e.g. before `else').
16212 Work around GCC warnings by surrounding corresponding calls with
16213 {} if needed.
16214 (yyhasResolvedValue): Remove unused function.
16215 (yymergeOptionSets, yyresolvStack): Use `continue;' for empty
16216 loop body.
16217 (yyreportSyntaxError): Renamed from yyreportParseError.
16218 (yyrecoverSyntaxError): Renamed from yyrecoverParseError.
16219 All uses changed.
16220 * tests/calc.at (_AT_DATA_CALC_Y): Make vars static instead of
16221 extern when possible. Remove unused initializations.
16222
16223 2002-11-16 Akim Demaille <akim@epita.fr>
16224
16225 Augment the similarity between GLR and LALR traces.
16226
16227 * data/yacc.c (yy_stack_print, YY_STACK_PRINT, yy_reduce_print)
16228 (YY_REDUCE_PRINT): New.
16229 (yyparse): Use them.
16230 * data/glr.c (yy_reduce_print): Use YYFPRINTF, no need for
16231 YYDPRINT here.
16232 (yyglrReduce, yyrecoverParseError, yyparse): Don't report the
16233 state reached after the reduction/recovery, since...
16234 (yyparse, yyprocessOneStack): Report the state we are entering in.
16235
16236 2002-11-16 Akim Demaille <akim@epita.fr>
16237
16238 * src/getargs.h, src/getargs.c (trace_e, trace_args, trace_types):
16239 Add support for --trace=skeleton.
16240 * src/scan-skel.l: %option debug.
16241 Scan strings of non-@ or \n instead of character by character.
16242 (scan_skel): Handle trace_skeleton.
16243 (QPUTS): New.
16244 (@output_parser_name@, @output_header_name@): ``Restore'' their
16245 support (used to be M4 macros).
16246 * data/yacc.c: Quote larger chunks, a la glr.c.
16247 * data/lalr1.cc: Likewise.
16248 The header guards are no longer available, so use some other
16249 string than `YYLSP_NEEDED'.
16250
16251 2002-11-16 Akim Demaille <akim@epita.fr>
16252
16253 Make the ``Printers and Destructors'' test more verbose, taking
16254 `yacc.c''s behavior as (possibly wrong) reference.
16255
16256 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use printf
16257 instead of fprint on stdout.
16258 Set and report the last_line of the symbols.
16259 Consistently display values and locations.
16260
16261 2002-11-16 Paul Eggert <eggert@twinsun.com>
16262
16263 * data/yacc.c: Avoid over-quoting of __line__ and __file__.
16264
16265 2002-11-15 Paul Eggert <eggert@twinsun.com>
16266
16267 * tests/actions.at (Actions after errors): New test case.
16268
16269 * data/glr.c, data/lalr1.cc, data/yacc.cc, doc/bison.texinfo,
16270 src/conflicts.c, src/parse-gram.y, src/tables.c, src/tables.h,
16271 tests/action.at, tests/calc.at, tests/conflicts.at,
16272 tests/cxx-type.at, tests/regression.at:
16273 "parse error" -> "syntax error" for POSIX compatibility.
16274 "parsing stack overflow..." -> "parser stack overflow" so
16275 that code matches Bison documentation.
16276
16277 2002-11-15 Akim Demaille <akim@epita.fr>
16278
16279 * src/parse-gram.y (declaration): Have %parse-param and %lex-param
16280 take two BRACED_CODE, not two string_content.
16281 Free the scanner's obstack when we are done.
16282 (code_content): New.
16283 * tests/calc.at: Adjust.
16284 * doc/bison.texinfo: Adjust.
16285 Also, make sure to include the `,' for these declarations.
16286
16287 2002-11-15 Tim Van Holder <tim.van.holder@pandora.be>
16288
16289 * m4/prereq.m4: Removed the commented jm_PREREQ_HASH
16290 definition; avoids potential autoreconf problems.
16291
16292 2002-11-15 Akim Demaille <akim@epita.fr>
16293
16294 Always check the value returned by yyparse.
16295
16296 * tests/calc.at (_AT_DATA_CALC_Y): Have `main' exit with the value
16297 returned by yyparse.
16298 (_AT_CHECK_CALC_ERROR): Take the expected exit value as argument.
16299 Adjust calls.
16300 * tests/glr-regr1.at (glr-regr1.y): Have `main' exit with the value
16301 returned by yyparse.
16302
16303 2002-11-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16304
16305 * data/glr.c (yyFail): Always set yyerrflag. Corrects regression
16306 on input.at test.
16307
16308 2002-11-14 Paul Eggert <eggert@twinsun.com>
16309
16310 * src/output.c (output_skeleton): Call xfopen instead of
16311 duplicating xfopen's body.
16312
16313 Fix bugs reported by Nelson H. F. Beebe in
16314 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00078.html>.
16315
16316 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that
16317 "$CC -E foo.h" is allowed, as this doesn't work with the Portland
16318 Group compiler. Instead, use "$CC -E bar.c". Include the .h
16319 file twice in the grammar, as an extra check.
16320
16321 * tests/input.at (Torturing the Scanner): Surround the
16322 backslash-newline tests with "#if 0", to make it less likely that
16323 we'll run into compiler bugs. Bring back solitary \ inside
16324 comment, but add a closing comment to work around HP C bug. Don't
16325 test backslash-newline in C character constant.
16326
16327 2002-11-14 Akim Demaille <akim@epita.fr>
16328
16329 * tests/synclines.at (AT_SYNCLINES_COMPILE): Ignore the exit
16330 status of the compiler.
16331 Calling `exit 1' is no longer needed.
16332 Reported by Nelson H. F. Beebe.
16333
16334 2002-11-14 Akim Demaille <akim@epita.fr>
16335
16336 * tests/atlocal.in (CPPFLAGS): We have config.h.
16337 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR):
16338 New.
16339 * tests/actions.at, tests/calc.at, tests/conflicts.at,
16340 * tests/cxx-type.at, tests/glr-regr1.at, tests/headers.at,
16341 * tests/regression.at, tests/torture.at: Use them for all the
16342 grammars that are to be compiled.
16343 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Rename as...
16344 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): this.
16345 * doc/bison.texinfo (GLR Parsers): Document `inline'.
16346
16347 2002-11-14 Akim Demaille <akim@epita.fr>
16348
16349 * doc/bison.texinfo: Various formatting changes (alignments in
16350 samples, additional @group/@end group, GCS in samples.
16351 Use @deffn instead of simple @table to define the directives,
16352 macros, variables etc.
16353
16354 2002-11-13 Paul Eggert <eggert@twinsun.com>
16355
16356 Fix some bugs reported by Albert Chin-A-Young in
16357 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00066.html>.
16358
16359 * tests/input.at (Torturing the Scanner): Don't invoke "cc a.c b.c
16360 -o c"; the HP C compiler chatters during compilation.
16361 Instead, invoke "cc -c a.c -o a.o; cc -c b.c -o b.o; cc a.o b.o -o c".
16362 * tests/headers.at (export YYLTYPE): Likewise.
16363
16364 * tests/input.at (Torturing the Scanner): Remove lines containing
16365 solitary backslashes, as they tickle a bug in the HP C compiler.
16366
16367 * tests/glr-regr1.at (Badly Collapsed GLR States): Avoid //
16368 comments, since they're not portable. Use GNU coding style.
16369
16370 2002-11-13 Akim Demaille <akim@epita.fr>
16371
16372 * data/yacc.c: Leave bigger chunks of quoted text.
16373 (YYDSYMPRINTF): New.
16374 Use it to report symbol activities.
16375 * data/glr.c (YYDSYMPRINTF): New.
16376 Use it.
16377
16378 2002-11-12 Paul Eggert <eggert@twinsun.com>
16379
16380 Version 1.75b.
16381
16382 * data/glr.c (yydoAction): Return YYRESULTTAG, not int.
16383 (yyglrReduce): Return yyok, not 0.
16384 This should avoid the enumerated-type warnings reported
16385 by Nelson H. F. Beebe in
16386 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00057.html>.
16387
16388 * lib/bbitset.h (BITSET_INLINE): Remove.
16389 * lib/bitset.h [! BITSET_INLINE]: Remove.
16390 (bitset_set, bitset_reset, bitset_test): Rename local vars
16391 to avoid shadowing warnings by GCC.
16392
16393 * data/glr.c (inline): Remove #define. It's the user's
16394 responsibility to #define it away, just like 'const'.
16395 This fixes one of the bugs reported by Nelson H. F. Beebe in
16396 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00058.html>.
16397
16398 * Makefile.maint (po-check): Scan .l and .y files instead of the
16399 .c and the .h files that they generate. This fixes the bug
16400 reported by Tim Van Holder in:
16401 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00062.html>
16402 Look for N_ as well as for _. Try to avoid matching #define for
16403 N_ and _.
16404 * po/POTFILES.in: Remove src/parse-gram.c, src/scan-gram.c,
16405 src/system.h. Add src/parse-gram.y, src/scan-gram.l.
16406 * src/scan-gram.l: Revamp regular expressions so that " and '
16407 do not confuse xgettext.
16408
16409 * src/struniq.h (struniq_new): Do not declare the return type
16410 to be 'const'; this violates the C standard.
16411 * src/struniq.c (struniq_new): Likewise.
16412
16413 2002-11-12 Albert Chin-A-Young <china@thewrittenword.com>
16414
16415 * src/Makefile.am (LDADD): Link $(LIBINTL) last to avoid the
16416 duplicate definition of optind on Tru64 UNIX 4.0D with the Compaq
16417 linker.
16418
16419 2002-11-12 Akim Demaille <akim@epita.fr>
16420
16421 * Makefile.maint: Sync with Autoconf:
16422 (local_updates): New.
16423
16424 2002-11-12 Akim Demaille <akim@epita.fr>
16425
16426 * po/POTFILES.in (src/lalr.c, src/state.c): Remove
16427
16428 2002-11-12 Akim Demaille <akim@epita.fr>
16429
16430 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Display the
16431 locations.
16432
16433 2002-11-12 Akim Demaille <akim@epita.fr>
16434
16435 * data/c.m4 (b4_yysymprint_generate): Pass *yyvaluep to YYPRINT,
16436 not yyvalue.
16437
16438 2002-11-12 Akim Demaille <akim@epita.fr>
16439
16440 * tests/actions.at (AT_CHECK_PRINTER_AND_DESTRUCTOR): New.
16441 Use it to test the GLR parser.
16442
16443 2002-11-12 Akim Demaille <akim@epita.fr>
16444
16445 * tests/regression.at (input.y): s/YYEOF/MYEOF/, as the skeleton
16446 defines it.
16447 * data/glr.c (yystos): New.
16448 (b4_yysymprint_generate, b4_yydestruct_generate): Invoke.
16449 (YYDSYMPRINT): New.
16450 (yyval): Don't define it, it is handled via M4.
16451 (yyrecoverParseError): Free verbosely the discarded symbols.
16452 * data/yacc.c (yysymprint): Remove, rather...
16453 (b4_yysymprint_generate): invoke.
16454 * data/c.m4 (b4_yysymprint_generate): New.
16455 Accept pointers as arguments, as opposed to the version from
16456 yacc.c.
16457 (b4_yydestruct_generate): Likewise.
16458 * tests/cations.at (Printers and Destructors): Use Bison directives
16459 instead of CPP macros.
16460 Don't rely on internal details.
16461
16462 2002-11-12 Akim Demaille <akim@epita.fr>
16463
16464 * data/c.m4 (b4_yydestruct_generate, b4_symbol_actions): New.
16465 * data/yacc.c: Rename yychar1 as yytoken, as in glr.c.
16466 Don't work on yychar (i.e., do set it to YYEMPTY, don't match
16467 it against YYEMPTY and so forth), work on yytoken (i.e., set
16468 it to YYEMPTY etc.).
16469 (yydestruct): Replace with a b4_yydestruct_generate invocation.
16470 (b4_symbol_actions): Remove.
16471 * data/glr.c (YYTRANSLATE): As for yacc.c, if negative, it stands
16472 for 0, end-of-input.
16473
16474 2002-11-12 Akim Demaille <akim@epita.fr>
16475
16476 * doc/bison.texinfo (Destructor Decl): New.
16477
16478 2002-11-12 Akim Demaille <akim@epita.fr>
16479
16480 * src/tables.c (tables_generate): Use free for pointers that
16481 cannot be NULL, not XFREE.
16482 (pack_vector): Use assert, not fatal, for bound violations.
16483 * src/state.c (state_new): Likewise.
16484 * src/reader.c (reader): Likewise.
16485 * src/lalr.c (set_goto_map): Likewise.
16486 * src/location.h (LOCATION_PRINT): If first_line is 0, just issue
16487 the file name.
16488
16489 2002-11-12 Akim Demaille <akim@epita.fr>
16490
16491 * src/scan-gram.l, src/reader.h (scanner_last_string_free):
16492 Restore.
16493 * src/scan-gram.l (last_string): Is global to the file, not to
16494 yylex.
16495 * src/parse-gram.y (input): Don't append the epilogue here,
16496 (epilogue.opt): do it here, and free the scanner's obstack.
16497 * src/reader.c (epilogue_set): Rename as...
16498 (epilogue_augment): this.
16499 * data/c.m4 (b4_epilogue): Defaults to empty.
16500
16501 2002-11-12 Akim Demaille <akim@epita.fr>
16502
16503 * src/getargs.c (long_options): Remove duplicates.
16504 * src/vmsgetargs.c, src/build.com, src/bison.cld, src/vmshlp.mar:
16505 Remove.
16506 * doc/bison.rnh: Remove.
16507 * doc/bison.texinfo (VMS Invocation): Remove.
16508
16509 2002-11-12 Akim Demaille <akim@epita.fr>
16510
16511 * src/struniq.h, src/struniq.c (struniq_t): Is const.
16512 (STRUNIQ_EQ, struniq_assert, struniq_assert_p): New.
16513
16514 Use struniq for symbols.
16515
16516 * src/symtab.h (symbol_t): The tag member is a struniq.
16517 (symbol_type_set): Adjust.
16518 * src/symtab.c (symbol_new): Takes a struniq.
16519 (symbol_free): Don't free the tag member.
16520 (hash_compare_symbol_t, hash_symbol_t): Rename as...
16521 (hash_compare_symbol, hash_symbol): these.
16522 Use the fact that tags as struniqs.
16523 (symbol_get): Use struniq_new.
16524 * src/symlist.h, src/symlist.c (symbol_list_n_type_name_get):
16525 Returns a strniq.
16526 * src/reader.h (merger_list, grammar_currentmerge_set): The name
16527 and type members are struniqs.
16528 * src/reader.c (get_merge_function)
16529 (grammar_current_rule_merge_set): Adjust.
16530 (TYPE, current_type): Are struniq.
16531
16532 Use struniq for file names.
16533
16534 * src/files.h, src/files.c (infile): Split into...
16535 (grammar_file, current_file): these.
16536 * src/scan-gram.c (YY_USER_INIT, handle_syncline): Adjust.
16537 * src/reduce.c (reduce_print): Likewise.
16538 * src/getargs.c (getargs): Likewise.
16539 * src/complain.h, src/complain.c: Likewise.
16540 * src/main.c (main): Call struniqs_new early enough to use it for
16541 file names.
16542 Don't free the input file name.
16543
16544 2002-11-12 Akim Demaille <akim@epita.fr>
16545
16546 * src/symtab.c (symbol_free): Remove dead deactivated code:
16547 type_name are properly removed.
16548 Don't use XFREE to free items that cannot be NULL.
16549 * src/struniq.h, src/struniq.c: New.
16550 * src/main.c (main): Initialize/free struniqs.
16551 * src/parse-gram.y (%union): Add astruniq member.
16552 (yyprint): Adjust.
16553 * src/scan-gram.l (<{tag}>): Return a struniq.
16554 Free the obstack bit that used to store it.
16555 * src/symtab.h (symbol_t): The 'type_name' member is a struniq.
16556
16557 2002-11-11 Paul Eggert <eggert@twinsun.com>
16558
16559 Revamp to fix many (but not all) of the C- and M4-related quoting
16560 problems. Among other things, this fixes the Bison bug reported
16561 by Jan Hubicka when processing the Bash grammar; see:
16562 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00039.html>
16563
16564 Use new @ escapes consistently. Represent brackets with @{ and @}
16565 rather than @<:@ and @:>@, since this works a bit better with dumb
16566 editors like vi. Represent @ with @@, since @ is now consistently
16567 an escape. Use @oline@ and @ofile@ rather than __oline__ and
16568 __ofile__, to avoid unexpected expansions. Similarly, use @output
16569 rather than #output.
16570
16571 * data/c.m4 (b4_copyright): Omit file name from comment, since
16572 the file name could contain "*/".
16573 (b4_synclines_flag): Don't quote the 2nd argument; it should already
16574 be quoted. All uses changed.
16575
16576 * data/glr.c: Use new @ escapes consistently.
16577 (b4_input_suffix, b4_output_parser_suffix, b4_output_parser_name,
16578 b4_output_header_suffix, b4_output_header_name, b4_header_guard):
16579 Remove, since they couldn't handle arbitrary characters in file
16580 names.
16581 * data/lalr1.cc: Likewise.
16582 * data/yacc.c: Likewise.
16583
16584 * src/files.c (output_infix): Remove; all uses removed.
16585 * src/files.h: Likewise.
16586
16587 * data/glr.c: Remove use of "#ifdef b4_header_guard", since it
16588 mishandled funny characters in file names, and anyway it isn't
16589 needed any more.
16590 * data/yacc.c: Likewise.
16591 * data/lalr1.cc: Use YYSLP_NEEDED instead of b4_header_guard.
16592
16593 * data/glr.c (YYSTYPE_IS_TRIVIAL): Define when the .h file would.
16594 * data/yacc.c: Likewise.
16595
16596 * src/muscle_tab.c: Include quotearg.h, since we need to quote C
16597 strings now.
16598 (muscle_init): Quote filename as a C string.
16599 * src/muscle_tab.h (MUSCLE_GROW_STRING_PAIR): Remove; unused.
16600 (MUSCLE_OBSTACK_SGROW, MUSCLE_INSERT_C_STRING): New macros.
16601 * src/output.c (escaped_file_name_output): New function.
16602 (prepare_symbols): Quote tokens for M4.
16603 (prepare): Don't insert output_infix, output_prefix,
16604 output_parser_name, output_header_name; this is now down by scan-skel.
16605 Insert skeleton as a C string.
16606
16607 * src/output.c (user_actions_output, symbol_destructors_output,
16608 symbol_printers_output): Quote filenames for C and M4.
16609 * src/reader.c (prologue_augment, epilogue_set): Likewise.
16610
16611 * src/scan-gram.l (<SC_CHARACTER>): Don't worry about any backslash
16612 escapes other than \\ and \'; this simplifies the code.
16613 (<SC_STRING>): Likewise, for \\ and \".
16614 (<SC_COMMENT,SC_LINE_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,
16615 SC_PROLOGUE,SC_EPILOGUE>): Escape $ and @, too.
16616 Use new escapes @{ and @} for [ and ].
16617
16618 * src/scan-skel.l (yylineno, yyoutname): Remove static vars, replacing
16619 them with auto vars.
16620 Switch to new escape scheme, where @ is the escape character uniformly.
16621 Abort if a stray escape character is found. Avoid unbounded input
16622 buffer when parsing non-escaped text.
16623
16624 * tests/input.at (Torturing the Scanner): Add tests that @oline@,
16625 __oline__, #output, $@, and @{ do not have unintended meanings.
16626
16627 2002-11-09 Paul Eggert <eggert@twinsun.com>
16628
16629 Fix the test failure due to GCC warnings described in
16630 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00000.html>.
16631 * data/glr.c (yyis_pact_ninf, yyis_table_ninf): New macros, which
16632 evaluate to 0 if it's impossible for NINF to be in the respective
16633 table.
16634 (yygetLRActions, yyrecoverParseError): Use them.
16635
16636 * src/scan-gram.l (unexpected_end_of_file): Fix bug: columns were
16637 counted in the token inserted at end of file. Now takes
16638 location_t *, not location_t, so that the location can be
16639 adjusted. All uses changed.
16640
16641 * tests/regression.at (Invalid inputs): Adjust wording in
16642 diagnostic to match the new behavior.
16643
16644 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR,
16645 AT_DATA_HORIZONTAL_GRAMMAR, AT_DATA_LOOKAHEADS_GRAMMAR,
16646 AT_DATA_STACK_TORTURE): Replace `assert (x);' with `if (! (x))
16647 abort ();'. This reduces the runtime of the "Many lookaheads"
16648 test from 27.6 to 2.7 minutes on a 440 MHz Ultrasparc III running
16649 GCC 3.2.
16650
16651 2002-11-07 Paul Eggert <eggert@twinsun.com>
16652
16653 * src/parse-gram.y (CHARACTER): Remove unused token.
16654 All uses removed.
16655
16656 * src/scan-gram.l: Remove stack option. We no longer use the
16657 stack, since the stack was never deeper than 1; instead, use the
16658 new auto var c_context to record the stacked value.
16659
16660 Remove nounput option. At an unexpected end of file, we now unput
16661 the minimal input necessary to end cleanly; this simplifies the
16662 code.
16663
16664 Avoid unbounded token sizes where this is easy.
16665
16666 (unexpected_end_of_file): New function.
16667 Use it to systematize the error message on unexpected EOF.
16668 (last-string): Now auto, not static.
16669 (YY_OBS_FREE): Remove unnecessary do while (0) wrapper.
16670 (scanner_last_string_free): Remove; not used.
16671 (percent_percent_count): Move decl to just before use.
16672 (SC_ESCAPED_CHARACTER): Return ID at unexpected end of file,
16673 not the (never otherwised-used) CHARACTER.
16674
16675 2002-11-07 Akim Demaille <akim@epita.fr>
16676
16677 Let yyerror always receive the msg as last argument, so that
16678 yyerror can be variadic.
16679
16680 * data/yacc.c (b4_yyerror_args): New.
16681 Use it when calling yyerror.
16682 * data/glr.c (b4_yyerror_args, b4_lyyerror_args): New.
16683 Use it when calling yyerror.
16684 * doc/bison.texinfo (Error Reporting): Adjust.
16685 * tests/calc.at (_AT_DATA_CALC_Y): Adjust.
16686 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Adjust.
16687
16688 2002-11-06 Akim Demaille <akim@epita.fr>
16689
16690 #line should have quoted strings.
16691 Ideally, this should be done by m4_quotearg.
16692
16693 * src/scan-skel.l: Include quotearg.h.
16694 Quote __ofile__.
16695 * src/output.c (symbol_printers_output)
16696 (symbol_destructors_output): Quote the file name.
16697
16698 2002-11-06 Akim Demaille <akim@epita.fr>
16699
16700 * tests/regression.at (Invalid inputs): Adjust to the recent
16701 messages.
16702
16703 2002-11-06 Akim Demaille <akim@epita.fr>
16704
16705 Restore --no-lines.
16706 Reported by Jim Kent.
16707
16708 * data/c.m4 (b4_syncline): New.
16709 * data/glr.c, data/yacc.c, data/lalr1.cc: Use it.
16710 * src/reader.c (prologue_augment, epilogue_set): Use b4_syncline.
16711 * src/output.c (user_actions_output): Likewise.
16712 (prepare): Define 'b4_synclines_flag'.
16713 * src/muscle_tab.c (muscle_init): Don't define b4_linef.
16714
16715 2002-11-06 Akim Demaille <akim@epita.fr>
16716
16717 * src/main.c (main): Free `infile'.
16718 * src/scan-gram.l (handle_syncline): New.
16719 Recognize `#line'.
16720 * src/output.c (user_actions_output, symbol_destructors_output)
16721 (symbol_printers_output): Use the location's file name, not
16722 infile.
16723 * src/reader.c (prologue_augment, epilogue_set): Likewise.
16724
16725 2002-11-05 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16726
16727 * src/tables.c (matching_state): Don't allow states to match if
16728 either has GLR conflict entries.
16729
16730 2002-11-05 Paul Eggert <eggert@twinsun.com>
16731
16732 * src/scan-gram.l: Use more accurate diagnostics, e.g.
16733 "integer out of range" rather than "invalid value".
16734 * tests/input.at (Invalid $n, Invalid @n): Change expected wording
16735 accordingly.
16736
16737 Scan <% and %> digraphs in C code as POSIX 1003.1-2001 requires.
16738 Also, remove one static variable in the scanner.
16739
16740 * src/scan-gram.l (braces_level): Now auto, not static.
16741 Initialize to zero if the compiler is being picky.
16742 (INITIAL): Clear braces_level instead of incrementing it.
16743 (SC_BRACED_CODE): Treat <% and %> as { and } when inside C code,
16744 as POSIX 1003.1-2001 requires.
16745 * src/system.h (IF_LINT): New macro, taken from coreutils.
16746 * configure.ac: Define "lint" if --enable-gcc-warnings.
16747
16748 2002-11-05 Akim Demaille <akim@epita.fr>
16749
16750 * src/scan-gram.l: When it starts with `%', complain about the
16751 whole directive, not just that `invalid character: %'.
16752
16753 2002-11-04 Akim Demaille <akim@epita.fr>
16754
16755 * Makefile.maint: Update from Autoconf.
16756 (update, cvs-update, po-update, do-po-update): New.
16757
16758 2002-11-04 Akim Demaille <akim@epita.fr>
16759
16760 * tests/glr-regr1.at (Badly Collapsed GLR States): Prototype yylex
16761 and yyerror.
16762 Have yyerror `use' its arguments.
16763 * tests/calc.at (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF
16764 returns true when location & yacc & pure & parse-param.
16765 (_AT_DATA_CALC_Y): Let yyerror ``use'' its arguments.
16766
16767 2002-11-04 Akim Demaille <akim@epita.fr>
16768
16769 * src/location.h (LOCATION_PRINT): Use quotearg slot 3 to avoid
16770 clashes.
16771 * src/scan-gram.l: Use [\'] instead of ['] to pacify
16772 font-lock-mode.
16773 Use complain_at.
16774 Use quote, not quote_n since LOCATION_PRINT no longer uses the
16775 slot 0.
16776
16777 2002-11-03 Paul Eggert <eggert@twinsun.com>
16778
16779 * src/reader.c (get_merge_function, grammar_current_rule_check):
16780 Use consistent diagnostics for reporting type name clashes.
16781 Quote the types with <>, for consistency with Yacc.
16782 * tests/input.at (Type Clashes): Adjust to diagnostic changes.
16783
16784 2002-11-03 Akim Demaille <akim@epita.fr>
16785
16786 * data/c.m4 (b4_identification, b4_user_args, b4_parse_param):
16787 New.
16788 * data/yacc.m4 (b4_pure_args, b4_Pure_args): New.
16789 (b4_parse_param): Remove.
16790 Use b4_identification.
16791 Propagate b4_pure_args where needed to pass them to yyerror.
16792 * data/glr.m4 (b4_parse_param): Remove.
16793 (b4_user_formals, b4_pure_args, b4_pure_formals, b4_lpure_args)
16794 (b4_lpure_formals): New.
16795 Use b4_identification.
16796 (YY_USER_FORMALS, YY_USER_ARGS): Remove, replaced by
16797 b4_user_formals and b4_user_args.
16798 (yyexpandGLRStack, yyFail, yyaddDeferredAction, yyglrShiftDefer)
16799 (yyreportAmbiguity): When using a pure parser, also need
16800 the location, and the parse-params.
16801 Adjust callers.
16802 (yyuserAction, yyglrShift, yyreportParseError, yyrecoverParseError):
16803 When using a pure parser, also need the parse-params.
16804 Adjust callers.
16805 * tests/calc.at: Test pure (%pure-parser) and absolutely pure
16806 (%pure-parser + %parse-param) LALR and GLR parsers.
16807 (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): New, define AT_PARAM_IF,
16808 AT_LOCATION_IF, AT_PURE_IF, AT_GLR_IF, AAT_PURE_AND_LOC_IF,
16809 AT_GLR_OR_PARAM_IF, AT_YYERROR_ARG_LOC_IF, AT_YYERROR_SEES_LOC_IF.
16810 (_AT_DATA_CALC_Y): Equip for purity of yyerror.
16811 (_AT_CHECK_CALC_ERROR): Use AT_YYERROR_SEES_LOC_IF.
16812 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Equip for yyerror purity.
16813 * doc/bison.texinfo: Untabify the whole file.
16814 (Parser Function): Document %parse-param, deprecate YYPARSE_PARAM.
16815 (Pure Calling): Document %lex-param, deprecate YYLEX_PARAM.
16816 (Error Reporting): Adjust to these new directives.
16817 Document %error-verbose, deprecate YYERROR_VERBOSE.
16818
16819 2002-11-03 Akim Demaille <akim@epita.fr>
16820
16821 * tests/calc.at: Change all the AT_CHECK_CALC_LALR and
16822 AT_CHECK_CALC_GLR invocations to use % directives, instead of
16823 command line options.
16824 * tests/cxx-type.at: Formatting changes.
16825
16826 2002-11-03 Paul Eggert <eggert@twinsun.com>
16827
16828 * src/scan-gram.l: Revamp to fix POSIX incompatibilities,
16829 to count columns correctly, and to check for invalid inputs.
16830
16831 Use mbsnwidth to count columns correctly. Account for tabs, too.
16832 Include mbswidth.h.
16833 (YY_USER_ACTION): Invoke extend_location rather than LOCATION_COLUMNS.
16834 (extend_location): New function.
16835 (YY_LINES): Remove.
16836
16837 Handle CRLF in C code rather than in Lex code.
16838 (YY_INPUT): New macro.
16839 (no_cr_read): New function.
16840
16841 Scan UCNs, even though we don't fully handle them yet.
16842 (convert_ucn_to_byte): New function.
16843
16844 Handle backslash-newline correctly in C code.
16845 (SC_LINE_COMMENT, SC_YACC_COMMENT): New states.
16846 (eols, blanks): Remove. YY_USER_ACTION now counts newlines etc.;
16847 all uses changed.
16848 (tag, splice): New EREs. Do not allow NUL or newline in tags.
16849 Use {splice} wherever C allows backslash-newline.
16850 YY_STEP after space, newline, vertical-tab.
16851 ("/*"): BEGIN SC_YACC_COMMENT, not yy_push_state (SC_COMMENT).
16852
16853 (letter, id): Don't assume ASCII; e.g., spell out a-z.
16854
16855 ({int}, handle_action_dollar, handle_action_at): Check for integer
16856 overflow.
16857
16858 (YY_STEP): Omit trailing semicolon, so that it's more like C.
16859
16860 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>): Allow \0 and \00
16861 as well as \000. Check for UCHAR_MAX, not 255.
16862 Allow \x with an arbitrary positive number of digits, as in C.
16863 Check for overflow here.
16864 Allow \? and UCNs, for compatibility with C.
16865
16866 (handle_symbol_code_dollar): Use quote_n slot 1 to avoid collision
16867 with quote slot used by complain_at.
16868
16869 * tests/input.at: Add tests for backslash-newline, m4 quotes
16870 in symbols, long literals, and funny escapes in strings.
16871
16872 * configure.ac (jm_PREREQ_MBSWIDTH): Add.
16873 * lib/Makefile.am (libbison_a_SOURCES): Add mbswidth.h, mbswidth.c.
16874 * lib/mbswidth.h, lib/mbswidth.c: New files, from GNU gettext.
16875 * m4/Makefile.am (EXTRA_DIST): Add mbswidth.m4.
16876 * m4/mbswidth.m4: New file, from GNU coreutils.
16877
16878 * doc/bison.texinfo (Grammar Outline): Document // comments.
16879 (Symbols): Document that trigraphs have no special meaning in Bison,
16880 nor is backslash-newline allowed.
16881 (Actions): Document that trigraphs have no special meaning.
16882
16883 * src/location.h (LOCATION_COLUMNS, LOCATION_LINES): Remove;
16884 no longer used.
16885
16886 2002-11-02 Paul Eggert <eggert@twinsun.com>
16887
16888 * src/reader.c: Don't include quote.h; not needed.
16889 (get_merge_function): Reword warning to be consistent with
16890 type clash diagnostic in grammar_current_rule_check.
16891
16892 * lib/quotearg.c (quotearg_buffer_restyled): Fix off-by-two
16893 bug in trigraph handling.
16894
16895 * src/output.c (prepare_symbols): When printing token names,
16896 escape "[" as "@<:@" and likewise for "]".
16897
16898 * src/system.h (errno): Remove declaration, as we are now
16899 assuming C89 or better, and C89 guarantees errno.
16900
16901 2002-10-30 Paul Eggert <eggert@twinsun.com>
16902
16903 * lib/bitset_stats.c (bitset_stats_read, bitset_stats_write):
16904 Check for close failures.
16905 * src/files.h (xfclose): Return void, not int, since it always
16906 returned zero.
16907 * src/files.c (xfclose): Likewise. Report I/O error if ferror
16908 indicates one.
16909 * src/output.c (output_skeleton): Use xfclose rather than fclose
16910 and ferror. xfclose now checks ferror.
16911
16912 * data/glr.c (YYLEFTMOST_STATE): Remove.
16913 (yyreportTree): Use a stack-based leftmost state. This avoids
16914 our continuing battles with bogus warnings about initializers.
16915
16916 2002-10-30 Akim Demaille <akim@epita.fr>
16917
16918 * src/system.h: Don't use #ifdef/#ifndef on HAVE_ values, only
16919 #if.
16920
16921 2002-10-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16922
16923 * tests/glr-regr1.at: New test for reported regressions.
16924 * tests/testsuite.at: Add glr-regr1.at test.
16925 * tests/Makefile.am: Add glr-regr1.at test.
16926
16927 2002-10-24 Paul Eggert <eggert@twinsun.com>
16928
16929 Version 1.75a.
16930
16931 * tests/calc.at (_AT_DATA_CALC_Y): Remove unused strcat declaration.
16932 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Include stdlib.h, since
16933 we use malloc. Don't assume 'A' through 'Z' are contiguous.
16934 Don't assume strdup exists; POSIX says its an XSI extension.
16935 Check for buffer overflow on input.
16936
16937 2002-10-24 Akim Demaille <akim@epita.fr>
16938
16939 * src/output.c (output_skeleton): Don't disable M4sugar comments
16940 too soon: it results in comments being expanded.
16941 * data/yacc.c, data/glr.c, data/lalr1.cc: Do it right before the
16942 first output.
16943
16944 2002-10-24 Akim Demaille <akim@epita.fr>
16945
16946 * data/yacc.c (m4_int_type): New.
16947 * data/c.m4 (m4_int_type): Don't use yysigned_char, but `signed
16948 char' as only yacc.c wants K&R portability.
16949 * data/glr.c (yysigned_char): Remove.
16950 * data/lalr1.cc: Rename the trailing b4_name as b4_parser_class_name.
16951 Reported by Quoc Peyrot.
16952
16953 2002-10-23 Paul Eggert <eggert@twinsun.com>
16954
16955 * src/main.c (main): With --trace=time, report times even if a
16956 non-fatal error occurs. Formerly, the times were reported in some
16957 such cases but not in others.
16958 * src/reader.c (reader): Just return if a complaint has been issued,
16959 instead of exiting, so that 'main' can report times.
16960
16961 2002-10-22 Akim Demaille <akim@epita.fr>
16962
16963 * src/system.h: Include sys/types.
16964 Reported by Bert Deknuydt.
16965
16966 2002-10-23 Paul Eggert <eggert@twinsun.com>
16967
16968 * configure.ac (AC_PROG_LEX): Use instead of AM_PROG_LEX.
16969 Suggested by Art Haas.
16970
16971 2002-10-22 Paul Eggert <eggert@twinsun.com>
16972
16973 * src/complain.c (exit) [! (STDC_HEADERS || _LIBC)]: Remove exit
16974 decl; not needed any more.
16975 * src/main.c (main): Use return to exit, undoing yesterday's change.
16976 The last OS that we could find where this wouldn't work is
16977 SunOS 3.5, and that's too old to worry about now.
16978
16979 * data/glr.c (struct yyltype): Define members even when not
16980 doing locations. This is more consistent with yacc.c, and it
16981 works around the following bug reports:
16982 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00106.html
16983 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00111.html
16984
16985 * doc/bison.texinfo: Minor spelling and typographical fixes. Use
16986 @acronym consistently. Standardize on "Yacc" instead of "YACC",
16987 "Algol" instead of "ALGOL". Give a bit more history about BNF.
16988
16989 2002-10-22 Akim Demaille <akim@epita.fr>
16990
16991 * data/README: New.
16992
16993 2002-10-21 Paul Eggert <eggert@twinsun.com>
16994
16995 Be consistent about 'bool'; the old code used an enum in one
16996 module and an int in another, and this violates the C standard.
16997 * m4/stdbool.m4: New file, from coreutils 4.5.3.
16998 * configure.ac (AC_HEADER_STDBOOL): Add.
16999 * m4/Makefile.am (EXTRA_DIST): Add stdbool.m4.
17000 * src/muscle_tab.c (hash_compare_muscles): (a ? FALSE : TRUE) -> (! a)
17001 * src/symtab.c (hash_compare_symbol_t): Likewise.
17002 * src/system.h (bool, false, true): Use a definition consistent
17003 with ../lib/hash.c. All uses changed.
17004
17005 * src/complain.c (warning_issued): Renamed from warn_message_count,
17006 so that we needn't worry about integer overflow (!).
17007 Now of type bool. All uses changed.
17008 (complaint_issued): Renamed from complain_message_count; likewise.
17009
17010 * src/main.c (main): Use exit to exit with failure.
17011
17012 * src/complain.c (fatal_at, fatal): Use EXIT_FAILURE and EXIT_SUCCESS
17013 rather than 1 and 0.
17014 * src/main.c (main): Likewise.
17015 * src/getargs.c (getargs): Likewise.
17016 * src/reader.c (reader): Likewise.
17017
17018 * src/getarg.c (getargs): Remove duplicate code for
17019 "Try `bison --help'".
17020
17021 * src/files.c (xfopen, xfclose): Use EXIT_FAILURE rather than 2.
17022 What was that "2" for?
17023
17024 * src/complain.h (fatal, fatal_at): Add __attribute__((__noreturn__)).
17025 * src/getargs.c (usage): Likewise.
17026
17027 * src/getargs.c (getargs): When there are too few operands, report
17028 the last one. When there are too many, report the first extra
17029 one. This is how diffutils does it.
17030
17031 2002-10-20 Paul Eggert <eggert@twinsun.com>
17032
17033 Remove K&R vestiges.
17034 * configure.ac (AC_C_CONST, AM_C_PROTOTYPES): Remove.
17035 * src/complain.c (VA_START): Remove. Assume prototypes.
17036 (vfprintf) [! (HAVE_VPRINTF || defined vfprintf)]: New macro.
17037 (private_strerror, warn_at, warn, complain_at, complain, fatal_at,
17038 fatal): Assume prototypes.
17039 * src/complain.h: Assume prototypes.
17040 * src/system.h (PARAMS): Remove.
17041 Include <limits.h> unconditionally, since it's guaranteeed even
17042 for a freestanding C89 compiler.
17043 (SHRT_MIN, SHRT_MAX): Remove, since C89 guarantees them.
17044 * src/vmsgetargs.c (getargs, cli_present, cli_get_value): Prototype.
17045
17046 2002-10-20 Akim Demaille <akim@epita.fr>
17047
17048 * src/muscle_tab.c (muscle_grow): Remove trailing debugging code.
17049 * data/glr.c (YY_USER_FORMALS, YY_USER_ARGS): New.
17050 (yyuserAction, yydoAction, yyglrReduce, yyresolveValue)
17051 (yyresolveStates, yyresolveAction, yyresolveStack)
17052 (yyprocessOneStack): Use them.
17053 (yy_reduce_print): New.
17054 * tests/calc.at (_AT_DATA_CALC_Y): Exercise %parse-param.
17055
17056 2002-10-20 Akim Demaille <akim@epita.fr>
17057
17058 * data/c.m4 (b4_c_ansi_args): Recognize functions with no
17059 arguments and output `void'.
17060 (b4_c_function): Rename as...
17061 (b4_c_function_def): this.
17062 (b4_c_function_decl, b4_c_ansi_function_def)
17063 (b4_c_ansi_function_decl): New.
17064 Change the interpretation of the arguments: before `int, foo', now
17065 `int foo, foo'.
17066 * data/yacc.c (yyparse): Prototype and define thanks to these.
17067 Adjust b4_c_function_def uses.
17068 * data/glr.c (yyparse): Likewise, but ANSI only.
17069
17070 2002-10-20 Akim Demaille <akim@epita.fr>
17071
17072 * src/output.c (prepare): Move the definition of `tokens_number',
17073 `nterms_number', `undef_token_number', `user_token_number_max'
17074 to...
17075 (prepare_tokens): Here.
17076 (prepare_tokens): Rename as...
17077 (prepare_symbols): this.
17078 (prepare): Move the definition of `rules_number' to...
17079 (prepare_rules): here.
17080 (prepare): Move the definition of `last', `final_state_number',
17081 `states_number' to...
17082 (prepare_states): here.
17083 * data/yacc.c, data/lalr1.cc, data/glr.c: Normalize `>' into `<'.
17084
17085 2002-10-20 Akim Demaille <akim@epita.fr>
17086
17087 * src/tables.h, src/tables.c, src/output.c: Comment changes.
17088
17089 2002-10-20 Akim Demaille <akim@epita.fr>
17090
17091 * data/yacc.c, data/yacc.c (b4_location_if, b4_pure_if): Move to...
17092 * data/c.m4: here.
17093
17094 2002-10-20 Akim Demaille <akim@epita.fr>
17095
17096 * src/output.c (prepare): Use MUSCLE_INSERT_STRING.
17097 * src/muscle_tab.c (muscle_pair_list_grow): Rename `val as
17098 `pair'.
17099 (muscle_init): Move the `b4_ltype', `b4_maxdepth', `b4_initdepth',
17100 `name' to...
17101 * data/glr.c, data/lalr1.cc, data/yacc.c (b4_location_type)
17102 (b4_stack_depth_init, b4_stack_depth_max, b4_parser_class_name):
17103 These.
17104
17105 2002-10-19 Paul Eggert <eggert@twinsun.com>
17106
17107 Do not create a temporary file, as that involves security and
17108 cleanup headaches. Instead, use a pair of pipes.
17109 Derived from a suggestion by Florian Krohm.
17110 * lib/subpipe.c, lib/subpipe.h, m4/subpipe.m4: New files.
17111 * lib/mkstemp.c, lib/readpipe.c, lib/tempname.c, m4/mkstemp.m4: Remove.
17112 * configure.ac (UTILS_FUNC_MKSTEMP, jm_PREREQ_TEMPNAME): Remove.
17113 (BISON_PREREQ_SUBPIPE): Add.
17114 * lib/Makefile.am (libbison_a_SOURCES): Remove readpipe.c.
17115 Add subpipe.h, subpipe.c.
17116 * m4/Makefile.am (EXTRA_DIST): Remove mkstemp.m4. Add subpipe.m4.
17117 * po/POTFILES.in: Add lib/subpipe.c.
17118 * src/output.c: Include "subpipe.h".
17119 (m4_invoke): Remove decl.
17120 (scan_skel): New decl.
17121 (output_skeleton): Use pipe rather than temporary file for m4 input.
17122 Check that m4sugar.m4 is readable, to avoid deadlock.
17123 Check for pipe I/O error.
17124 * src/scan-skel.l (readpipe): Remove decl.
17125 (scan_skel): New function, to be used in place of m4_invoke.
17126 Read from stream rather than file.
17127
17128 * lib/timevar.c (TICKS_TO_MSEC, CLOCKS_TO_MSEC): Do not cast to
17129 float, as this generates a warning on Solaris 8 + GCC 3.2 with
17130 --enable-gcc-warnings. Instead, divide into 1.0 rather than 1;
17131 this generates a more-accurate value anyway.
17132
17133 * lib/timevar.c (timervar_accumulate): Rename locals to
17134 avoid confusion with similarly-named more-global.
17135 * src/muscle_tab.c (muscle_pair_list_grow): Likewise.
17136
17137 * src/output.c (prepare): Use xstrdup to convert char const *
17138 to char *, to avoid GCC warning.
17139
17140 2002-10-19 Akim Demaille <akim@epita.fr>
17141
17142 * tests/calc.at (_AT_DATA_CALC_Y): Define VAL, LOC, LEX_FORMALS,
17143 LEX_PRE_FORMALS, LEX_ARGS, LEX_PRE_ARGS, USE_LEX_ARGS.
17144 Use them to have `calc.y' ready for %pure-parser.
17145 * data/yacc.c (YYLEX): Pass a yylex return type to
17146 b4_c_function_call.
17147
17148 2002-10-19 Akim Demaille <akim@epita.fr>
17149
17150 Prototype support of %lex-param and %parse-param.
17151
17152 * src/parse-gram.y: Add the definition of the %lex-param and
17153 %parse-param tokens, plus their rules.
17154 Drop the `_' version of %glr-parser.
17155 Add the "," token.
17156 * src/scan-gram.l (INITIAL): Scan them.
17157 * src/muscle_tab.c: Comment changes.
17158 (muscle_insert, muscle_find): Rename `pair' as `probe'.
17159 * src/muscle_tab.h (MUSCLE_INSERT_PREFIX): Remove unused.
17160 (muscle_entry_s): The `value' member is no longer const.
17161 Adjust all dependencies.
17162 * src/muscle_tab.c (muscle_init): Adjust: use
17163 MUSCLE_INSERT_STRING.
17164 Initialize the obstack earlier.
17165 * src/muscle_tab.h, src/muscle_tab.c (muscle_grow)
17166 (muscle_pair_list_grow): New.
17167 * data/c.m4 (b4_c_function_call, b4_c_args): New.
17168 * data/yacc.c (YYLEX): Use b4_c_function_call to honor %lex-param.
17169 * tests/calc.at: Use %locations, not --locations.
17170 (AT_CHECK_CALC_GLR): Use %glr-parser, not %glr_parser.
17171
17172 2002-10-19 Akim Demaille <akim@epita.fr>
17173
17174 * src/getargs.c (usage): Take status as argument and exit
17175 accordingly.
17176 Report the traditional `Try ... --help' message when status != 0.
17177 (usage, version): Don't take a FILE * as arg, it is pointless.
17178 (getargs): When there is an incorrect number of arguments, make it
17179 an error, and report it GNUlically thanks to `usage ()'.
17180
17181 2002-10-18 Paul Eggert <eggert@twinsun.com>
17182
17183 * data/glr.c (yyreportParseError): Don't assume that sprintf
17184 yields the length of the printed string, as this is not true
17185 on SunOS 4.1.4. Reported by Peter Klein.
17186
17187 * tests/calc.at (_AT_DATA_CALC_Y): #undef memcmp and realloc.
17188 * tests/conflicts.at (%nonassoc and eof): Likewise.
17189 Fixes SunOS 4.1.4 test failure reported by Peter Klein.
17190
17191 2002-10-17 Akim Demaille <akim@epita.fr>
17192
17193 * src/getargs.h (trace_e): Add trace_scan, and trace_parse.
17194 * src/getargs.c (trace_types, trace_args): Adjust.
17195 * src/reader.c (grammar_current_rule_prec_set)
17196 (grammar_current_rule_dprec_set, grammar_current_rule_merge_set):
17197 Standardize error messages.
17198 And s/@prec/%prec/!
17199 (reader): Use trace_flag to enable scanner/parser debugging,
17200 instead of an adhoc scheme.
17201 * src/scan-gram.l: Remove trailing debugging code.
17202
17203 2002-10-16 Paul Eggert <eggert@twinsun.com>
17204
17205 * src/muscle_tab.h (MUSCLE_TAB_H_): Was misspelled as
17206 MUSCLE_TAB_H.
17207
17208 * NEWS: Officially drop support for building Bison with K&R C,
17209 since it didn't work anyway and it's not worth worrying about.
17210 * Makefile.maint (wget_files): Remove ansi2knr.c.
17211 (ansi2knr.c-url_prefix): Remove.
17212 * lib/.cvsignore: Remove ansi2knr, ansi2knr.*.
17213 * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
17214 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
17215
17216 2002-10-15 Paul Eggert <eggert@twinsun.com>
17217
17218 Stop using the "enum_" trick for K&R-style function definitions;
17219 it confused me, and I was the author! Instead, assume that people
17220 who want to use K&R C compilers (when using these modules in GCC,
17221 perhaps?) will run ansi2knr.
17222
17223 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): Remove.
17224 All uses of "enum_" changed to "enum ".
17225 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
17226 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
17227
17228 * lib/abitset.c (abitset_and, abitset_and_cmp, abitset_and_or,
17229 abitset_and_or_cmp, abitset_andn, abitset_andn_cmp,
17230 abitset_andn_or, abitset_andn_or_cmp, abitset_bytes, abitset_copy,
17231 abitset_copy1, abitset_disjoint_p, abitset_empty_p,
17232 abitset_equal_p, abitset_init, abitset_list, abitset_list_reverse,
17233 abitset_not, abitset_ones, abitset_or, abitset_or_and,
17234 abitset_or_and_cmp, abitset_or_cmp, abitset_reset, abitset_set,
17235 abitset_size, abitset_small_list, abitset_subset_p, abitset_test,
17236 abitset_unused_clear, abitset_xor, abitset_xor_cmp, abitset_zero):
17237 Use function prototypes; this removes the need for declaring
17238 static functions simply to provide their prototypes.
17239 * lib/bitset.c (bitset_alloc, bitset_and_or_, bitset_and_or_cmp_,
17240 bitset_andn_or_, bitset_andn_or_cmp_, bitset_bytes, bitset_copy_,
17241 bitset_count_, bitset_create, bitset_dump, bitset_first,
17242 bitset_free, bitset_init, bitset_last, bitset_next,
17243 bitset_obstack_alloc, bitset_obstack_free, bitset_only_set_p,
17244 bitset_op4_cmp, bitset_or_and_, bitset_or_and_cmp_, bitset_prev,
17245 bitset_print, bitset_release_memory, bitset_toggle_,
17246 bitset_type_choose, bitset_type_get, bitset_type_name_get,
17247 debug_bitset): Likewise.
17248 * lib/bitset.h (bitset_set, bitset_reset, bitset_test): Likewise.
17249 * lib/bitset_stats.c (bitset_log_histogram_print,
17250 bitset_percent_histogram_print, bitset_stats_and,
17251 bitset_stats_and_cmp, bitset_stats_and_or,
17252 bitset_stats_and_or_cmp, bitset_stats_andn, bitset_stats_andn_cmp,
17253 bitset_stats_andn_or, bitset_stats_andn_or_cmp, bitset_stats_copy,
17254 bitset_stats_count, bitset_stats_disable, bitset_stats_disjoint_p,
17255 bitset_stats_dump, bitset_stats_empty_p, bitset_stats_enable,
17256 bitset_stats_equal_p, bitset_stats_free, bitset_stats_init,
17257 bitset_stats_list, bitset_stats_list_reverse, bitset_stats_not,
17258 bitset_stats_ones, bitset_stats_or, bitset_stats_or_and,
17259 bitset_stats_or_and_cmp, bitset_stats_or_cmp, bitset_stats_print,
17260 bitset_stats_print_1, bitset_stats_read, bitset_stats_reset,
17261 bitset_stats_set, bitset_stats_size, bitset_stats_subset_p,
17262 bitset_stats_test, bitset_stats_toggle, bitset_stats_type_get,
17263 bitset_stats_write, bitset_stats_xor, bitset_stats_xor_cmp,
17264 bitset_stats_zero): Likewise.
17265 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
17266 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
17267 bitsetv_dump, debug_bitsetv): Likewise.
17268 * lib/ebitset.c (ebitset_and, ebitset_and_cmp, ebitset_andn,
17269 ebitset_andn_cmp, ebitset_bytes, ebitset_copy, ebitset_copy_,
17270 ebitset_copy_cmp, ebitset_disjoint_p, ebitset_elt_add,
17271 ebitset_elt_alloc, ebitset_elt_calloc, ebitset_elt_find,
17272 ebitset_elt_free, ebitset_elt_last, ebitset_elt_remove,
17273 ebitset_elt_zero_p, ebitset_elts_grow, ebitset_empty_p,
17274 ebitset_equal_p, ebitset_free, ebitset_init, ebitset_list,
17275 ebitset_list_reverse, ebitset_not, ebitset_ones, ebitset_op3_cmp,
17276 ebitset_or, ebitset_or_cmp, ebitset_release_memory, ebitset_reset,
17277 ebitset_set, ebitset_size, ebitset_subset_p, ebitset_test,
17278 ebitset_weed, ebitset_xor, ebitset_xor_cmp, ebitset_zero):
17279 Likewise.
17280 * lib/lbitset.c (debug_lbitset, lbitset_and, lbitset_and_cmp,
17281 lbitset_andn, lbitset_andn_cmp, lbitset_bytes, lbitset_copy,
17282 lbitset_copy_cmp, lbitset_disjoint_p, lbitset_elt_alloc,
17283 lbitset_elt_calloc, lbitset_elt_find, lbitset_elt_free,
17284 lbitset_elt_link, lbitset_elt_unlink, lbitset_elt_zero_p,
17285 lbitset_empty_p, lbitset_equal_p, lbitset_free, lbitset_init,
17286 lbitset_list, lbitset_list_reverse, lbitset_not, lbitset_ones,
17287 lbitset_op3_cmp, lbitset_or, lbitset_or_cmp, lbitset_prune,
17288 lbitset_release_memory, lbitset_reset, lbitset_set, lbitset_size,
17289 lbitset_subset_p, lbitset_test, lbitset_weed, lbitset_xor,
17290 lbitset_xor_cmp, lbitset_zero): Likewise.
17291
17292 2002-10-14 Akim Demaille <akim@epita.fr>
17293
17294 Version 1.75.
17295
17296 2002-10-14 Akim Demaille <akim@epita.fr>
17297
17298 * tests/Makefile.am (maintainer-check-posix): New.
17299
17300 2002-10-14 Akim Demaille <akim@epita.fr>
17301
17302 * data/glr.c [YYDEBUG] (YYLEFTMOST_STATE): Initialize the yyloc
17303 member.
17304
17305 2002-10-14 Akim Demaille <akim@epita.fr>
17306
17307 * src/tables.c (table_ninf_remap): base -> tab.
17308 Reported by Matt Rosing.
17309
17310 2002-10-14 Paul Eggert <eggert@twinsun.com>
17311
17312 * tests/action.at, tests/calc.at, tests/conflicts.at,
17313 tests/cxx-type.at, tests/headers.at, tests/input.at,
17314 tests/regression.at, tests/synclines.at, tests/torture.at:
17315 Say "bison -o foo.c foo.y", not "bison foo.y -o foo.c",
17316 so that the tests still work even if POSIXLY_CORRECT is set.
17317 * doc/bison.texinfo (Rpcalc Compile, Invocation): Likewise.
17318
17319 * data/c.m4 (b4_int_type): Use yysigned_char instead of signed char,
17320 for portability to K&R hosts. Fix typo: signed char is guaranteed
17321 only to 127, not to 128.
17322 * data/glr.c (yysigned_char): New type.
17323 * data/yacc.c (yysigned_char): Likewise.
17324 * tests/regression.at (Web2c Actions): signed char -> yysigned_char.
17325
17326 2002-10-13 Paul Eggert <eggert@twinsun.com>
17327
17328 * data/yacc.c (yyparse): Rewrite to avoid "comparison is always
17329 true due to limited range of data type" warning from GCC.
17330
17331 * data/c.m4 (b4_token_defines): Protect against double-inclusion
17332 by wrapping enum yytokentype's definition inside #ifndef
17333 YYTOKENTYPE. This undoes a bug I introduced on 2002-10-12.
17334
17335 2002-10-13 Akim Demaille <akim@epita.fr>
17336
17337 * data/glr.c (yyglrShiftDefer, yyaddDeferredAction, yydoAction):
17338 Un yy- yyrhs to avoid the name clash with the global YYRHS.
17339
17340 2002-10-13 Akim Demaille <akim@epita.fr>
17341
17342 * Makefile.maint: Update from Autoconf 2.54.
17343 * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Remove, shipped with 2.54.
17344
17345 2002-10-13 Akim Demaille <akim@epita.fr>
17346
17347 * src/print.c (print_state): Separate the list of solved conflicts
17348 from the other items.
17349 * tests/conflicts.at (Resolved SR Conflicts): Adjust.
17350
17351 2002-10-13 Akim Demaille <akim@epita.fr>
17352
17353 Let nondeterministic skeletons be usable with deterministic
17354 tables.
17355
17356 With the patch, GAWK compiled by GCC without -O2 passes its test
17357 suite using a GLR parser driven by LALR tables. It fails with -O2
17358 because `struct stat' gives two different answers on my machine:
17359 88 (definition of an auto var) and later 96 (memset on this var).
17360 Hence the stack is badly corrumpted. The headers inclusion is to
17361 blame: if I move the awk.h inclusion before GLR's system header
17362 inclusion, the two struct stat have the same size.
17363
17364 * src/tables.c (pack_table): Always create conflict_table.
17365 (token_actions): Always create conflict_list.
17366 * data/glr.c (YYFLAG): Remove, unused.
17367
17368 2002-10-13 Akim Demaille <akim@epita.fr>
17369
17370 * configure.ac (AC_GNU_SOURCE): Use it instead of hand written code.
17371 (O0FLAGS): New.
17372 (VALGRIND, GXX): New.
17373 * tests/atlocal.in (CFLAGS): Use O0FLAGS.
17374 * tests/bison.in: Run $PREBISON a pre-command.
17375 * tests/Makefile.am (maintainer-check, maintainer-check-valgrind)
17376 (maintainer-check-g++): New.
17377 * Makefile.am (maintainer-check): New.
17378
17379 2002-10-13 Akim Demaille <akim@epita.fr>
17380
17381 * data/glr.c: Formatting changes.
17382 Tweak some trace messages to match yacc.c's.
17383
17384 2002-10-13 Akim Demaille <akim@epita.fr>
17385
17386 GLR parsers sometimes raise parse errors instead of performing the
17387 default reduction.
17388 Reported by Charles-Henry de Boysson.
17389
17390 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Don't
17391 check the length of the traces when %glr.
17392 (_AT_CHECK_CALC_ERROR): Also skip `^Stack' lines, coming from
17393 GLR's traces.
17394 (AT_CHECK_CALC_LALR, AT_CHECK_CALC_GLR): New.
17395 Test GLR parsers.
17396 * data/glr.c (YYLEFTMOST_STATE): Fix its value.
17397 (yyltype): Remove the yy prefix from the member names.
17398 (yytable): Complete its comment.
17399 (yygetLRActions): Map error action number from YYTABLE from
17400 YYTABLE_NINF to 0.
17401 (yyisErrorAction): No longer compare YYACTION to YYPACT_NINF
17402 (which was a bug: it should have been YYTABEL_NINF, and yet it was
17403 not satisfying as we could compare an YYACTION computed from
17404 YYDEFACT to YYTABLE_NINF although they are unrelated): 0 is the
17405 only value for error actions.
17406 (yyreportParseError): In verbose parse error messages, don't issue
17407 `error' in the list of expected tokens.
17408 * data/yacc.c (yyparse) <yybackup>: Rewrite the decoding of the
17409 next action to perform to match glr.c's decoding.
17410 (yytable): Complete its comment.
17411
17412 2002-10-13 Paul Eggert <eggert@twinsun.com>
17413
17414 Fix problem reported by Henrik Grubbstroem in
17415 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00098.html>:
17416 "nonterm: { $$ = 123; } { $$ = $1; };" was wrongly rejected,
17417 because the Bison parser reads the second action before reducing
17418 the first one.
17419 * src/scan-gram.l (rule_length): New static var.
17420 Use it to keep track of the rule length in the scanner, since
17421 we can't expect the parser to be in lock-step sync with the scanner.
17422 (handle_action_dollar, handle_action_at): Use this var.
17423 * tests/actions.at (Exotic Dollars): Test for the problem.
17424
17425 2002-10-12 Paul Eggert <eggert@twinsun.com>
17426
17427 * lib/timevar.c [! IN_GCC && HAVE_SYS_TIME_H]: Include <sys/time.h>.
17428 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): Check for <sys/time.h>.
17429 Include <sys/time.h> when checking for clock_t and struct tms.
17430 Use same include order as source.
17431 This is for the SunOS 4.1.4 porting bug reported by Peter Klein in
17432 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00016.html>.
17433
17434 * lib/timevar.c: Update copyright date and clarify comments.
17435 (get_time) [IN_GCC]: Keep the GCC version for reference.
17436
17437 * lib/timevar.c, lib/timevar.h, lib/timevar.def: Import
17438 GCC version as of today, then merge Bison's changes.
17439 Change "GCC" to "Bison" in copyright notice. timevar.def's
17440 author is Akim, so change that too.
17441
17442 * src/reader.c (grammar_current_rule_check):
17443 Don't worry about the default action if $$ is untyped.
17444 Prevents bogus warnings reported by Jim Gifford in
17445 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00015.html>.
17446
17447 * data/c.m4 (b4_token_enum): Do not define YYTOKENTYPE.
17448 * data/glr.c, data/lalr1.cc, data/yacc.c:
17449 Output token definitions before the first part of user declarations.
17450 Fixes compatibility problem reported by Jim Gifford for kbd in
17451 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00014.html>.
17452
17453 2002-10-11 Paul Eggert <eggert@twinsun.com>
17454
17455 * data/yacc.c (yyreport_parse_error): Remove, putting its body into...
17456 (yyparse): here. This undoes some of the 2002-07-25 change.
17457 Compatibility problem reported by Ralf S. Engelschall with
17458 OSSP cfg <http://www.ossp.org/pkg/lib/cfg/>.
17459
17460 2002-10-11 Akim Demaille <akim@epita.fr>
17461
17462 * tests/regression.at Characters Escapes): New.
17463 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Accept \' in strings and
17464 characters.
17465 Reported by Jan Nieuwenhuizen.
17466
17467 2002-10-11 Akim Demaille <akim@epita.fr>
17468
17469 * po/id.po: New.
17470
17471 2002-10-10 Paul Eggert <eggert@twinsun.com>
17472
17473 Portability fixes for bitsets; this also avoids several GCC
17474 warnings.
17475
17476 * lib/abitset.c: Include <stddef.h>, for offsetof.
17477 * lib/lbitset.c: Likewise.
17478
17479 * lib/abitset.c (abitset_bytes): Return a size that is aligned
17480 properly for vectors of objects. Do not assume that adding a
17481 header size to a multiple of a word size yields a value that is
17482 properly aligned for the whole union.
17483 * lib/bitsetv.c (bitsetv_alloc): Likewise.
17484
17485 * lib/bitset_stats.c (bitset_stats_bytes): Adjust to new,
17486 unique names for structures.
17487 * lib/ebitset.c (ebitset_bytes): Likewise.
17488 * lib/lbitset.c (lbitset_bytes): Likewise.
17489
17490 * lib/abitset.c (abitset_ones, abitset_zero, abitset_empty_p,
17491 abitset_copy1, abitset_not, abitset_equal_p, abitset_subset_p,
17492 abitset_disjoint_p, abitset_and, abitset_and_cmp, abitset_andn,
17493 abitset_andn_cmp, abitset_or, abitset_or_cmp, abitset_xor,
17494 abitset_xor_cmp, abitset_and_or, abitset_and_or_cmp,
17495 abitset_andn_or, abitset_andn_or_cmp, abitset_or_and,
17496 abitset_or_and_cmp, abitset_copy): Supply prototype decls,
17497 to improve the type-checking that GCC can do.
17498 * lib/bitset.c (bitset_op4_cmp): Likewise.
17499 * lib/bitset_stats.c (bitset_stats_count,
17500 bitset_stats_empty_p, bitset_stats_ones, bitset_stats_zero,
17501 bitset_stats_copy, bitset_stats_disjoint_p,
17502 bitset_stats_equal_p, bitset_stats_not, bitset_stats_subset_p,
17503 bitset_stats_and, bitset_stats_and_cmp, bitset_stats_andn,
17504 bitset_stats_andn_cmp, bitset_stats_or, bitset_stats_or_cmp,
17505 bitset_stats_xor, bitset_stats_xor_cmp, bitset_stats_and_or,
17506 bitset_stats_and_or_cmp, bitset_stats_andn_or,
17507 bitset_stats_andn_or_cmp, bitset_stats_or_and,
17508 bitset_stats_or_and_cmp): Likewise.
17509 * lib/lbitset.c (lbitset_and, lbitset_and_cmp, lbitset_andn,
17510 lbitset_andn_cmp, lbitset_or, lbitset_or_cmp, lbitset_xor,
17511 lbitset_xor_cmp, lbitset_empty_p, lbitset_ones, lbitset_not,
17512 lbitset_subset_p, lbitset_disjoint_p, debug_lbitset): Likewise.
17513
17514 * lib/abitset.h: Include bitset.h, not bbitset.h.
17515 * lib/ebitset.h: Likewise.
17516 * lib/lbitset.h: Likewise.
17517
17518 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): New types.
17519 All instances of parameters of type enum bitset_opts are now of
17520 type enum_bitset_opts, to conform to the C Standard, and similarly
17521 for enum_bitset_type.
17522 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
17523 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
17524
17525 Do not use "struct bitset_struct" to mean different things in
17526 different modules. Not only is this confusing, it violates
17527 the C Standard, which requires that structure types in different
17528 modules must be compatible if one is to be passed to the other.
17529 * lib/bbitset.h (bitset): Now points to a union, not to a struct.
17530 All instances of "struct bitset_struct *" replaced with "bitset".
17531 * lib/bitset.h (struct bitset_struct): Remove, replacing with....
17532 (union bitset_union, struct abitset_struct, struct ebitset_struct,
17533 struct lbitset_struct, struct bitset_stats_struct): New types.
17534 All uses of struct bitset_struct changed to union bitset_union,
17535 etc.
17536 * lib/abitset.c (struct abitset_struct, abitset,
17537 struct bitset_struct): Remove.
17538 * lib/bitset_stats.c (struct bitset_stats_struct, bitset_stats,
17539 struct bitset_struct): Remove.
17540 * lib/ebitset.c (struct ebitset_struct, ebitset, struct
17541 bitset_struct): Remove.
17542 * lib/lbitset.c (struct lbitset_struct, lbitset, bitset_struct):
17543 Likewise.
17544
17545 Do not call a function of type T using a call that assumes the
17546 function is of a different type U. Standard C requires that a
17547 function must be called with a type that is compatible with its
17548 definition.
17549 * lib/bbitset.h (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
17550 New decls.
17551 * lib/bitset.c (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
17552 New functions.
17553 * lib/ebitset.c (PFV): Remove.
17554 * lib/lbitset.c (PFV): Likewise.
17555 * lib/ebitset.c (ebitset_and, ebitset_andn, ebitset_or,
17556 ebitset_xor, ebitset_copy, ebitset_ones, ebitset_empty_p): New
17557 decls.
17558 (ebitset_and, ebitset_andn, ebitset_or, ebitset_xor): New functions.
17559 (ebitset_vtable): Use them.
17560 * lib/lbitset.c (lbitset_and, lbitset_andn, lbitset_or,
17561 lbitset_xor): New functions.
17562 (lbitset_vtable): Use them.
17563
17564 * lib/bitset.h (bitset_next, bitset_prev, bitset_only_set_p):
17565 Declare.
17566
17567 * lib/bitsetv.c (bitsetv_alloc): Add a cast to (void *) to avoid a
17568 GCC warning.
17569 * lib/lbitset.c (LBITSET_CURRENT1): Likewise.
17570 Use offsetof, for simplicity.
17571
17572 2002-10-06 Paul Eggert <eggert@twinsun.com>
17573
17574 * lib/bitset.h (bitset_reset): Do not assume that bitset_word is
17575 the same width as int. This reapplies a hunk of the 2002-08-12 patch
17576 <http://lists.gnu.org/archive/html/bison-patches/2002-08/msg00007.html>,
17577 which was inadvertently undone by the 2002-09-30 patch.
17578 * lib/lbitset.c (debug_lbitset): Do not assume that bitset_word is
17579 the same width as int.
17580
17581 2002-10-04 Paul Eggert <eggert@twinsun.com>
17582
17583 Version 1.50.
17584
17585 * configure.ac (AC_INIT), NEWS: Increment version number.
17586
17587 * doc/bison.texinfo: Minor spelling, grammar, and white space
17588 fixes.
17589 (Symbols): Mention that any negative value returned from yylex
17590 signifies end-of-input. Warn about negative chars. Mention
17591 the portable Standard C character set.
17592
17593 The GNU coding standard says CFLAGS and YFLAGS are reserved
17594 for the installer to set.
17595 * lib/Makefile.am (AM_CFLAGS): Renamed from CFLAGS.
17596 * src/Makefile.am (AM_CFLAGS): Likewise.
17597 (AM_YFLAGS): Renamed from YFLAGS.
17598
17599 Fix some MAX and MIN problems.
17600 * src/gram.h (ITEM_NUMBER_MIN): MIN_MAX -> INT_MIN.
17601 * src/lalr.h (GOTO_NUMBER_MAX): INT_MAX -> SHRT_MAX.
17602 * src/symtab.h (SYMBOL_NUMBER_MAX): New macro.
17603 * src/reader.c (reader): Use it.
17604
17605 * tests/regression.at (Braces parsing): Use grep, not fgrep, as
17606 POSIX 1003.1-2001 has removed fgrep.
17607
17608 2002-10-04 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
17609
17610 * lib/bbitset.h (BITSET_WINDEX_MAX): Redefine so that it cannot be
17611 interpreted as signed.
17612 * lib/ebitset.c (ebitset_list): Fix bug.
17613
17614 2002-10-01 Paul Eggert <eggert@twinsun.com>
17615
17616 More fixes for 64-bit hosts and large bitsets.
17617
17618 * lib/abitset.c (struct abitset_struct.n_bits, abitset_small_list,
17619 abitset_size, abitset_list, abitset_list_reverse, abitset_list):
17620 Use bitset_bindex, not int or unsigned int or size_t, to count bits.
17621 * lib/bbitset.h (struct bitset_vtable.size, struct bitset_vtable.count,
17622 struct bitset_vtable.list, struct bitset_vtable.list_reverse,
17623 bitset_count_, bitset_next, bitset_prev, bitset_first, bitset_last,
17624 bitset_count_): Likewise.
17625 * lib/bitset.h (bitset_iterator.num, bitset_iterator.i,
17626 bitset_first, bitset_last): Likewise.
17627 * lib/bitset_stats.c (bitset_stats_size, bitset_stats_list,
17628 bitset_stats_list_reverse, bitset_stats_size,
17629 bitset_stats_count, bitset_stats_list, bitset_stat_list_reverse):
17630 Likewise.
17631 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
17632 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
17633 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
17634 bitsetv_reflexive_transitive_closure): Likewise.
17635 * lib/bitsetv.h (bitsetv_alloc, bitsetv_create): Likewise.
17636 * lib/ebitset.c (ebitset_size, ebitset_list, ebitset_list_reverse):
17637 Likewise.
17638 * lib/lbitset.c (lbitset_size, lbitset_list, lbitset_list_merge):
17639 Likewise.
17640
17641 * lib/abitset.c (abitset_ones, abitset_zero, abitset_bytes):
17642 Use size_t, not unsigned int, to count bytes.
17643 * lib/abitset.h (abitset_bytes): Likewise.
17644 * lib/bitset.c (bitset_bytes, bitset_alloc, bitset_obstack_alloc):
17645 Likewise.
17646 * lib/bitset.h (bitset_bytes): Likewise.
17647 * lib/bitset_stats.c (bitset_stats_bytes, bitset_stats_init): Likewise.
17648 * lib/bitset_stats.h (bitset_stats_bytes): Likewise.
17649 * lib/bitsetv.c (bitsetv_alloc): Likewise.
17650 * lib/ebitset.c (ebitset_bytes): Likewise.
17651 * lib/ebitset.h (ebitset_bytes): Likewise.
17652 * lib/lbitset.c (lbitset_bytes): Likewise.
17653 * lib/lbitset.h (lbitset_bytes): Likewise.
17654
17655 * lib/abitset.c (abitset_empty_p, abitset_not, abitset_equal_p,
17656 abitset_subset_p, abitset_disjoint_p, abitset_and,
17657 abitset_and_cmp, abitset_andn, abitset_andn_cmp, abitset_or,
17658 abitset_or_cmp, abitset_xor, abitset_xor_cmp, abitset_and_or,
17659 abitset_and_or_cmp, abitset_andn_or, abitset_andn_or_cmp,
17660 abitset_or_and, abitset_or_and_cmp):
17661 Use bitset_windex instead of unsigned int.
17662 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
17663 * lib/ebitset.c (struct ebitset_struct.size, ebitset_elts_grow,
17664 ebitset_elt_add, ebitset_elt_remove, ebitset_weed,
17665 ebitset_elt_find, ebitset_list_reverse, ebitset_list, ebitset_init):
17666 Likewise.
17667 * lib/lbitset.c (lbitset_ones, lbitset_not): Likewise.
17668
17669 * lib/bitset.c (bitset_print):
17670 Use proper printf formats for widths of integer types.
17671 * lib/bitset_stats.c (bitset_percent_histogram_print,
17672 bitset_log_histogram_print, bitset_stats_print_1): Likewise.
17673 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
17674 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
17675 * lib/lbitset.c (lbitset_bytes): Likewise.
17676
17677 * lib/bbitset.h (BITSET_BINDEX_MAX, BITSET_WINDEX_MAX,
17678 BITSET_SIZE_MAX): New macros.
17679 (BITSET_INDEX_MAX): Remove. It wasn't right, since it assumed that
17680 sizeof (bitset_word) == sizeof (bitset_windex). All uses changed
17681 to BITSET_WINDEX_MAX.
17682
17683 * lib/bitset.c (bitset_next, bitset_prev, bitset_first,
17684 bitset_last): Return BITSET_BINDEX_MAX (not -1) for no value,
17685 since we now return the bitset_bindex type (not int).
17686
17687 * lib/bitsetv.c (bitsetv_alloc): Check for arithmetic overflow
17688 when computing sizes.
17689 * lib/ebitset.c (ebitset_elts_grow): Likewise.
17690
17691 * lib/lbitset.c (lbitset_elt_find): Simplify windex calculation
17692 and avoid cast to unsigned.
17693
17694 2002-09-30 Akim Demaille <akim@epita.fr>
17695
17696 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
17697 * lib/bitset_stats.c, lib/bitsetv.c, lib/ebitset.c, lib/lbitset.c:
17698 Updates from Michael Hayes.
17699
17700 2002-09-30 Art Haas <ahaas@neosoft.com>
17701
17702 * configure.ac: Update AC_OUTPUT and AM_CONFIG_HEADER
17703 invocations.
17704 * tests/cxx-type.at (declarator): Don't rely on NDEBUG being not
17705 defined.
17706
17707 2002-09-27 Akim Demaille <akim@epita.fr>
17708
17709 Version 1.49c.
17710
17711 2002-09-27 Akim Demaille <akim@epita.fr>
17712
17713 * configure.ac (AM_INIT_AUTOMAKE): We _need_ 1.7.
17714 (Because of AC_LIBSOURCE).
17715
17716 2002-09-27 Akim Demaille <akim@epita.fr>
17717
17718 Playing with Autoscan.
17719
17720 * configure.ac: Remove the old LIBOBJ tweaks.
17721 (AC_REPLACE_FUNCS): Add strrchr and strtol.
17722 * lib/strrchr.c: New.
17723 * lib/strtol.c: New, from the Coreutils 4.5.1.
17724
17725 2002-09-27 Akim Demaille <akim@epita.fr>
17726
17727 Playing with Autoscan.
17728
17729 * m4/prereq.m4 (jm_PREREQ_ARGMATCH, jm_FUNC_ARGMATCH): New.
17730 * lib/Makefile.am (libbison_a_SOURCES): No longer include
17731 argmatch.c and argmatch.h, since they are AC_LIBSOURCE'd.
17732 * lib/strcasecmp.c, lib/strncasecmp.c, lib/memcmp.c: New, from the
17733 Coreutils 4.5.1.
17734
17735 2002-09-24 Akim Demaille <akim@epita.fr>
17736
17737 * doc/bison.texinfo (Stack Overflow): xref to Recursion.
17738 (Frequently Asked Questions, Parser Stack Overflow): New.
17739
17740 2002-09-13 Akim Demaille <akim@epita.fr>
17741
17742 Playing with autoscan.
17743
17744 * src/reader.c (get_merge_function): Use xstrdup, not strdup.
17745 * src/files.c (skeleton_find): Remove, unused.
17746 * m4/memcmp.m4: New, from the Coreutils 4.5.1.
17747 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Run jm_FUNC_MEMCMP.
17748
17749 2002-09-13 Akim Demaille <akim@epita.fr>
17750
17751 * configure.ac (AM_INIT_AUTOMAKE): Require Automake 1.6.3.
17752 * Makefile.am (AUTOMAKE_OPTIONS): Don't.
17753
17754 2002-09-13 Akim Demaille <akim@epita.fr>
17755
17756 * configure.ac: Require 2.54.
17757 s/jm_FUNC_MALLOC/AC_FUNC_MALLOC/.
17758 s/jm_FUNC_REALLOC/AC_FUNC_REALLOC/.
17759 * m4/c-bs-a.m4, m4/malloc.m4, m4/mbstate_t.m4, m4/realloc.m4:
17760 Remove, provided by Autoconf macros.
17761
17762 2002-09-12 Akim Demaille <akim@epita.fr>
17763
17764 * m4/prereq.m4: Update, from Coreutils 4.5.1.
17765
17766 2002-09-12 Akim Demaille <akim@epita.fr>
17767
17768 * m4/prereq.m4: Update, from Fileutils 4.1.5.
17769 * configure.ac (jm_PREREQ_TEMPNAME): Invoke it.
17770 Reported by Martin Mokrejs.
17771
17772 2002-09-10 Akim Demaille <akim@epita.fr>
17773
17774 * src/parse-gram.y: Associate a human readable string to each
17775 token type.
17776 * tests/regression.at (Invalid inputs): Adjust.
17777
17778 2002-09-10 Gary V. Vaughan <gary@gnu.org>
17779
17780 * tests/Makefile.am ($(srcdir)/package.m4): Bison now ships
17781 with an Autoconf-2.5x style configure.ac.
17782
17783 2002-09-06 Paul Eggert <eggert@twinsun.com>
17784
17785 * doc/bison.texinfo (Conditions): Make explicit that the GPL
17786 exception applies only to yacc.c. This is a modification of a
17787 patch originally suggested by Akim Demaille.
17788
17789 2002-09-06 Akim Demaille <akim@epita.fr>
17790
17791 * data/c.m4 (b4_copyright): Move the GPL exception comment from
17792 here to...
17793 * data/yacc.c: here.
17794
17795 * data/lalr1.cc (struct yyltype): Don't define it, since we use
17796 LocationType.
17797 (b4_ltype): Default to yy::Location from location.hh.
17798
17799 2002-09-04 Jim Meyering <jim@meyering.net>
17800
17801 * data/yacc.c: Guard the declaration of yytoknum also with
17802 `#ifdef YYPRINT', so it is declared only when used.
17803
17804 2002-09-04 Akim Demaille <akim@epita.fr>
17805
17806 * configure.in: Rename as...
17807 * configure.ac: this.
17808 Bump to 1.49c.
17809
17810 2002-09-04 Akim Demaille <akim@epita.fr>
17811
17812 * src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
17813 * src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't
17814 translate maintainer only messages.
17815
17816 2002-08-12 Paul Eggert <eggert@twinsun.com>
17817
17818 Version 1.49b.
17819
17820 * Makefile.am (SUBDIRS): Remove intl.
17821 (DISTCLEANFILES): Remove.
17822 * NEWS: Mention that GNU M4 is now required. Clarify what is
17823 meant by "larger grammars". Mention the pt_BR translation.
17824 * configure.in (AC_CHECK_DECLS): Add getenv, getopt.
17825 (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var.
17826 Bump version from 0.11.2 to 0.11.5.
17827 (BISON_PREREQ_STAGE): Remove.
17828 (AM_GNU_GETTEXT): Use external gettext.
17829 (AC_OUTPUT): Remove intl/Makefile.
17830
17831 * config/depcomp, config/install-sh: Sync with Automake 1.6.3.
17832
17833 * data/glr.c: Include string.h, for strlen.
17834 (yyreportParseError): Use size_t for yysize.
17835 (yy_yypstack): No longer nested inside yypstates, as nested
17836 functions are not portable. Do not assume size_t is the
17837 same width as int.
17838 (yypstates): Do not assume that ptrdiff_t is the same width
17839 as int, and similarly for yyposn and YYINDEX.
17840
17841 * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.
17842
17843 * lib/Makefile.am (INCLUDES): Do not include from the intl
17844 directory, which has been removed.
17845 * src/Makefile.am (INCLUDES): Likewise.
17846
17847 * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
17848 (bitsets_sources, additional_bitsets_sources, timevars_sources):
17849 New vars.
17850
17851 * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
17852 * tests/Makefile.am (EXTRA_DIST): Likewise.
17853
17854 * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
17855 Do not assume that bitset_windex is the same width as unsigned.
17856
17857 * lib/abitset.c (abitset_unused_clear): Do not assume that
17858 bitset_word is the same width as int.
17859 * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise.
17860 * lib/bitset.h (bitset_set, bitset_reset): Likewise.
17861 * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise.
17862 * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise.
17863 * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise.
17864
17865 * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for
17866 portability to one's complement hosts!).
17867 * lib/ebitset.c (ebitset_op1): Likewise.
17868 * lib/lbitset.c (lbitset_op1): Likewise.
17869
17870 * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar.
17871 * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
17872 lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c:
17873 Sync with fileutils.
17874 * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
17875 lib/gettext.h: Sync with diffutils.
17876
17877 * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
17878 lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.
17879
17880 * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
17881 PROTOTYPES to check for prototypes, and "defined __STDC__" to
17882 check for void *.
17883
17884 * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not
17885 size_t; the old version tried to do this but casted improperly.
17886 (bitset_bindex, bitset_windex): Now size_t, not unsigned long.
17887 (bitset_test): Now returns int, not unsigned long.
17888
17889 * lib/bitset_stats.c: Include "gettext.h".
17890 (_): New macro.
17891 (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
17892 name locals "index", as it generates unnecessary warnings on some
17893 hosts that have an "index" function.
17894
17895 * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print,
17896 bitset_stats_read, bitset_stats_write): Wrap strings in _() if
17897 they need translation.
17898 * src/LR0.c (state_list_append, new_itemsets, get_state,
17899 append_states, generate_states): Likewise.
17900 * src/assoc.c (assoc_to_string): Likewise.
17901 * src/closure.c (print_closure, set_firsts, closure): Likewise.
17902 * src/gram.c (grammar_dump): Likewise.
17903 * src/injections.c (injections_compute): Likewise.
17904 * src/lalr.c (lookaheads_print): Likewise.
17905 * src/relation.c (relation_transpose): Likewise.
17906 * src/scan-gram.l: Likewise.
17907 * src/tables.c (table_grow, pack_vector): Likewise.
17908
17909 * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4,
17910 glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4.
17911 * m4/malloc.m4, m4/realloc.m4: Sync with diffutils.
17912 * m4/mbstate_t.m4: Sync with fileutils.
17913 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T.
17914
17915 * po/LINGUAS: Add pt_BR.
17916 * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c,
17917 src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c,
17918 lib/timevar.c.
17919 Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
17920 manual recommends.
17921 Similarly, use src/scan-gram.l instead of src/scan-gram.c.
17922
17923 * src/complain.c (strerror_r): Remove decl; not needed.
17924 (strerror): Use same pattern as ../lib/error.c.
17925
17926 * src/files.c, src/files.h (compute_header_macro): Remove; unused.
17927
17928 * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.
17929
17930 * src/main.c (main): Cast result of bindtextdomain and textdomain
17931 to void, to avoid a GCC warning when --disable-nls is in effect.
17932
17933 * src/scan-gram.l: Use strings rather than escapes when possible,
17934 to minimize the number of warnings from xgettext.
17935 (handle_action_dollar, handle_action_at): Don't use isdigit,
17936 as it mishandles negative chars and it may not work as expected
17937 outside the C locale.
17938
17939 * src/symtab.c (symbol_get): Don't cast LHS of an assignment;
17940 this is a GCC extension and is not portable to other compilers.
17941
17942 * src/system.h (alloca): Use same pattern as ../lib/error.c.
17943 Do not include <ctype.h>; no longer needed.
17944 Do not include <malloc.h>; no longer needed (and generates
17945 warnings on OpenBSD 3.0).
17946
17947 * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
17948 it's not portable.
17949
17950 * tests/regression.at: Do not use 'cc -c input.c -o input';
17951 Sun C rejects this. Instead, use 'cc -c input.c -o input.o'.
17952
17953 * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero
17954 exit status as failure, not just exit status 1. Sun C exits
17955 with status 2 sometimes.
17956
17957 * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
17958 Use it for the two large tests.
17959
17960 2002-08-02 Akim Demaille <akim@epita.fr>
17961
17962 * src/conflicts.c (conflicts_output): Don't output rules never
17963 reduced here, since anyway that computation doesn't work.
17964 * src/gram.h, src/gram.h (rule_filter_t, rule_useful_p)
17965 (rule_useless_p, rule_never_reduced_p): New.
17966 (grammar_rules_partial_print): Use a filter instead of a range.
17967 Display the title only if needed.
17968 (grammar_rules_print): Adjust.
17969 (grammar_rules_never_reduced_report): New.
17970 * src/tables.c (action_row): Move the computation of rules never
17971 reduced to...
17972 (token_actions): here.
17973 * src/main.c (main): Make the parser before making the report, so
17974 that rules never reduced are computed.
17975 Call grammar_rules_never_reduced_report.
17976 * src/print.c (print_results): Report rules never reduced.
17977 * tests/conflicts.at, tests/reduce.at: Adjust.
17978
17979 2002-08-01 Akim Demaille <akim@epita.fr>
17980
17981 Instead of attaching lookaheads and duplicating the rules being
17982 reduced by a state, attach the lookaheads to the reductions.
17983
17984 * src/state.h (state_t): Remove the `lookaheads',
17985 `lookaheads_rule' member.
17986 (reductions_t): Add a `lookaheads' member.
17987 Use a regular array for the `rules'.
17988 * src/state.c (reductions_new): Initialize the lookaheads member
17989 to 0.
17990 (state_rule_lookaheads_print): Adjust.
17991 * src/state.h, src/state.c (state_reductions_find): New.
17992 * src/conflicts.c (resolve_sr_conflict, set_conflicts)
17993 (count_rr_conflicts): Adjust.
17994 * src/lalr.c (LArule): Remove.
17995 (add_lookback_edge): Adjust.
17996 (state_lookaheads_count): New.
17997 (states_lookaheads_initialize): Merge into...
17998 (initialize_LA): this.
17999 (lalr_free): Adjust.
18000 * src/main.c (main): Don't free nullable and derives too early: it
18001 is used by --verbose.
18002 * src/print.c, src/print_graph.c, src/tables.c: Adjust.
18003
18004 2002-08-01 Akim Demaille <akim@epita.fr>
18005
18006 * src/derives.h, src/derives.c (derives): A `rule_t***' instead of
18007 `rule_number_t**'.
18008 (set_derives, free_derives): Rename as...
18009 (derives_compute, derives_free): this.
18010 Adjust all dependencies.
18011 * src/nullable.c (set_nullable, free_nullable): Rename as...
18012 (nullable_compute, nullable_free): these.
18013 (rule_list_t): Store rule_t *, not rule_number_t.
18014 * src/state.c (state_rule_lookaheads_print): Directly compare rule
18015 pointers, instead of their numbers.
18016 * src/main.c (main): Call nullable_free, and derives_free earlier,
18017 as they were lo longer used.
18018
18019 2002-08-01 Akim Demaille <akim@epita.fr>
18020
18021 * lib/timevar.c (get_time): Include children time.
18022 * src/lalr.h (LA, LArule): Don't export them: used with the
18023 state_t.
18024 * src/lalr.c (LA, LArule): Static.
18025 * src/lalr.h, src/lalr.c (lalr_free): New.
18026 * src/main.c (main): Call it.
18027 * src/tables.c (pack_vector): Check whether loc is >= to the
18028 table_size, not >.
18029 (pack_tables): Don't free froms, tos, conflict_tos, and pos...
18030 (tables_generate): do it, since that's also it which allocates
18031 them.
18032 Don't free LA and LArule, main does.
18033
18034 2002-07-31 Akim Demaille <akim@epita.fr>
18035
18036 Separate parser tables computation and output.
18037
18038 * src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
18039 (conflict_list, conflict_list_cnt, table, check, table_ninf)
18040 (yydefgoto, yydefact, high): Move to...
18041 * src/tables.h, src/tables.c: here.
18042 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
18043 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
18044 (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
18045 (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
18046 (ACTION_MIN, actrow, order, nentries, pos, conflrow)
18047 (conflict_list_free, table_size, lowzero, table_grow, conflict_row)
18048 (action_row, save_row, token_actions, save_column, default_goto)
18049 (goto_actions, sort_actions, matching_state, pack_vector)
18050 (table_ninf_remap, pack_table, prepare_actions): Move to...
18051 * src/tables.c: here.
18052 * src/tables.h, src/tables.c(tables_generate, tables_free): New.
18053 * src/output.c (token_actions, output_base, output_conflicts)
18054 (output_check): Merge into...
18055 (prepare_actions): this.
18056 (actions_output): Rename as...
18057 (user_actions_output): this.
18058 * src/main.c (main): Call tables_generate and tables_free.
18059
18060 2002-07-31 Akim Demaille <akim@epita.fr>
18061
18062 Steal GCC's --time-report support.
18063
18064 * lib/timevar.c, lib/timevar.h, lib/timevar.def: New,
18065 stolen/adjusted from GCC.
18066 * m4/stage.m4: Remove time related checks.
18067 * m4/timevar.m4: New.
18068 * configure.in: Adjust.
18069 * src/system.h: Adjust to using timevar.h.
18070 * src/getargs.h, src/getargs.c: Support trace_time for
18071 --trace=time.
18072 * src/main.c (stage): Remove.
18073 (main): Replace `stage' invocations with timevar calls.
18074 * src/output.c: Insert pertinent timevar calls.
18075
18076 2002-07-31 Akim Demaille <akim@epita.fr>
18077
18078 Let --trace have arguments.
18079
18080 * src/getargs.h (enum trace_e): New.
18081 * src/getargs.c (trace_args, trace_types, trace_argmatch): New.
18082 (long_options, short_options): --trace/-T takes an optional
18083 argument.
18084 Change all the uses of trace_flag to reflect the new flags.
18085 * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
18086
18087 Strengthen `stage' portability.
18088
18089 * m4/stage.m4 (BISON_PREREQ_STAGE): New.
18090 * configure.in: Use it.
18091 Don't check for malloc.h and sys/times.h.
18092 * src/system.h: Include them when appropriate.
18093 * src/main.c (stage): Compile only when mallinfo, struct mallinfo,
18094 times and struct tms are available.
18095
18096 2002-07-30 Akim Demaille <akim@epita.fr>
18097
18098 In verbose parse error message, don't report `error' as an
18099 expected token.
18100 * tests/actions.at (Printers and Destructors): Adjust.
18101 * tests/calc.at (Calculator $1): Adjust.
18102 * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose
18103 error message, do not report the parser accepts the error token in
18104 that state.
18105
18106 2002-07-30 Akim Demaille <akim@epita.fr>
18107
18108 Normalize conflict related messages.
18109
18110 * src/complain.h, src/complain.c (warn, complain): New.
18111 * src/conflicts.c (conflicts_print): Use them.
18112 (conflict_report_yacc): New, extracted from...
18113 (conflicts_print): here.
18114 * tests/conflicts.at, tests/existing.at: Adjust.
18115
18116 2002-07-30 Akim Demaille <akim@epita.fr>
18117
18118 Report rules which are never reduced by the parser: those hidden
18119 by conflicts.
18120
18121 * src/LR0.c (save_reductions): Don't make the final state too
18122 different: save its reduction (accept) instead of having a state
18123 without any action (no shift or goto, no reduce).
18124 Note: the final state is now a ``regular'' state, i.e., the
18125 parsers now contain `reduce 0' as default reduction.
18126 Nevertheless, since they decide to `accept' when yystate =
18127 final_state, they still will not reduce rule 0.
18128 * src/print.c (print_actions, print_reduction): Adjust.
18129 * src/output.c (action_row): Track reduced rules.
18130 (token_actions): Report rules never reduced.
18131 * tests/conflicts.at, tests/regression.at: Adjust.
18132
18133 2002-07-30 Akim Demaille <akim@epita.fr>
18134
18135 `stage' was accidently included in a previous patch.
18136 Initiate its autoconfiscation.
18137
18138 * configure.in: Look for malloc.h and sys/times.h.
18139 * src/main.c (stage): Adjust.
18140 Report only when trace_flag.
18141
18142 2002-07-29 Akim Demaille <akim@epita.fr>
18143
18144 * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not
18145 state_number_t.
18146 (errs_t): symbol_t*, not symbol_number_t.
18147 (reductions_t): rule_t*, not rule_number_t.
18148 (FOR_EACH_SHIFT): New.
18149 * src/LR0.c, src/conflicts.c, src/lalr.c, src/output.c
18150 * src/print.c, src/print_graph.c: Adjust.
18151
18152 2002-07-29 Akim Demaille <akim@epita.fr>
18153
18154 Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
18155
18156 * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
18157 (endtoken, accept): these.
18158 * src/reader.c (reader): Set endtoken's default tag to "$end".
18159 Set undeftoken's tag to "$undefined" instead of "$undefined.".
18160 * doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
18161 Adjust.
18162
18163 2002-07-29 Akim Demaille <akim@epita.fr>
18164
18165 * src/reduce.c (reduce_grammar): When the language is empty,
18166 complain about the start symbol, not the axiom.
18167 Use its location.
18168 * tests/reduce.at (Empty Language): New.
18169
18170 2002-07-26 Akim Demaille <akim@epita.fr>
18171
18172 * src/reader.h, src/reader.c (gram_error): ... can't get
18173 yycontrol without making too strong assumptions on the parser
18174 itself.
18175 * src/output.c (prepare_tokens): Use the real 0th value of
18176 token_translations instead of `0'.
18177 * src/parse-gram.y (yyerror): Don't rely on yycontrol being
18178 visible here.
18179 * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
18180 for the time being: %locations ought to provide it to yyerror.
18181
18182 2002-07-25 Akim Demaille <akim@epita.fr>
18183
18184 * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
18185 * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
18186 * tests/regression.at (Web2c Actions): Adjust.
18187
18188 2002-07-25 Akim Demaille <akim@epita.fr>
18189
18190 Stop storing rules from 1 to nrules + 1.
18191
18192 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
18193 * src/nullable.c, src/output.c, src/print.c, src/reader.c
18194 * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
18195 Iterate from 0 to nrules.
18196 Use rule_number_as_item_number and item_number_as_rule_number.
18197 Adjust to `derive' now containing possibly 0.
18198 * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
18199 Handle the `- 1' part in rule numbers from/to item numbers.
18200 * src/conflicts.c (log_resolution): Fix the message which reversed
18201 shift and reduce.
18202 * src/output.c (action_row): Initialize default_rule to -1.
18203 (token_actions): Adjust.
18204 * tests/sets.at (Nullable, Firsts): Fix the previously bogus
18205 expected output.
18206 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
18207
18208 2002-07-25 Akim Demaille <akim@epita.fr>
18209
18210 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
18211 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
18212 (b4_c_knr_arg_decl): New.
18213 * data/yacc.c: Use it to define yysymprint, yydestruct, and
18214 yyreport_parse_error.
18215
18216 2002-07-25 Akim Demaille <akim@epita.fr>
18217
18218 * data/yacc.c (yyreport_parse_error): New, extracted from...
18219 (yyparse): here.
18220 (yydestruct, yysymprint): Move above yyparse.
18221 Be K&R compliant.
18222
18223 2002-07-25 Akim Demaille <akim@epita.fr>
18224
18225 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
18226 replace...
18227 (b4_sint_type, b4_uint_type): these.
18228 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
18229 * tests/regression.at (Web2c Actions): Adjust.
18230
18231 2002-07-25 Akim Demaille <akim@epita.fr>
18232
18233 * src/gram.h (TIEM_NUMBER_MAX): New.
18234 (item_number_of_rule_number, rule_number_of_item_number): Rename
18235 as...
18236 (rule_number_as_item_number, item_number_as_rule_number): these.
18237 Adjust dependencies.
18238 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
18239 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
18240 (symbol_number_to_vector_number): New.
18241 (order): Of vector_number_t* type.
18242 (base_t, BASE_MAX, BASE_MIN): New.
18243 (froms, tos, width, pos, check): Of base_t type.
18244 (action_number_t, ACTION_MIN, ACTION_MAX): New.
18245 (actrow): Of action_number_t type.
18246 (conflrow): Of unsigned int type.
18247 (table_ninf, base_ninf): New.
18248 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
18249 (muscle_insert_int_table, muscle_insert_base_table)
18250 (muscle_insert_rule_number_table): New.
18251 (prepare_tokens): Output `toknum' as int_table.
18252 (action_row): Returns a rule_number_t.
18253 Use ACTION_MIN, not SHRT_MIN.
18254 (token_actions): yydefact is rule_number_t*.
18255 (table_ninf_remap): New.
18256 (pack_table): Use it for `base' and `table'.
18257 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
18258 replaced with...
18259 (YYPACT_NINF, YYTABLE_NINF): these.
18260 (yypact, yytable): Compute their types instead of hard-coded
18261 `short'.
18262 * tests/regression.at (Web2c Actions): Adjust.
18263
18264 2002-07-19 Akim Demaille <akim@epita.fr>
18265
18266 * src/scan-gram.l (id): Can start with an underscore.
18267
18268 2002-07-16 Akim Demaille <akim@epita.fr>
18269
18270 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
18271 Adjust all former `associativity' dependencies.
18272 * src/symtab.c (symbol_new): Default associativity is `undef', not
18273 `right'.
18274 (symbol_check_alias_consistence): Adjust.
18275
18276 2002-07-09 Akim Demaille <akim@epita.fr>
18277
18278 * doc/bison.texinfo: Properly set the ``header'' part.
18279 Use @dircategory ``GNU programming tools'' as per Texinfo's
18280 documentation.
18281 Use @copying.
18282
18283 2002-07-09 Akim Demaille <akim@epita.fr>
18284
18285 * lib/quotearg.h: Protect against multiple inclusions.
18286 * src/location.h (location_t): Add a `file' member.
18287 (LOCATION_RESET, LOCATION_PRINT): Adjust.
18288 * src/complain.c (warn_at, complain_at, fatal_at): Drop
18289 `error_one_per_line' support.
18290
18291 2002-07-09 Akim Demaille <akim@epita.fr>
18292
18293 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
18294 * src/reader.c (lineno): Remove.
18295 Adjust all dependencies.
18296 (get_merge_function): Take a location and use complain_at.
18297 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
18298 * tests/regression.at (Invalid inputs, Mixing %token styles):
18299 Adjust.
18300
18301 2002-07-09 Akim Demaille <akim@epita.fr>
18302
18303 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
18304 recovery rule, and forbid extensions when --yacc.
18305 (gram_error): Use complain_at.
18306 * src/reader.c (reader): Exit if there were parse errors.
18307
18308 2002-07-09 Akim Demaille <akim@epita.fr>
18309
18310 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
18311 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
18312 Reported by R Blake <blakers@mac.com>.
18313
18314 2002-07-09 Akim Demaille <akim@epita.fr>
18315
18316 * data/yacc.c: Output the copyright notive in the header.
18317
18318 2002-07-03 Akim Demaille <akim@epita.fr>
18319
18320 * src/output.c (froms, tos): Are state_number_t.
18321 (save_column): sp, sp1, and sp2 are state_number_t.
18322 (prepare): Rename `final' as `final_state_number', `nnts' as
18323 `nterms_number', `nrules' as `rules_number', `nstates' as
18324 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
18325 unused.
18326 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
18327 * data/lalr1.cc (nsym_): Remove, unused.
18328
18329 2002-07-03 Akim Demaille <akim@epita.fr>
18330
18331 * src/lalr.h, src/lalr.c (goto_number_t): New.
18332 * src/lalr.c (goto_list_t): New.
18333 Propagate them.
18334 * src/nullable.c (rule_list_t): New.
18335 Propagate.
18336 * src/types.h: Remove.
18337
18338 2002-07-03 Akim Demaille <akim@epita.fr>
18339
18340 * src/closure.c (print_fderives): Use rule_rhs_print.
18341 * src/derives.c (print_derives): Use rule_rhs_print.
18342 (rule_list_t): New, replaces `shorts'.
18343 (set_derives): Add comments.
18344 * tests/sets.at (Nullable, Firsts): Adjust.
18345
18346 2002-07-03 Akim Demaille <akim@epita.fr>
18347
18348 * src/output.c (prepare_actions): Free `tally' and `width'.
18349 (prepare_actions): Allocate and free `order'.
18350 * src/symtab.c (symbols_free): Free `symbols'.
18351 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
18352 * src/output.c (m4_invoke): Move to...
18353 * src/scan-skel.l: here.
18354 (<<EOF>>): Close yyout, and free its name.
18355
18356 2002-07-03 Akim Demaille <akim@epita.fr>
18357
18358 Fix some memory leaks, and fix a bug: state 0 was examined twice.
18359
18360 * src/LR0.c (new_state): Merge into...
18361 (state_list_append): this.
18362 (new_states): Merge into...
18363 (generate_states): here.
18364 (set_states): Don't ensure a proper `errs' state member here, do it...
18365 * src/conflicts.c (conflicts_solve): here.
18366 * src/state.h, src/state.c: Comment changes.
18367 (state_t): Rename member `shifts' as `transitions'.
18368 Adjust all dependencies.
18369 (errs_new): For consistency, also take the values as argument.
18370 (errs_dup): Remove.
18371 (state_errs_set): New.
18372 (state_reductions_set, state_transitions_set): Assert that no
18373 previous value was assigned.
18374 (state_free): New.
18375 (states_free): Use it.
18376 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
18377 temporary storage: use `errs' and `nerrs' as elsewhere.
18378 (set_conflicts): Allocate and free this `errs'.
18379
18380 2002-07-02 Akim Demaille <akim@epita.fr>
18381
18382 * lib/libiberty.h: New.
18383 * lib: Update the bitset implementation from upstream.
18384 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
18385 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
18386 * src/main.c: Adjust bitset stats calls.
18387
18388 2002-07-01 Paul Eggert <eggert@twinsun.com>
18389
18390 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
18391 char, so that negative chars don't collide with $.
18392
18393 2002-06-30 Akim Demaille <akim@epita.fr>
18394
18395 Have the GLR tests be `warning' checked, and fix the warnings.
18396
18397 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
18398 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
18399 (yyremoveDeletes): `yyi' and `yyj' are size_t.
18400 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
18401 (yyaddDeferredAction): static.
18402 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
18403 (yyreportParseError): yyprefix is const.
18404 yytokenp is used only when verbose.
18405 (yy__GNUC__): Replace with __GNUC__.
18406 (yypdumpstack): yyi is size_t.
18407 (yypreference): Un-yy local variables and arguments, to avoid
18408 clashes with `yyr1'. Anyway, we are not in the user name space.
18409 (yytname_size): be an int, as is compared with ints.
18410 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
18411 Use them.
18412 * tests/cxx-gram.at: Use quotation to protect $1.
18413 Use AT_COMPILE to enable warnings hunts.
18414 Prototype yylex and yyerror.
18415 `Use' argc.
18416 Include `string.h', not `strings.h'.
18417 Produce and prototype stmtMerge only when used.
18418 yylex takes a location.
18419
18420 2002-06-30 Akim Demaille <akim@epita.fr>
18421
18422 We spend a lot of time in quotearg, in particular when --verbose.
18423
18424 * src/symtab.c (symbol_get): Store a quoted version of the key.
18425 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
18426 Adjust all callers.
18427
18428 2002-06-30 Akim Demaille <akim@epita.fr>
18429
18430 * src/state.h (reductions_t): Rename member `nreds' as num.
18431 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
18432 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
18433
18434 2002-06-30 Akim Demaille <akim@epita.fr>
18435
18436 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
18437 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
18438 (shifts_to): Rename as...
18439 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
18440 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
18441 (TRANSITION_IS_DISABLED, transitions_to): these.
18442
18443 2002-06-30 Akim Demaille <akim@epita.fr>
18444
18445 * src/print.c (print_shifts, print_gotos): Merge into...
18446 (print_transitions): this.
18447 (print_transitions, print_errs, print_reductions): Align the
18448 lookaheads columns.
18449 (print_core, print_transitions, print_errs, print_state,
18450 print_grammar): Output empty lines separator before, not after.
18451 (state_default_rule_compute): Rename as...
18452 (state_default_rule): this.
18453 * tests/conflicts.at (Defaulted Conflicted Reduction),
18454 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
18455 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
18456
18457 2002-06-30 Akim Demaille <akim@epita.fr>
18458
18459 Display items as we display rules.
18460
18461 * src/gram.h, src/gram.c (rule_lhs_print): New.
18462 * src/gram.c (grammar_rules_partial_print): Use it.
18463 * src/print.c (print_core): Likewise.
18464 * tests/conflicts.at (Defaulted Conflicted Reduction),
18465 (Unresolved SR Conflicts): Adjust.
18466 (Unresolved SR Conflicts): Adjust and rename as...
18467 (Resolved SR Conflicts): this, as was meant.
18468 * tests/regression.at (Web2c Report): Adjust.
18469
18470 2002-06-30 Akim Demaille <akim@epita.fr>
18471
18472 * src/print.c (state_default_rule_compute): New, extracted from...
18473 (print_reductions): here.
18474 Pessimize, but clarify the code.
18475 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
18476
18477 2002-06-30 Akim Demaille <akim@epita.fr>
18478
18479 * src/output.c (action_row): Let default_rule be always a rule
18480 number.
18481
18482 2002-06-30 Akim Demaille <akim@epita.fr>
18483
18484 * src/closure.c (print_firsts, print_fderives, closure):
18485 Use BITSET_EXECUTE.
18486 * src/lalr.c (lookaheads_print): Likewise.
18487 * src/state.c (state_rule_lookaheads_print): Likewise.
18488 * src/print_graph.c (print_core): Likewise.
18489 * src/print.c (print_reductions): Likewise.
18490 * src/output.c (action_row): Likewise.
18491 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
18492
18493 2002-06-30 Akim Demaille <akim@epita.fr>
18494
18495 * src/print_graph.c: Use report_flag.
18496
18497 2002-06-30 Akim Demaille <akim@epita.fr>
18498
18499 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
18500 to...
18501 * src/relation.h, src/relation.c (traverse, relation_digraph)
18502 (relation_print, relation_transpose): New.
18503
18504 2002-06-30 Akim Demaille <akim@epita.fr>
18505
18506 * src/state.h, src/state.c (shifts_to): New.
18507 * src/lalr.c (build_relations): Use it.
18508
18509 2002-06-30 Akim Demaille <akim@epita.fr>
18510
18511 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
18512 (item_number_of_rule_number, rule_number_of_item_number): New.
18513 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
18514 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
18515 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
18516 Propagate their use.
18517 Much remains to be done, in particular wrt `shorts' from types.h.
18518
18519 2002-06-30 Akim Demaille <akim@epita.fr>
18520
18521 * src/symtab.c (symbol_new): Initialize the `printer' member.
18522
18523 2002-06-30 Akim Demaille <akim@epita.fr>
18524
18525 * src/LR0.c (save_reductions): Remove, replaced by...
18526 * src/state.h, src/state.c (state_reductions_set): New.
18527 (reductions, errs): Rename as...
18528 (reductions_t, errs_t): these.
18529 Adjust all dependencies.
18530
18531 2002-06-30 Akim Demaille <akim@epita.fr>
18532
18533 * src/LR0.c (state_list_t, state_list_append): New.
18534 (first_state, last_state): Now symbol_list_t.
18535 (this_state): Remove.
18536 (new_itemsets, append_states, save_reductions): Take a state_t as
18537 argument.
18538 (set_states, generate_states): Adjust.
18539 (save_shifts): Remove, replaced by...
18540 * src/state.h, src/state.c (state_shifts_set): New.
18541 (shifts): Rename as...
18542 (shifts_t): this.
18543 Adjust all dependencies.
18544 * src/state.h (state_t): Remove the `next' member.
18545
18546 2002-06-30 Akim Demaille <akim@epita.fr>
18547
18548 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
18549 escaped in slot 0.
18550
18551 2002-06-30 Akim Demaille <akim@epita.fr>
18552
18553 Use hash.h for the state hash table.
18554
18555 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
18556 (allocate_storage): Use state_hash_new.
18557 (free_storage): Use state_hash_free.
18558 (new_state, get_state): Adjust.
18559 * src/lalr.h, src/lalr.c (states): Move to...
18560 * src/states.h (state_t): Remove the `link' member, no longer
18561 used.
18562 * src/states.h, src/states.c: here.
18563 (state_hash_new, state_hash_free, state_hash_lookup)
18564 (state_hash_insert, states_free): New.
18565 * src/states.c (state_table, state_compare, state_hash): New.
18566 * src/output.c (output_actions): Do not free states now, since we
18567 still need to know the final_state number in `prepare', called
18568 afterwards. Do it...
18569 * src/main.c (main): here: call states_free after `output'.
18570
18571 2002-06-30 Akim Demaille <akim@epita.fr>
18572
18573 * src/state.h, src/state.c (state_new): New, extracted from...
18574 * src/LR0.c (new_state): here.
18575 * src/state.h (STATE_ALLOC): Move to...
18576 * src/state.c: here.
18577 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
18578 * src/state.h, src/state.c: here.
18579
18580 2002-06-30 Akim Demaille <akim@epita.fr>
18581
18582 * src/reader.c (gensym): Rename as...
18583 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
18584 (getsym): Rename as...
18585 (symbol_get): this.
18586
18587 2002-06-30 Akim Demaille <akim@epita.fr>
18588
18589 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
18590 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
18591 * src/output.c, src/print.c, src/print_graph.c: Propagate.
18592 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
18593
18594 2002-06-30 Akim Demaille <akim@epita.fr>
18595
18596 Make the test suite pass with warnings checked.
18597
18598 * tests/actions.at (Printers and Destructors): Improve.
18599 Avoid unsigned vs. signed issues.
18600 * tests/calc.at: Don't exercise the scanner here, do it...
18601 * tests/input.at (Torturing the Scanner): here.
18602
18603 2002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18604
18605 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
18606 reorganize first lines parallel to yacc.c.
18607
18608 2002-06-28 Akim Demaille <akim@epita.fr>
18609
18610 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
18611 (b4_token_enum, b4_token_defines): New, factored from...
18612 * data/lalr1.cc, data/yacc.c, glr.c: here.
18613
18614 2002-06-28 Akim Demaille <akim@epita.fr>
18615
18616 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
18617 unused variables.
18618 * src/output.c (merger_output): static.
18619
18620 2002-06-28 Akim Demaille <akim@epita.fr>
18621
18622 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
18623 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
18624 pacify GCC.
18625 * src/output.c (save_row): Initialize all the variables to pacify GCC.
18626
18627 2002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18628
18629 Accumulated changelog for new GLR parsing features.
18630
18631 * src/conflicts.c (count_total_conflicts): Change name to
18632 conflicts_total_count.
18633 * src/conflicts.h: Ditto.
18634 * src/output.c (token_actions): Use the new name.
18635 (output_conflicts): Change conflp => conflict_list_heads, and
18636 confl => conflict_list for better readability.
18637 * data/glr.c: Use the new names.
18638 * NEWS: Add self to GLR announcement.
18639
18640 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
18641
18642 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
18643 Akim Demaille.
18644
18645 * data/bison.glr: Change name to glr.c
18646 * data/glr.c: Renamed from bison.glr.
18647 * data/Makefile.am: Add glr.c
18648
18649 * src/getargs.c:
18650
18651 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
18652 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
18653
18654 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18655
18656 * data/bison.glr: Be sure to restore the
18657 current #line when returning to the skeleton contents after having
18658 exposed the input file's #line.
18659
18660 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18661
18662 * data/bison.glr: Bring up to date with changes to bison.simple.
18663
18664 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18665
18666 * data/bison.glr: Correct definitions that use b4_prefix.
18667 Various reformatting.
18668 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
18669 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
18670 yytokenp argument; now part of stack.
18671 (yychar): Define to behave as documented.
18672 (yyclearin): Ditto.
18673
18674 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18675
18676 * src/reader.h: Add declaration for free_merger_functions.
18677
18678 * src/reader.c (merge_functions): New variable.
18679 (get_merge_function): New function.
18680 (free_merger_functions): New function.
18681 (readgram): Check for %prec that is not followed by a symbol.
18682 Handle %dprec and %merge declarations.
18683 (packgram): Initialize dprec and merger fields in rules array.
18684
18685 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
18686 conflict_list_cnt, conflict_list_free): New variables.
18687 (table_grow): Also grow conflict_table.
18688 (prepare_rules): Output dprec and merger tables.
18689 (conflict_row): New function.
18690 (action_row): Output conflict lists for GLR parser. Don't use
18691 default reduction in conflicted states for GLR parser so that there
18692 are spaces for the conflict lists.
18693 (save_row): Also save conflict information.
18694 (token_actions): Allocate conflict list.
18695 (merger_output): New function.
18696 (pack_vector): Pack conflict table, too.
18697 (output_conflicts): New function to output yyconflp and yyconfl.
18698 (output_check): Allocate conflict_tos.
18699 (output_actions): Output conflict tables, also.
18700 (output_skeleton): Output b4_mergers definition.
18701 (prepare): Output b4_max_rhs_length definition.
18702 Use 'bison.glr' as default skeleton for GLR parsers.
18703
18704 * src/gram.c (glr_parser): New flag.
18705 (grammar_free): Call free_merger_functions.
18706
18707 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
18708 all pairs of conflicting reductions, rather than just all tokens
18709 causing conflicts. Needed to size conflict tables.
18710 (conflicts_output): Modify call to count_rr_conflicts for new
18711 interface.
18712 (conflicts_print): Ditto.
18713 (count_total_conflicts): New function.
18714
18715 * src/reader.h (merger_list): New type.
18716 (merge_functions): New variable.
18717
18718 * src/lex.h (tok_dprec, tok_merge): New token types.
18719
18720 * src/gram.h (rule_s): Add dprec and merger fields.
18721 (glr_parser): New flag.
18722
18723 * src/conflicts.h (count_total_conflicts): New function.
18724
18725 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
18726
18727 * doc/bison.texinfo (Generalized LR Parsing): New section.
18728 (GLR Parsers): New section.
18729 (Language and Grammar): Mention GLR parsing.
18730 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
18731 Correct typo ("tge" -> "the").
18732
18733 * data/bison.glr: New skeleton for GLR parsing.
18734
18735 * tests/cxx-gram.at: New tests for GLR parsing.
18736
18737 * tests/testsuite.at: Include cxx-gram.at.
18738
18739 * tests/Makefile.am: Add cxx-gram.at.
18740
18741 * src/parse-gram.y:
18742
18743 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
18744
18745 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
18746
18747 2002-06-27 Akim Demaille <akim@epita.fr>
18748
18749 * src/options.h, src/options.c: Remove.
18750 * src/getargs.c (short_options, long_options): New.
18751
18752 2002-06-27 Akim Demaille <akim@epita.fr>
18753
18754 * data/bison.simple, data/bison.c++: Rename as...
18755 * data/yacc.c, data/lalr1.cc: these.
18756 * doc/bison.texinfo (Environment Variables): Remove.
18757
18758 2002-06-25 Raja R Harinath <harinath@cs.umn.edu>
18759
18760 * src/getargs.c (report_argmatch): Initialize strtok().
18761
18762 2002-06-20 Akim Demaille <akim@epita.fr>
18763
18764 * data/bison.simple (b4_symbol_actions): New, replaces...
18765 (b4_symbol_destructor, b4_symbol_printer): these.
18766 (yysymprint): Be sure to call YYPRINT only for tokens, and using
18767 user token numbers.
18768
18769 2002-06-20 Akim Demaille <akim@epita.fr>
18770
18771 * data/bison.simple (yydestructor): Rename as...
18772 (yydestruct): this.
18773
18774 2002-06-20 Akim Demaille <akim@epita.fr>
18775
18776 * src/symtab.h, src/symtab.c (symbol_type_set)
18777 (symbol_destructor_set, symbol_precedence_set): The location is
18778 the last argument.
18779 Adjust all callers.
18780
18781 2002-06-20 Akim Demaille <akim@epita.fr>
18782
18783 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
18784 internals.
18785 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
18786 Takes a location.
18787 * src/symtab.h, src/symtab.c (symbol_class_set)
18788 (symbol_user_token_number_set): Likewise.
18789 Adjust all callers.
18790 Promote complain_at.
18791 * tests/input.at (Type Clashes): Adjust.
18792
18793 2002-06-20 Akim Demaille <akim@epita.fr>
18794
18795 * data/bison.simple (YYLEX): Fix the declaration when
18796 %pure-parser.
18797
18798 2002-06-20 Akim Demaille <akim@epita.fr>
18799
18800 * data/bison.simple (yysymprint): Don't print the token number,
18801 just its name.
18802 * tests/actions.at (Destructors): Rename as...
18803 (Printers and Destructors): this.
18804 Also exercise %printer.
18805
18806 2002-06-20 Akim Demaille <akim@epita.fr>
18807
18808 * data/bison.simple (YYDSYMPRINT): New.
18809 Use it to remove many of the #if YYDEBUG/if (yydebug).
18810
18811 2002-06-20 Akim Demaille <akim@epita.fr>
18812
18813 * src/symtab.h, src/symtab.c (symbol_t): printer and
18814 printer_location are new members.
18815 (symbol_printer_set): New.
18816 * src/parse-gram.y (PERCENT_PRINTER): New token.
18817 Handle its associated rule.
18818 * src/scan-gram.l: Adjust.
18819 (handle_destructor_at, handle_destructor_dollar): Rename as...
18820 (handle_symbol_code_at, handle_symbol_code_dollar): these.
18821 * src/output.c (symbol_printers_output): New.
18822 (output_skeleton): Call it.
18823 * data/bison.simple (yysymprint): New. Cannot be named yyprint
18824 since there are already many grammar files with a user `yyprint'.
18825 Replace the calls to YYPRINT to calls to yysymprint.
18826 * tests/calc.at: Adjust.
18827 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
18828 taking advantage of parser very internal details (stack size!).
18829
18830 2002-06-20 Akim Demaille <akim@epita.fr>
18831
18832 * src/scan-gram.l: Complete the scanner with the missing patterns
18833 to pacify Flex.
18834 Use `quote' and `symbol_tag_get' where appropriate.
18835
18836 2002-06-19 Akim Demaille <akim@epita.fr>
18837
18838 * tests/actions.at (Destructors): Augment to test locations.
18839 * data/bison.simple (yydestructor): Pass it the current location
18840 if locations are enabled.
18841 Prototype only when __STDC__ or C++.
18842 Change the argument names to move into the yy name space: there is
18843 user code here.
18844
18845 2002-06-19 Akim Demaille <akim@epita.fr>
18846
18847 * data/bison.simple (b4_pure_if): New.
18848 Use it instead of #ifdef YYPURE.
18849
18850 2002-06-19 Akim Demaille <akim@epita.fr>
18851
18852 * data/bison.simple (b4_location_if): New.
18853 Use it instead of #ifdef YYLSP_NEEDED.
18854
18855 2002-06-19 Akim Demaille <akim@epita.fr>
18856
18857 Prepare @$ in %destructor, but currently don't bind it in the
18858 skeleton, as %location use is not cleaned up yet.
18859
18860 * src/scan-gram.l (handle_dollar, handle_destructor_at)
18861 (handle_action_at): New.
18862 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
18863 a braced_code_t and a location as additional arguments.
18864 (handle_destructor_dollar): Instead of requiring `b4_eval', just
18865 unquote one when outputting `b4_dollar_dollar'.
18866 Adjust callers.
18867 * data/bison.simple (b4_eval): Remove.
18868 (b4_symbol_destructor): Adjust.
18869 * tests/input.at (Invalid @n): Adjust.
18870
18871 2002-06-19 Zack Weinberg <zack@codesourcery.com>
18872
18873 * doc/bison.texinfo: Document ability to have multiple
18874 prologue sections.
18875
18876 2002-06-18 Akim Demaille <akim@epita.fr>
18877
18878 * src/files.c (compute_base_names): When computing the output file
18879 names from the input file name, strip the directory part.
18880
18881 2002-06-18 Akim Demaille <akim@epita.fr>
18882
18883 * data/bison.simple.new: Comment changes.
18884 Reported by Andreas Schwab.
18885
18886 2002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
18887
18888 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
18889 there are no `label `yyoverflowlab' defined but not used' warnings
18890 when yyoverflow is defined.
18891
18892 2002-06-18 Akim Demaille <akim@epita.fr>
18893
18894 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
18895 new member.
18896 (symbol_destructor_set): Adjust.
18897 * src/output.c (symbol_destructors_output): Output the destructor
18898 locations.
18899 Output the symbol name.
18900 * data/bison.simple (b4_symbol_destructor): Adjust.
18901
18902 2002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
18903 and Akim Demaille <akim@epita.fr>
18904
18905 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
18906 what's left on the stack when the error recovery hits EOF.
18907 * tests/actions.at (Destructors): Complete to exercise this case.
18908
18909 2002-06-17 Akim Demaille <akim@epita.fr>
18910
18911 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
18912 arguments is really empty, not only equal to `[]'.
18913 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
18914 member.
18915 (symbol_destructor_set): New.
18916 * src/output.c (symbol_destructors_output): New.
18917 * src/reader.h (brace_code_t, current_braced_code): New.
18918 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
18919 (handle_dollar): Rename as...
18920 (handle_action_dollar): this.
18921 (handle_destructor_dollar): New.
18922 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
18923 (grammar_declaration): Use it.
18924 * data/bison.simple (yystos): Is always defined.
18925 (yydestructor): New.
18926 * tests/actions.at (Destructors): New.
18927 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
18928
18929 2002-06-17 Akim Demaille <akim@epita.fr>
18930
18931 * src/symlist.h, src/symlist.c (symbol_list_length): New.
18932 * src/scan-gram.l (handle_dollar, handle_at): Compute the
18933 rule_length only when needed.
18934 * src/output.c (actions_output, token_definitions_output): Output
18935 the full M4 block.
18936 * src/symtab.c: Don't access directly to the symbol tag, use
18937 symbol_tag_get.
18938 * src/parse-gram.y: Use symbol_list_free.
18939
18940 2002-06-17 Akim Demaille <akim@epita.fr>
18941
18942 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
18943 (symbol_list_prepend, get_type_name): Move to...
18944 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
18945 (symbol_list_prepend, symbol_list_n_type_name_get): here.
18946 Adjust all callers.
18947 (symbol_list_free): New.
18948 * src/scan-gram.l (handle_dollar): Takes a location.
18949 * tests/input.at (Invalid $n): Adjust.
18950
18951 2002-06-17 Akim Demaille <akim@epita.fr>
18952
18953 * src/reader.h, src/reader.c (symbol_list_new): Export it.
18954 (symbol_list_prepend): New.
18955 * src/parse-gram.y (%union): `list' is a new member.
18956 (symbols.1): New, replaces...
18957 (terms_to_prec.1, nterms_to_type.1): these.
18958 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
18959 Take a location as additional argument.
18960 Adjust all callers.
18961
18962 2002-06-15 Akim Demaille <akim@epita.fr>
18963
18964 * src/parse-gram.y: Move %token in the declaration section so that
18965 we don't depend upon CVS Bison.
18966
18967 2002-06-15 Akim Demaille <akim@epita.fr>
18968
18969 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
18970 * src/print.c (print_core): Use it.
18971
18972 2002-06-15 Akim Demaille <akim@epita.fr>
18973
18974 * src/conflicts.c (log_resolution): Accept the rule involved in
18975 the sr conflicts instead of the lookahead number that points to
18976 that rule.
18977 (flush_reduce): Accept the current lookahead vector as argument,
18978 instead of the index in LA.
18979 (resolve_sr_conflict): Accept the current number of lookahead
18980 bitset to consider for the STATE, instead of the index in LA.
18981 (set_conflicts): Adjust.
18982 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
18983
18984 2002-06-15 Akim Demaille <akim@epita.fr>
18985
18986 * src/state.h (state_t): Replace the `lookaheadsp' member, a
18987 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
18988 Adjust all dependencies.
18989 * src/lalr.c (initialize_lookaheads): Split into...
18990 (states_lookaheads_count, states_lookaheads_initialize): these.
18991 (lalr): Adjust.
18992
18993 2002-06-15 Akim Demaille <akim@epita.fr>
18994
18995 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
18996 out of...
18997 (grammar_rules_print): here.
18998 * src/reduce.c (reduce_output): Use it.
18999 * tests/reduce.at (Useless Rules, Reduced Automaton)
19000 (Underivable Rules): Adjust.
19001
19002 2002-06-15 Akim Demaille <akim@epita.fr>
19003
19004 Copy BYacc's nice way to report the grammar.
19005
19006 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
19007 New.
19008 Don't print the rules' location, it is confusing and useless.
19009 (rule_print): Use grammar_rhs_print.
19010 * src/print.c (print_grammar): Use grammar_rules_print.
19011
19012 2002-06-15 Akim Demaille <akim@epita.fr>
19013
19014 Complete and rationalize `useless thing' warnings.
19015
19016 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
19017 (symbol_tag_print): New.
19018 Use them everywhere in place of accessing directly the tag member.
19019 * src/gram.h, src/gram.c (rule_print): New.
19020 Use it where a rule used to be printed `by hand'.
19021 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
19022 (reduce_grammar_tables): Report the useless rules.
19023 (reduce_print): Useless things are a warning, not an error.
19024 Report it as such.
19025 * tests/reduce.at (Useless Nonterminals, Useless Rules):
19026 (Reduced Automaton, Underivable Rules): Adjust.
19027 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
19028 * tests/conflicts.at (Unresolved SR Conflicts)
19029 (Solved SR Conflicts): Adjust.
19030
19031 2002-06-15 Akim Demaille <akim@epita.fr>
19032
19033 Let symbols have a location.
19034
19035 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
19036 (getsym): Adjust.
19037 Adjust all callers.
19038 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
19039 Use location_t, not int.
19040 * src/symtab.c (symbol_check_defined): Take advantage of the
19041 location.
19042 * tests/regression.at (Invalid inputs): Adjust.
19043
19044 2002-06-15 Akim Demaille <akim@epita.fr>
19045
19046 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
19047 (input): Don't try to initialize yylloc here, do it in the
19048 scanner.
19049 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
19050 * src/gram.h (rule_t): Change line and action_line into location
19051 and action_location, of location_t type.
19052 Adjust all dependencies.
19053 * src/location.h, src/location.c (empty_location): New.
19054 * src/reader.h, src/reader.c (grammar_start_symbol_set)
19055 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
19056 (grammar_current_rule_symbol_append)
19057 (grammar_current_rule_action_append): Expect a location as argument.
19058 * src/reader.c (grammar_midrule_action): Adjust to attach an
19059 action's location as dummy symbol location.
19060 * src/symtab.h, src/symtab.c (startsymbol_location): New.
19061 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
19062 the line numbers.
19063
19064 2002-06-14 Akim Demaille <akim@epita.fr>
19065
19066 Grammar declarations may be found in the grammar section.
19067
19068 * src/parse-gram.y (rules_or_grammar_declaration): New.
19069 (declarations): Each declaration may end with a semicolon, not
19070 just...
19071 (grammar_declaration): `"%union"'.
19072 (grammar): Branch to rules_or_grammar_declaration.
19073
19074 2002-06-14 Akim Demaille <akim@epita.fr>
19075
19076 * src/main.c (main): Invoke scanner_free.
19077
19078 2002-06-14 Akim Demaille <akim@epita.fr>
19079
19080 * src/output.c (m4_invoke): Extracted from...
19081 (output_skeleton): here.
19082 Free tempfile.
19083
19084 2002-06-14 Akim Demaille <akim@epita.fr>
19085
19086 * src/parse-gram.y (directives, directive, gram)
19087 (grammar_directives, precedence_directives, precedence_directive):
19088 Rename as...
19089 (declarations, declaration, grammar, grammar_declaration)
19090 (precedence_declaration, precedence_declarator): these.
19091 (symbol_declaration): New.
19092
19093 2002-06-14 Akim Demaille <akim@epita.fr>
19094
19095 * src/files.c (action_obstack): Remove, unused.
19096 (output_obstack): Remove it, and all its dependencies, as it is no
19097 longer needed.
19098 * src/reader.c (epilogue_set): Build the epilogue in the
19099 muscle_obstack.
19100 * src/output.h, src/output.c (muscle_obstack): Move to...
19101 * src/muscle_tab.h, src/muscle_tab.h: here.
19102 (muscle_init): Initialize muscle_obstack.
19103 (muscle_free): New.
19104 * src/main.c (main): Call it.
19105
19106 2002-06-14 Akim Demaille <akim@epita.fr>
19107
19108 * src/location.h: New, extracted from...
19109 * src/reader.h: here.
19110 * src/Makefile.am (noinst_HEADERS): Merge into
19111 (bison_SOURCES): this.
19112 Add location.h.
19113 * src/parse-gram.y: Use location_t instead of Bison's.
19114 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
19115 Use location_t instead of ints.
19116
19117 2002-06-14 Akim Demaille <akim@epita.fr>
19118
19119 * data/bison.simple, data/bison.c++: Be sure to restore the
19120 current #line when returning to the skeleton contents after having
19121 exposed the input file's #line.
19122
19123 2002-06-12 Akim Demaille <akim@epita.fr>
19124
19125 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
19126 eager.
19127 * tests/actions.at (Exotic Dollars): New.
19128
19129 2002-06-12 Akim Demaille <akim@epita.fr>
19130
19131 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
19132 ['"/] too eagerly.
19133 * tests/input.at (Torturing the Scanner): New.
19134
19135 2002-06-11 Akim Demaille <akim@epita.fr>
19136
19137 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
19138 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
19139 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
19140 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
19141 * src/reader.c (reader): Use it.
19142
19143 2002-06-11 Akim Demaille <akim@epita.fr>
19144
19145 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
19146 Adjust all callers.
19147 (scanner_last_string_free): New.
19148
19149 2002-06-11 Akim Demaille <akim@epita.fr>
19150
19151 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
19152 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
19153 (last_string, YY_OBS_FREE): New.
19154 Use them when returning an ID.
19155
19156 2002-06-11 Akim Demaille <akim@epita.fr>
19157
19158 Have Bison grammars parsed by a Bison grammar.
19159
19160 * src/reader.c, src/reader.h (prologue_augment): New.
19161 * src/reader.c (copy_definition): Remove.
19162
19163 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
19164 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
19165 (grammar_current_rule_prec_set, grammar_current_rule_check)
19166 (grammar_current_rule_symbol_append)
19167 (grammar_current_rule_action_append): Export.
19168 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
19169 (symbol_list_action_append): Remove.
19170 Hook the routines from reader.
19171 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
19172 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
19173
19174 * src/reader.c (read_declarations): Remove, unused.
19175
19176 * src/parse-gram.y: Handle the epilogue.
19177 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
19178 (grammar_start_symbol_set): this.
19179 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
19180 * src/reader.c (readgram): Remove, unused.
19181 (reader): Adjust to insert eoftoken and axiom where appropriate.
19182
19183 * src/reader.c (copy_dollar): Replace with...
19184 * src/scan-gram.h (handle_dollar): this.
19185 * src/parse-gram.y: Remove `%thong'.
19186
19187 * src/reader.c (copy_at): Replace with...
19188 * src/scan-gram.h (handle_at): this.
19189
19190 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
19191 New.
19192
19193 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
19194 time being.
19195
19196 * src/reader.h, src/reader.c (grammar_rule_end): New.
19197
19198 * src/parse.y (current_type, current_class): New.
19199 Implement `%nterm', `%token' support.
19200 Merge `%term' into `%token'.
19201 (string_as_id): New.
19202 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
19203 type name.
19204
19205 * src/parse-gram.y: Be sure to handle properly the beginning of
19206 rules.
19207
19208 * src/parse-gram.y: Handle %type.
19209 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
19210
19211 * src/parse-gram.y: More directives support.
19212 * src/options.c: No longer handle source directives.
19213
19214 * src/parse-gram.y: Fix %output.
19215
19216 * src/parse-gram.y: Handle %union.
19217 Use the prologue locations.
19218 * src/reader.c (parse_union_decl): Remove.
19219
19220 * src/reader.h, src/reader.c (epilogue_set): New.
19221 * src/parse-gram.y: Use it.
19222
19223 * data/bison.simple, data/bison.c++: b4_stype is now either not
19224 defined, then default to int, or to the contents of %union,
19225 without `union' itself.
19226 Adjust.
19227 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
19228
19229 * src/output.c (actions_output): Don't output braces, as they are
19230 already handled by the scanner.
19231
19232 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
19233 characters to themselves.
19234
19235 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
19236 that the epilogue has a proper #line.
19237
19238 * src/parse-gram.y: Handle precedence/associativity.
19239
19240 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
19241 a terminal.
19242 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
19243 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
19244 at all to define terminals that cannot be emitted.
19245
19246 * src/scan-gram.l: Escape M4 characters.
19247
19248 * src/scan-gram.l: Working properly with escapes in user
19249 strings/characters.
19250
19251 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
19252 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
19253 grammar.
19254 Use more modest sizes, as for the time being the parser does not
19255 release memory, and therefore the process swallows a huge amount
19256 of memory.
19257
19258 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
19259 stricter %token grammar.
19260
19261 * src/symtab.h (associativity): Add `undef_assoc'.
19262 (symbol_precedence_set): Do nothing when passed an undef_assoc.
19263 * src/symtab.c (symbol_check_alias_consistence): Adjust.
19264
19265 * tests/regression.at (Invalid %directive): Remove, as it is now
19266 meaningless.
19267 (Invalid inputs): Adjust to the new error messages.
19268 (Token definitions): The new grammar doesn't allow too many
19269 eccentricities.
19270
19271 * src/lex.h, src/lex.c: Remove.
19272 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
19273 (copy_character, copy_string2, copy_string, copy_identifier)
19274 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
19275 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
19276 (parse_action): Remove.
19277 * po/POTFILES.in: Adjust.
19278
19279 2002-06-11 Akim Demaille <akim@epita.fr>
19280
19281 * src/reader.c (parse_action): Don't store directly into the
19282 rule's action member: return the action as a string.
19283 Don't require `rule_length' as an argument: compute it.
19284 (grammar_current_rule_symbol_append)
19285 (grammar_current_rule_action_append): New, eved out from
19286 (readgram): here.
19287 Remove `action_flag', `rulelength', unused now.
19288
19289 2002-06-11 Akim Demaille <akim@epita.fr>
19290
19291 * src/reader.c (grammar_current_rule_prec_set).
19292 (grammar_current_rule_check): New, eved out from...
19293 (readgram): here.
19294 Remove `xaction', `first_rhs': useless.
19295 * tests/input.at (Type clashes): New.
19296 * tests/existing.at (GNU Cim Grammar): Adjust.
19297
19298 2002-06-11 Akim Demaille <akim@epita.fr>
19299
19300 * src/reader.c (grammar_midrule_action): New, Eved out from
19301 (readgram): here.
19302
19303 2002-06-11 Akim Demaille <akim@epita.fr>
19304
19305 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
19306 New.
19307 (readgram): Use them as replacement of inlined code, crule and
19308 crule1.
19309
19310 2002-06-11 Akim Demaille <akim@epita.fr>
19311
19312 * src/reader.c (grammar_end, grammar_symbol_append): New.
19313 (readgram): Use them.
19314 Make the use of `p' as local as possible.
19315
19316 2002-06-10 Akim Demaille <akim@epita.fr>
19317
19318 GCJ's parser requires the tokens to be defined before the prologue.
19319
19320 * data/bison.simple: Output the token definition before the user's
19321 prologue.
19322 * tests/regression.at (Braces parsing, Duplicate string)
19323 (Mixing %token styles): Check the output from bison.
19324 (Early token definitions): New.
19325
19326 2002-06-10 Akim Demaille <akim@epita.fr>
19327
19328 * src/symtab.c (symbol_user_token_number_set): Don't complain when
19329 assigning twice the same user number to a token, so that we can
19330 use it in...
19331 * src/lex.c (lex): here.
19332 Also use `symbol_class_set' instead of hand written code.
19333 * src/reader.c (parse_assoc_decl): Likewise.
19334
19335 2002-06-10 Akim Demaille <akim@epita.fr>
19336
19337 * src/symtab.c, src/symtab.c (symbol_class_set)
19338 (symbol_user_token_number_set): New.
19339 * src/reader.c (parse_token_decl): Use them.
19340 Use a switch instead of ifs.
19341 Use a single argument.
19342
19343 2002-06-10 Akim Demaille <akim@epita.fr>
19344
19345 Remove `%thong' support as it is undocumented, unused, duplicates
19346 `%token's job, and creates useless e-mail traffic with people who
19347 want to know what it is, why it is undocumented, unused, and
19348 duplicates `%token's job.
19349
19350 * src/reader.c (parse_thong_decl): Remove.
19351 * src/options.c (option_table): Remove "thong".
19352 * src/lex.h (tok_thong): Remove.
19353
19354 2002-06-10 Akim Demaille <akim@epita.fr>
19355
19356 * src/symtab.c, src/symtab.c (symbol_type_set)
19357 (symbol_precedence_set): New.
19358 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
19359 (value_components_used): Remove, unused.
19360
19361 2002-06-09 Akim Demaille <akim@epita.fr>
19362
19363 Move symbols handling code out of the reader.
19364
19365 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
19366 (axiom): Move to...
19367 * src/symtab.h, src/symtab.c: here.
19368
19369 * src/gram.c (start_symbol): Remove: use startsymbol->number.
19370 * src/reader.c (startval): Rename as...
19371 * src/symtab.h, src/symtab.c (startsymbol): this.
19372 * src/reader.c: Adjust.
19373
19374 * src/reader.c (symbol_check_defined, symbol_make_alias)
19375 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
19376 (token_translations_init)
19377 Move to...
19378 * src/symtab.c: here.
19379 * src/reader.c (packsymbols): Move to...
19380 * src/symtab.h, src/symtab.c (symbols_pack): here.
19381 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
19382 argument.
19383
19384 2002-06-03 Akim Demaille <akim@epita.fr>
19385
19386 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
19387 then statements.
19388
19389 2002-06-03 Akim Demaille <akim@epita.fr>
19390
19391 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
19392 structs with non literals.
19393 * src/scan-skel.l: never-interactive.
19394 * src/conflicts.c (enum conflict_resolution_e): No trailing
19395 comma.
19396 * src/getargs.c (usage): Split long literal strings.
19397 Reported by Hans Aberg.
19398
19399 2002-05-28 Akim Demaille <akim@epita.fr>
19400
19401 * data/bison.c++: Use C++ ostreams.
19402 (cdebug_): New member.
19403
19404 2002-05-28 Akim Demaille <akim@epita.fr>
19405
19406 * src/output.c (output_skeleton): Be sure to allocate enough room
19407 for `/' _and_ for `\0' in full_skeleton.
19408
19409 2002-05-28 Akim Demaille <akim@epita.fr>
19410
19411 * data/bison.c++: Catch up with bison.simple:
19412 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
19413 and Paul Eggert <eggert@twinsun.com>: `error' handing.
19414 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
19415 and popping traces.
19416
19417 2002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
19418
19419 * src/output.c (output_skeleton): Put an explicit path in front of
19420 the skeleton file name, rather than relying on the -I directory,
19421 to partially alleviate effects of having a skeleton file lying around
19422 in the current directory.
19423
19424 2002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
19425
19426 * src/conflicts.c (log_resolution): Correct typo:
19427 obstack_printf should be obstack_fgrow1.
19428
19429 2002-05-26 Akim Demaille <akim@epita.fr>
19430
19431 * src/state.h (state_t): `solved_conflicts' is a new member.
19432 * src/LR0.c (new_state): Set it to 0.
19433 * src/conflicts.h, src/conflicts.c (print_conflicts)
19434 (free_conflicts, solve_conflicts): Rename as...
19435 (conflicts_print, conflicts_free, conflicts_solve): these.
19436 Adjust callers.
19437 * src/conflicts.c (enum conflict_resolution_e)
19438 (solved_conflicts_obstack): New, used by...
19439 (log_resolution): this.
19440 Adjust to attach the conflict resolution to each state.
19441 Complete the description with the precedence/associativity
19442 information.
19443 (resolve_sr_conflict): Adjust.
19444 * src/print.c (print_state): Output its solved_conflicts.
19445 * tests/conflicts.at (Unresolved SR Conflicts)
19446 (Solved SR Conflicts): Exercise --report=all.
19447
19448 2002-05-26 Akim Demaille <akim@epita.fr>
19449
19450 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
19451 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
19452 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
19453 (token_number_t, item_number_as_token_number)
19454 (token_number_as_item_number, muscle_insert_token_number_table):
19455 Rename as...
19456 (symbol_number_t, item_number_as_symbol_number)
19457 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
19458 these, since it is more appropriate.
19459
19460 2002-05-26 Akim Demaille <akim@epita.fr>
19461
19462 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
19463 `Error:' lines.
19464 * data/bison.simple (yystos) [YYDEBUG]: New.
19465 (yyparse) [YYDEBUG]: Display the symbols which are popped during
19466 error recovery.
19467 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
19468
19469 2002-05-25 Akim Demaille <akim@epita.fr>
19470
19471 * doc/bison.texinfo (Debugging): Split into...
19472 (Tracing): this new section, its former contents, and...
19473 (Understanding): this new section.
19474 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
19475 by...
19476 (report_flag): this.
19477 Adjust all dependencies.
19478 (report_args, report_types, report_argmatch): New.
19479 (usage, getargs): Report/support -r, --report.
19480 * src/options.h
19481 (struct option_table_struct): Rename as..,
19482 (struct option_table_s): this.
19483 Rename the `set_flag' member to `flag' to match with getopt_long's
19484 struct.
19485 * src/options.c (option_table): Split verbose into an entry for
19486 %verbose, and another for --verbose.
19487 Support --report/-r, so remove -r from the obsolete --raw.
19488 * src/print.c: Attach full item sets and lookaheads reports to
19489 report_flag instead of trace_flag.
19490 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
19491
19492 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
19493 and Paul Eggert <eggert@twinsun.com>
19494
19495 * data/bison.simple (yyparse): Correct error handling to conform to
19496 POSIX and yacc. Specifically, after syntax error is discovered,
19497 do not reduce further before shifting the error token.
19498 Clean up the code a bit by removing the labels yyerrdefault,
19499 yyerrhandle, yyerrpop.
19500 * NEWS: Document the above.
19501
19502 2002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
19503
19504 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
19505 type; it isn't always big enough, since it doesn't necessarily
19506 include non-terminals.
19507 (yytranslate): Expand definition of yy_token_number_type, so that
19508 the latter can be removed.
19509 (yy_token_number_type): Remove, only one use.
19510 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
19511 don't use TokenNumberType as element type.
19512
19513 * tests/regression.at: Modify expected output to agree with change
19514 to yyr1 and yytranslate.
19515
19516 2002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
19517
19518 * src/reader.c (parse_action): Use copy_character instead of
19519 obstack_1grow.
19520
19521 2002-05-13 Akim Demaille <akim@epita.fr>
19522
19523 * tests/regression.at (Token definitions): Prototype yylex and
19524 yyerror.
19525
19526 2002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
19527
19528 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
19529 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
19530 32-bit arithmetic.
19531 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
19532
19533 2002-05-07 Akim Demaille <akim@epita.fr>
19534
19535 * tests/synclines.at: Be sure to prototype yylex and yyerror to
19536 avoid GCC warnings.
19537
19538 2002-05-07 Akim Demaille <akim@epita.fr>
19539
19540 Kill GCC warnings.
19541
19542 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
19543 over the RHS of each rule.
19544 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
19545 * src/state.h (state_t): Member `nitems' is unsigned short.
19546 * src/LR0.c (get_state): Adjust.
19547 * src/reader.c (packgram): Likewise.
19548 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
19549 `Type'.
19550 (muscle_insert_int_table): Remove, unused.
19551 (prepare_rules): Remove `max'.
19552
19553 2002-05-06 Akim Demaille <akim@epita.fr>
19554
19555 * src/closure.c (print_firsts): Display of the symbol tags.
19556 (bitmatrix_print): Move to...
19557 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
19558 here.
19559 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
19560
19561 2002-05-06 Akim Demaille <akim@epita.fr>
19562
19563 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
19564 hash_do_for_each.
19565
19566 2002-05-06 Akim Demaille <akim@epita.fr>
19567
19568 * src/LR0.c (new_state, get_state): Instead of using the global
19569 `kernel_size' and `kernel_base', have two new arguments:
19570 `core_size' and `core'.
19571 Adjust callers.
19572
19573 2002-05-06 Akim Demaille <akim@epita.fr>
19574
19575 * src/reader.c (packgram): No longer end `ritem' with a 0
19576 sentinel: it is not used.
19577
19578 2002-05-05 Akim Demaille <akim@epita.fr>
19579
19580 New experimental feature: display the lookaheads in the report and
19581 graph.
19582
19583 * src/print (print_core): When --trace-flag, display the rules
19584 lookaheads.
19585 * src/print_graph.c (print_core): Likewise.
19586 Swap the arguments.
19587 Adjust caller.
19588
19589 2002-05-05 Akim Demaille <akim@epita.fr>
19590
19591 * tests/torture.at (Many lookaheads): New test.
19592
19593 2002-05-05 Akim Demaille <akim@epita.fr>
19594
19595 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
19596 (GENERATE_MUSCLE_INSERT_TABLE): this.
19597 (output_int_table, output_unsigned_int_table, output_short_table)
19598 (output_token_number_table, output_item_number_table): Replace with...
19599 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
19600 (muscle_insert_short_table, muscle_insert_token_number_table)
19601 (muscle_insert_item_number_table): these.
19602 Adjust all callers.
19603 (prepare_tokens): Don't free `translations', since...
19604 * src/reader.h, src/reader.c (grammar_free): do it.
19605 Move to...
19606 * src/gram.h, src/gram.c (grammar_free): here.
19607 * data/bison.simple, data/bison.c++: b4_token_number_max is now
19608 b4_translate_max.
19609
19610 2002-05-05 Akim Demaille <akim@epita.fr>
19611
19612 * src/output.c (output_unsigned_int_table): New.
19613 (prepare_rules): `i' is unsigned.
19614 `prhs', `rline', `r2' are unsigned int.
19615 Rename muscle `rhs_number_max' as `rhs_max'.
19616 Output muscles `prhs_max', `rline_max', and `r2_max'.
19617 Free rline and r1.
19618 * data/bison.simple, data/bison.c++: Adjust to use these muscles
19619 to compute types instead of constant types.
19620 * tests/regression.at (Web2c Actions): Adjust.
19621
19622 2002-05-04 Akim Demaille <akim@epita.fr>
19623
19624 * src/symtab.h (SALIAS, SUNDEF): Rename as...
19625 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
19626 Adjust dependencies.
19627 * src/output.c (token_definitions_output): Be sure not to output a
19628 `#define 'a'' when fed with `%token 'a' "a"'.
19629 * tests/regression.at (Token definitions): New.
19630
19631 2002-05-03 Paul Eggert <eggert@twinsun.com>
19632
19633 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
19634 for K&R C.
19635
19636 2002-05-03 gettextize <bug-gnu-gettext@gnu.org>
19637
19638 * Makefile.am (SUBDIRS): Remove intl.
19639 (EXTRA_DIST): Add config/config.rpath.
19640
19641 2002-05-03 Akim Demaille <akim@epita.fr>
19642
19643 * data/bison.simple (m4_if): Don't output empty enums.
19644 And actually, output valid enum definitions :(.
19645
19646 2002-05-03 Akim Demaille <akim@epita.fr>
19647
19648 * configure.bat: Remove, completely obsolete.
19649 * Makefile.am (EXTRA_DIST): Adjust.
19650 Don't distribute config.rpath...
19651 * config/Makefile.am (EXTRA_DIST): Do it.
19652
19653 2002-05-03 Akim Demaille <akim@epita.fr>
19654
19655 * configure.in (GETTEXT_VERSION): New.
19656 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
19657
19658 2002-05-03 Akim Demaille <akim@epita.fr>
19659
19660 * data/bison.simple (b4_token_enum): New.
19661 (b4_token_defines): Use it to output tokens both as #define and
19662 enums.
19663 Suggested by Paul Eggert.
19664 * src/output.c (token_definitions_output): Don't output spurious
19665 white spaces.
19666
19667 2002-05-03 Akim Demaille <akim@epita.fr>
19668
19669 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
19670
19671 2002-05-02 Robert Anisko <robert@lrde.epita.fr>
19672
19673 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
19674 Update the stack class, give a try to deque as the default container.
19675
19676 2002-05-02 Akim Demaille <akim@epita.fr>
19677
19678 * data/bison.simple (yyparse): Do not implement @$ = @1.
19679 (YYLLOC_DEFAULT): Adjust to do it.
19680 * doc/bison.texinfo (Location Default Action): Fix.
19681
19682 2002-05-02 Akim Demaille <akim@epita.fr>
19683
19684 * src/reader.c (parse_braces): Merge into...
19685 (parse_action): this.
19686
19687 2002-05-02 Akim Demaille <akim@epita.fr>
19688
19689 * configure.in (ALL_LINGUAS): Remove.
19690 * po/LINGUAS, hr.po: New.
19691
19692 2002-05-02 Akim Demaille <akim@epita.fr>
19693
19694 Remove the so called hairy (semantic) parsers.
19695
19696 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
19697 * src/gram.h, src/gram.c (semantic_parser): Remove.
19698 (rule_t): Remove the guard and guard_line members.
19699 * src/lex.h (token_t): remove tok_guard.
19700 * src/options.c (option_table): Remove %guard and %semantic_parser
19701 support.
19702 * src/output.c, src/output.h (guards_output): Remove.
19703 (prepare): Adjust.
19704 (token_definitions_output): Don't output the `T'
19705 tokens (???).
19706 (output_skeleton): Don't output the guards.
19707 * src/files.c, src/files.c (attrsfile): Remove.
19708 * src/reader.c (symbol_list): Remove the guard and guard_line
19709 members.
19710 Adjust dependencies.
19711 (parse_guard): Remove.
19712 * data/bison.hairy: Remove.
19713 * doc/bison.texinfo (Environment Variables): Remove occurrences of
19714 BISON_HAIRY.
19715
19716 2002-05-02 Akim Demaille <akim@epita.fr>
19717
19718 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
19719 (parse_guard): Rename the formal argument `stack_offset' as
19720 `rule_length', which is more readable.
19721 Adjust callers.
19722 (copy_at, copy_dollar): Instead of outputting the hard coded
19723 values of $$, $n and so forth, output invocation to b4_lhs_value,
19724 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
19725 Note: this patch partially drops `semantic-parser' support: it
19726 always does `rule_length - n', where semantic parsers ought to
19727 always use `-n'.
19728 * data/bison.simple, data/bison.c++ (b4_lhs_value)
19729 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
19730
19731 2002-05-02 Akim Demaille <akim@epita.fr>
19732
19733 * configure.in (AC_INIT): Bump to 1.49b.
19734 (AM_INIT_AUTOMAKE): Short invocation.
19735
19736 2002-05-02 Akim Demaille <akim@epita.fr>
19737
19738 Version 1.49a.
19739
19740 2002-05-01 Akim Demaille <akim@epita.fr>
19741
19742 * src/skeleton.h: Remove.
19743
19744 2002-05-01 Akim Demaille <akim@epita.fr>
19745
19746 * src/skeleton.h: Fix the #endif.
19747 Reported by Magnus Fromreide.
19748
19749 2002-04-26 Paul Eggert <eggert@twinsun.com>
19750
19751 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
19752 Define if we define YYSTYPE and YYLTYPE, respectively.
19753 (YYCOPY): Fix [] quoting problem in the non-GCC case.
19754
19755 2002-04-25 Robert Anisko <robert@lrde.epita.fr>
19756
19757 * src/scan-skel.l: Postprocess quadrigraphs.
19758
19759 * src/reader.c (copy_character): New function, used to output
19760 single characters while replacing `[' and `]' with quadrigraphs, to
19761 avoid troubles with M4 quotes.
19762 (copy_comment): Output characters with copy_character.
19763 (read_additionnal_code): Likewise.
19764 (copy_string2): Likewise.
19765 (copy_definition): Likewise.
19766
19767 * tests/calc.at: Exercise M4 quoting.
19768
19769 2002-04-25 Akim Demaille <akim@epita.fr>
19770
19771 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
19772 between `!' and the command.
19773 Reported by Paul Eggert.
19774
19775 2002-04-24 Robert Anisko <robert@lrde.epita.fr>
19776
19777 * tests/calc.at: Exercise prologue splitting.
19778
19779 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
19780 `b4_post_prologue' instead of `b4_prologue'.
19781
19782 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
19783 muscles.
19784 (output): Free pre_prologue_obstack and post_prologue_obstack.
19785 * src/files.h, src/files.c (attrs_obstack): Remove.
19786 (pre_prologue_obstack, post_prologue_obstack): New.
19787 * src/reader.c (copy_definition): Add a parameter to specify the
19788 obstack to fill, instead of using attrs_obstack unconditionally.
19789 (read_declarations): Pass pre_prologue_obstack to copy_definition if
19790 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
19791
19792 2002-04-23 Paul Eggert <eggert@twinsun.com>
19793
19794 * data/bison.simple: Remove unnecessary commentary and white
19795 space differences from 1_29-branch.
19796 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
19797
19798 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
19799 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
19800 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
19801 constructors or destructors.
19802
19803 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
19804
19805 2002-04-23 Akim Demaille <akim@epita.fr>
19806
19807 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
19808 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
19809 location with columns.
19810 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
19811 All reported by Paul Eggert.
19812
19813 2002-04-22 Akim Demaille <akim@epita.fr>
19814
19815 * src/reduce.c (dump_grammar): Move to...
19816 * src/gram.h, src/gram.c (grammar_dump): here.
19817 Be sure to separate long item numbers.
19818 Don't read the members of a rule's prec if its nil.
19819
19820 2002-04-22 Akim Demaille <akim@epita.fr>
19821
19822 * src/output.c (table_size, table_grow): New.
19823 (MAXTABLE): Remove, replace uses with table_size.
19824 (pack_vector): Instead of dying when the table is too big, grow it.
19825
19826 2002-04-22 Akim Demaille <akim@epita.fr>
19827
19828 * data/bison.simple (yyr1): Its type is that of a token number.
19829 * data/bison.c++ (r1_): Likewise.
19830 * tests/regression.at (Web2c Actions): Adjust.
19831
19832 2002-04-22 Akim Demaille <akim@epita.fr>
19833
19834 * src/reader.c (token_translations_init): 256 is now the default
19835 value for the error token, i.e., it will be assigned another
19836 number if the user assigned 256 to one of her tokens.
19837 (reader): Don't force 256 to error.
19838 * doc/bison.texinfo (Symbols): Adjust.
19839 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
19840 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
19841 etc. instead of 10, 20, 30 (which was used to `jump' over error
19842 (256) and undefined (2)).
19843
19844 2002-04-22 Akim Demaille <akim@epita.fr>
19845
19846 Propagate more token_number_t.
19847
19848 * src/gram.h (token_number_as_item_number)
19849 (item_number_as_token_number): New.
19850 * src/output.c (GENERATE_OUTPUT_TABLE): New.
19851 Use it to create output_item_number_table and
19852 output_token_number_table.
19853 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
19854 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
19855 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
19856 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
19857
19858 2002-04-22 Akim Demaille <akim@epita.fr>
19859
19860 * src/output.h, src/output.c (get_lines_number): Remove.
19861
19862 2002-04-19 Akim Demaille <akim@epita.fr>
19863
19864 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
19865 as Lex/Flex'.
19866 (Debugging): More details about enabling the debugging features.
19867 (Table of Symbols): Describe $$, $n, @$, and @n.
19868 Suggested by Tim Josling.
19869
19870 2002-04-19 Akim Demaille <akim@epita.fr>
19871
19872 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
19873
19874 2002-04-10 Akim Demaille <akim@epita.fr>
19875
19876 * src/system.h: Rely on HAVE_LIMITS_H.
19877 Suggested by Paul Eggert.
19878
19879 2002-04-09 Akim Demaille <akim@epita.fr>
19880
19881 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
19882 full stderr, and strip it according to the bison options, instead
19883 of composing the error message from different bits.
19884 This makes it easier to check for several error messages.
19885 Adjust all the invocations.
19886 Add an invocation exercising the error token.
19887 Add an invocation demonstrating a stupid error message.
19888 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
19889 Adjust the tests.
19890 Error message are for stderr, not stdout.
19891
19892 2002-04-09 Akim Demaille <akim@epita.fr>
19893
19894 * src/gram.h, src/gram.c (error_token_number): Remove, use
19895 errtoken->number.
19896 * src/reader.c (reader): Don't specify the user token number (2)
19897 for $undefined, as it uselessly prevents using it.
19898 * src/gram.h (token_number_t): Move to...
19899 * src/symtab.h: here.
19900 (state_t.number): Is a token_number_t.
19901 * src/print.c, src/reader.c: Use undeftoken->number instead of
19902 hard coded 2.
19903 (Even though this 2 is not the same as above: the number of the
19904 undeftoken remains being 2, it is its user token number which
19905 might not be 2).
19906 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
19907 `user_token_number_max'.
19908 Output `undef_token_number'.
19909 * data/bison.simple, data/bison.c++: Use them.
19910 Be sure to map invalid yylex return values to
19911 `undef_token_number'. This saves us from gratuitous SEGV.
19912
19913 * tests/conflicts.at (Solved SR Conflicts)
19914 (Unresolved SR Conflicts): Adjust.
19915 * tests/regression.at (Web2c Actions): Adjust.
19916
19917 2002-04-08 Akim Demaille <akim@epita.fr>
19918
19919 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
19920 Adding #line.
19921 Remove the duplicate `typedefs'.
19922 (RhsNumberType): Fix the declaration and various other typos.
19923 Use __ofile__.
19924 * data/bison.simple: Use __ofile__.
19925 * src/scan-skel.l: Handle __ofile__.
19926
19927 2002-04-08 Akim Demaille <akim@epita.fr>
19928
19929 * src/gram.h (item_number_t): New, the type of item numbers in
19930 RITEM. Note that it must be able to code symbol numbers as
19931 positive number, and the negation of rule numbers as negative
19932 numbers.
19933 Adjust all dependencies (pretty many).
19934 * src/reduce.c (rule): Remove this `short *' pointer: use
19935 item_number_t.
19936 * src/system.h (MINSHORT, MAXSHORT): Remove.
19937 Include `limits.h'.
19938 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
19939 (shortcpy): Remove.
19940 (MAXTABLE): Move to...
19941 * src/output.c (MAXTABLE): here.
19942 (prepare_rules): Use output_int_table to output rhs.
19943 * data/bison.simple, data/bison.c++: Adjust.
19944 * tests/torture.at (Big triangle): Move the limit from 254 to
19945 500.
19946 * tests/regression.at (Web2c Actions): Ajust.
19947
19948 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
19949 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
19950 passes, but produces negative #line number, once fixed, GCC is
19951 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
19952 C), it passes.
19953 * src/state.h (state_h): Code input lines on ints, not shorts.
19954
19955 2002-04-08 Akim Demaille <akim@epita.fr>
19956
19957 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
19958 and then the grammar.
19959
19960 2002-04-08 Akim Demaille <akim@epita.fr>
19961
19962 * src/system.h: No longer using strndup.
19963
19964 2002-04-07 Akim Demaille <akim@epita.fr>
19965
19966 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
19967 * src/output.c (output_table_data): Return the longest number.
19968 (prepare_tokens): Output `token_number_max').
19969 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
19970 New.
19971 Use them to define yy_token_number_type/TokenNumberType.
19972 Use this type for yytranslate.
19973 * tests/torture.at (Big triangle): Push the limit from 124 to
19974 253.
19975 * tests/regression.at (Web2c Actions): Adjust.
19976
19977 2002-04-07 Akim Demaille <akim@epita.fr>
19978
19979 * tests/torture.at (Big triangle): New.
19980 (GNU AWK Grammar, GNU Cim Grammar): Move to...
19981 * tests/existing.at: here.
19982
19983 2002-04-07 Akim Demaille <akim@epita.fr>
19984
19985 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
19986 nritems.
19987 Adjust dependencies.
19988
19989 2002-04-07 Akim Demaille <akim@epita.fr>
19990
19991 * src/reader.c: Normalize increments to prefix form.
19992
19993 2002-04-07 Akim Demaille <akim@epita.fr>
19994
19995 * src/reader.c, symtab.c: Remove debugging code.
19996
19997 2002-04-07 Akim Demaille <akim@epita.fr>
19998
19999 Rename all the `bucket's as `symbol_t'.
20000
20001 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
20002 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
20003 * src/symtab.c, src/symtab.h (bucket): Rename as...
20004 (symbol_t): this.
20005 (symbol_list_new, bucket_check_defined, bucket_make_alias)
20006 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
20007 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
20008 (buckets_new, buckets_free, buckets_do): Rename as...
20009 (symbol_list_new, symbol_check_defined, symbol_make_alias)
20010 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
20011 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
20012 (symbols_new, symbols_free, symbols_do): these.
20013
20014 2002-04-07 Akim Demaille <akim@epita.fr>
20015
20016 Use lib/hash for the symbol table.
20017
20018 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
20019 EOF.
20020 * src/lex.c (lex): Set the `number' member of new terminals.
20021 * src/reader.c (bucket_check_defined, bucket_make_alias)
20022 (bucket_check_alias_consistence, bucket_translation): New.
20023 (reader, grammar_free, readgram, token_translations_init)
20024 (packsymbols): Adjust.
20025 (reader): Number the predefined tokens.
20026 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
20027 for predefined tokens.
20028 * src/symtab.h (bucket): Remove all the hash table related
20029 members.
20030 * src/symtab.c (symtab): Replace by...
20031 (bucket_table): this.
20032 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
20033 (buckets_new, buckets_do): New.
20034
20035 2002-04-07 Akim Demaille <akim@epita.fr>
20036
20037 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
20038 (start_symbol, max_user_token_number, semantic_parser)
20039 (error_token_number): Initialize.
20040 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
20041 Initialize.
20042 (reader): Don't.
20043 (errtoken, eoftoken, undeftoken, axiom): Extern.
20044
20045 2002-04-07 Akim Demaille <akim@epita.fr>
20046
20047 * src/gram.h (rule_s): prec and precsym are now pointers
20048 to the bucket giving the priority/associativity.
20049 Member `associativity' removed: useless.
20050 * src/reduce.c, src/conflicts.c: Adjust.
20051
20052 2002-04-07 Akim Demaille <akim@epita.fr>
20053
20054 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
20055 Properly escape the symbols' TAG when outputting them.
20056
20057 2002-04-07 Akim Demaille <akim@epita.fr>
20058
20059 * src/lalr.h (LA): Is a bitsetv, not bitset*.
20060
20061 2002-04-07 Akim Demaille <akim@epita.fr>
20062
20063 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
20064 (LArule): this, which is an array to rule_t*.
20065 * src/print.c, src/conflicts.c: Adjust.
20066
20067 2002-04-07 Akim Demaille <akim@epita.fr>
20068
20069 * src/gram.h (rule_t): Rename `number' as `user_number'.
20070 `number' is a new member.
20071 Adjust dependencies.
20072 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
20073
20074 2002-04-07 Akim Demaille <akim@epita.fr>
20075
20076 As a result of the previous patch, it is no longer needed
20077 to reorder ritem itself.
20078
20079 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
20080
20081 2002-04-07 Akim Demaille <akim@epita.fr>
20082
20083 Be sure never to walk through RITEMS, but use only data related to
20084 the rules themselves. RITEMS should be banished.
20085
20086 * src/output.c (output_token_translations): Rename as...
20087 (prepare_tokens): this.
20088 In addition to `translate', prepare the muscles `tname' and
20089 `toknum', which were handled by...
20090 (output_rule_data): this.
20091 Remove, and move the remainder of its outputs into...
20092 (prepare_rules): this new routines, which also merges content from
20093 (output_gram): this.
20094 (prepare_rules): Be sure never to walk through RITEMS.
20095 (output_stos): Rename as...
20096 (prepare_stos): this.
20097 (output): Always invoke prepare_states, after all, just don't use it
20098 in the output if you don't need it.
20099
20100 2002-04-07 Akim Demaille <akim@epita.fr>
20101
20102 * src/LR0.c (new_state): Display `nstates' as the name of the
20103 newly created state.
20104 Adjust to initialize first_state and last_state if needed.
20105 Be sure to distinguish the initial from the final state.
20106 (new_states): Create the itemset of the initial state, and use
20107 new_state.
20108 * src/closure.c (closure): Now that the initial state has its
20109 items properly set, there is no need for a special case when
20110 creating `ruleset'.
20111
20112 As a result, now the rule 0, reducing to $axiom, is visible in the
20113 outputs. Adjust the test suite.
20114
20115 * tests/conflicts.at (Solved SR Conflicts)
20116 (Unresolved SR Conflicts): Adjust.
20117 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
20118 * tests/conflicts.at (S/R in initial): New.
20119
20120 2002-04-07 Akim Demaille <akim@epita.fr>
20121
20122 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
20123 the RHS of the rules.
20124 * src/output.c (output_gram): Likewise.
20125
20126 2002-04-07 Akim Demaille <akim@epita.fr>
20127
20128 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
20129 bucket.
20130 Adjust all dependencies.
20131 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
20132 `number' of the buckets too.
20133 * src/gram.h: Include `symtab.h'.
20134 (associativity): Move to...
20135 * src/symtab.h: here.
20136 No longer include `gram.h'.
20137
20138 2002-04-07 Akim Demaille <akim@epita.fr>
20139
20140 * src/gram.h, src/gram.c (rules_rhs_length): New.
20141 (ritem_longest_rhs): Use it.
20142 * src/gram.h (rule_t): `number' is a new member.
20143 * src/reader.c (packgram): Set it.
20144 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
20145 the end of `rules', and count them out of `nrules'.
20146 (reduce_output, dump_grammar): Adjust.
20147 * src/print.c (print_grammar): It is no longer needed to check for
20148 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
20149 * tests/reduce.at (Reduced Automaton): New test.
20150
20151 2002-04-07 Akim Demaille <akim@epita.fr>
20152
20153 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
20154 lacking `+ 1' to nrules, Bison reported as useless a token if it
20155 was used solely to set the precedence of the last rule...
20156
20157 2002-04-07 Akim Demaille <akim@epita.fr>
20158
20159 * data/bison.c++, data/bison.simple: Don't output the current file
20160 name in #line, to avoid useless diffs between two identical
20161 outputs under different names.
20162
20163 2002-04-07 Akim Demaille <akim@epita.fr>
20164
20165 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
20166 Normalize loops to using `< nrules + 1', not `<= nrules'.
20167
20168 2002-04-07 Akim Demaille <akim@epita.fr>
20169
20170 * TODO: Update.
20171
20172 2002-04-07 Akim Demaille <akim@epita.fr>
20173
20174 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
20175 bucket.value as bucket.number.
20176
20177 2002-04-07 Akim Demaille <akim@epita.fr>
20178
20179 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
20180 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
20181 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
20182 RHS, instead of being an index in RITEMS.
20183
20184 2002-04-04 Paul Eggert <eggert@twinsun.com>
20185
20186 * doc/bison.texinfo: Update copyright date.
20187 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
20188 (Symbols): Warn about running Bison in one character set,
20189 but compiling and/or running in an incompatible one.
20190 Warn about character code 256, too.
20191
20192 2002-04-03 Paul Eggert <eggert@twinsun.com>
20193
20194 * src/bison.data (YYSTACK_ALLOC): Depend on whether
20195 YYERROR_VERBOSE is nonzero, not whether it is defined.
20196
20197 Merge changes from bison-1_29-branch.
20198
20199 2002-03-20 Paul Eggert <eggert@twinsun.com>
20200
20201 Merge fixes from Debian bison_1.34-1.diff.
20202
20203 * configure.in (AC_PREREQ): 2.53.
20204
20205 2002-03-20 Akim Demaille <akim@epita.fr>
20206
20207 * src/conflicts.c (log_resolution): Argument `resolution' is const.
20208
20209 2002-03-19 Paul Eggert <eggert@twinsun.com>
20210
20211 * src/bison.simple (YYCOPY): New macro.
20212 (YYSTACK_RELOCATE): Use it.
20213 Remove Type arg; no longer needed. All callers changed.
20214 (yymemcpy): Remove; no longer needed.
20215
20216 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
20217 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
20218
20219 2002-03-19 Akim Demaille <akim@epita.fr>
20220
20221 Test and fix the #line outputs.
20222
20223 * tests/atlocal.at (GCC): New.
20224 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
20225 (Prologue synch line, %union synch line, Postprologue synch line)
20226 (Action synch line, Epilogue synch line): New tests.
20227 * src/reader.c (parse_union_decl): Define the muscle stype_line.
20228 * data/bison.simple, data/bison.c++: Use it.
20229
20230 2002-03-19 Akim Demaille <akim@epita.fr>
20231
20232 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
20233 (Solved SR Conflicts, %expect not enough, %expect right)
20234 (%expect too much): Move to...
20235 * tests/conflicts.at: this new file.
20236
20237 2002-03-19 Akim Demaille <akim@epita.fr>
20238
20239 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
20240 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
20241 that we can move to enums for instance.
20242 * src/output.c (token_definitions_output): Output a list of
20243 `token-name, token-number' instead of the #define.
20244 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
20245
20246 2002-03-14 Akim Demaille <akim@epita.fr>
20247
20248 Use Gettext 0.11.1.
20249
20250 2002-03-09 Robert Anisko <robert@lrde.epita.fr>
20251
20252 * data/bison.c++: Make the user able to add members to the generated
20253 parser by subclassing.
20254
20255 2002-03-05 Robert Anisko <robert@lrde.epita.fr>
20256
20257 * src/reader.c (read_additionnal_code): `c' should be an integer, not
20258 a character.
20259 Reported by Nicolas Tisserand and Nicolas Burrus.
20260
20261 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
20262
20263 * src/reader.c: Warn about lacking semi-colons, do not complain.
20264
20265 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
20266
20267 * data/bison.c++: Remove a debug line.
20268
20269 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
20270
20271 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
20272 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
20273 provide a default implementation.
20274
20275 2002-03-04 Akim Demaille <akim@epita.fr>
20276
20277 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
20278 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
20279 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
20280 * tests/semantic.at (Parsing Guards): Similarly.
20281 * src/reader.at (readgram): Complain if the last rule is not ended
20282 with a semi-colon.
20283
20284 2002-03-04 Akim Demaille <akim@epita.fr>
20285
20286 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
20287 * src/closure.c: here.
20288 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
20289 RTC.
20290 * src/warshall.h, src/warshall.c: Remove.
20291 * tests/sets.at (Broken Closure): Adjust.
20292
20293 2002-03-04 Akim Demaille <akim@epita.fr>
20294
20295 * src/output.c (output_skeleton): tempdir is const.
20296 bytes_read is unused.
20297
20298 2002-03-04 Akim Demaille <akim@epita.fr>
20299
20300 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
20301 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
20302 Update.
20303 From Michael Hayes.
20304
20305 2002-03-04 Akim Demaille <akim@epita.fr>
20306
20307 * src/closure.c (closure): `r' is unused.
20308
20309 2002-03-04 Akim Demaille <akim@epita.fr>
20310
20311 * tests/sets.at (Broken Closure): Add the ending `;'.
20312 * src/reader.at (readgram): Complain if a rule is not ended with a
20313 semi-colon.
20314
20315 2002-03-04 Akim Demaille <akim@epita.fr>
20316
20317 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
20318 (count_sr_conflicts): Use bitset_count.
20319 * src/reduce.c (inaccessable_symbols): Ditto.
20320 (bits_size): Remove.
20321 * src/warshall.h, src/warshall.c: Convert to bitsetv.
20322
20323 2002-03-04 Akim Demaille <akim@epita.fr>
20324
20325 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
20326 * src/reduce.c: Remove the `bitset_zero's following the
20327 `bitset_create's, as now it is performed by the latter.
20328
20329 2002-03-04 Akim Demaille <akim@epita.fr>
20330
20331 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
20332 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
20333 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
20334 latest sources from Michael.
20335
20336 2002-03-04 Akim Demaille <akim@epita.fr>
20337
20338 * src/output.c (output): Don't free the grammar.
20339 * src/reader.c (grammar_free): New.
20340 * src/main.c (main): Call it and don't free symtab here.
20341
20342 2002-03-04 Akim Demaille <akim@epita.fr>
20343
20344 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
20345 before returning.
20346 Reported by Benoit Perrot.
20347
20348 2002-03-04 Akim Demaille <akim@epita.fr>
20349
20350 Use bitset operations when possible, not loops over bits.
20351
20352 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
20353 bitset_or.
20354 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
20355 * src/reduce.c (useless_nonterminals): Formatting changes.
20356 * src/warshall.c (TC): Use bitset_or.
20357
20358 2002-03-04 Akim Demaille <akim@epita.fr>
20359
20360 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
20361 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
20362 Ditto.
20363
20364 2002-03-04 Akim Demaille <akim@epita.fr>
20365
20366 * src/lalr.c (F): Now a bitset*.
20367 Adjust all dependencies.
20368
20369 2002-03-04 Akim Demaille <akim@epita.fr>
20370
20371 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
20372 Adjust all dependencies.
20373
20374 2002-03-04 Akim Demaille <akim@epita.fr>
20375
20376 * src/L0.c, src/LR0.h (nstates): Be size_t.
20377 Adjust comparisons (signed vs unsigned).
20378 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
20379 bitset*.
20380 Adjust all dependencies.
20381
20382 2002-03-04 Akim Demaille <akim@epita.fr>
20383
20384 * src/closure.c (firsts): Now, also a bitset.
20385 Adjust all dependencies.
20386 (varsetsize): Remove, now unused.
20387 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
20388
20389 2002-03-04 Akim Demaille <akim@epita.fr>
20390
20391 * src/print.c: Convert to use bitset.h, not hand coded iterations
20392 over ints.
20393
20394 2002-03-04 Akim Demaille <akim@epita.fr>
20395
20396 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
20397
20398 2002-03-04 Akim Demaille <akim@epita.fr>
20399
20400 * src/closure.c (ruleset): Be a bitset.
20401 (rulesetsize): Remove.
20402
20403 2002-03-04 Akim Demaille <akim@epita.fr>
20404
20405 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
20406 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
20407 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
20408 * src/closure.c (fderives): Be an array of bitsets.
20409
20410 2002-02-28 Robert Anisko <robert@lrde.epita.fr>
20411
20412 * data/bison.c++: Merge the two generated headers. Insert a copyright
20413 notice in each output file.
20414
20415 2002-02-28 Akim Demaille <akim@epita.fr>
20416
20417 * data/bison.c++: Copy the prologue of bison.simple to fetch
20418 useful M4 definitions, such as b4_header_guard.
20419
20420 2002-02-25 Akim Demaille <akim@epita.fr>
20421
20422 * src/getargs.c (version): Give the name of the authors, and use a
20423 translator friendly scheme for the bgr
20424 copyright notice.
20425
20426 2002-02-25 Akim Demaille <akim@epita.fr>
20427
20428 * src/output.c (header_output): Remove, now handled completely via
20429 M4.
20430
20431 2002-02-25 Akim Demaille <akim@epita.fr>
20432
20433 * m4/m4.m4: New, from CVS Autoconf.
20434 * configure.in: Invoke it.
20435 * src/output.c (output_skeleton): Use its result instead of the
20436 hard coded name.
20437
20438 2002-02-25 Akim Demaille <akim@epita.fr>
20439
20440 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
20441 Fileutils 4.1.5.
20442 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
20443 * src/output.c (output_skeleton): Use mkstemp to create a real
20444 temporary file.
20445 Move the filling of `skeleton' and its muscle to...
20446 (prepare): here.
20447 (output): Move the definition of the prologue muscle to...
20448 (prepare): here.
20449 * src/system.h (DEFAULT_TMPDIR): New.
20450
20451 2002-02-14 Paul Eggert <eggert@twinsun.com>
20452
20453 Remove the support for C++ namespace cleanliness; it was
20454 causing more problems than it was curing, since it didn't work
20455 properly on some nonstandard C++ compilers. This can wait
20456 for a proper C++ parser.
20457
20458 * NEWS: Document this.
20459 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
20460 of C++, as it's treated like C now.
20461 * src/bison.simple (YYSTD): Remove.
20462 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
20463 Treat C++ just like Standard C instead of trying to support
20464 namespace cleanliness.
20465
20466 2002-02-14 Akim Demaille <akim@epita.fr>
20467
20468 * tests/regression.at (else): Adjust to Andreas' change.
20469
20470 2002-02-14 Akim Demaille <akim@epita.fr>
20471
20472 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
20473
20474 2002-02-13 Andreas Schwab <schwab@suse.de>
20475
20476 * src/output.c (output_rule_data): Don't output NULL, it might
20477 not be defined yet.
20478
20479 2002-02-11 Robert Anisko <robert@lrde.epita.fr>
20480
20481 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
20482 (Copyright notice): Update.
20483
20484 2002-02-11 Akim Demaille <akim@epita.fr>
20485
20486 * tests/regression.at (%nonassoc and eof): Don't include
20487 nonportable headers.
20488
20489 2002-02-08 Robert Anisko <robert@lrde.epita.fr>
20490
20491 * data/bison.c++: Correct error recovery. Make the user able to
20492 initialize the starting location.
20493
20494 2002-02-07 Akim Demaille <akim@epita.fr>
20495
20496 * tests/input.at: New.
20497
20498 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
20499
20500 * data/bison.c++: Replace some direct m4 expansions by constants. Be
20501 more consistent when naming methods and variables. Put preprocessor
20502 directives around tables only needed for debugging.
20503
20504 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
20505
20506 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
20507 C++ parsers.
20508 (yy::b4_name::parse): Use print_.
20509
20510 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
20511
20512 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
20513
20514 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
20515
20516 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
20517 C++ parsers.
20518 (yy::b4_name::parse): Build verbose error messages, and use error_.
20519
20520 2002-02-06 Robert Anisko <robert@lrde.epita.fr>
20521
20522 * data/bison.c++: Fix m4 quoting in comments.
20523
20524 2002-02-06 Robert Anisko <robert@lrde.epita.fr>
20525
20526 * data/bison.c++: Adjust the parser code. Fix some muscles that were
20527 not expanded by m4.
20528
20529 2002-02-05 Akim Demaille <akim@epita.fr>
20530
20531 * data/bison.c++: Adjust to the M4 back end.
20532 More is certainly needed.
20533
20534 2002-02-05 Akim Demaille <akim@epita.fr>
20535
20536 Give a try to M4 as a back end.
20537
20538 * lib/readpipe.c: New, from wdiff.
20539 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
20540 BISON_HAIRY.
20541 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
20542 specific values. Now it is m4 that performs the lookup.
20543 * src/parse-skel.y: Remove.
20544 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
20545 * src/output.c (actions_output, guards_output)
20546 (token_definitions_output): No longer keeps track of the output
20547 line number, hence remove the second argument.
20548 (guards_output): Check against the guard member of a rule, not the
20549 action member.
20550 Adjust callers.
20551 (output_skeleton): Don't look for the skeleton location, let m4 do
20552 that.
20553 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
20554 file will be used.
20555 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
20556 (prepare): Given that for the time being changesyntax is not
20557 usable in M4, rename the muscles using `-' to `_'.
20558 Define `defines_flag', `output_parser_name' and `output_header_name'.
20559 * src/output.h (actions_output, guards_output)
20560 (token_definitions_output): Adjust prototypes.
20561 * src/scan-skel.l: Instead of scanning the skeletons, it now
20562 processes the output of m4: `__oline__' and `#output'.
20563 * data/bison.simple: Adjust to be used by M4(sugar).
20564 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
20565 to date.
20566 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
20567 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
20568 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
20569 shamelessly stolen from CVS Autoconf.
20570
20571 2002-02-05 Akim Demaille <akim@epita.fr>
20572
20573 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
20574 * configure.in: Check for the declarations of free and malloc.
20575 * src/muscle_tab.c: Adjust.
20576
20577 2002-02-05 Akim Demaille <akim@epita.fr>
20578
20579 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
20580 which have no values.
20581
20582 2002-02-05 Akim Demaille <akim@epita.fr>
20583
20584 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
20585 * data/: here.
20586
20587 2002-01-29 Paul Eggert <eggert@twinsun.com>
20588
20589 * src/bison.simple (YYSIZE_T): Do not define merely because
20590 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
20591 On some platforms, <alloca.h> does not declare YYSTD (size_t).
20592
20593 2002-01-27 Akim Demaille <akim@epita.fr>
20594
20595 Fix `%nonassoc and eof'.
20596
20597 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
20598 which were not properly copied! Replace
20599 memcpy (res->errs, src->errs, src->nerrs);
20600 with
20601 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
20602 !!!
20603 * tests/regression.at (%nonassoc and eof): Adjust to newest
20604 Autotest: `.' is not in the PATH.
20605
20606 2002-01-27 Akim Demaille <akim@epita.fr>
20607
20608 * tests/sets.at (AT_EXTRACT_SETS): New.
20609 (Nullable): Use it.
20610 (Firsts): New.
20611
20612 2002-01-26 Akim Demaille <akim@epita.fr>
20613
20614 * tests/actions.at, tests/calc.at, tests/headers.at,
20615 * tests/torture.at: Adjust to the newest Autotest which no longer
20616 forces `.' in the PATH.
20617
20618 2002-01-25 Akim Demaille <akim@epita.fr>
20619
20620 * tests/regression.at (%nonassoc and eof): New.
20621 Suggested by Robert Anisko.
20622
20623 2002-01-24 Akim Demaille <akim@epita.fr>
20624
20625 Bison dumps core when trying to complain about broken input files.
20626 Reported by Cris van Pelt.
20627
20628 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
20629 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
20630 into...
20631 (Invalid inputs): Strengthen: exercise parse_percent_token.
20632
20633 2002-01-24 Robert Anisko <robert.anisko@epita.fr>
20634
20635 * src/Makefile.am: Add bison.c++.
20636 * src/bison.c++: New skeleton.
20637
20638 2002-01-21 Paolo Bonzini <bonzini@gnu.org>
20639
20640 * po/it.po: New.
20641
20642 2002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
20643
20644 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
20645
20646 2002-01-20 Marc Autret <marc@gnu.org>
20647
20648 * src/files.c (compute_output_file_names): Fix
20649
20650 2002-01-20 Marc Autret <marc@gnu.org>
20651
20652 * tests/output.at: New test.
20653 * src/files.c (compute_base_names): Don't map extensions when
20654 the YACC flag is set, use defaults.
20655 Reported by Evgeny Stambulchik.
20656
20657 2002-01-20 Marc Autret <marc@gnu.org>
20658
20659 * src/system.h: Need to define __attribute__ away for non-GCC
20660 compilers as well (i.e., the vendor C compiler).
20661 Suggested by Albert Chin-A-Young.
20662
20663 2002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
20664
20665 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
20666 canonical definition.
20667 * src/system.h: Use the canonical definition for PARAMS (avoids
20668 a conflict with the macro from lib/hash.h).
20669
20670 2002-01-11 Akim Demaille <akim@epita.fr>
20671
20672 * configure.in: Use AC_FUNC_STRNLEN.
20673 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
20674
20675 2002-01-09 Akim Demaille <akim@epita.fr>
20676
20677 * src/files.c, src/files.h (output_infix): New.
20678 (tab_extension): Remove.
20679 (compute_base_names): Compute the former, drop the latter.
20680 * src/output.c (prepare): Insert the muscles `output-infix', and
20681 `output-suffix'.
20682 * src/parse-skel.y (string, string.1): New.
20683 (section.header): Use it.
20684 (section.yacc): Remove.
20685 (prefix): Remove too.
20686 * src/scan-skel.l: Adjust.
20687 * src/bison.simple, src/bison.hairy: Adjust.
20688
20689 2002-01-09 Akim Demaille <akim@epita.fr>
20690
20691 * configure.in (WERROR_CFLAGS): Compute it.
20692 * src/Makefile.am (CFLAGS): Pass it.
20693 * tests/atlocal.in (CFLAGS): Idem.
20694 * src/files.c: Fix a few warnings.
20695 (get_extension_index): Remove, unused.
20696
20697 2002-01-08 Akim Demaille <akim@epita.fr>
20698
20699 * src/getargs.c (AS_FILE_NAME): New.
20700 (getargs): Use it to convert DOSish file names.
20701 * src/files.c (base_name): Rename as full_base_name to avoid
20702 clashes with `base_name ()'.
20703 (filename_split): New.
20704 (compute_base_names): N-th rewrite, using filename_split.
20705
20706 2002-01-08 Akim Demaille <akim@epita.fr>
20707
20708 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
20709 New, stolen from the Fileutils 4.1.
20710 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
20711 * configure.in: Check for the presence of memrchr, and of its
20712 prototype.
20713
20714 2002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
20715
20716 * lib/hash.h (__P): Added definition for this macro.
20717 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
20718 BUILT_SOURCES, to ensure they are generated first.
20719 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
20720 %error-verbose to allow bootstrapping with bison 1.30x.
20721
20722 2002-01-06 Akim Demaille <akim@epita.fr>
20723
20724 * src/reader.c (parse_braces): Don't fetch the next char, the
20725 convention is to fetch on entry.
20726 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
20727 'switch' without a following semicolon.
20728 * tests/regression.at (braces parsing): New.
20729
20730 2002-01-06 Akim Demaille <akim@epita.fr>
20731
20732 Bison is dead wrong in its RR conflict reports.
20733
20734 * tests/torture.at (GNU Cim Grammar): New.
20735 * src/conflicts.c (count_rr_conflicts): Fix.
20736
20737 2002-01-06 Akim Demaille <akim@epita.fr>
20738
20739 Creating package.m4 from configure.ac causes too many problems.
20740
20741 * tests/Makefile.am (package.m4): Create it by hand,
20742 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
20743
20744 2002-01-06 Akim Demaille <akim@epita.fr>
20745
20746 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
20747 skeleton.h.
20748
20749 2002-01-04 Paul Eggert <eggert@twinsun.com>
20750
20751 * doc/bison.texinfo (Debugging):
20752 Remove YYSTDERR; it's no longer defined or used.
20753 Also, s/cstdio.h/cstdio/.
20754
20755 2002-01-03 Akim Demaille <akim@epita.fr>
20756
20757 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
20758
20759 2002-01-03 Akim Demaille <akim@epita.fr>
20760
20761 * src/parse-skel.y (process_skeleton): Don't bind the parser's
20762 tracing code to --trace, wait for a better --trace option, with
20763 args.
20764
20765 2002-01-03 Akim Demaille <akim@epita.fr>
20766
20767 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
20768 The ISO C++ standard is extremely clear about it: stderr is
20769 considered a macro, not a regular symbol (see table 94 `Header
20770 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
20771 Therefore std:: does not apply to it. It still does with fprintf.
20772 Also, s/cstdio.h/cstdio/.
20773
20774 2002-01-03 Akim Demaille <akim@epita.fr>
20775
20776 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
20777 for non system headers.
20778
20779 2002-01-02 Akim Demaille <akim@epita.fr>
20780
20781 Equip the skeleton chain with location tracking, runtime trace,
20782 pure parser and scanner.
20783
20784 * src/parse-skel.y: Request a pure parser, locations, and prefix
20785 renaming.
20786 (%union): Having several members with the same type does not help
20787 type mismatches, simplify.
20788 (YYPRINT, yyprint): New.
20789 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
20790 (skel_error): this.
20791 Handle locations.
20792 * src/scan-skel.l: Adjust to these changes.
20793 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
20794 (LOCATION_PRINT, skel_control_t): New.
20795
20796 2001-12-30 Akim Demaille <akim@epita.fr>
20797
20798 * src/parse-skel.y: Get rid of the shift/reduce conflict:
20799 replace `gb' with BLANKS.
20800 * src/scan-skel.l: Adjust.
20801
20802 2001-12-30 Akim Demaille <akim@epita.fr>
20803
20804 * src/system.h: We don't need nor want bcopy.
20805 Throw away MS-DOS crap: we don't need getpid.
20806 * configure.in: We don't need strndup. It was even causing
20807 problems: because Flex includes the headers *before* us,
20808 _GNU_SOURCE is not defined by config.h, and therefore strndup was
20809 not visible.
20810 * lib/xstrndup.c: New.
20811 * src/scan-skel.l: Use it.
20812 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
20813 * src/parse-skel.y: Use %directives instead of #defines.
20814
20815 2001-12-30 Akim Demaille <akim@epita.fr>
20816
20817 * src/skeleton.h: New.
20818 * src/output.c (output_parser, output_master_parser): Remove, dead
20819 code.
20820 * src/output.h (get_lines_number, actions_output, guards_output)
20821 (token_definitions_output): Prototype them.
20822 * src/parse-skel.y: Add the license notice.
20823 Include output.h and skeleton.h.
20824 (process_skeleton): Returns void, and takes a single parameter.
20825 * src/scan-skel.l: Add the license notice.
20826 Include skeleton.h.
20827 Don't use %option yylineno: it seems that then Flex imagines
20828 REJECT has been used, and therefore it won't reallocate its
20829 buffers (which makes no other sense to me than a bug). It results
20830 in warnings for `unused: yy_flex_realloc'.
20831
20832 2001-12-30 Robert Anisko <robert.anisko@epita.fr>
20833
20834 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
20835 (MUSCLE_INSERT_PREFIX): ...to there.
20836 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
20837 (MUSCLE_INSERT_PREFIX): Move from here...
20838
20839 * src/bison.hairy: Add a section directive. Put braces around muscle
20840 names. This parser skeleton is still broken, but Bison should not
20841 choke on a bad muscle 'syntax'.
20842 * src/bison.simple: Add a section directive. Put braces around muscle
20843 names.
20844
20845 * src/files.h (strsuffix, stringappend): Add declarations.
20846 (tab_extension): Add declaration.
20847 (short_base_name): Add declaration.
20848
20849 * src/files.c (strsuffix, stringappend): No longer static. These
20850 functions are used in the skeleton parser.
20851 (tab_extension): New.
20852 (compute_base_names): Use the computations done in this function
20853 to guess if the generated parsers should have '.tab' in their
20854 names.
20855 (short_base_name): No longer static.
20856
20857 * src/output.c (output_skeleton): New.
20858 (output): Disable call to output_master_parser, and give a try to
20859 a new skeleton handling system.
20860 (guards_output, actions_output): No longer static.
20861 (token_definitions_output, get_lines_number): No longer static.
20862
20863 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
20864
20865 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
20866 parse-skel.y.
20867
20868 * src/parse-skel.y: New file.
20869 * src/scan-skel.l: New file.
20870
20871 2001-12-29 Akim Demaille <akim@epita.fr>
20872
20873 %name-prefix is broken.
20874
20875 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
20876 Adjust all dependencies.
20877 * tests/headers.at (export YYLTYPE): Strengthen this test: use
20878 %name-prefix.
20879
20880 Renaming yylval but not yylloc is not consistent. Now we do.
20881
20882 * src/bison.simple: Prefix yylloc if used.
20883 * doc/bison.texinfo (Decl Summary): Document that.
20884
20885 2001-12-29 Akim Demaille <akim@epita.fr>
20886
20887 * doc/bison.texinfo: Promote `%long-directive' over
20888 `%long_directive'.
20889 Remove all references to fixed-output-files, yacc is enough.
20890
20891 2001-12-29 Akim Demaille <akim@epita.fr>
20892
20893 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
20894 user prologue. These are defaults.
20895 * tests/actions.at (Mid-rule actions): Make sure the user can
20896 define YYDEBUG and YYERROR_VERBOSE.
20897
20898 2001-12-29 Akim Demaille <akim@epita.fr>
20899
20900 * src/output.c (header_output): Don't forget to export YYLTYPE and
20901 yylloc.
20902 * tests/headers.at (export YYLTYPE): New, make sure it does.
20903 * tests/regression.at (%union and --defines, Invalid CPP headers):
20904 Move to...
20905 * tests/headers.at: here.
20906
20907 2001-12-29 Akim Demaille <akim@epita.fr>
20908
20909 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
20910
20911 2001-12-29 Akim Demaille <akim@epita.fr>
20912
20913 * tests/actions.at (Mid-rule actions): Output on a single line
20914 instead of several.
20915
20916 2001-12-29 Akim Demaille <akim@epita.fr>
20917
20918 * doc/bison.texinfo: Formatting changes.
20919
20920 2001-12-29 Akim Demaille <akim@epita.fr>
20921
20922 Don't store the token defs in a muscle, just be ready to output it
20923 on command. Now possible via `symbols'. Fixes a memory leak.
20924
20925 * src/output.c (token_definitions_output): New.
20926 (output_parser, header_output): Use it.
20927 * src/reader.c (symbols_save): Remove.
20928
20929 2001-12-29 Akim Demaille <akim@epita.fr>
20930
20931 * src/bison.simple: Do not provide a default for YYSTYPE and
20932 YYLTYPE before the user's prologue. Otherwise it's hardly... a
20933 default.
20934
20935 2001-12-29 Akim Demaille <akim@epita.fr>
20936
20937 Mid-rule actions are simply... ignored!
20938
20939 * src/reader.c (readgram): Be sure to attach mid-rule actions to
20940 the empty-rule associated to the dummy symbol, not to the host
20941 rule.
20942 * tests/actions.at (Mid-rule actions): New.
20943
20944 2001-12-29 Akim Demaille <akim@epita.fr>
20945
20946 Memory leak.
20947
20948 * src/reader.c (reader): Free grammar.
20949
20950 2001-12-29 Akim Demaille <akim@epita.fr>
20951
20952 Memory leak.
20953
20954 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
20955 since it allocates it for each state, although only one is needed.
20956 (allocate_storage): Do it here.
20957
20958 2001-12-29 Akim Demaille <akim@epita.fr>
20959
20960 * src/options.h, src/options.c (create_long_option_table): Rename
20961 as...
20962 (long_option_table_new): this, with a clearer prototype.
20963 (percent_table): Remove, unused,
20964 * src/getargs.c (getargs): Adjust.
20965
20966 2001-12-29 Akim Demaille <akim@epita.fr>
20967
20968 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
20969 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
20970 as states.
20971
20972 2001-12-29 Akim Demaille <akim@epita.fr>
20973
20974 * src/lalr.c (build_relations): Rename `states' as `states1'.
20975 Sorry, I don't understand exactly what it is, no better name...
20976
20977 2001-12-29 Akim Demaille <akim@epita.fr>
20978
20979 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
20980 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
20981 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
20982 as rules.
20983
20984 2001-12-29 Akim Demaille <akim@epita.fr>
20985
20986 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
20987 ago.
20988
20989 2001-12-29 Akim Demaille <akim@epita.fr>
20990
20991 * src/reader.c, src/reader.h (user_toknums): Remove.
20992 Adjust all users to use symbols[i]->user_token_number.
20993
20994 2001-12-29 Akim Demaille <akim@epita.fr>
20995
20996 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
20997 Adjust all users to use symbols[i]->prec or ->assoc.
20998
20999 2001-12-29 Akim Demaille <akim@epita.fr>
21000
21001 * src/reader.c, src/reader.h (tags): Remove.
21002 Adjust all users to use symbols[i]->tag.
21003
21004 2001-12-29 Akim Demaille <akim@epita.fr>
21005
21006 * src/gram.h, src/gram.c (symbols): New, similar to state_table
21007 and rule_table.
21008 * src/reader.c (packsymbols): Fill this table.
21009 Drop sprec.
21010 * src/conflicts.c (resolve_sr_conflict): Adjust.
21011 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
21012 single table.
21013 Use symbols[i]->tag instead of tags[i].
21014
21015 2001-12-29 Akim Demaille <akim@epita.fr>
21016
21017 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
21018 In addition, put a comment in there, to replace...
21019 * tests/regression.at (%union and C comments): Remove.
21020
21021 2001-12-29 Akim Demaille <akim@epita.fr>
21022
21023 * tests/regression.at (Web2c Actions): Blindly move the actual
21024 output as expected output. The contents *seem* right to me, but I
21025 can't pretend reading perfectly parser tables... Nonetheless, all
21026 the other tests pass correctly, the table look OK, even though the
21027 presence of `$axiom' is to be noted: AFAICS it is useless (but
21028 harmless).
21029
21030 2001-12-29 Akim Demaille <akim@epita.fr>
21031
21032 * src/reader.c (readgram): Don't add the rule 0 if there were no
21033 rules read. In other words, add it _after_ having performed
21034 grammar sanity checks.
21035 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
21036
21037 2001-12-29 Akim Demaille <akim@epita.fr>
21038
21039 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
21040 visible, and some states have now a different number.
21041
21042 2001-12-29 Akim Demaille <akim@epita.fr>
21043
21044 * src/reader.c (readgram): Bind the initial rule's lineno to that
21045 of the first rule.
21046 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
21047 (Solved SR Conflicts): Adjust rule 0's line number.
21048
21049 2001-12-29 Akim Demaille <akim@epita.fr>
21050
21051 Fix the `GAWK Grammar' failure.
21052
21053 * src/LR0.c (final_state): Initialize to -1 so that we do compute
21054 the reductions of the first state which was mistakenly confused
21055 with the final state because precisely final_state was initialized
21056 to 0.
21057 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
21058 now noticed by Bison.
21059 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
21060 have a reduction on $default.
21061
21062 2001-12-29 Akim Demaille <akim@epita.fr>
21063
21064 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
21065 rule line numbers.
21066 * src/closure.c (print_closure): Likewise.
21067 * src/derives.c (print_derives): Likewise.
21068 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
21069 now.
21070
21071 2001-12-29 Akim Demaille <akim@epita.fr>
21072
21073 * src/lalr.c (lookaheads_print): New.
21074 (lalr): Call it when --trace-flag.
21075 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
21076 are dumped.
21077
21078 2001-12-29 Akim Demaille <akim@epita.fr>
21079
21080 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
21081 when walking through ritem, even via rule->rhs.
21082 * src/reduce.c (dump_grammar, useful_production, reduce_output)
21083 (useful_production, useless_nonterminals): Likewise.
21084 (reduce_grammar_tables): Likewise, plus update nritems.
21085 * src/nullable.c (set_nullable): Likewise.
21086 * src/lalr.c (build_relations): Likewise.
21087 * tests/sets.at (Nullable): Adjust.
21088 Fortunately, now, the $axiom is no longer nullable.
21089
21090 2001-12-29 Akim Demaille <akim@epita.fr>
21091
21092 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
21093 the 0-sentinel.
21094 * src/gram.c (ritem_longest_rhs): Likewise.
21095 * src/reduce.c (nonterminals_reduce): Likewise.
21096 * src/print_graph.c (print_graph): Likewise.
21097 * src/output.c (output_rule_data): Likewise.
21098 * src/nullable.c (set_nullable): Likewise.
21099
21100 2001-12-29 Akim Demaille <akim@epita.fr>
21101
21102 * src/output.c: Comment changes.
21103
21104 2001-12-27 Paul Eggert <eggert@twinsun.com>
21105
21106 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
21107 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
21108 Sparc, as they were causing more porting problems than the
21109 (minor) performance improvement was worth.
21110
21111 Also, catch up with 1.31's YYSTD.
21112
21113 2001-12-27 Akim Demaille <akim@epita.fr>
21114
21115 * src/output.c (output_gram): Rely on nritems, not the
21116 0-sentinel. See below.
21117 Use -1 as separator, not 0.
21118 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
21119 Rely on -1 as separator in yyrhs, instead of 0.
21120 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
21121 twice `Now at end of input', therefore there are two lines less to
21122 expect.
21123
21124 2001-12-27 Akim Demaille <akim@epita.fr>
21125
21126 * tests/regression.at (Unresolved SR Conflicts):
21127 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
21128 below.
21129
21130 2001-12-27 Akim Demaille <akim@epita.fr>
21131
21132 * src/LR0.c (new_state): Recognize the final state by the fact it
21133 is reached by eoftoken.
21134 (insert_start_shifting_state, insert_eof_shifting_state)
21135 (insert_accepting_state, augment_automaton): Remove, since now
21136 these states are automatically computed from the initial state.
21137 (generate_states): Adjust.
21138 * src/print.c: When reporting a rule number to the user, substract
21139 1, so that the axiom rule is rule 0, and the first user rule is 1.
21140 * src/reduce.c: Likewise.
21141 * src/print_graph.c (print_core): For the time being, just as for
21142 the report, depend upon --trace-flags to dump the full set of
21143 items.
21144 * src/reader.c (readgram): Once the grammar read, insert the rule
21145 0: `$axiom: START-SYMBOL $'.
21146 * tests/set.at: Adjust: rule 0 is now displayed, and since the
21147 number of the states has changed (the final state is no longer
21148 necessarily the last), catch up.
21149
21150 2001-12-27 Akim Demaille <akim@epita.fr>
21151
21152 Try to make the use of the eoftoken valid. Given that its value
21153 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
21154 is used instead of > 0 where appropriate, (ii), depend upon nritems
21155 instead of the 0-sentinel.
21156
21157 * src/gram.h, src/gram.c (nritems): New.
21158 Expected to be duplication of nitems, but for the time being...
21159 * src/reader.c (packgram): Assert nritems and nitems are equal.
21160 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
21161 * src/closure.c (print_closure, print_fderives): Likewise.
21162 * src/gram.c (ritem_print): Likewise.
21163 * src/print.c (print_core, print_grammar): Likewise.
21164 * src/print_graph.c: Likewise.
21165
21166 2001-12-27 Akim Demaille <akim@epita.fr>
21167
21168 * src/main.c (main): If there are complains after grammar
21169 reductions, then output the report anyway if requested, then die.
21170 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
21171 * src/reader.c (eoftoken): New.
21172 (parse_token_decl): If the token being defined has value `0', it
21173 is the eoftoken.
21174 (packsymbols): No longer hack `tags' to insert `$' by hand.
21175 Be sure to preserve the value of the eoftoken.
21176 (reader): Make sure eoftoken is defined.
21177 Initialize nsyms to 0: now eoftoken is created just like the others.
21178 * src/print.c (print_grammar): Don't special case the eof token.
21179 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
21180 lie anyway, albeit pleasant.
21181 * tests/calc.at: Exercise error messages with eoftoken.
21182 Change the grammar so that empty input is invalid.
21183 Adjust expectations.
21184 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
21185
21186 2001-12-27 Akim Demaille <akim@epita.fr>
21187
21188 * configure.in: Check the protos of strchr ans strspn.
21189 Replace strchr if needed.
21190 * src/system.h: Provide the protos of strchr, strspn and memchr if
21191 missing.
21192 * lib/strchr.c: New.
21193 * src/reader.c (symbols_save): Use strchr.
21194
21195 2001-12-27 Akim Demaille <akim@epita.fr>
21196
21197 * src/print.c, src/print_graph.c (escape): New.
21198 Use it to quote the TAGS outputs.
21199 * src/print_graph.c (print_state): Now errors are in red, and
21200 reductions in green.
21201 Prefer high to wide: output the state number on a line of its own.
21202
21203 2001-12-27 Akim Demaille <akim@epita.fr>
21204
21205 * src/state.h, src/state.c (reductions_new): New.
21206 * src/LR0.c (set_state_table): Let all the states have a
21207 `reductions', even if reduced to 0.
21208 (save_reductions): Adjust.
21209 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
21210 * src/print.c (print_reductions, print_actions): Adjust.
21211 * src/output.c (action_row): Adjust.
21212
21213 2001-12-27 Akim Demaille <akim@epita.fr>
21214
21215 * src/state.h, src/state.c (errs_new, errs_dup): New.
21216 * src/LR0.c (set_state_table): Let all the states have an errs,
21217 even if reduced to 0.
21218 * src/print.c (print_errs, print_reductions): Adjust.
21219 * src/output.c (output_actions, action_row): Adjust.
21220 * src/conflicts.c (resolve_sr_conflict): Adjust.
21221
21222 2001-12-27 Akim Demaille <akim@epita.fr>
21223
21224 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
21225
21226 2001-12-27 Akim Demaille <akim@epita.fr>
21227
21228 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
21229 * src/print.c: here.
21230 (lookaheadset, shiftset): New, used as additional storage by
21231 print_reductions.
21232 (print_results): Adjust.
21233 (print_shifts, print_gotos, print_errs): New, extracted from...
21234 (print_actions): here.
21235 * src/print_graph.c (print_actions): Remove dead code.
21236
21237 2001-12-27 Akim Demaille <akim@epita.fr>
21238
21239 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
21240 `$n' and `@n'.
21241
21242 2001-12-27 Akim Demaille <akim@epita.fr>
21243
21244 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
21245 (build_relations): Adjust.
21246
21247 2001-12-27 Akim Demaille <akim@epita.fr>
21248
21249 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
21250 duplication.
21251
21252 2001-12-27 Akim Demaille <akim@epita.fr>
21253
21254 * src/reader.c (packgram): Catch nitems overflows.
21255
21256 2001-12-27 Akim Demaille <akim@epita.fr>
21257
21258 * src/files.c, src/files.h (guard_obstack): Remove.
21259 * src/output.c (output): Adjust.
21260 * src/reader.c (parse_braces): New, factoring...
21261 (copy_action, copy_guard): these two which are renamed as...
21262 (parse_action, parse_guard): these.
21263 As a voluntary consequence, using braces around guards is now
21264 mandatory.
21265
21266 2001-12-27 Akim Demaille <akim@epita.fr>
21267
21268 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
21269 * src/reader.c (symbol_list): `guard' and `guard_line' are new
21270 members.
21271 (symbol_list_new): Adjust.
21272 (copy_action): action_line is the first line, not the last.
21273 (copy_guard): Just as for actions, store the `action' only, not
21274 the switch/case/break flesh.
21275 Don't parse the user action that might follow the guard, let...
21276 (readgram): do it, i.e., now, there can be an action after a
21277 guard.
21278 In other words the guard is just explicitly optional.
21279 (packgram): Adjust.
21280 * src/output.c (guards_output): New.
21281 (output_parser): Call it when needed.
21282 (output): Also free the guard and attrs obstacks.
21283 * src/files.c, src/files.h (obstack_save): Remove.
21284 (output_files): Remove.
21285 As a result, if one needs the former `.act' file, using an
21286 appropriate skeleton which requires actions and guards is now
21287 required.
21288 * src/main.c (main): Adjust.
21289 * tests/semantic.at: New.
21290 * tests/regression.at: Use `input.y' as input file name.
21291 Avoid 8+3 problems by requiring input.c when the test needs the
21292 parser.
21293
21294 2001-12-27 Akim Demaille <akim@epita.fr>
21295
21296 * src/reader.c (symbol_list_new): Be sure to initialize all the
21297 fields.
21298
21299 2001-12-27 Akim Demaille <akim@epita.fr>
21300
21301 All the hacks using a final pseudo state are now useless.
21302
21303 * src/LR0.c (set_state_table): state_table holds exactly nstates.
21304 * src/lalr.c (nLA): New.
21305 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
21306 instead of lookaheadsp from the pseudo state (nstate + 1).
21307
21308 2001-12-27 Akim Demaille <akim@epita.fr>
21309
21310 * src/output.c (action_row, token_actions): Use a state_t instead
21311 of a integer, and nlookaheads instead of the following state's
21312 lookaheadsp.
21313
21314 2001-12-27 Akim Demaille <akim@epita.fr>
21315
21316 * src/conflicts.c (log_resolution, flush_shift)
21317 (resolve_sr_conflict, set_conflicts, solve_conflicts)
21318 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
21319 (conflicts_print, print_reductions): Use a state_t instead of an
21320 integer when referring to a state.
21321 As much as possible, depend upon nlookaheads, instead of the
21322 `lookaheadsp' member of the following state (since lookaheads of
21323 successive states are successive, the difference between state n + 1
21324 and n served as the number of lookaheads for state n).
21325 * src/lalr.c (add_lookback_edge): Likewise.
21326 * src/print.c (print_core, print_actions, print_state)
21327 (print_results): Likewise.
21328 * src/print_graph.c (print_core, print_actions, print_state)
21329 (print_graph): Likewise.
21330 * src/conflicts.h: Adjust.
21331
21332 2001-12-27 Akim Demaille <akim@epita.fr>
21333
21334 * src/bison.hairy: Formatting/comment changes.
21335 ANSIfy.
21336 Remove `register' indications.
21337 Add plenty of `static'.
21338
21339 2001-12-27 Akim Demaille <akim@epita.fr>
21340
21341 * src/output.c (prepare): Drop the muscle `ntbase' which
21342 duplicates ntokens.
21343 * src/bison.simple: Formatting/comment changes.
21344 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
21345 is an undocumented synonym.
21346
21347 2001-12-22 Akim Demaille <akim@epita.fr>
21348
21349 * src/output.c (output_table_data): Change the prototype to use
21350 `int' for array ranges: some invocations do pass an int, not a
21351 short.
21352 Reported by Wayne Green.
21353
21354 2001-12-22 Akim Demaille <akim@epita.fr>
21355
21356 Some actions of web2c.y are improperly triggered.
21357 Reported by Mike Castle.
21358
21359 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
21360 * tests/regression.at (Web2c): Rename as...
21361 (Web2c Report): this.
21362 (Web2c Actions): New.
21363
21364 2001-12-22 Akim Demaille <akim@epita.fr>
21365
21366 Reductions in web2c.y are improperly reported.
21367 Reported by Mike Castle.
21368
21369 * src/conflicts.c (print_reductions): Fix.
21370 * tests/regression.at (Web2c): New.
21371
21372 2001-12-18 Akim Demaille <akim@epita.fr>
21373
21374 Some host fail on `assert (!"foo")', which expands to
21375 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
21376 Reported by Nelson Beebee.
21377
21378 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
21379 `#define it_succeeded 0' and `assert (it_succeeded)'.
21380
21381 2001-12-17 Marc Autret <autret_m@epita.fr>
21382
21383 * src/bison.simple: Don't hard code the skeleton line and filename.
21384 * src/output.c (output_parser): Rename 'line' as 'output_line'.
21385 New line counter 'skeleton_line' (skeleton-line muscle).
21386
21387 2001-12-17 Paul Eggert <eggert@twinsun.com>
21388
21389 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
21390 YYDEBUG must be defined to a nonzero value.
21391
21392 * src/bison.simple (yytname): Do not assume that the user defines
21393 YYDEBUG to a properly parenthesized expression.
21394
21395 2001-12-17 Akim Demaille <akim@epita.fr>
21396
21397 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
21398 nlookaheads is a new member.
21399 Adjust all users.
21400 * src/lalr.h (nlookaheads): Remove this orphan declaration.
21401 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
21402 state.
21403
21404 2001-12-17 Akim Demaille <akim@epita.fr>
21405
21406 * src/files.h, src/files.c (open_files, close_files): Remove.
21407 * src/main.c (main): Don't open/close files, nor invoke lex_free,
21408 let...
21409 * src/reader.c (reader): Do it.
21410
21411 2001-12-17 Akim Demaille <akim@epita.fr>
21412
21413 * src/conflicts.c (print_reductions): Formatting changes.
21414
21415 2001-12-17 Akim Demaille <akim@epita.fr>
21416
21417 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
21418 (flush_reduce): New.
21419 (resolve_sr_conflict): Adjust.
21420
21421 2001-12-17 Akim Demaille <akim@epita.fr>
21422
21423 * src/output.c (output_obstack): Be static and rename as...
21424 (format_obstack): this, to avoid any confusion with files.c's
21425 output_obstack.
21426 * src/reader.h (muscle_obstack): Move to...
21427 * src/output.h: here, since it's defined in output.c.
21428
21429 2001-12-17 Akim Demaille <akim@epita.fr>
21430
21431 * src/output.c (action_row, save_column, default_goto)
21432 (sort_actions, matching_state, pack_vector): Better variable
21433 locality.
21434
21435 2001-12-17 Akim Demaille <akim@epita.fr>
21436
21437 * src/output.c: Various formatting changes.
21438
21439 2001-12-17 Akim Demaille <akim@epita.fr>
21440
21441 * src/files.c (output_files): Free the output_obstack.
21442 * src/main.c (main): Call print and print_graph conditionally.
21443 * src/print.c (print): Work unconditionally.
21444 * src/print_graph.c (print_graph): Work unconditionally.
21445 * src/conflicts.c (log_resolution): Output only if verbose_flag.
21446
21447 2001-12-16 Marc Autret <autret_m@epita.fr>
21448
21449 * src/output.c (actions_output): Fix. When we use %no-lines,
21450 there is one less line per action.
21451
21452 2001-12-16 Marc Autret <autret_m@epita.fr>
21453
21454 * src/bison.simple: Remove a useless #line directive.
21455 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
21456 * src/output.c (get_lines_number): New.
21457 (output_parser): Adjust, now takes care about the lines of a
21458 output muscles.
21459 Fix line numbering.
21460 (actions_output): Computes the number of lines taken by actions.
21461 (output_master_parser): Insert new skeleton which is the name of
21462 the output parser file name.
21463
21464 2001-12-15 Marc Autret <autret_m@epita.fr>
21465
21466 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
21467
21468 2001-12-15 Marc Autret <autret_m@epita.fr>
21469
21470 * src/output.c (output_gram): Keep track of the hairy one.
21471
21472 2001-12-15 Akim Demaille <akim@epita.fr>
21473
21474 Make `make distcheck' work.
21475
21476 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
21477 system.h which uses libgettext.h.
21478
21479 2001-12-15 Akim Demaille <akim@epita.fr>
21480
21481 * src/nullable.c (set_nullable): Useless rules must be skipped,
21482 otherwise, since we range over their symbols, we might look at a
21483 nonterminal which no longer ``exists'', i.e., it is not counted in
21484 `nvars', hence we overflow our arrays.
21485
21486 2001-12-15 Akim Demaille <akim@epita.fr>
21487
21488 The header can also be produced directly, without any obstack!
21489 Yahoo!
21490
21491 * src/files.c, src/files.h (defines_obstack): Remove.
21492 (compute_header_macro): Global.
21493 (defines_obstack_save): Remove.
21494 * src/reader.c (parse_union_decl): No longer output to
21495 defines_obstack: its content can be found in the `stype' muscle
21496 anyway.
21497 (output_token_translations): Merge into...
21498 (symbols_output): this.
21499 Rename as...
21500 (symbols_save): this.
21501 (reader): Adjust.
21502 * src/output.c (header_output): New.
21503 (output): Call it.
21504
21505 2001-12-15 Akim Demaille <akim@epita.fr>
21506
21507 * src/reader.c (parse_union_decl): Instead of handling two obstack
21508 simultaneously, use one to define the `stype' muscle, and use the
21509 value of the latter to fill defines_obstack.
21510 (copy_comment): Remove.
21511 (copy_comment2): Work for a single obstack.
21512 Rename as...
21513 (copy_comment): this.
21514
21515 2001-12-15 Akim Demaille <akim@epita.fr>
21516
21517 * src/lex.c, src/lex.h (xgetc): No longer static.
21518 * src/reader.c (parse_union_decl): Revamp.
21519
21520 2001-12-15 Akim Demaille <akim@epita.fr>
21521
21522 Still making progress in separating Bison into (i) input, (ii)
21523 process, (iii) output: now we can directly output the parser file
21524 without using table_obstack at all.
21525
21526 * src/files.c, src/files.h (table_obstack): Bye bye.
21527 (parser_file_name): New.
21528 * src/files.c (compute_output_file_names): Compute it.
21529 * src/output.c (actions_output, output_parser)
21530 (output_master_parser): To a file instead of an obstack.
21531
21532 2001-12-15 Akim Demaille <akim@epita.fr>
21533
21534 Attach actions to rules, instead of pre-outputting them to
21535 actions_obstack.
21536
21537 * src/gram.h (rule_t): action and action_line are new members.
21538 * src/reader.c (symbol_list): Likewise.
21539 (copy_action): Save the actions within the rule.
21540 (packgram): Save them in rule_table.
21541 * src/output.c (actions_output): New.
21542 (output_parser): Use it on `%%actions'.
21543 (output_rule_data): Don't free rule_table.
21544 (output): Do it.
21545 (prepare): Don't save the `action' muscle.
21546 * src/bison.simple: s/%%action/%%actions/.
21547
21548 2001-12-15 Akim Demaille <akim@epita.fr>
21549
21550 * src/reader.c (copy_action): When --yacc, don't append a `;'
21551 to the user action: let it fail if lacking.
21552 Suggested by Arnold Robbins and Tom Tromey.
21553
21554 2001-12-14 Akim Demaille <akim@epita.fr>
21555
21556 * src/lex.c (literalchar): Simply return the char you decoded, non
21557 longer mess around with obstacks and int pointers.
21558 Adjust all callers.
21559
21560 2001-12-14 Akim Demaille <akim@epita.fr>
21561
21562 * src/lex.c (literalchar): Don't escape the special characters,
21563 just decode them, and keep them as char (before, eol was output as
21564 the 2 char string `\n' etc.).
21565 * src/output.c (output_rule_data): Use quotearg to output the
21566 token strings.
21567
21568 2001-12-13 Paul Eggert <eggert@twinsun.com>
21569
21570 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
21571 Do not infringe on the global user namespace when using C++.
21572 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
21573 All uses of `fprintf' and `stderr' changed.
21574
21575 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
21576
21577 2001-12-13 Akim Demaille <akim@epita.fr>
21578
21579 The computation of nullable is broken: it doesn't handle empty
21580 RHS's properly.
21581
21582 * tests/torture.at (GNU AWK Grammar): New.
21583 * tests/sets.at (Nullable): New.
21584 * src/nullable.c (set_nullable): Instead of blindly looping over
21585 `ritems', loop over the rules, and then over their rhs's.
21586
21587 Work around Autotest bugs.
21588
21589 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
21590 frame, because Autotest understand lines starting with a `+' as
21591 traces from the shell. Then, they are not processed properly.
21592 Admittedly an Autotest bug, but we don't have time to wait for
21593 Autotest to catch up.
21594 * tests/regression.at (Broken Closure): Adjust to the new table
21595 frames.
21596 Move to...
21597 * tests/sets.at: here.
21598
21599 2001-12-13 Akim Demaille <akim@epita.fr>
21600
21601 * src/closure.c (closure): Use nrules instead of playing tricks
21602 with BITS_PER_WORD.
21603
21604 2001-12-13 Akim Demaille <akim@epita.fr>
21605
21606 * src/print.c (print_actions): Output the handling of `$' as the
21607 traces do: shifting the token EOF. Before EOF was treated as a
21608 nonterminal.
21609 * tests/regression.at: Adjust some tests.
21610 * src/print_graph.c (print_core): Complete the set of items via
21611 closure. The next-to-final and final states are still unsatisfying,
21612 but that's to be addressed elsewhere.
21613 No longer output the rule numbers, but do output the state number.
21614 A single loop for the shifts + gotos is enough, but picked a
21615 distinct color for each.
21616 (print_graph): Initialize and finalize closure.
21617
21618 2001-12-13 Akim Demaille <akim@epita.fr>
21619
21620 * src/reader.c (readgram): Remove dead code, an strip useless
21621 braces.
21622 (get_type): Remove, unused.
21623
21624 2001-12-12 Akim Demaille <akim@epita.fr>
21625
21626 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
21627 on that of lib/error.c.
21628
21629 2001-12-12 Akim Demaille <akim@epita.fr>
21630
21631 Some hosts don't like `/' in includes.
21632
21633 * src/system.h: Include libgettext.h without qualifying the path.
21634 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
21635 $(top_srcdir).
21636
21637 2001-12-11 Marc Autret <autret_m@epita.fr>
21638
21639 * src/output.c (output_parser): Remove useless muscle.
21640
21641 2001-12-11 Marc Autret <autret_m@epita.fr>
21642
21643 * src/bison.simple: Remove #line just before %%epilogue. It
21644 is now handled in ...
21645 * src/reader.c (read_additionnal_code): Add the output of a
21646 #line for the epilogue.
21647
21648 2001-12-10 Marc Autret <autret_m@epita.fr>
21649
21650 * src/reader.c (copy_definition): Re-use CPP-outed code which
21651 replace precedent remove.
21652 * src/bison.simple: Remove #line before %%prologue because
21653 %%input-line is wrong at this time.
21654
21655 2001-12-10 Marc Autret <autret_m@epita.fr>
21656
21657 * src/reader.c (symbols_output): Clean up.
21658 * src/output.c (output_gram, output): Clean up.
21659
21660 2001-12-10 Akim Demaille <akim@epita.fr>
21661
21662 * src/lalr.c (initialize_lookaheads): New. Extracted from...
21663 * src/LR0.c (set_state_table): here.
21664 * src/lalr.c (lalr): Call it.
21665
21666 2001-12-10 Akim Demaille <akim@epita.fr>
21667
21668 * src/state.h (shifts): Remove the `number' member: shifts are
21669 attached to state, hence no longer need to be labelled with a
21670 state number.
21671
21672 2001-12-10 Akim Demaille <akim@epita.fr>
21673
21674 Now that states have a complete set of members, the linked list of
21675 shifts is useless: just fill directly the state's shifts member.
21676
21677 * src/state.h (shifts): Remove the `next' member.
21678 * src/LR0.c (first_state, last_state): Remove.
21679 Adjust the callers.
21680 (augment_automaton): Don't look for the shifts that must be added
21681 a shift on EOF: it is those of the state we looked for! But now,
21682 since shifts are attached, it is no longer needed to looking
21683 merely by its id: its number.
21684
21685 2001-12-10 Akim Demaille <akim@epita.fr>
21686
21687 * src/LR0.c (augment_automaton): Better variable locality.
21688 Remove an impossible branch: if there is a state corresponding to
21689 the start symbol being shifted, then there is shift for the start
21690 symbol from the initial state.
21691
21692 2001-12-10 Akim Demaille <akim@epita.fr>
21693
21694 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
21695 only when appropriate: when insert_start_shifting_state' is not
21696 invoked.
21697 * tests/regression.at (Rule Line Numbers): Adjust.
21698
21699 2001-12-10 Akim Demaille <akim@epita.fr>
21700
21701 * src/LR0.c (augment_automaton): Now that all states have shifts,
21702 merge the two cases addition shifts to the initial state.
21703
21704 2001-12-10 Akim Demaille <akim@epita.fr>
21705
21706 * src/lalr.c (set_state_table): Move to...
21707 * src/LR0.c: here.
21708 * src/lalr.c (lalr): Don't call it...
21709 * src/LR0.c (generate_states): do it.
21710 * src/LR0.h (first_state): Remove, only the table is used.
21711
21712 2001-12-10 Akim Demaille <akim@epita.fr>
21713
21714 * src/LR0.h (first_shift, first_reduction): Remove.
21715 * src/lalr.c: Don't use first_shift: find shifts through the
21716 states.
21717
21718 2001-12-10 Akim Demaille <akim@epita.fr>
21719
21720 * src/LR0.c: Attach shifts to states as soon as they are
21721 computed.
21722 * src/lalr.c (set_state_table): Instead of assigning shifts to
21723 state, just assert that the mapping was properly done.
21724
21725 2001-12-10 Akim Demaille <akim@epita.fr>
21726
21727 * src/LR0.c (insert_start_shift): Rename as...
21728 (insert_start_shifting_state): this.
21729 (insert_eof_shifting_state, insert_accepting_state): New.
21730 (augment_automaton): Adjust.
21731 Better locality of the variables.
21732 When looking if the start_symbol is shifted from the initial
21733 state, using `while (... symbol != start_symbol ...)' sounds
21734 better than `while (... symbol < start_symbol ...)': If fail
21735 to see how the order between symbols could be relevant!
21736
21737 2001-12-10 Akim Demaille <akim@epita.fr>
21738
21739 * src/getargs.h: Don't declare `spec_name_prefix' and
21740 `spec_file_prefix', declared by src/files.h.
21741 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
21742 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
21743 * src/output.c (prepare): Adjust.
21744 * src/reader.c (symbols_output): Likewise.
21745 * src/vmsgetargs.c: Vaguely adjust, but who cares?
21746
21747 2001-12-10 Akim Demaille <akim@epita.fr>
21748
21749 * src/muscle_tab.c (muscle_init): NULL is a better default than
21750 `"0"'.
21751
21752 2001-12-10 Akim Demaille <akim@epita.fr>
21753
21754 * src/reader.c (reader): Calling symbols_output once is enough.
21755
21756 2001-12-10 Akim Demaille <akim@epita.fr>
21757
21758 Now that states have a complete set of members, the linked list of
21759 reductions is useless: just fill directly the state's reductions
21760 member.
21761
21762 * src/state.h (struct reductions): Remove member `number' and
21763 `next'.
21764 * src/LR0.c (first_reduction, last_reduction): Remove.
21765 (save_reductions): Don't link the new reductions, store them in
21766 this_state.
21767 * src/lalr.c (set_state_table): No need to attach reductions to
21768 states, it's already done.
21769 * src/output.c (output_actions): No longer free the shifts, then
21770 the reductions, then the states: free all the states and their
21771 members.
21772
21773 2001-12-10 Akim Demaille <akim@epita.fr>
21774
21775 * src/options.c (OPTN, DRTV, BOTH): New.
21776 (option_table): Use them.
21777
21778 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
21779 the job of system.h.
21780 * src/options.c: Don't include stdio.h and xalloc.h for the same
21781 reasons.
21782
21783 2001-12-10 Akim Demaille <akim@epita.fr>
21784
21785 * src/output.c (output, prepare): Make sure the values of the
21786 muscles `action' and `prologue' are 0-terminated.
21787
21788 2001-12-10 Akim Demaille <akim@epita.fr>
21789
21790 Clean up GCC warnings.
21791
21792 * src/reader.c (copy_action): `buf' is not used.
21793 (parse_skel_decl): Be static.
21794 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
21795 * src/options.h (create_long_option_table): Have a real prototype.
21796 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
21797 (hash_delete_at): Return const void *.
21798 Adjust casts to preserve the const.
21799
21800 2001-12-10 Akim Demaille <akim@epita.fr>
21801
21802 * configure.in: Require 2.52g.
21803 M4 is not needed, but AUTOM4TE is.
21804 * m4/m4.m4: Remove.
21805 * tests/Makefile.am: Adjust.
21806
21807 2001-12-10 Akim Demaille <akim@epita.fr>
21808
21809 One structure for states is enough, even though theoretically
21810 there are LR(0) states and LALR(1) states.
21811
21812 * src/lalr.h (state_t): Remove.
21813 (state_table): Be state_t **, not state_t *.
21814 * src/state.h (core, CORE_ALLOC): Rename as...
21815 (state_t, STATE_ALLOC): this.
21816 Add the LALR(1) members: shifts, reductions, errs.
21817 * src/LR0.c (state_table): Rename as...
21818 (state_hash): this, to avoid name clashes with the global
21819 `state_table'.
21820 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
21821 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
21822
21823 2001-12-10 Akim Demaille <akim@epita.fr>
21824
21825 Bison dumps core on bash.y.
21826 Reported by Pascal Bart.
21827
21828 * src/warshall.c (bitmatrix_print): New.
21829 (TC): Use it.
21830 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
21831 j must be the outer loop.
21832 * tests/regression.at (Broken Closure): New.
21833
21834 2001-12-05 Akim Demaille <akim@epita.fr>
21835
21836 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
21837 its argument.
21838 Reported by Peter Hamorsky.
21839
21840 2001-12-05 Akim Demaille <akim@epita.fr>
21841
21842 * src/conflicts.c (err_table): Remove.
21843 (resolve_sr_conflict): Adjust.
21844 * src/lalr.h (state_t.reduction_table, state_t.shift_table):
21845 Rename as...
21846 (state_t.reductions, state_t.shifts): this.
21847
21848 2001-12-05 Akim Demaille <akim@epita.fr>
21849
21850 * src/reduce.c (reduce_grammar_tables): No longer disable the
21851 removal of useless rules via CPP but via `if (0)', so that the
21852 compiler still check the code is valid.
21853 For instance, it should have noticed `rline' no longer exists: use
21854 the `line' member of rule_t.
21855 * src/gram.c (dummy, rline): Remove, unused.
21856
21857 2001-12-05 Akim Demaille <akim@epita.fr>
21858
21859 * src/output.c (pack_vector): Use assert, not berror.
21860 * src/main.c (berror): Remove, unused.
21861
21862 2001-12-05 Akim Demaille <akim@epita.fr>
21863
21864 New experimental feature: if --verbose --trace output all the
21865 items of a state, not only its kernel.
21866
21867 * src/print.c (print_core): If `trace_flag', then invoke closure
21868 before outputting the items of the state (print_core is no longer
21869 a correct name them).
21870 (print_results): Invoke new_closure/free_closure if needed.
21871
21872 2001-12-05 Akim Demaille <akim@epita.fr>
21873
21874 * src/LR0.c (new_itemsets): Use nshifts only, not shiftcount.
21875 * src/closure.c, src/closure.h (itemsetsize): Rename as...
21876 (nitemset): for consistency with the rest of the project.
21877
21878 2001-12-05 Akim Demaille <akim@epita.fr>
21879
21880 * src/closure.c (print_closure): Improve.
21881 (closure): Use it for printing input and output.
21882
21883 2001-12-05 Akim Demaille <akim@epita.fr>
21884
21885 * src/closure.c (FIRSTS, FDERIVES): Adjust to reality: they are
21886 indexed by nonterminals.
21887
21888 2001-12-05 Akim Demaille <akim@epita.fr>
21889
21890 * src/warshall.c (TC, RTC): De-obsfucate (source reduced to 22% of
21891 what it was!).
21892 * src/warshall.h: Remove accidental duplication of the content.
21893
21894 2001-12-05 Akim Demaille <akim@epita.fr>
21895
21896 * src/closure.c (set_fderives): De-obfuscate.
21897
21898 2001-12-05 Akim Demaille <akim@epita.fr>
21899
21900 * src/closure.c (print_firsts, print_fderives): De-obfuscate.
21901
21902 2001-12-05 Akim Demaille <akim@epita.fr>
21903
21904 * src/closure.c (set_firsts): De-obfuscate.
21905
21906 2001-12-05 Akim Demaille <akim@epita.fr>
21907
21908 * src/output.c (action_row): De-obfuscate
21909 using the good o' techniques: arrays not pointers, variable
21910 locality, BITISSET, RESETBIT etc.
21911
21912 2001-12-05 Akim Demaille <akim@epita.fr>
21913
21914 Pessimize the code to simplify it: from now on, all the states
21915 have a valid SHIFTS, which NSHIFTS is possibly 0.
21916
21917 * src/LR0.c (shifts_new): Be global and move to..
21918 * src/state.c, src/state.h: here.
21919 * src/conflicts, src/lalr.c, src/output.c, src/print.c,
21920 * src/print_graph: Adjust.
21921
21922 2001-12-05 Akim Demaille <akim@epita.fr>
21923
21924 * src/state.h (SHIFT_DISABLE, SHIFT_IS_DISABLED): New.
21925 * src/conflicts.c: Use it.
21926 Restore a few missing `if (!SHIFT_IS_DISABLED)' which were
21927 incorrectly ``simplified''.
21928
21929 2001-12-05 Akim Demaille <akim@epita.fr>
21930
21931 * src/conflicts.c (flush_shift, resolve_sr_conflict): De-obfuscate
21932 using the good o' techniques: arrays not pointers, variable
21933 locality, BITISSET, RESETBIT etc.
21934
21935 2001-12-05 Akim Demaille <akim@epita.fr>
21936
21937 * src/state.h (SHIFT_SYMBOL): New.
21938 * src/conflicts.c: Use it to deobfuscate.
21939
21940 2001-12-05 Akim Demaille <akim@epita.fr>
21941
21942 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts)
21943 (print_reductions): De-obfuscate using the good o' techniques:
21944 arrays not pointers, variable locality, BITISSET.
21945
21946 2001-12-05 Akim Demaille <akim@epita.fr>
21947
21948 * src/conflicts.c (print_reductions): Arrays, not pointers.
21949 Use BITISSET.
21950
21951 2001-12-05 Akim Demaille <akim@epita.fr>
21952
21953 * src/conflicts.c (print_reductions): Pessimize, but clarify.
21954
21955 2001-12-05 Akim Demaille <akim@epita.fr>
21956
21957 * src/conflicts.c (print_reductions): Improve variable locality.
21958
21959 2001-12-05 Akim Demaille <akim@epita.fr>
21960
21961 * src/conflicts.c (print_reductions): Pessimize, but clarify.
21962
21963 2001-12-05 Akim Demaille <akim@epita.fr>
21964
21965 * src/conflicts.c (print_reductions): Improve variable locality.
21966
21967 2001-12-05 Akim Demaille <akim@epita.fr>
21968
21969 * src/state.h (SHIFT_IS_ERROR, SHIFT_IS_GOTO, SHIFT_IS_SHIFT): New.
21970 * src/lalr.c: Use them.
21971
21972 2001-12-05 Akim Demaille <akim@epita.fr>
21973
21974 * src/LR0.c (augment_automaton): Formatting changes.
21975 Better variable locality.
21976
21977 2001-12-05 Akim Demaille <akim@epita.fr>
21978
21979 * src/lalr.c (matrix_print): New.
21980 (transpose): Use it.
21981 Use arrays instead of pointers.
21982
21983 2001-12-05 Akim Demaille <akim@epita.fr>
21984
21985 * src/lalr.c (maxrhs): Move to...
21986 * src/gram.c, src/gram.h (ritem_longest_rhs): here.
21987 * src/lalr.c (build_relations): Adjust.
21988
21989 2001-12-05 Akim Demaille <akim@epita.fr>
21990
21991 * src/lalr.c (transpose): Free the memory allocated to the
21992 argument, as it is replaced by the results by the unique caller.
21993 (build_relations): Merely invoke transpose: it handles the memory
21994 deallocation.
21995 Improve variable locality.
21996 Avoid variables used as mere abbreviations.
21997 (compute_lookaheads): Use arrays instead of pointers.
21998
21999 2001-12-05 Akim Demaille <akim@epita.fr>
22000
22001 * src/lalr.c (initialize_F): Improve variable locality.
22002 Avoid variables used as mere abbreviations.
22003
22004 2001-12-05 Akim Demaille <akim@epita.fr>
22005
22006 * src/derives.c (print_derives): Display the ruleno.
22007 * src/lalr.c (initialize_F, transpose): Better variable locality
22008 to improve readability.
22009 Avoid variables used as mere abbreviations.
22010
22011 2001-12-05 Akim Demaille <akim@epita.fr>
22012
22013 * src/lalr.c (traverse): Use arrays instead of pointers.
22014
22015 2001-12-05 Akim Demaille <akim@epita.fr>
22016
22017 * src/nullable.c (set_nullable): Use a for loop to de-obfuscate
22018 the handling of squeue.
22019 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
22020
22021 2001-12-05 Akim Demaille <akim@epita.fr>
22022
22023 Because useless nonterminals are now kept alive (instead of being
22024 `destroyed'), we now sometimes examine them, and store information
22025 related to them. Hence we need to know their number, and adjust
22026 memory allocations.
22027
22028 * src/reduce.c, src/reduce.h (nuseless_nonterminals): No longer
22029 static.
22030 * src/LR0.c (allocate_itemsets): The memory allocated to
22031 `symbol_count' was used for two different purpose: once to count
22032 the number of occurrences of each symbol, and later reassigned to
22033 `shift_symbol', containing the symbol that can be shifted from a
22034 given state.
22035 Deobfuscate, i.e., allocate, use and free `symbol_count' here
22036 only, and...
22037 (new_itemsets): Allocate `shift_symbol' here.
22038 (allocate_itemsets): symbol_count includes useless nonterminals.
22039 Make room for them.
22040 (free_storage): Use `free', not `XFREE', for pointers that cannot
22041 be null.
22042
22043 2001-12-05 Akim Demaille <akim@epita.fr>
22044
22045 * src/nullable.c (set_nullable): Deobfuscate the handling of
22046 ritem.
22047 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
22048
22049 2001-12-05 Akim Demaille <akim@epita.fr>
22050
22051 * src/gram.c, src/gram.h (ritem_print): New.
22052 * src/gram.c (dummy): Remove, now there is actual code in gram.c.
22053 (This useless function was defined only to work around VMS linkers
22054 that can't handle compilation units with variables only).
22055 * src/reduce.c (dump_grammar): Use it to trace the construction of
22056 ritem.
22057
22058 2001-12-04 Paul Eggert <eggert@twinsun.com>
22059
22060 * src/bison.simple (union yyalloc): Change member names
22061 to be the same as the stack names.
22062 (yyparse): yyptr is now union yyalloc *, not char *.
22063 (YYSTACK_RELOCATE): Likewise. This avoids a GCC warning,
22064 and may generate better code on some machines.
22065 (yystpcpy): Use prototype if __STDC__ is defined, not just
22066 if __cplusplus is defined.
22067
22068 2001-11-30 Akim Demaille <akim@epita.fr>
22069
22070 * configure.in (WARNING_CFLAGS): Add -Werror when possible.
22071 (CFLAGS): Do not include the WARNING_CFLAGS here, since GNU
22072 Gettext doesn't compile cleanly, and dies with -Werror.
22073 * src/Makefile.am, lib/Makefile.am, tests/atlocal.in (CFLAGS):
22074 Include WARNING_CFLAGS here.
22075 * lib/xstrdup.c: Include xalloc.h, so that xstrdup be declared
22076 before being defined.
22077
22078 2001-11-27 Paul Eggert <eggert@twinsun.com>
22079
22080 * lib/quotearg.h (quotearg_n, quotearg_n_style):
22081 First arg is int, not unsigned.
22082 * lib/quotearg.c (quotearg_n, quotearg_n_style): Likewise.
22083 (SIZE_MAX, UINT_MAX): New macros.
22084 (quotearg_n_options): Abort if N is negative.
22085 Avoid overflow check on hosts where size_t is 64 bits and int
22086 is 32 bits, as overflow is impossible there.
22087 Fix off-by-one typo that caused unnecessary reallocation.
22088
22089 2001-11-29 Paul Eggert <eggert@twinsun.com>
22090
22091 Name space cleanup in generated parser.
22092
22093 * doc/bison.texinfo (Bison Parser): Discuss system headers
22094 and their effect on the user name space.
22095
22096 * src/bison.simple:
22097 (YYSTACK_ALLOC, YYSTACK_FREE, union yyalloc, YYSTACK_GAP_MAX,
22098 YYSTACK_BYTES, YYSTACK_RELOCATE): Do not define unless necessary,
22099 i.e. unless ! defined (yyoverflow) || defined (YYERROR_VERBOSE).
22100
22101 (YYSIZE_T): New macro. Use it instead of size_t, to avoid infringing
22102 on user names when possible.
22103
22104 (YYSTACK_USE_ALLOCA): Do not define; just use any existing defn.
22105 Simplify test for whather <alloca.h> exists.
22106
22107 (<stdlib.h>): Include if we will use malloc, and if standard C or C++.
22108
22109 (<stdio.h>): Include if YYDEBUG.
22110
22111 (yymemcpy): Renamed from __yy_memcpy. Do not define unless
22112 ! defined (yyoverflow) && ! defined (yymemcpy).
22113
22114 (yymemcpy, yyparse): Rename local variables as needed so that
22115 they all begin with 'yy'.
22116
22117 (yystrlen, yystpcpy): New functions.
22118
22119 (YY_DECL_NON_LSP_VARIABLES): Renamed from _YY_DECL_VARIABLES.
22120 All uses changed.
22121
22122 (yyparse): size_t -> YYSIZE_T. Use yystrlen and yystpcpy
22123 instead of relying on string.h functions. Use YYSTACK_ALLOC
22124 and YYSTACK_FREE instead of malloc and free.
22125
22126 2001-11-30 Akim Demaille <akim@epita.fr>
22127
22128 * src/bison.simple (YYSTYPE, YYLTYPE): Move their definitions
22129 before their first uses.
22130 (YYBISON, YYPURE): Move to the top of the output.
22131
22132 2001-11-30 Akim Demaille <akim@epita.fr>
22133
22134 * tests/reduce.at (Useless Nonterminals): Fix.
22135
22136 2001-11-30 Akim Demaille <akim@epita.fr>
22137
22138 * src/bison.simple (YYSTACK_FREE): Use `do {;} while (0)' as empty
22139 if body instead of `;' to pacify GCC's warnings.
22140
22141 2001-11-30 Akim Demaille <akim@epita.fr>
22142
22143 Instead of mapping the LHS of unused rules to -1, keep the LHS
22144 valid, but flag the rules as invalid.
22145
22146 * src/gram.h (rule_t): `useful' is a new member.
22147 * src/print.c (print_grammar): Adjust.
22148 * src/derives.c (set_derives): Likewise.
22149 * src/reader.c (packgram, reduce_output): Likewise.
22150 * src/reduce.c (reduce_grammar_tables): Likewise.
22151 * tests/reduce.at (Underivable Rules, Useless Rules): New.
22152
22153 2001-11-30 Akim Demaille <akim@epita.fr>
22154
22155 * src/reduce.c (reduce_output): Formatting changes.
22156 * src/print.c (print_results, print_grammar): Likewise.
22157 * tests/regression.at (Rule Line Numbers)
22158 (Solved SR Conflicts, Unresolved SR Conflicts): Adjust.
22159
22160 2001-11-30 Akim Demaille <akim@epita.fr>
22161
22162 * src/reduce.c (nonterminals_reduce): Instead of throwing away
22163 useless nonterminals, move them at the end of the symbol arrays.
22164 (reduce_output): Adjust.
22165 * tests/reduce.at (Useless Nonterminals): Adjust.
22166
22167 2001-11-30 Akim Demaille <akim@epita.fr>
22168
22169 * src/reduce.c: Various comment/formatting changes.
22170 (nonterminals_reduce): New, extracted from...
22171 (reduce_grammar_tables): here.
22172 (reduce_grammar): Call nonterminals_reduce.
22173
22174 2001-11-29 Paul Eggert <eggert@twinsun.com>
22175
22176 * src/bison.simple (YYSTACK_REALLOC): Remove.
22177 (YYSTACK_ALLOC): Resurrect this macro, with its old meaning.
22178 (YYSTACK_FREE, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYSTACK_RELOCATE):
22179 New macros.
22180 (union yyalloc): New type.
22181 (__yy_memcpy): Last arg is size_t, not unsigned int, to remove
22182 an arbitrary restriction on hosts where size_t is wider than int.
22183
22184 (yyparse): Don't dump core if alloca or malloc fails; instead, report
22185 a parser stack overflow. Allocate just one block of memory for all
22186 three stacks, instead of allocating three blocks; this typically is
22187 faster and reduces fragmentation.
22188
22189 Do not limit the number of items in the stack to a value that fits
22190 in 'int', as this is an arbitrary limit on hosts with 64-bit
22191 size_t and 32-bit int.
22192
22193 2001-11-29 Marc Autret <autret_m@epita.fr>
22194
22195 * tests/calc.at [AT_DATA_CALC_Y]: Use %error-verbose instead
22196 of defining YYERROR_VERBOSE.
22197 [AT_DATA]: $4 is now out of C declarations in the prologue.
22198
22199 2001-11-28 Marc Autret <autret_m@epita.fr>
22200
22201 * src/reader.c (parse_dquoted_param): New.
22202 (parse_skel_decl): Use it.
22203 * src/lex.h: Add its prototype.
22204 * src/lex.c (literalchar): Become not static.
22205
22206 2001-11-28 Marc Autret <autret_m@epita.fr>
22207
22208 * src/output.h: And put its extern declaration here.
22209 * src/output.c (error_verbose): Define here.
22210 (prepare): Echo name modification.
22211 * src/getargs.h: Clean its extern declaration.
22212 * src/getargs.c (error_verbose_flag): Remove.
22213 (getargs): Remove case 'e'.
22214 * src/options.c (option_table): 'error-verbose' is now seen as simple
22215 percent option.
22216 Include output.h.
22217
22218 * src/reader.c (read_declarations): Remove case tok_include.
22219 (parse_include_decl): Remove.
22220 * src/lex.h (token_t): Remove tok_include.
22221 * src/options.c (option_table): 'include' is now a simple command line
22222 option.
22223
22224 2001-11-28 Marc Autret <autret_m@epita.fr>
22225
22226 * src/bison.simple: Adjust muscle names.
22227 * src/muscle_tab.c (muscle_init): Also rename the muscles.
22228 * src/output.c (prepare): s/_/-/ for the muscles names.
22229 (output_parser): When scanning for a muscle, allow '-' instead of '_'.
22230
22231 2001-11-28 Marc Autret <autret_m@epita.fr>
22232
22233 * src/bison.simple: Fix debug.
22234 [YYERROR_VERBOSE]: Re-integrate as an internal macro.
22235
22236 2001-11-28 Akim Demaille <akim@epita.fr>
22237
22238 * src/LR0.c (shifts_new): New.
22239 (save_shifts, insert_start_shift, augment_automaton): Use it.
22240
22241 2001-11-28 Akim Demaille <akim@epita.fr>
22242
22243 * src/closure.c (closure): `b' and `ruleno' denote the same value:
22244 keep ruleno only.
22245
22246 2001-11-28 Akim Demaille <akim@epita.fr>
22247
22248 * src/closure.c (closure): Instead of looping over word in array
22249 then bits in words, loop over bits in array.
22250
22251 2001-11-28 Akim Demaille <akim@epita.fr>
22252
22253 * src/closure.c (closure): No longer optimize the special case
22254 where all the bits of `ruleset[r]' are set to 0, to make the code
22255 clearer.
22256
22257 2001-11-28 Akim Demaille <akim@epita.fr>
22258
22259 * src/closure.c (closure): `r' and `c' are new variables, used to
22260 de-obfuscate accesses to RULESET and CORE.
22261
22262 2001-11-28 Akim Demaille <akim@epita.fr>
22263
22264 * src/reduce.c (reduce_print): Use ngettext.
22265 (dump_grammar): Improve the trace accuracy.
22266
22267 2001-11-28 Akim Demaille <akim@epita.fr>
22268
22269 * src/reduce.c (dump_grammar): Don't translate trace messages.
22270
22271 2001-11-28 Akim Demaille <akim@epita.fr>
22272
22273 * tests/reduce.at (Useless Terminals, Useless Nonterminals): New.
22274 * src/reduce.c (reduce_grammar_tables): Do not free useless tags,
22275 as all tags are free'ed afterwards.
22276 From Enrico Scholz.
22277
22278 2001-11-27 Paul Eggert <eggert@twinsun.com>
22279
22280 * src/bison.simple (YYSTACK_REALLOC): Fix typo that caused us to
22281 use alloca when we didn't want to, and vice versa.
22282
22283 2001-11-27 Marc Autret <autret_m@epita.fr>
22284
22285 * src/muscle_tab.c (muscle_init): Remove 'verbose' muscle
22286 initialization.
22287 * src/output.c (prepare): Remove its update.
22288
22289 2001-11-27 Marc Autret <autret_m@epita.fr>
22290
22291 * tests/torture.at [AT_DATA]: Remove YYERROR_VERBOSE definition.
22292 Use %error-verbose.
22293
22294 2001-11-27 Marc Autret <autret_m@epita.fr>
22295
22296 * src/bison.simple: Remove YYERROR_VERBOSE using.
22297 Use %%error_verbose.
22298 (yyparse): Likewise.
22299 * src/output.c (prepare): Give its final value.
22300 * src/muscle_tab.c (muscle_init): Init new muscle 'error_verbose'.
22301 * src/getargs.h: Add its extern declaration.
22302 * src/getargs.c (error_verbose_flag): New int.
22303 (getargs): Update to catch new case.
22304 * src/options.c (option_table): 'error-verbose' is a new option.
22305 (shortopts): Update.
22306
22307 2001-11-27 Akim Demaille <akim@epita.fr>
22308
22309 * src/system.h: Use intl/libgettext.h.
22310 * src/Makefile.am (INCLUDES): Add -I $(top_srcdir).
22311
22312 2001-11-27 Akim Demaille <akim@epita.fr>
22313
22314 * tests/torture.at (Exploding the Stack Size with Malloc):
22315 s/YYSTACK_USE_ALLOCA_ALLOCA/YYSTACK_USE_ALLOCA/.
22316
22317 2001-11-27 Akim Demaille <akim@epita.fr>
22318
22319 * src/files.c: Include error.h.
22320 Reported by Hans Aberg.
22321
22322 2001-11-26 Marc Autret <autret_m@epita.fr>
22323
22324 * src/reader.c (parse_include_decl): New, not yet implemented.
22325 (read_declarations): Add case tok_include.
22326 * src/getargs.h (include): Add its extern definition.
22327 * src/getargs.c (include): New const char *.
22328 (getargs): Add case '-I'.
22329 * src/options.c (option_table): Add include as command line and
22330 percent option.
22331 * src/lex.h (token_t): Add tok_include.
22332
22333 2001-11-26 Akim Demaille <akim@epita.fr>
22334
22335 * src/reader.c (readgram): Make sure rules for mid-rule actions
22336 have a lineno equal to that of their host rule.
22337 Reported by Hans Aberg.
22338 * tests/regression.at (Rule Line Numbers): New.
22339
22340 2001-11-26 Akim Demaille <akim@epita.fr>
22341
22342 * src/LR0.c (allocate_itemsets): kernel_size contains ints, not
22343 size_ts.
22344
22345 2001-11-26 Akim Demaille <akim@epita.fr>
22346
22347 * src/complain.c, src/complain.h (error): Remove, provided by
22348 lib/error.[ch].
22349
22350 2001-11-26 Akim Demaille <akim@epita.fr>
22351
22352 * src/reader.c (read_declarations): Don't abort on tok_illegal,
22353 issue an error message.
22354 * tests/regression.at (Invalid %directive): New.
22355 Reported by Hans Aberg.
22356
22357 2001-11-26 Akim Demaille <akim@epita.fr>
22358
22359 * configure.in: Invoke AC_FUNC_OBSTACK and AC_FUNC_ERROR_AT_LINE.
22360 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
22361
22362 2001-11-26 Akim Demaille <akim@epita.fr>
22363
22364 * src/conflicts.c (conflicts_print): Don't complain at all when
22365 there are no reduce/reduce conflicts, and as many shift/reduce
22366 conflicts as expected.
22367 * tests/regression.at (%expect right): Adjust.
22368
22369 2001-11-23 Akim Demaille <akim@epita.fr>
22370
22371 * lib/alloca.c: Update, from fileutils.
22372
22373 2001-11-23 Akim Demaille <akim@epita.fr>
22374
22375 * lib/Makefile.am (libbison_a_LIBADD): Add @ALLOCA@.
22376
22377 2001-11-23 Akim Demaille <akim@epita.fr>
22378
22379 * src/system.h: Include alloca.h.
22380 * src/main.c (main) [C_ALLOCA]: Call alloca (0).
22381
22382 2001-11-23 Akim Demaille <akim@epita.fr>
22383
22384 * src/print_graph.c (print_actions): Remove `rule', unused.
22385 * src/LR0.c (kernel_size): Contain `int' instead of `size_t' to
22386 pacify GCC's signed < unsigned warnings.
22387 * src/closure.c (itemsetsize): Likewise.
22388 * src/reader.c (symbol_list_new): Static.
22389
22390 2001-11-23 Akim Demaille <akim@epita.fr>
22391
22392 Attaching lineno to buckets is stupid, since only one copy of each
22393 symbol is kept, only the line of the first occurrence is kept too.
22394
22395 * src/symtab.h, src/symtab.c (bucket): Remove the line member.
22396 * src/reader.c (rline_allocated): Remove, unused.
22397 (symbol_list): Have a `line' member.
22398 (symbol_list_new): New.
22399 (readgram): Use it.
22400 * src/print.c (print_grammar): Output the rule line numbers.
22401 * tests/regression.at (Solved SR Conflicts)
22402 (Unresolved SR Conflicts): Adjust.
22403 Reported by Hans Aberg.
22404
22405 2001-11-22 Marc Autret <autret_m@epita.fr>
22406
22407 * src/bison.simple [YYERROR_VERBOSE]: Force its value to be 1 or 0.
22408
22409 2001-11-22 Marc Autret <autret_m@epita.fr>
22410
22411 * src/muscle_tab.c (muscle_init): Remove initialization of
22412 skeleton muscle.
22413 * src/output.c (output_master_parser): Do it here.
22414
22415 2001-11-20 Akim Demaille <akim@epita.fr>
22416
22417 * po/sv.po: New.
22418 * configure.in (ALL_LINGUAS): Adjust.
22419 * po/POTFILE.in: Remove `nullable.c' and `derives.c' which no
22420 longer contains strings to translate.
22421
22422 2001-11-19 Akim Demaille <akim@epita.fr>
22423
22424 * src/conflicts.c (conflicts_print): Add a missing \n.
22425
22426 2001-11-19 Akim Demaille <akim@epita.fr>
22427
22428 * src/nullable.c (nullable_print): New.
22429 (set_nullable): Call it when tracing.
22430 Better locality of variables.
22431
22432 2001-11-19 Akim Demaille <akim@epita.fr>
22433
22434 * src/print.c (print_actions): Better locality of variables.
22435
22436 2001-11-19 Akim Demaille <akim@epita.fr>
22437
22438 * src/derives.c (print_derives): Fix and enrich.
22439 * src/closure.c (print_fderives): Likewise.
22440
22441 2001-11-19 Akim Demaille <akim@epita.fr>
22442
22443 * src/closure.c (itemsetend): Remove, replaced with...
22444 (itemsetsize): new.
22445
22446 2001-11-19 Akim Demaille <akim@epita.fr>
22447
22448 * src/LR0.c (kernel_end): Remove, replaced with...
22449 (kernel_size): new.
22450
22451 2001-11-19 Akim Demaille <akim@epita.fr>
22452
22453 * src/conflicts.c (set_conflicts): Use arrays instead of pointers
22454 to clarify.
22455
22456 2001-11-19 Akim Demaille <akim@epita.fr>
22457
22458 * src/closure.c (closure): Use arrays instead of pointers to clarify.
22459
22460 2001-11-19 Akim Demaille <akim@epita.fr>
22461
22462 * src/closure.c, src/derives.c, src/nullable.c: Adjust various
22463 trace messages.
22464 * src/LR0.c: Likewise.
22465 (allocate_itemsets): Use arrays instead of pointers to clarify.
22466
22467 2001-11-19 Akim Demaille <akim@epita.fr>
22468
22469 * src/getargs.c (statistics_flag): Replace with...
22470 (trace_flag): New.
22471 (longopts): Accept --trace instead of --statistics.
22472 * src/getargs.h, src/options.c: Adjust.
22473 * src/LR0.c, src/closure.c, src/derives.c, src/nullable.c,
22474 * src/reduce.c: Use trace_flags instead of the CPP conditional TRACE.
22475
22476 2001-11-19 Akim Demaille <akim@epita.fr>
22477
22478 * src/LR0.c (new_itemsets, get_state): Use more arrays and fewer
22479 pointers to clarify the code.
22480 (save_reductions, save_shifts): Factor common parts of alternatives.
22481
22482 2001-11-19 Akim Demaille <akim@epita.fr>
22483
22484 * src/LR0.c (new_state, get_state): Complete TRACE code.
22485 * src/closure.c: Include `reader.h' to get `tags', needed by the
22486 trace code.
22487 Rename the conditional DEBUG as TRACE.
22488 Output consistently TRACEs to stderr, not stdout.
22489 * src/derives.c: Likewise.
22490 * src/reduce.c: (inaccessable_symbols): Using if is better style
22491 than goto.
22492 Use `#if TRACE' instead of `#if 0' for tracing code.
22493
22494 2001-11-19 Akim Demaille <akim@epita.fr>
22495
22496 * src/system.h (LIST_FREE, shortcpy): New.
22497 * src/LR0.c: Use them.
22498 * src/output.c (free_itemsets, free_reductions, free_shifts):
22499 Remove, replaced by LIST_FREE.
22500
22501 2001-11-19 Akim Demaille <akim@epita.fr>
22502
22503 * src/state.h (CORE_ALLOC, SHIFTS_ALLOC, ERRS_ALLOC)
22504 (REDUCTIONS_ALLOC): New.
22505 * src/LR0.c, src/conflicts.c: Use them to de-obfuscate memory
22506 allocation.
22507
22508 2001-11-19 Akim Demaille <akim@epita.fr>
22509
22510 * src/LR0.c (new_state): Complete trace code.
22511 * src/nullable.c (set_nullable): Don't translate traces.
22512
22513 2001-11-19 Akim Demaille <akim@epita.fr>
22514
22515 * src/print_graph.c (print_core): Better locality of variables.
22516 * src/print.c (print_core): Likewise.
22517
22518 2001-11-19 Akim Demaille <akim@epita.fr>
22519
22520 * src/vcg.c: You do the output, so you are responsible of the
22521 handling of VCG syntax, in particular: use quotearg.
22522 * src/print_graph.c: Don't.
22523 (print_actions): Don't output the actions as part of the nodes,
22524 since that's the job of the edges.
22525 (print_state): Don't output by hand: fill the node description,
22526 and ask for its output.
22527
22528 2001-11-19 Akim Demaille <akim@epita.fr>
22529
22530 * src/bison.simple (yyparse): When verbosely reporting an error,
22531 no longer put additional quotes around token names.
22532 * tests/calc.at: Adjust.
22533
22534 2001-11-19 Akim Demaille <akim@epita.fr>
22535
22536 * src/symtab.h, src/symtab.c: `line' is a new member of `bucket'.
22537 * src/reader.c (record_rule_lines, rline, rline_allocated): Remove.
22538 * src/output.c: Adjust.
22539
22540 2001-11-19 Akim Demaille <akim@epita.fr>
22541
22542 * src/gram.h (rprec, rprecsym, rassoc): Remove, now part of...
22543 (rule_t): this.
22544 * src/conflicts.c, src/reader.c, src/reduce.c: Adjust.
22545
22546 2001-11-19 Akim Demaille <akim@epita.fr>
22547
22548 * src/gram.h (rule_t): New.
22549 (rule_table): New.
22550 (rrhs, rlhs): Remove, part of state_t.
22551 * src/print_graph.c, src/closure.c, src/conflicts.c, src/derives.c,
22552 * src/lalr.c, src/nullable.c, src/output.c, src/print.c,
22553 * src/reader.c, src/reduce.c: Adjust.
22554
22555 2001-11-19 Akim Demaille <akim@epita.fr>
22556
22557 * src/reader.c (symbols_output): New, extracted from...
22558 (packsymbols): Here.
22559 (reader): Call it.
22560
22561 2001-11-19 Akim Demaille <akim@epita.fr>
22562
22563 * src/lalr.c (set_maxrhs, maxrhs): Remove, replaced with...
22564 (maxrhs): this new function.
22565
22566 2001-11-19 Akim Demaille <akim@epita.fr>
22567
22568 * src/lalr.c (F): New macro to access the variable F.
22569 Adjust.
22570
22571 2001-11-19 Akim Demaille <akim@epita.fr>
22572
22573 * src/lalr.h (LA): New macro to access the variable LA.
22574 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
22575 * src/lalr.c: Adjust.
22576
22577 2001-11-19 Akim Demaille <akim@epita.fr>
22578
22579 * src/lalr.c (initialize_LA): Only initialize LA. Let...
22580 (set_state_table): handle the `lookaheads' members.
22581
22582 2001-11-19 Akim Demaille <akim@epita.fr>
22583
22584 * src/lalr.h (lookaheads): Removed array, whose contents is now
22585 a member of...
22586 (state_t): this structure.
22587 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
22588 Adjust.
22589
22590 2001-11-19 Akim Demaille <akim@epita.fr>
22591
22592 * src/lalr.h (consistent): Removed array, whose contents is now
22593 a member of...
22594 (state_t): this structure.
22595 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
22596 Adjust.
22597
22598 2001-11-19 Akim Demaille <akim@epita.fr>
22599
22600 * src/lalr.h (reduction_table, shift_table): Removed arrays, whose
22601 contents are now members of...
22602 (state_t): this structure.
22603 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
22604 Adjust.
22605
22606 2001-11-19 Akim Demaille <akim@epita.fr>
22607
22608 * src/lalr.h (state_t): New.
22609 (state_table): Be a state_t * instead of a core **.
22610 (accessing_symbol): Remove, part of state_t.
22611 * src/lalr.c: Adjust.
22612 (set_accessing_symbol): Merge into...
22613 (set_state_table): this.
22614 * src/print_graph.c, src/conflicts.c: Adjust.
22615
22616 2001-11-14 Akim Demaille <akim@epita.fr>
22617
22618 * tests/calc.at, tests/output.at, tests/regression.at,
22619 * tests/testsuite.at, tests/torture.at: Rely on Autotest 2.52g:
22620 now the tests are run in private dirs, therefore AC_CLEANUP and
22621 family can be simplified to 0-ary.
22622 * tests/atlocal.in: Now that we run `elsewhere' than in tests/,
22623 use abs. path to find config.h.
22624 * tests/calc.at (AT_CHECK_CALC): Don't try to check the compiler's
22625 stderr, there can be way too much random noise.
22626 Instead pass -Werror to GCC and rely on the exit status.
22627 Reported by Wolfram Wagner.
22628
22629 2001-11-14 Akim Demaille <akim@epita.fr>
22630
22631 * src/bison.simple (yyparse): Let yyls1, yyss1 and yyvs1 be
22632 defined only if yyoverflow is defined, to avoid `warning: unused
22633 variable `yyvs1''.
22634 Reported by The Test Suite.
22635
22636 2001-11-14 Akim Demaille <akim@epita.fr>
22637
22638 * src/print.c: Include reduce.h.
22639 Reported by Hans Aberg.
22640
22641 2001-11-14 Akim Demaille <akim@epita.fr>
22642
22643 * src/lex.c, src/lex.h (token_buffer, unlexed_token_buffer):
22644 Revert a previous patch: these are really const.
22645 * src/conflicts.c (conflict_report): Additional useless pair of
22646 braces to pacify GCC's warnings for `if () if () {} else {}'.
22647 * src/lex.c (parse_percent_token): Replace equal_offset with
22648 arg_offset.
22649 arg is const.
22650 Be sure to strdup `arg' when used, since there is no reason for
22651 token_buffer not to change.
22652
22653 2001-11-14 Akim Demaille <akim@epita.fr>
22654
22655 * src/system.h (EXIT_SUCCESS, EXIT_FAILURE): Ensure a proper
22656 definition.
22657 * src/main.c (main): Use them.
22658 Suggested by Hans Aberg.
22659
22660 2001-11-12 Akim Demaille <akim@epita.fr>
22661
22662 * src/system.h (ngettext): Now that we use ngettext, be sure to
22663 provide a default definition when NLS are not used.
22664
22665 2001-11-12 Akim Demaille <akim@epita.fr>
22666
22667 * doc/bison.texinfo: Use `$' as shell prompt, not `%'.
22668 Use @kbd to denote user input.
22669 (Language and Grammar): ANSIfy the example.
22670 Adjust its layout for info/notinfo.
22671 (Location Tracking Calc): Output error messages to stderr.
22672 Output locations in a more GNUtically correct way.
22673 Fix a couple of Englishos.
22674 Adjust @group/@end group pairs.
22675
22676 2001-11-12 Akim Demaille <akim@epita.fr>
22677
22678 %expect was not functioning at all.
22679
22680 * src/conflicts.c (expected_conflicts): Set to -1.
22681 (conflict_report): Use ngettext.
22682 (conflicts_print): Check %expect and make its violation an error.
22683 * doc/bison.texinfo (Expect Decl): Adjust.
22684 * configure.in (AM_GNU_GETTEXT): Ask for ngettext.
22685 * tests/regression.at (%expect not enough, %expect right)
22686 (%expect too much): New.
22687
22688 2001-11-12 Akim Demaille <akim@epita.fr>
22689
22690 * tests/regression.at (Conflicts): Rename as...
22691 (Unresolved SR Conflicts): this.
22692 (Solved SR Conflicts): New.
22693
22694 2001-11-12 Akim Demaille <akim@epita.fr>
22695
22696 * src/reduce.c (print_results): Rename as...
22697 (reduce_output): This.
22698 Output to OUT, passed as argument, instead of output_obstack.
22699 (dump_grammar): Likewise.
22700 (reduce_free): New.
22701 Also free V1.
22702 (reduce_grammar): No longer call reduce_output, since...
22703 * src/print.c (print_results): do it.
22704 * src/main.c (main): Call reduce_free;
22705
22706 2001-11-12 Akim Demaille <akim@epita.fr>
22707
22708 * src/conflicts.c (print_reductions): Accept OUT as argument.
22709 Output to it, not to output_obstack.
22710 * src/print.c (print_actions): Adjust.
22711
22712 2001-11-12 Akim Demaille <akim@epita.fr>
22713
22714 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts): Return
22715 the result instead of using...
22716 (src_total, rrc_total, src_count, rrc_count): Remove.
22717 (any_conflicts): Remove.
22718 (print_conflicts): Split into...
22719 (conflicts_print, conflicts_output): New.
22720 * src/conflicts.h: Adjust.
22721 * src/main.c (main): Invoke both conflicts_output and conflicts_print.
22722 * src/print.c (print_grammar): Issue `\n' between two rules.
22723 * tests/regression.at (Conflicts): New.
22724 Reported by Tom Lane.
22725
22726 2001-11-12 Akim Demaille <akim@epita.fr>
22727
22728 * tests/regression.at (Invalid input): Remove, duplicate with
22729 ``Invalid input: 1''.
22730
22731 2001-11-12 Akim Demaille <akim@epita.fr>
22732
22733 * tests/torture.at (AT_DATA_STACK_TORTURE)
22734 (Exploding the Stack Size with Alloca)
22735 (Exploding the Stack Size with Malloc): New.
22736
22737 2001-11-12 Akim Demaille <akim@epita.fr>
22738
22739 * src/bison.simple (YYSTACK_REALLOC): New.
22740 (yyparse) [!yyoverflow]: Use it and free the old stack.
22741 Reported by Per Allansson.
22742
22743 2001-11-12 Pascal Bart <pascal.bart@epita.fr>
22744
22745 * src/bison.simple: Define type yystype instead of YYSTYPE, and
22746 define CPP macro, which substitute YYSTYPE by yystype.
22747 * src/reader.c (parse_union_decl): Output yystype/YYSTYPE as we do
22748 with yyltype/YYLTYPE. This allows inclusion of the generated
22749 header within the parser if the compiler, such as GGC, accepts
22750 multiple equivalent #defines.
22751 From Akim.
22752
22753 2001-11-05 Akim Demaille <akim@epita.fr>
22754
22755 * src/reader.c (symbols_output): New, extracted from...
22756 (packsymbols): here.
22757 (reader): Adjust.
22758
22759 2001-11-05 Akim Demaille <akim@epita.fr>
22760
22761 * src/lex.c (parse_percent_token): s/quotearg/quote/.
22762
22763 2001-11-05 Akim Demaille <akim@epita.fr>
22764
22765 * tests/regression.at (AT_TEST_CPP_GUARD_H): Adjust the clean up
22766 pattern.
22767
22768 2001-11-05 Akim Demaille <akim@epita.fr>
22769
22770 * src/options.h (struct option_table_struct): set_flags is void*.
22771 * src/options.c (longopts): Support `--output' and `%output'.
22772 (usage): Adjust.
22773 * src/lex.h (tok_setopt): Remove, replaced with...
22774 (tok_intopt, tok_stropt): these new guys.
22775 * src/lex.c (getopt.h): Not needed.
22776 (token_buffer, unlexed_token_buffer): Not const.
22777 (percent_table): Promote `-' over `_' in directive names.
22778 Active `%name-prefix', `file-prefix', and `output'.
22779 (parse_percent_token): Accept possible arguments to directives.
22780 Promote `-' over `_' in directive names.
22781
22782 2001-11-04 Akim Demaille <akim@epita.fr>
22783
22784 * doc/bison.texinfo (Decl Summary): Split the list into
22785 `directives for grammars' and `directives for bison'.
22786 Sort'em.
22787 Add description of `%name-prefix', `file-prefix', and `output'.
22788 Promote `-' over `_' in directive names.
22789 (Bison Options): s/%locactions/%locations/. Nice Freudian slip.
22790 Simplify the description of `--name-prefix'.
22791 Promote `-' over `_' in directive names.
22792 Promote `--output' over `--output-file'.
22793 Fix the description of `--defines'.
22794 * tests/output.at: Exercise %file-prefix and %output.
22795
22796 2001-11-02 Akim Demaille <akim@epita.fr>
22797
22798 * doc/refcard.tex: Update.
22799
22800 2001-11-02 Akim Demaille <akim@epita.fr>
22801
22802 * src/symtab.h (SUNDEF): New.
22803 * src/symtab.c (bucket_new): Init user_token_number to SUNDEF to
22804 stand for `uninitialized', instead of 0.
22805 * src/reader.c (packsymbols, parse_thong_decl): Adjust.
22806 * src/lex.c (lex): Adjust.
22807
22808 * tests/calc.at (_AT_DATA_CALC_Y): Declare a token for EOF.
22809 Number it 0.
22810 Let yylex return it instead of a plain 0.
22811 Reported by Dick Streefland.
22812
22813 2001-11-02 Akim Demaille <akim@epita.fr>
22814
22815 * tests/regression.at (Mixing %token styles): New test.
22816
22817 2001-11-02 Akim Demaille <akim@epita.fr>
22818
22819 * src/reader.c (parse_thong_decl): Formatting changes.
22820 (token_translations_init): New, extracted from...
22821 (packsymbols): Here.
22822 Adjust.
22823
22824 2001-11-01 Akim Demaille <akim@epita.fr>
22825
22826 * tests/regression.at (AT_TEST_CPP_GUARD_H): New.
22827 Check that `9foo.y' produces correct cpp guards.
22828 * src/files.c (compute_header_macro): Prepend `BISON_' to CPP
22829 guards.
22830 Reported by Wwp.
22831
22832 2001-11-01 Akim Demaille <akim@epita.fr>
22833
22834 * tests/regression.at (Invalid input: 2): New.
22835 * src/lex.c (unlexed_token_buffer): New.
22836 (lex, unlex): Adjust: when unlexing, be sure to save token_buffer
22837 too.
22838 Reported by Wwp.
22839
22840 2001-11-01 Akim Demaille <akim@epita.fr>
22841
22842 * tests/calc.at: Catch up with 1.30.
22843 * configure.in: Bump to 1.49a.
22844 Adjust to newer Autotest.
22845
22846 2001-10-19 Pascal Bart <pascal.bart@epita.fr>
22847
22848 * src/conflicts.c: Move global variables rrc_total and src_total ...
22849 (print_conflicts): here.
22850 * src/output.c (output): Free global variable user_toknums.
22851 * src/lex.c (token_obstack): Become static.
22852
22853 2001-10-18 Akim Demaille <akim@epita.fr>
22854
22855 * tests/atlocal.in (GCC): Add.
22856 * tests/calc.at: s/m4_match/m4_bmatch/.
22857 s/m4_patsubst/m4_bpatsubst/.
22858 (AT_CHECK_CALC): Check the compiler's stderr only if it's GCC.
22859 * configure.in: AC_SUBST(GCC).
22860
22861 2001-10-14 Marc Autret <autret_m@epita.fr>
22862
22863 * src/options.c (create_long_option_table): Fix.
22864
22865 2001-10-10 Akim Demaille <akim@epita.fr>
22866
22867 * src/bison.simple: Be sure to set YYSTACK_USE_ALLOCA.
22868
22869 2001-10-04 Akim Demaille <akim@epita.fr>
22870
22871 * src/reader.c (parse_union_decl): Push the caracters in
22872 union_obstack, not attrs_obstack.
22873
22874 2001-10-04 Akim Demaille <akim@epita.fr>
22875
22876 Merge in the branch 1.29.
22877
22878 * src/reader.c (packsymbols): Use a temporary obstack for
22879 `%%tokendef', since output_stack is already used elsewhere.
22880
22881 2001-10-02 Akim Demaille <akim@epita.fr>
22882
22883 Bump 1.29d.
22884
22885 2001-10-02 Akim Demaille <akim@epita.fr>
22886
22887 Version 1.29c.
22888
22889 2001-10-02 Akim Demaille <akim@epita.fr>
22890
22891 * tests/regression.at (Invalid CPP headers): New.
22892 From Alexander Belopolsky.
22893 * src/files.c (compute_header_macro): Map non alnum chars to `_'.
22894
22895 2001-10-02 Akim Demaille <akim@epita.fr>
22896
22897 * tests/regression.at (Invalid input): New.
22898 * src/lex.c (lex): Be sure to set `token_buffer' in any case.
22899 Reported by Shura.
22900
22901 2001-10-02 Akim Demaille <akim@epita.fr>
22902
22903 * tests/calc.at: Now that --debug works, the tests must be adjusted.
22904
22905 2001-10-02 Akim Demaille <akim@epita.fr>
22906
22907 * src/output.c (output_parser): Assert `skeleton'.
22908 * src/files.c (skeleton_find): Look harder for skeletons on DOSish
22909 systems.
22910 From Shura.
22911
22912 2001-10-01 Marc Autret <autret_m@epita.fr>
22913
22914 * src/lex.h: Echo modifications.
22915 * src/lex.c (unlex): Parameter is now token_t.
22916 From Hans Aberg.
22917
22918 2001-10-01 Marc Autret <autret_m@epita.fr>
22919
22920 * src/main.c: Include lex.h.
22921 From Hans Aberg.
22922
22923 2001-09-29 Akim Demaille <akim@epita.fr>
22924
22925 * src/getargs.c (longopts): `--debug' is `-t', not `-d'.
22926
22927 2001-09-28 Akim Demaille <akim@epita.fr>
22928
22929 * tests/testsuite.at: Update to newer Autotest.
22930 * tests/Makefile.am (EXTRA_DIST): bison is not to be shipped.
22931
22932 2001-09-27 Akim Demaille <akim@epita.fr>
22933
22934 Position independent wrapper.
22935
22936 * tests/bison: Remove.
22937 * tests/bison.in: New.
22938 * configure.in: Adjust.
22939
22940 2001-09-27 Paul Eggert <eggert@twinsun.com>
22941
22942 Port quotearg fixes from tar 1.13.24.
22943
22944 * lib/quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
22945 tm to be declared.
22946 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
22947 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
22948
22949 * m4/Makefile.am (EXTRA_DIST): Add mbrtowc.m4.
22950 * m4/mbrtowc.m4: New file.
22951 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Check for mbsinit and stddef.h.
22952 Use jm_FUNC_MBRTOWC instead of AC_CHECK_FUNCS(mbrtowc).
22953
22954 2001-09-27 Akim Demaille <akim@epita.fr>
22955
22956 Bump to 1.29c.
22957
22958 2001-09-27 Akim Demaille <akim@epita.fr>
22959
22960 Version 1.29b.
22961
22962 2001-09-25 Akim Demaille <akim@epita.fr>
22963
22964 * src/system.h: Include `xalloc.h'.
22965 Remove it from the C files.
22966 * src/files.c (output_files): Free the obstacks.
22967 * src/lex.c (init_lex): Rename as...
22968 (lex_init): this.
22969 (lex_free): New.
22970 * src/main.c (main): Use it.
22971
22972 2001-09-24 Marc Autret <autret_m@epita.fr>
22973
22974 * src/vcg.c (open_edge, close_edge, open_node, close_node): Change
22975 to output informations in fout (FILE*).
22976 (open_graph, close_graph): Likewise.
22977 (output_graph, output_edge, output_node): Likewise.
22978 * src/vcg.h: Update function prototypes.
22979 * src/print_graph.c (print_graph): Open output graph file.
22980 (print_actions): Adjust.
22981 * src/files.h: Remove extern declaration.
22982 * src/files.c: Remove graph_obstack declaration.
22983 (open_files): Remove graph_obstack initialization.
22984 (output_files): Remove graph_obstack saving.
22985
22986 2001-09-24 Marc Autret <autret_m@epita.fr>
22987
22988 * src/files.c (compute_output_file_names): Fix.
22989
22990 2001-09-24 Marc Autret <autret_m@epita.fr>,
22991 Akim Demaille <akim@epita.fr>
22992
22993 * src/reader.c (reader): Remove call to free_symtab ().
22994 * src/main.c (main): Call it here.
22995 Include symtab.h.
22996 * src/conflicts.c (initialize_conflicts): Rename as...
22997 (solve_conflicts): this.
22998 * src/print.c (print_core, print_actions, print_state)
22999 (print_grammar): Dump to a file instead a `output_obstack'.
23000 (print_results): Dump `output_obstack', and then proceed with the
23001 FILE *.
23002 * src/files.c (compute_output_file_names, close_files): New.
23003 (output_files): Adjust.
23004 * src/main.c (main): Adjust.
23005
23006 2001-09-23 Marc Autret <autret_m@epita.fr>
23007
23008 * src/files.c (compute_header_macro): Computes header macro name
23009 from spec_defines_file when given.
23010
23011 2001-09-23 Marc Autret <autret_m@epita.fr>
23012
23013 * src/files.c (output_files): Add default extensions.
23014
23015 2001-09-22 Akim Demaille <akim@epita.fr>
23016
23017 * src/conflicts.c (finalize_conflicts): Rename as...
23018 (free_conflicts): this.
23019
23020 2001-09-22 Akim Demaille <akim@epita.fr>
23021
23022 * src/gram.c (gram_free): Rename back as...
23023 (dummy): this.
23024 (output_token_translations): Free `token_translations'.
23025 * src/symtab.c (free_symtab): Free the tag field.
23026
23027 2001-09-22 Akim Demaille <akim@epita.fr>
23028
23029 Remove `translations' as it is always set to true.
23030
23031 * src/gram.h: Adjust.
23032 * src/reader.c (packsymbols, parse_token_decl): Adjust
23033 * src/print.c (print_grammar): Adjust.
23034 * src/output.c (output_token_translations): Adjust.
23035 * src/lex.c (lex): Adjust.
23036 * src/gram.c: Be sure the set pointers to NULL.
23037 (dummy): Rename as...
23038 (gram_free): this.
23039
23040 2001-09-22 Akim Demaille <akim@epita.fr>
23041
23042 * configure.in: Invoke AM_LIB_DMALLOC.
23043 * src/system.h: Use dmalloc.
23044 * src/LR0.c: Be sure to have pointers initialized to NULL.
23045 (allocate_itemsets): Allocate kernel_items only if needed.
23046
23047 2001-09-22 Akim Demaille <akim@epita.fr>
23048
23049 * configure.in: Bump to 1.29b.
23050 * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
23051 * tests/calc.at (_AT_DATA_CALC_Y): #undef malloc so that we don't
23052 need xmalloc.c in calc.y.
23053 From Pascal Bart.
23054
23055 2001-09-21 Akim Demaille <akim@epita.fr>
23056
23057 Version 1.29a.
23058 * Makefile.maint, config/config.guess, config/config.sub,
23059 * config/missing: Update from masters.
23060 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): No longer depend
23061 upon package.m4.
23062 * configure.in (ALL_LINGUAS): Add `tr'.
23063
23064 2001-09-21 Akim Demaille <akim@epita.fr>
23065
23066 * tests/Makefile.am (package.m4): Move to...
23067 ($(srcdir)/$(TESTSUITE)): here.
23068
23069 2001-09-20 Akim Demaille <akim@epita.fr>
23070
23071 * src/complain.c: No longer try to be standalone: use system.h.
23072 Don't assume __STDC__ is defined to 1. Just test if it is defined.
23073 * src/complain.h: Likewise.
23074 * src/reduce.c (useless_nonterminals, inaccessable_symbols):
23075 Remove the unused variable `n'.
23076 From Albert Chin-A-Young.
23077
23078 2001-09-18 Marc Autret <autret_m@epita.fr>
23079
23080 * doc/bison.1: Update.
23081 * doc/bison.texinfo (Bison Options): Update --defines and --graph
23082 descriptions.
23083 (Option Cross Key): Update.
23084 Add --graph.
23085
23086 2001-09-18 Marc Autret <autret_m@epita.fr>
23087
23088 * tests/regression.at: New test (comment in %union).
23089
23090 2001-09-18 Marc Autret <autret_m@epita.fr>
23091
23092 * src/reader.c (parse_union_decl): Do not output '/'. Let copy_comment
23093 do that.
23094 Reported by Keith Browne.
23095
23096 2001-09-18 Marc Autret <autret_m@epita.fr>
23097
23098 * tests/output.at: Add tests for --defines and --graph.
23099
23100 2001-09-18 Marc Autret <autret_m@epita.fr>
23101
23102 * tests/output.at: Removes tests of %{header,src}_extension features.
23103
23104 2001-09-18 Akim Demaille <akim@epita.fr>
23105
23106 * tests/Makefile.am (package.m4): New.
23107 * tests/calc.at (_AT_CHECK_CALC): Just run `calc input'.
23108 (_AT_CHECK_CALC_ERROR): Likewise.
23109 Factor the `, ' part of verbose error messages.
23110
23111 2001-09-18 Marc Autret <autret_m@epita.fr>
23112
23113 * src/getargs.c (longopts): Declare --defines and --graph as options
23114 with optional arguments.
23115 * src/files.h: Add extern declarations.
23116 * src/files.c (spec_graph_file, spec_defines_file): New.
23117 (output_files): Update.
23118 Remove CPP-outed code.
23119
23120 2001-09-18 Marc Autret <autret_m@epita.fr>
23121
23122 Turn off %{source,header}_extension feature.
23123
23124 * src/files.c (compute_exts_from_gf): Update.
23125 (compute_exts_from_src): Update.
23126 (output_files): CPP-out useless code.
23127 * src/files.h: Remove {header,source}_extension extern declarations.
23128 * src/reader.c (parse_dquoted_param): CPP-out.
23129 (parse_header_extension_decl): Remove.
23130 (parse_source_extension_decl): Remove.
23131 (read_declarations): Remove cases tok_{hdrext,srcext}.
23132 * src/lex.c (percent_table): Remove {header,source}_extension entries.
23133 * src/lex.h (token_t): Remove tok_hdrext and tok_srcext.
23134
23135 2001-09-10 Akim Demaille <akim@epita.fr>
23136
23137 * tests/output.at (AT_CHECK_BISON_FLAGS, AT_CHECK_BISON_PERCENT):
23138 (AT_CHECK_BISON_PERCENT_FLAGS): Merge into...
23139 (AT_CHECK_OUTPUT): this.
23140 Merely check ls' exit status, its output is useless.
23141
23142 2001-09-10 Akim Demaille <akim@epita.fr>
23143
23144 * tests/calc.at: Use m4_match.
23145 (_AT_DATA_CALC_Y): Check `yyin != NULL', not `stdin != NULL'.
23146
23147 2001-09-10 Marc Autret <autret_m@epita.fr>,
23148 Akim Demaille <akim@epita.fr>
23149
23150 * src/vcg.h (graph_s): color, textcolor, bordercolor are now
23151 enum color_e.
23152 * src/print_graph.c (print_graph): Initalize graph.layoutalgorithm
23153 to `normal'.
23154 * src/reader.c (parse_token_decl): Initialize token with tok_eof.
23155 * src/lex.h: Adjust prototype.
23156 (token_t): Add `tok_undef'.
23157 * src/lex.c (struct percent_table_struct): Retval is now a token_t.
23158 (parse_percent_token): Now returns token_t.
23159 Add default statement in switch.
23160 (lex): Separate `c' as an input variable, from the token_t result
23161 part.
23162 (unlexed): Is a token_t.
23163
23164 2001-09-10 Akim Demaille <akim@epita.fr>
23165
23166 * configure.in: Bump to 1.29a.
23167
23168 2001-09-07 Akim Demaille <akim@epita.fr>
23169
23170 Version 1.29.
23171
23172 2001-08-30 Akim Demaille <akim@epita.fr>
23173
23174 * tests/atgeneral.m4, tests/atconfig.in, tests/suite.at: Remove.
23175 * m4/atconfig.m4: Remove.
23176 * tests/testsuite.at, tests/atlocal.in, tests/output.at,
23177 * tests/bison: New.
23178 * tests/regression.at, tests/calc.at: Use m4_define, AT_BANNER,
23179 m4_if, m4_patsubst, and m4_regexp.
23180 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Use an
23181 `input' file instead of echo.
23182
23183 2001-08-29 Akim Demaille <akim@epita.fr>
23184
23185 Bump to 1.28e.
23186
23187 2001-08-29 Akim Demaille <akim@epita.fr>
23188
23189 Version 1.28d.
23190
23191 2001-08-29 Paul Eggert <eggert@twinsun.com>
23192
23193 * src/bison.simple (yyparse): Don't take the address of an
23194 item before the start of an array, as that doesn't conform to
23195 the C Standard.
23196
23197 2001-08-29 Robert Anisko <anisko_r@epita.fr>
23198
23199 * doc/bison.texinfo (Location Tracking Calc): New node.
23200
23201 2001-08-29 Paul Eggert <eggert@twinsun.com>
23202
23203 * src/output.c (output): Do not define const, as this now
23204 causes more problems than it cures.
23205
23206 2001-08-29 Akim Demaille <akim@epita.fr>
23207
23208 * doc/bison.texinfo: Modernize `@node' and `@top' use: just name
23209 the nodes.
23210 Be sure to tag the `detailmenu'.
23211
23212 2001-08-29 Akim Demaille <akim@epita.fr>
23213
23214 * Makefile.maint (do-po-update): Wget refuses to overwrite files:
23215 download in a tmp dir.
23216
23217 2001-08-28 Marc Autret <autret_m@epita.fr>
23218
23219 * config/depcomp: New file.
23220
23221 2001-08-28 Marc Autret <autret_m@epita.fr>
23222
23223 * doc/bison.1 (mandoc): Adjust.
23224 From Juan Manuel Guerrero.
23225
23226 2001-08-28 Marc Autret <autret_m@epita.fr>
23227
23228 * src/print_graph.c (print_state): Fix.
23229
23230 2001-08-27 Marc Autret <autret_m@epita.fr>
23231
23232 * src/vcg.h (classname_s, infoname_s, node_s): Constify the
23233 char * members.
23234 Echo modifications to the functions prototypes.
23235 * src/vcg.c (add_classname, add_infoname): Adjust arguments.
23236
23237 2001-08-27 Marc Autret <autret_m@epita.fr>
23238
23239 * src/vcg.c: Include `xalloc.h'.
23240 (add_colorentry): New.
23241 (add_classname): New.
23242 (add_infoname): New.
23243 * src/vcg.h: Add new prototypes.
23244
23245 2001-08-27 Akim Demaille <akim@epita.fr>
23246
23247 * Makefile.maint: Sync. again with CVS Autoconf.
23248
23249 2001-08-27 Akim Demaille <akim@epita.fr>
23250
23251 * Makefile.maint: Formatting changes.
23252 (po-update, cvs-update, update): New targets.
23253 (AMTAR): Remove.
23254
23255 2001-08-27 Akim Demaille <akim@epita.fr>
23256
23257 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
23258 * Makefile.maint: Sync. with CVS Autoconf.
23259
23260 2001-08-27 Marc Autret <autret_m@epita.fr>
23261
23262 * src/vcg.h (struct infoname_s): New.
23263 (struct colorentry_s): New.
23264 (graph_s): New fields {vertical,horizontal}_order in structure.
23265 Add `infoname' field.
23266 Add `colorentry' field;
23267 * src/vcg_defaults.h (G_VERTICAL_ORDER): New.
23268 (G_HORIZONTAL_ORDER): New.
23269 (G_INFONAME): New.
23270 (G_COLORENTRY): New.
23271 * src/vcg.c (output_graph): Add output of {vertical,horizontal}_order.
23272 Add output of `infoname'.
23273 Add output of `colorentry'.
23274
23275 2001-08-27 Marc Autret <autret_m@epita.fr>
23276
23277 * src/reader.c (parse_dquoted_param): Rename variable `index' to `i'.
23278 This one shadowed a global parameter.
23279
23280 2001-08-24 Marc Autret <autret_m@epita.fr>
23281
23282 * src/print_graph.c (node_output_size): Declared POSIX `size_t' type,
23283 instead of `unsigned'.
23284 (print_state): Do not call obstack_object_size () in obstack_grow ()
23285 to avoid macro variables shadowing.
23286
23287 2001-08-23 Marc Autret <autret_m@epita.fr>
23288
23289 * src/lex.c (percent_table): Typo: s/naem/name/.
23290 Add graph option.
23291 Normalize new options declarations.
23292
23293 2001-08-20 Pascal Bart <pascal.bart@epita.fr>
23294
23295 * tests/suite.at: Exercise %header_extension and %source_extension.
23296
23297 2001-08-16 Marc Autret <autret_m@epita.fr>
23298
23299 * src/reader.c (parse_dquoted_param): New.
23300 (parse_header_extension_decl): Use it.
23301 (parse_source_extension_decl): Likewise.
23302
23303 2001-08-16 Marc Autret <autret_m@epita.fr>
23304
23305 * src/vcg.c: Remove includes of `complain.h' and `xalloc.h'.
23306 (get_xxxx_str): Use assert () instead of complain ().
23307 Remove return invokations in default cases.
23308 (get_decision_str): Modify default behaviour. Remove second argument.
23309 Echo modifications on calls.
23310 (output_graph): Fix.
23311
23312 2001-08-16 Marc Autret <autret_m@epita.fr>
23313
23314 * src/getargs.c (usage): Update with ``-g, --graph''.
23315
23316 2001-08-16 Marc Autret <autret_m@epita.fr>
23317
23318 * doc/bison.texinfo (Bison Options): Add items `-g', `--graph'.
23319 (Option Cross Key): Likewise.
23320 * doc/bison.1: Update.
23321
23322 2001-09-25 Pascal Bart <pascal.bart@epita.fr>
23323
23324 * src/output.c (output_master_parser): Don't finish action_obstack.
23325 (output_parser): Don't care about the muscle action, here.
23326 (prepare): Copy the action_obstack in the action muscle.
23327 (output): Free action_obstack.
23328
23329 2001-09-23 Pascal Bart <pascal.bart@epita.fr>
23330
23331 * src/reader.c (parse_union_decl): Add new obstack union_obstack. Which
23332 will contain `%union' declaration.
23333 (parse_union_decl): Delete #line directive output.
23334 (parse_union_decl): Substitute /attrs_obstack/union_obstack for all
23335 informations about %union.
23336 (parse_union_decl): Copy the union_obstack in the muscle stype.
23337 * src/bison.simple: Add new #line directive.
23338 Add typdef %%stype YYSTYPE.
23339
23340 2001-09-23 Pascal Bart <pascal.bart@epita.fr>
23341
23342 * src/bison.simple: Add new `#line' directive.
23343
23344 2001-09-22 Pascal Bart <pascal.bart@epita.fr>
23345
23346 * src/bison.simple: New `#line' directive.
23347 * src/output.c (output_parser): Support new dynamic muscle input_line.
23348
23349 2001-09-22 Marc Autret <autret_m@epita.fr>
23350
23351 * src/output.c (output_master_parser): New.
23352 (output_parser): Be more re-entrant.
23353
23354 2001-09-21 Marc Autret <autret_m@epita.fr>
23355
23356 * src/reader.c (copy_definition, parse_union_decl): Update and use
23357 `linef' muscle.
23358 (copy_action): Likewise.
23359 Use obstack_1grow ().
23360 * src/muscle_tab.c (muscle_init): Add muscle `linef'.
23361
23362 2001-09-21 Marc Autret <autret_m@epita.fr>
23363
23364 * src/options.c (option_table): Adjust.
23365 * src/lex.c (parse_percent_token): Fix.
23366
23367 2001-09-20 Pascal Bart <pascal.bart@epita.fr>
23368
23369 * src/options.c (symtab.h): Include it, need by lex.h.
23370
23371 2001-09-20 Pascal Bart <pascal.bart@epita.fr>
23372
23373 * src/lex.c (parse_percent_token): Change type of variable `tx', which
23374 is now an option_table_struct*.
23375 (option_strcmp): New function option_strcmp.
23376 (parse_percent_token): Call option_strcmp.
23377 * src/getargs.c (xalloc.h, options.h): Include it.
23378 (getargs): Call create_long_option_table.
23379 (getargs): Free longopts at the end of the function.
23380 (shortopts): Move in options.c.
23381 * src/options.c (create_long_option_table): New function. Convert
23382 information from option_table to option structure.
23383 * src/reader.c (options.h): Include it.
23384
23385 * src/Makefile.am: Adjust.
23386 * src/options.c (option_table): Create from longopts and percent_table.
23387 * src/getargs.c (longopts): Delete.
23388 * src/lex.c (struct percent_table_struct): Delete.
23389 (percent_table): Delete.
23390 (options.h): Include it.
23391 * src/options.c: Create.
23392 * src/options.h: Create.
23393 Declare enum opt_access_e.
23394 Define struct option_table_struct.
23395
23396 2001-09-20 Marc Autret <autret_m@epita.fr>
23397
23398 * doc/bison.texinfo: Adjust terminologies about prologue and epilogue
23399 sections of Bison.
23400
23401 2001-09-19 Pascal Bart <pascal.bart@epita.fr>
23402
23403 * src/bison.simple: s/%%filename/%%skeleton.
23404 * src/muscle_tab.c (getargs.h): Include it.
23405 (muscle_init): Insert new muscle skeleton.
23406
23407 2001-09-18 Pascal Bart <pascal.bart@epita.fr>
23408
23409 * src/output.c (output_parser): Delete unused variable actions_dumped.
23410
23411 2001-09-07 Pascal Bart <pascal.bart@epita.fr>
23412
23413 * src/output.c (output): Delete call to reader_output_yylsp.
23414 * src/reader.c (reader): Likewise.
23415 * src/reader.h: Delete declaration of reader_output_yylsp.
23416
23417 2001-09-02 Marc Autret <autret_m@epita.fr>
23418
23419 * src/reader.c: Include muscle_tab.h.
23420 (parse_union_decl): Update.
23421 (parse_macro_decl): Rename parse_muscle_decl.
23422 Update to use renamed functions and variable.
23423 (read_declarations, copy_action, read_additionnal_code, : Updated
23424 with correct variables and functions names.
23425 (packsymbols, reader): Likewise.
23426
23427 * src/reader.h (muscle_obstack): Extern declaration update.
23428
23429 * src/output.c: Include muscle_tab.h
23430 In all functions using macro_insert, change by using muscle_insert ().
23431 (macro_obstack): Rename muscle_obstack.
23432 Echo modifications in the whole file.
23433 (MACRO_INSERT_INT): Rename MUSCLE_INSERT_INT.
23434 (MACRO_INSERT_STRING): Rename MUSCLE_INSERT_STRING.
23435 (MACRO_INSERT_PREFIX): Rename MUSCLE_INSERT_PREFIX.
23436
23437 * src/muscle_tab.h: Update double inclusion macros.
23438 (macro_entry_s): Rename muscle_entry_s.
23439 Update prototypes.
23440
23441 * src/muscle_tab.c: Include muscle_tab.h.
23442 Rename macro_tabble to muscle_table.
23443 (mhash1, mhash2, mcmp): Use muscle_entry.
23444 (macro_init): Rename muscle_init. Update.
23445 (macro_insert): Rename muscle_insert. Update.
23446 (macro_find): Rename muscle_find. Update.
23447
23448 * src/main.c: Include muscle_tab.h.
23449 (main): Call muscle_init ().
23450 * src/Makefile.am (bison_SOURCES): Echo modifications.
23451
23452 2001-09-02 Marc Autret <autret_m@epita.fr>
23453
23454 Now the files macro_tab.[ch] are named muscle_tab.[ch].
23455
23456 * src/muscle_tab.c, src/muscle_tab.h: Add files.
23457
23458 2001-09-02 Marc Autret <autret_m@epita.fr>
23459
23460 * src/macrotab.c, src/macrotab.h: Remove.
23461
23462 2001-09-01 Pascal Bart <pascal.bart@epita.fr>
23463
23464 * src/reader.c (copy_guard): Use muscle to specify the `#line'
23465 filename.
23466
23467 2001-09-01 Marc Autret <autret_m@epita.fr>
23468
23469 * tests/calc.at (exp): Now, YYERROR_VERBOSE need to be set
23470 to an explicit value to activate the feature. We do it here.
23471
23472 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
23473
23474 * src/output.c (prepare): Delete the `filename' muscule insertion.
23475 * src/reader.c (copy_action): Use `filename' muscule with `#line'.
23476 (parse_union_decl): Likewise.
23477 * src/macrotab.c (macro_init): Initialize filename by infile.
23478
23479 2001-08-31 Marc Autret <autret_m@epita.fr>
23480
23481 * src/bison.simple (YYLSP_NEEDED): New definition.
23482 * src/output.c (prepare): Add macro insertion of `locations_flag'
23483
23484 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
23485
23486 * src/output.c (prepare): Delete insertion of previous muscles,
23487 and insert the `prefix' muscles.
23488 * src/macrotab.c (macro_init): Likewise.
23489 (macro_init): Initialization prefix directive by `yy'.
23490 * src/bison.simple: Substitute all %%yylex, %%yychar, %%yylval,
23491 %%yydebug, %%yyerror, %%yynerrs and %%yyparse by yylex, yychar,
23492 yylval, yydebug, yyerror, yynerrs and yyparse.
23493 New directive `#define' to substitute yydebug, ... with option
23494 name_prefix.
23495
23496 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
23497
23498 * src/main.c (main): Standardize.
23499 * src/output.c (output_table_data, output_parser): Likewise.
23500 * src/macrotab.h, src/macrotab.c, src/bison.simple: Likewise.
23501
23502 2001-08-31 Pascal Bart <pascal.bart@epita.fr>, Marc Autret <autret_m@epita.fr>
23503
23504 * src/reader.c (read_additionnal_code): Rename %%user_code to
23505 %%epilogue.
23506 * src/output.c (output): Rename %%declarations to %%prologue.
23507 * src/bison.simple: Echo modifications.
23508
23509 2001-08-31 Marc Autret <autret_m@epita.fr>
23510
23511 * src/reader.c (readgram): CleanUp.
23512 (output_token_defines): Likewise.
23513 (packsymbols): Likewise.
23514 (reader): Likewise.
23515 * src/output.c (output): CPP-out useless code.
23516
23517 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
23518
23519 * src/reader.c (reader): Delete obsolete call to function
23520 output_trailers and output_headers.
23521 * src/output.h: Remove obsolete functions prototypes of output_headers
23522 and output_trailers.
23523
23524 2001-08-30 Pascal Bart <pascal.bart@epita.fr>
23525
23526 * src/main.c: Include macrotab.h.
23527 * src/macrotab.h (macro_entry_s): Constify fields.
23528 Adjust functions prototypes.
23529 * src/macrotab.c (macro_insert): Constify key and value.
23530 (macro_find): Constify key.
23531 (macro_insert): Include 'xalloc.h'
23532 (macro_insert): Use XMALLOC.
23533 (macro_find): Constify return value.
23534 * src/output.c (output_table_data): Rename table to table_data.
23535 (output_parser): Constify macro_key, macro_value.
23536
23537 2001-08-30 Marc Autret <autret_m@epita.fr>
23538
23539 * src/reader.c (parse_skel_decl): New.
23540 (read_declarations): Add case `tok_skel', call parse_skel_decl ().
23541 * src/lex.h (token_t): New token `tok_skel'.
23542 * src/lex.c (percent_table): Add skeleton option entry.
23543 Standardize.
23544
23545 2001-08-29 Marc Autret <autret_m@epita.fr>
23546
23547 * src/bison.simple: Add %%user_code directive at the end.
23548 * src/reader.c (read_additionnal_code): New.
23549 (reader): Use it.
23550 * src/output.c (output_program): Remove.
23551 (output): Update.
23552
23553 2001-08-28 Marc Autret <autret_m@epita.fr>
23554
23555 * src/output.c (output_actions): Clean up.
23556 (output_gram): CPP-out useless code.
23557 * src/reader.c (reader): Clean up, CPP-out useless code.
23558
23559 2001-08-28 Pascal Bart <pascal.bart@epita.fr>
23560
23561 * src/output.c (output): Copy attrs_obstack in the '%%definitions'
23562 directive.
23563 * src/bison.simple: Add `%%definitions'.
23564
23565 2001-08-28 Marc Autret <autret_m@epita.fr>
23566
23567 * config/depcomp: New file.
23568
23569 2001-08-27 Paul Eggert <eggert@twinsun.com>
23570
23571 * src/bison.simple (yyparse): Don't take the address of an
23572 item before the start of an array, as that doesn't conform to
23573 the C Standard.
23574
23575 2001-08-27 Robert Anisko <robert.anisko@epita.fr>
23576
23577 * src/output.c (output): Remove the initialization of the macro
23578 obstack. It was done too late here.
23579
23580 * src/reader.c (parse_macro_decl): Fix. Use of the macro obstack was
23581 completely wrong.
23582 (reader): Initialize the macro obstack here, since we need it to grow
23583 '%define' directives.
23584
23585 * src/reader.h: Declare the macro obstack as extern.
23586
23587 2001-08-27 Robert Anisko <robert.anisko@epita.fr>
23588
23589 * src/output.c (output_parser): Fix. Store single '%' characters in
23590 the output obstack instead of throwing them away.
23591
23592 2001-08-27 Akim Demaille <akim@epita.fr>
23593
23594 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
23595
23596 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
23597
23598 * lib/Makefile.am: Adjust.
23599
23600 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
23601
23602 * src/bison.simple: Update and add '%%' directives.
23603
23604 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
23605
23606 * src/reader.c (reader): Remove calls to 'output_headers' and
23607 'output_trailers'. Remove some C output.
23608 (readgram): Disable a piece of code that was writing a default
23609 definition for 'YYSTYPE'.
23610 (reader_output_yylsp): Remove.
23611 (packsymbols): Output token defintions to a macro.
23612 (copy_definition): Disable C output.
23613
23614 * src/reader.c (parse_macro_decl): New function used to parse macro
23615 declarations.
23616 (copy_string2): Put the body of copy_string into this new function.
23617 Add a parameter to let the caller choose whether he wants to copy the
23618 string delimiters or not.
23619 (copy_string): Be a simple call to copy_string2 with the last argument
23620 bound to true.
23621 (read_declarations): Add case for macro definition.
23622 (copy_identifier): New.
23623 (parse_macro_decl): Read macro identifiers using copy_identifier
23624 rather than lex.
23625
23626 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
23627
23628 * src/output.c (prepare): Add prefixed names.
23629 (output_parser): Output semantic actions.
23630 (output_parser): Fix bug on '%%line' directives.
23631
23632 * src/output.c (output_headers): Remove. The C code printed by this
23633 function should now be in the skeletons.
23634 (output_trailers): Remove.
23635 (output): Disable call to 'reader_output_yylsp'.
23636 (output_rule_data): Do not output tables to the table obstack.
23637
23638 * src/output.c: Remove some C dedicated output.
23639 Improve the use of macro and output obstacks.
23640 (output_defines): Remove.
23641
23642 * src/output.c (output_token_translations): Associate 'translate'
23643 table with a macro. No output to the table obstack.
23644 (output_gram): Same for 'rhs' and 'prhs'.
23645 (output_stos): Same for 'stos'.
23646 (output_rule_data): Same for 'r1' and 'r2'.
23647 (token_actions): Same for 'defact'.
23648 (goto_actions): Same for 'defgoto'.
23649 (output_base): Same for 'pact' and 'pgoto'.
23650 (output_table): Same for 'table'.
23651 (output_check): Same for 'check'.
23652
23653 * src/output.c (output_table_data): New function.
23654 (output_short_table): Remove.
23655 (output_short_or_char_table): Remove.
23656
23657 * src/output.c (output_parser): Replace most of the skeleton copy code
23658 with something new. Skeletons are now processed character by character
23659 rather than line by line, and Bison looks for '%%' macros. This is the
23660 first step in making Bison's output process (a lot) more flexible.
23661 (output_parser): Use the macro table.
23662
23663 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
23664
23665 * src/main.c (main): Initialize the macro table.
23666
23667 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
23668
23669 * src/lex.c (percent_table): Add tok_define.
23670 * src/lex.h: Add tok_define.
23671
23672 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
23673
23674 * src/macrotab.c: New file.
23675 * src/macrotab.h: New file.
23676 * src/Makefile.am: Update.
23677
23678 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
23679
23680 * lib/hash.c: New file.
23681 * lib/hash.h: New file.
23682 * lib/Makefile.am: Update.
23683
23684 2001-08-15 Akim Demaille <akim@epita.fr>
23685
23686 Version 1.28c.
23687
23688 2001-08-15 Marc Autret <autret_m@epita.fr>
23689
23690 * src/reader.c (readgram): Indent output macro YYSTYPE.
23691 (packsymbols): Likewise.
23692 (output_token_defines): Likewise.
23693 * src/files.c: Standardize.
23694 (compute_header_macro): New.
23695 (defines_obstack_save): New. Use compute_header_macro.
23696 (output_files): Update. Use defines_obstack_save.
23697
23698 2001-08-15 Akim Demaille <akim@epita.fr>
23699
23700 * doc/bison.texinfo (Table of Symbols): Document
23701 YYSTACK_USE_ALLOCA.
23702
23703 2001-08-15 Akim Demaille <akim@epita.fr>
23704
23705 * missing: Update from CVS Automake.
23706 * config/config.guess, config/config.sub, config/texinfo.tex:
23707 Update from gnu.org.
23708
23709 2001-08-15 Akim Demaille <akim@epita.fr>
23710
23711 * Makefile.maint: Sync with CVS Autoconf.
23712
23713 2001-08-14 Pascal Bart <pascal.bart@epita.fr>
23714
23715 * doc/bison.texinfo: Include GNU Free Documentation License from
23716 `fdl.texi'.
23717 * doc/fdl.texi: Add to package.
23718
23719 2001-08-14 Marc Autret <autret_m@epita.fr>
23720
23721 Turn on %{source,header}_extension features.
23722
23723 * src/lex.c (percent_table): Un-CPP out header_extension and
23724 source_extension.
23725 * src/files.c (compute_exts_from_gf): Compare pointers with NULL.
23726 (compute_exts_from_src): Remove conditions. It restores priorities
23727 between options.
23728
23729 2001-08-14 Marc Autret <autret_m@epita.fr>
23730
23731 * src/files.c (compute_base_names): Add extensions computing when
23732 `--file-prefix' used.
23733 Standardize function calls.
23734
23735 2001-08-13 Marc Autret <autret_m@epita.fr>
23736
23737 * src/bison.simple (YYSTACK_USE_ALLOCA): Changed to allow users
23738 defining it (defined but null disables alloca).
23739
23740 2001-08-13 Marc Autret <autret_m@epita.fr>
23741
23742 * src/bison.simple (_yy_memcpy): CPP reformat.
23743
23744 2001-08-13 Pascal Bart <pascal.bart@epita.fr>
23745
23746 * tests/atconfig.in (CPPFLAGS): Fix.
23747
23748 2001-08-10 Pascal Bart <pascal.bart@epita.fr>
23749
23750 * doc/bison.texinfo: Include GNU General Public License from
23751 `gpl.texi'.
23752 * doc/gpl.texi: Add to package.
23753
23754 2001-08-10 Marc Autret <autret_m@epita.fr>
23755
23756 * src/print_graph.h: Fix.
23757 * src/reader.c (read_declarations): Use parse_header_extension_decl ().
23758
23759 2001-08-10 Akim Demaille <akim@epita.fr>
23760
23761 * src/system.h: Provide default declarations for stpcpy, strndup,
23762 and strnlen.
23763
23764 2001-08-10 Robert Anisko <anisko_r@epita.fr>
23765
23766 * doc/bison.texinfo (Locations): Update @$ stuff.
23767
23768 2001-08-09 Robert Anisko <anisko_r@epita.fr>
23769
23770 * src/bison.simple (YYLLOC_DEFAULT): Update.
23771 (yyparse): Adjust.
23772
23773 2001-08-08 Marc Autret <autret_m@epita.fr>
23774
23775 * doc/bison.texinfo: Change @samp{$<@dots{}>} to
23776 @samp{$<@dots{}>@var{n}} in Section Actions in Mid-Rule.
23777 Reported by Fabrice Bauzac.
23778
23779 2001-08-08 Marc Autret <autret_m@epita.fr>
23780
23781 * src/vcg_default.h: Use NULL instead of 0 to initialize pointers.
23782 * src/vcg.c (output_node): Fix.
23783 * src/vcg.h: Cleanup.
23784 * src/print_graph.c: Add comments.
23785 (node_output_size): New global variable. Simplify the formatting of
23786 the VCG graph output.
23787 (print_actions): Unused code is now used. It notifies the final state
23788 and no action states in the VCG graph. It also give the reduce actions.
23789 The `shift and goto' edges are red and the `go to state' edges are
23790 blue.
23791 Get the current node name and node_obstack by argument.
23792 (node_obstack): New variable.
23793 (print_state): Manage node_obstack.
23794 (print_core): Use node_obstack given by argument.
23795 A node is not only computed here but in print_actions also.
23796 (print_graph): CPP out useless code instead of commenting it.
23797
23798 2001-08-07 Pascal Bart <pascal.bart@epita.fr>
23799
23800 * tests/atconfig.in (CPPFLAGS): Fix.
23801
23802 2001-08-07 Akim Demaille <akim@epita.fr>
23803
23804 * src/print_graph.c (quote): New.
23805 (print_core): Use it.
23806
23807 2001-08-06 Akim Demaille <akim@epita.fr>, Marc Autret <autret_m@epita.fr>
23808
23809 * src/vcg.c (complain.h): Include it.
23810 Unepitaize `return' invocations.
23811 [NDEBUG] (main): Remove.
23812 * src/vcg.h (node_t, edge_t, graph_t): Constify the char * members.
23813 * src/files.c (open_files): Initialize graph_obstack.
23814 * src/print_graph.c (print_actions): CPP out useless code.
23815 (print_core): Don't output the last `\n' in labels.
23816 Use `quote'.
23817 * src/files.c (output_files): Output the VCG file.
23818 * src/main.c (main): Invoke print_graph ();
23819
23820 2001-08-06 Marc Autret <autret_m@epita.fr>
23821
23822 Automaton VCG graph output.
23823 Using option ``-g'' or long option ``--graph'', you can generate
23824 a gram_filename.vcg file containing a VCG description of the LALR (1)
23825 automaton of your grammar.
23826
23827 * src/main.c: Call to print_graph() function.
23828 * src/getargs.h: Update.
23829 * src/getargs.c (options): Update to catch `-g' and `--graph' options.
23830 (graph_flag): New flag.
23831 (longopts): Update.
23832 (getargs): Add case `g'.
23833 * src/files.c (graph_obstack): New obstack struct.
23834 (open_files): Initialize new obstack.
23835 (output_files): Saves graph_obstack if required.
23836 * src/files.h (graph_obstack): New extern declaration.
23837 * src/Makefile.am: Add new source files.
23838
23839 2001-08-06 Marc Autret <autret_m@epita.fr>
23840
23841 * src/print_graph.c, src/print_graph.h (graph): New.
23842 * src/vcg.h: New file.
23843 * src/vcg.c: New file, VCG graph handling.
23844
23845 2001-08-06 Marc Autret <autret_m@epita.fr>
23846
23847 Add of %source_extension and %header_extension which specify
23848 the source or/and the header output file extension.
23849
23850 * src/files.c (compute_base_names): Remove initialisation of
23851 src_extension and header_extension.
23852 (compute_exts_from_gf): Update.
23853 (compute_exts_from_src): Update.
23854 (output_files): Update.
23855 * src/reader.c (parse_header_extension_decl): New.
23856 (parse_source_extension_decl): New.
23857 (read_declarations): New case statements for the new tokens.
23858 * src/lex.c (percent_table): Add entries for %source_extension
23859 and %header_extension.
23860 * src/lex.h (token_e): New tokens tok_hdrext and tok_srcext.
23861
23862 2001-08-06 Marc Autret <autret_m@epita.fr>
23863
23864 * configure.in: Bump to 1.28c.
23865 * doc/bison.texinfo: Texinfo thingies.
23866
23867 2001-08-04 Pascal Bart <pascal.bart@epita.fr>
23868
23869 * tests/atconfig.in (CPPFLAGS): Add.
23870 * tests/calc.at (AT_CHECK): Use CPPFLAGS.
23871
23872 2001-08-03 Akim Demaille <akim@epita.fr>
23873
23874 Version 1.28b.
23875
23876 2001-08-03 Akim Demaille <akim@epita.fr>
23877
23878 * tests/Makefile.am (check-local): Ship testsuite.
23879 * tests/calc.at (_AT_DATA_CALC_Y): Prototype all the functions.
23880 Include `string.h'.
23881
23882 2001-08-03 Akim Demaille <akim@epita.fr>
23883
23884 * configure.in: Try using -Wformat when compiling.
23885
23886 2001-08-03 Akim Demaille <akim@epita.fr>
23887
23888 * configure.in: Bump to 1.28b.
23889
23890 2001-08-03 Akim Demaille <akim@epita.fr>
23891
23892 * src/complain.c: Adjust strerror_r portability issues.
23893
23894 2001-08-03 Akim Demaille <akim@epita.fr>
23895
23896 Version 1.28a.
23897
23898 2001-08-03 Akim Demaille <akim@epita.fr>
23899
23900 * src/getargs.c, src/getarg.h (skeleton)): Constify.
23901 * src/lex.c (literalchar): Avoid name clashes on `buf'.
23902 * src/getargs.c: Include complain.h.
23903 * src/files.c, src/files.h (skeleton_find): Avoid name clashes.
23904 * lib/quotearg.c, lib/quotearg.h: Update from fileutils 4.1.
23905
23906 2001-08-03 Akim Demaille <akim@epita.fr>
23907
23908 * src/reader.c (readgram): Display hidden chars in error messages.
23909
23910 2001-08-03 Akim Demaille <akim@epita.fr>
23911
23912 Update to gettext 0.10.39.
23913
23914 2001-08-03 Akim Demaille <akim@epita.fr>
23915
23916 * lib/strspn.c: New.
23917
23918 2001-08-01 Marc Autret <autret_m@epita.fr>
23919
23920 * doc/bison.texinfo: Update.
23921 * doc/bison.1 (mandoc): Update.
23922 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove .c and .h.
23923 * src/files.c: Support output files extensions computing.
23924 (src_extension): New static variable.
23925 (header_extension): New static variable.
23926 (tr): New function.
23927 (get_extension_index): New function, gets the index of an extension
23928 filename in a string.
23929 (compute_exts_from_gf): New function, computes extensions from the
23930 grammar file extension.
23931 (compute_exts_from_src): New functions, computes extensions from the
23932 C source file extension, file given by ``-o'' option.
23933 (compute_base_names): Update.
23934 (output_files): Update.
23935
23936 2001-08-01 Robert Anisko <anisko_r@epita.fr>
23937
23938 * doc/bison.texi: Document @$.
23939 (Locations): New section.
23940
23941 2001-07-18 Akim Demaille <akim@epita.fr>
23942
23943 * Makefile.maint, GNUmakefile: New, from Autoconf 2.52.
23944 * config/prev-version.txt, config/move-if-change: New.
23945 * Makefile.am: Adjust.
23946
23947 2001-07-08 Pascal Bart <pascal.bart@epita.fr>
23948
23949 * src/bison.simple (yyparse): Suppress warning `comparaison
23950 between signed and unsigned'.
23951
23952 2001-07-05 Pascal Bart <pascal.bart@epita.fr>
23953
23954 * src/getargs.h (raw_flag): Remove.
23955 * src/getargs.c: Die on `-r'/`--raw'.
23956 * src/lex.c (parse_percent_token): Die on `%raw'.
23957 * src/reader.c (output_token_defines): Suppress call to `raw_flag'.
23958 * tests/calc.at: Suppress test with option `--raw'.
23959
23960 2001-07-14 Akim Demaille <akim@epita.fr>
23961
23962 * config/: New.
23963 * configure.in: Require Autoconf 2.50.
23964 Update to gettext 0.10.38.
23965
23966 2001-03-16 Akim Demaille <akim@epita.fr>
23967
23968 * doc/bison.texinfo: ANSIfy the examples.
23969
23970 2001-03-16 Akim Demaille <akim@epita.fr>
23971
23972 * getargs.c (skeleton): New variable.
23973 (longopts): --skeleton is a new option.
23974 (shortopts, getargs): -S is a new option.
23975 * getargs.h: Declare skeleton.
23976 * output.c (output_parser): Use it.
23977
23978 2001-03-16 Akim Demaille <akim@epita.fr>
23979
23980 * m4/strerror_r.m4: New.
23981 * m4/error.m4: Run AC_FUNC_STRERROR_R.
23982 * lib/error.h, lib/error.c: Update.
23983
23984 2001-03-16 Akim Demaille <akim@epita.fr>
23985
23986 * src/getargs.c (longopts): Clean up.
23987
23988 2001-02-21 Akim Demaille <akim@epita.fr>
23989
23990 * src/reader.c (gensym): `gensym_count' is your own.
23991 Use a static buf to create the symbol name, as token_buffer is no
23992 longer a buffer.
23993
23994 2001-02-08 Akim Demaille <akim@epita.fr>
23995
23996 * src/conflicts.c (conflict_report): Be sure not to append to res
23997 between two calls, which could happen if both first sprintf were
23998 skipped, but not the first cp += strlen.
23999
24000 2001-02-08 Akim Demaille <akim@epita.fr>
24001
24002 * lib/memchr.c, lib/stpcpy.c, lib/strndup.c, lib/strnlen.c:
24003 New, from fileutils 4.0.37.
24004 * configure.in: Require Autoconf 2.49c. I took some time before
24005 making this decision. This is the only way out for portability
24006 issues in Bison, it would mean way too much duplicate effort to
24007 import in Bison features implemented in 2.49c since 2.13.
24008 AC_REPLACE_FUNCS and AC_CHECK_DECLS the functions above.
24009
24010 2001-02-02 Akim Demaille <akim@epita.fr>
24011
24012 * lib/malloc.c, lib/realloc.c: New, from the fileutils 4.0.37.
24013 * lib/xalloc.h, lib/xmalloc.c: Update.
24014
24015 2001-01-19 Akim Demaille <akim@epita.fr>
24016
24017 Get rid of the ad hoc handling of token_buffer in the scanner: use
24018 the obstacks.
24019
24020 * src/lex.c (token_obstack): New.
24021 (init_lex): Initialize it. No longer call...
24022 (grow_token_buffer): this. Remove it.
24023 Adjust all the places which used it to use the obstack.
24024
24025 2001-01-19 Akim Demaille <akim@epita.fr>
24026
24027 * src/lex.h: Rename all the tokens:
24028 s/\bENDFILE\b/tok_eof/g;
24029 s/\bIDENTIFIER\b/tok_identifier/g;
24030 etc.
24031 Let them be enums, not #define, to ease debugging.
24032 Adjust all the code.
24033
24034 2001-01-18 Akim Demaille <akim@epita.fr>
24035
24036 * src/lex.h (MAXTOKEN, maxtoken, grow_token_buffer): Remove, private.
24037 * src/lex.c (maxtoken, grow_token_buffer): Static.
24038
24039 2001-01-18 Akim Demaille <akim@epita.fr>
24040
24041 Since we now use obstacks, more % directives can be enabled.
24042
24043 * src/lex.c (percent_table): Also accept `%yacc',
24044 `%fixed_output_files', `%defines', `%no_parser', `%verbose', and
24045 `%debug'.
24046 Handle the actions for `%semantic_parser' and `%pure_parser' here,
24047 instead of returning a token.
24048 * src/lex.h (SEMANTIC_PARSER, PURE_PARSER): Remove, unused.
24049 * src/reader.c (read_declarations): Adjust.
24050 * src/files.c (open_files): Don't call `compute_base_names', don't
24051 compute `attrsfile' since they depend upon data which might be
24052 *in* the input file now.
24053 (output_files): Do it here.
24054 * src/output.c (output_headers): Document the fact that this patch
24055 introduces a guaranteed SEGV for semantic parsers.
24056 * doc/bison.texinfo: Document them.
24057 * tests/suite.at: Exercise these %options.
24058
24059 2000-12-20 Akim Demaille <akim@epita.fr>
24060
24061 Also handle the output file (--verbose) with obstacks.
24062
24063 * files.c (foutput): Remove.
24064 (output_obstack): New.
24065 Adjust all dependencies.
24066 * src/conflicts.c: Return a string.
24067 * src/system.h (obstack_grow_string): Rename as...
24068 (obstack_sgrow): this. Be ready to work with non literals.
24069 (obstack_fgrow4): New.
24070
24071 2000-12-20 Akim Demaille <akim@epita.fr>
24072
24073 * src/files.c (open_files): Fix the computation of short_base_name
24074 in the case of `-o foo.tab.c'.
24075
24076 2000-12-20 Akim Demaille <akim@epita.fr>
24077
24078 * src/reader.c (copy_string, copy_comment, copy_comment2, copy_at)
24079 (copy_dollar): Now that everything uses obstacks, get rid of the
24080 FILE * parameters.
24081
24082 2000-12-20 Akim Demaille <akim@epita.fr>
24083
24084 * src/files.c (open_files): Actually the `.output' file is based
24085 on the short_base_name, not base_name.
24086 * tests/suite.at (Checking output file names): Adjust.
24087
24088 2000-12-20 Akim Demaille <akim@epita.fr>
24089
24090 * src/bison.s1: Remove, we now use directly...
24091 * src/bison.simple: this.
24092 * src/Makefile.am: Use pkgdata instead of data.
24093
24094 2000-12-20 Akim Demaille <akim@epita.fr>
24095
24096 * src/files.c (guard_obstack): New.
24097 (open_files): Initialize it.
24098 (output_files): Dump it...
24099 * src/files.h: Export it.
24100 * src/reader.c (copy_guard): Use it.
24101
24102 2000-12-19 Akim Demaille <akim@epita.fr>
24103
24104 * src/files.c (outfile, defsfile, actfile): Removed as global
24105 vars.
24106 (open_files): Don't compute them.
24107 (output_files): Adjust.
24108 (base_name, short_base_name): Be global.
24109 Adjust dependencies.
24110
24111 2000-12-19 Akim Demaille <akim@epita.fr>
24112
24113 * src/files.c (strsuffix): New.
24114 (stringappend): Be just like strcat but allocate.
24115 (base_names): Eve out from open_files.
24116 Try to simplify the rather hairy computation of base_name and
24117 short_base_name.
24118 (open_files): Use it.
24119 * tests/suite.at (Checking output file names): New test.
24120
24121 2000-12-19 Akim Demaille <akim@epita.fr>
24122
24123 * src/system.h (obstack_grow_literal_string): Rename as...
24124 (obstack_grow_string): this.
24125 * src/output.c (output_parser): Recognize `%% actions' instead of
24126 `$'.
24127 * src/bison.s1: s/$/%% actions/.
24128 * src/bison.hairy: Likewise.
24129
24130 2000-12-19 Akim Demaille <akim@epita.fr>
24131
24132 * src/output.c (output_parser): Compute the `#line' lines when
24133 there are.
24134 * src/Makefile.am (bison.simple): Be a simple copy of bison.s1.
24135 Suggested by Hans Aberg.
24136
24137 2000-12-19 Akim Demaille <akim@epita.fr>
24138
24139 Let the handling of the skeleton files be local to the procedures
24140 that use it.
24141
24142 * src/files.c (xfopen, xfclose, skeleton_find, guardfile): No
24143 longer static.
24144 (fparser, open_extra_files): Remove.
24145 (open_files, output_files): Don't take care of fparser.
24146 * src/files.h: Adjust.
24147 * src/output.c (output_parser): Open and close the file to the
24148 skeleton.
24149 * src/reader.c (read_declarations): When %semantic_parser, open
24150 fguard.
24151
24152 2000-12-19 Akim Demaille <akim@epita.fr>
24153
24154 * src/file.h (BISON_SIMPLE, BISON_HAIRY): Move from here...
24155 * src/system.h (BISON_SIMPLE, BISON_HAIRY): ... to here.
24156
24157 2000-12-19 Akim Demaille <akim@epita.fr>
24158
24159 * src/files.c (open_files): Yipee! We no longer need all the code
24160 looking for `/tmp' since we have no tmp file.
24161
24162 2000-12-19 Akim Demaille <akim@epita.fr>
24163
24164 * src/system.h (EXT_TAB, EXT_OUTPUT, EXT_STYPE_H, EXT_GUARD_C):
24165 New macros.
24166 * src/files.c (open_files): Less dependency on MSDOS etc.
24167
24168 2000-12-14 Akim Demaille <akim@epita.fr>
24169
24170 * src/bison.s1 (YYLLOC_DEFAULT): New macro.
24171 Provide a default definition.
24172 Use it when executing the default @ action.
24173 * src/reader.c (reader_output_yylsp): No longer include
24174 `timestamp' and `text' in the default YYLTYPE.
24175
24176 2000-12-12 Akim Demaille <akim@epita.fr>
24177
24178 * src/reader.c (copy_definition, parse_union_decl, copy_action)
24179 (copy_guard): Quote the file names.
24180 Reported by Laurent Mascherpa.
24181
24182 2000-12-12 Akim Demaille <akim@epita.fr>
24183
24184 * src/output.c (output_headers, output_program, output): Be sure
24185 to escape special characters when outputting filenames.
24186 (ACTSTR_PROLOGUE, ACTSTR_EPILOGUE): Remove.
24187 (output_headers): Don't depend on them, Use ACTSTR.
24188
24189 2000-11-17 Akim Demaille <akim@epita.fr>
24190
24191 * lib/obstack.h: Formatting changes.
24192 (obstack_grow, obstack_grow0): Don't cast WHERE at all: it
24193 prevents type checking.
24194 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
24195 cast the value to (void *): assigning a `foo *' to a `void *'
24196 variable is valid.
24197 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
24198 * src/reader.c (parse_union_decl): Typo: use obstack_1grow to
24199 append characters.
24200
24201 2000-11-17 Akim Demaille <akim@epita.fr>
24202
24203 * tests/Makefile.am (suite.m4, regression.m4, calc.m4): Rename
24204 as...
24205 (suite.m4, regression.m4, calc.m4): these.
24206 * tests/atgeneral.m4: Update from CVS Autoconf.
24207
24208 2000-11-17 Akim Demaille <akim@epita.fr>
24209
24210 * tests/regression.m4 (%union and --defines): New test,
24211 demonstrating a current bug in the obstack implementation.
24212
24213 2000-11-17 Akim Demaille <akim@epita.fr>
24214
24215 * src/bison.s1 (_YY_DECL_VARIABLES, YY_DECL_VARIABLES): New
24216 macros.
24217 Use them to declare the variables which are global or local to
24218 `yyparse'.
24219
24220 2000-11-17 Akim Demaille <akim@epita.fr>
24221
24222 * acconfig.h: Remove, no longer used.
24223
24224 2000-11-07 Akim Demaille <akim@epita.fr>
24225
24226 * src: s/Copyright (C)/Copyright/g.
24227
24228 2000-11-07 Akim Demaille <akim@epita.fr>
24229
24230 * src/reader.c (reader): #define YYLSP_NEEDED to 1 instead of just
24231 defining.
24232 * src/bison.s1: s/#ifdef YYLSP_NEEDED/#if YYLSP_NEEDED/.
24233
24234 2000-11-07 Akim Demaille <akim@epita.fr>
24235
24236 * src/bison.s1 (YYLEX): Use #if instead of #ifdef.
24237 Merge in a single CPP if/else.
24238
24239 2000-11-07 Akim Demaille <akim@epita.fr>
24240
24241 * src/output.c (output): Remove useless variables.
24242 * lib/obstack.c (obstack_grow, obstack_grow0): Rename the second
24243 argument `data' for consistency with the prototypes.
24244 Qualify it `const'.
24245 (obstack_copy, obstack_copy0): Rename the second argument as
24246 `address' for consistency. Qualify it `const'.
24247 * lib/obstack.h (obstack_copy, obstack_copy0, obstack_grow)
24248 (obstack_grow0, obstack_ptr_grow, obstack_ptr_grow_fast): Qualify
24249 `const' their input argument (`data' or `address').
24250 Adjust the corresponding macros to include `const' in casts.
24251
24252 2000-11-03 Akim Demaille <akim@epita.fr>
24253
24254 * src/Makefile.am (INCLUDES): s/PFILE/BISON_SIMPLE/.
24255 s/PFILE1/BISON_HAIRY/.
24256 Adjust dependencies.
24257
24258 2000-11-03 Akim Demaille <akim@epita.fr>
24259
24260 For some reason, this was not applied.
24261
24262 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
24263 `unlink': it's no longer used.
24264
24265 2000-11-03 Akim Demaille <akim@epita.fr>
24266
24267 * src/files.c (skeleton_find): New function, eved out of...
24268 (open_files, open_extra_files): here.
24269
24270 2000-11-03 Akim Demaille <akim@epita.fr>
24271
24272 Don't use `atexit'.
24273
24274 * src/files.c (obstack_save): New function.
24275 (done): Rename as...
24276 (output_files): this.
24277 Use `obstack_save'.
24278 * src/main.c (main): Don't use `atexit' to register `done', since
24279 it no longer has to remove tmp files, just call `output_files'
24280 when there are no errors.
24281
24282 2000-11-02 Akim Demaille <akim@epita.fr>
24283
24284 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
24285 `unlink': it's no longer used.
24286 * src/files.h: Formatting changes.
24287
24288 2000-11-02 Akim Demaille <akim@epita.fr>
24289
24290 Remove the last uses of mktemp and unlink/delete.
24291
24292 * src/files.c (fdefines, ftable): Removed.
24293 (defines_ostack, table_obstack): New.
24294 Adjust dependencies of the former into uses of the latter.
24295 * src/output.c (output_short_or_char_table, output_short_table):
24296 Convert to using obstacks.
24297 * src/reader.c (copy_comment2): Accept one FILE * and two
24298 obstacks.
24299 (output_token_defines, reader_output_yylsp): Use obstacks.
24300 * src/system.h (obstack_fgrow3): New.
24301 * po/POTFILES.in: Adjust.
24302
24303 2000-11-01 Akim Demaille <akim@epita.fr>
24304
24305 Change each use of `fattrs' into a use of `attrs_obstack'.
24306
24307 * src/reader.c (copy_at): Typo: s/yylloc/yyloc/.
24308 * src/files.c (fattrs): Remove.
24309 (attrs_obstack): New.
24310 Adjust all dependencies.
24311 (done): If SEMANTIC_PARSER, dump attrs_obstack into attrsfile.
24312
24313 2000-11-01 Akim Demaille <akim@epita.fr>
24314
24315 Introduce obstacks.
24316 Change each use of `faction' into a use of `action_obstack'.
24317
24318 * lib/obstack.h, lib/obstack.c: New files.
24319 * src/files.c (faction): Remove.
24320 (action_obstack): New.
24321 Adjust all dependencies.
24322
24323 2000-10-20 Akim Demaille <akim@epita.fr>
24324
24325 * lib/quote.h (PARAMS): New macro. Use it.
24326
24327 2000-10-16 Akim Demaille <akim@epita.fr>
24328
24329 * src/output.c (output_short_or_char_table): New function.
24330 (output_short_table, output_token_translations): Use it.
24331 (goto_actions): Use output_short_table.
24332
24333 2000-10-16 Akim Demaille <akim@epita.fr>
24334
24335 * src/symtab.c (bucket_new): New function.
24336 (getsym): Use it.
24337
24338 * src/output.c (output_short_table): New argument to display the
24339 comment associated with the table.
24340 Adjust dependencies.
24341 (output_gram): Use it.
24342 (output_rule_data): Nicer output layout for YYTNAME.
24343
24344 2000-10-16 Akim Demaille <akim@epita.fr>
24345
24346 * src/lex.c (read_typename): New function.
24347 (lex): Use it.
24348 * src/reader.c (copy_dollar): Likewise.
24349
24350 2000-10-16 Akim Demaille <akim@epita.fr>
24351
24352 * src/reader.c (copy_comment2): Expect the input stream to be on
24353 the `/' which is suspected to open a comment, instead of being
24354 called after `//' or `/*' was read.
24355 (copy_comment, copy_definition, parse_union_decl, copy_action)
24356 (copy_guard): Adjust.
24357
24358 2000-10-16 Akim Demaille <akim@epita.fr>
24359
24360 * src/reader.c (parse_expect_decl): Use `skip_white_space' and
24361 `read_signed_integer'.
24362
24363 2000-10-16 Akim Demaille <akim@epita.fr>
24364
24365 * src/reader.c (copy_dollar): New function.
24366 (copy_guard, copy_action): Use it.
24367
24368 2000-10-16 Akim Demaille <akim@epita.fr>
24369
24370 * lib/quote.h, lib/quote.c, lib/quotearg.h, lib/quotearg.c:
24371 * m4/prereq.m4, m4/c-bs-a.m4, m4/mbstate.m4:
24372 New files, from Fileutils 4.0.27.
24373 * src/main.c (printable_version): Remove.
24374 * src/lex.c, src/reader.c: Use `quote'.
24375
24376 2000-10-04 Akim Demaille <akim@epita.fr>
24377
24378 * lib/error.c, lib/error.h: New files, needed by xmalloc.c.
24379
24380 2000-10-04 Akim Demaille <akim@epita.fr>
24381
24382 * doc/bison.texinfo: Various typos spotted by Neil Booth.
24383
24384 2000-10-04 Akim Demaille <akim@epita.fr>
24385
24386 When a literal string is used to define two different tokens,
24387 `bison -v' segfaults.
24388 Reported by Piotr Gackiewicz, and fixed by Neil Booth.
24389
24390 * tests/regression.m4: New file.
24391 Include the core of the sample provided by Piotr Gackiewicz.
24392 * src/reader.c (parse_token_decl): Diagnose bad cases, and proceed
24393 properly.
24394
24395 2000-10-04 Akim Demaille <akim@epita.fr>
24396
24397 * src/reader.c (parse_expect_decl): Keep `count' within the size
24398 of `buffer'.
24399 From Neil Booth.
24400
24401 2000-10-02 Paul Eggert <eggert@twinsun.com>
24402
24403 * bison.s1 (yyparse): Assign the default value
24404 unconditionally, to avoid a GCC warning and make the parser a
24405 tad smaller.
24406
24407 2000-10-02 Akim Demaille <akim@epita.fr>
24408
24409 * src/getargs.c (getargs): Don't dump `--help' on unrecognized
24410 options.
24411
24412 2000-10-02 Akim Demaille <akim@epita.fr>
24413
24414 * src/derives.c, src/print.c, src/reduce.c: To ease the
24415 translation, move some `\n' out of the translated strings.
24416
24417 2000-10-02 Akim Demaille <akim@epita.fr>
24418
24419 The location tracking mechanism is precious for parse error
24420 messages. Nevertheless, it is enabled only when `@n' is used in
24421 the grammar, which is a different issue (you can use it in error
24422 message, but not in the grammar per se). Therefore, there should
24423 be another means to enable it.
24424
24425 * src/getargs.c (getargs): Support `--locations'.
24426 (usage): Report it.
24427 * src/getargs.h (locationsflag): Export it.
24428 * src/lex.c (percent_table): Support `%locations'.
24429 * src/reader.c (yylsp_needed): Remove this variable, now replaced
24430 with `locationsflag'.
24431 * doc/bison.texinfo: Document `--locations' and `%locations'.
24432 Sort the options.
24433 * tests/calc.m4: Test it.
24434
24435 For regularity of the names, replace each
24436 (nolineflag, toknumflag, rawtokenumflag, noparserflag): with...
24437 (no_lineflag, token_tableflag, rawflag, no_parserflag): this.
24438 In addition replace each `flag' with `_flag'.
24439
24440 2000-10-02 Akim Demaille <akim@epita.fr>
24441
24442 Also test parse error messages, including with YYERROR_VERBOSE.
24443
24444 * tests/calc.m4 (calc.y): Add support for `exp = exp' (non
24445 associative).
24446 Use it to check the computations.
24447 Use it to check `nonassoc' is honored.
24448 (AT_DATA_CALC_Y): Equip `calc.y' with YYERROR_VERBOSE when passed
24449 `--yyerror-verbose'.
24450 (_AT_CHECK_CALC): Adjust to this option.
24451 (_AT_CHECK_CALC_ERROR): New macro to check parse error messages.
24452
24453 2000-10-02 Akim Demaille <akim@epita.fr>
24454
24455 Test also `--verbose', `--defines' and `--name-prefix'. Testing
24456 the latter demonstrates a flaw in the handling of non debugging
24457 parsers introduced by myself on 2000-03-16: `#define yydebug 0'
24458 was used in order to simplify:
24459
24460 #if YYDEBUG
24461 if (yydebug)
24462 {
24463 ...
24464 }
24465 #endif
24466
24467 into
24468
24469 if (yydebug)
24470 {
24471 ...
24472 }
24473
24474 unfortunately this leads to a CPP conflict when
24475 `--name-prefix=foo' is used since it produces `#define yydebug
24476 foodebug'.
24477
24478 * src/bison.s1 [!YYDEBUG]: Do not define yydebug.
24479 (YYDPRINTF): New macro.
24480 Spread its use.
24481 * tests/calc.m4 (AT_CHECK_CALC): Do require a title, build it from
24482 the bison options.
24483 Also test `--verbose', `--defines' and `--name-prefix'.
24484
24485 2000-10-02 Akim Demaille <akim@epita.fr>
24486
24487 Improve the readability of the produced parsers.
24488
24489 * src/bison.s1: Formatting changes.
24490 Improve the comment related to the `$' mark.
24491 (yydefault): Don't fall through to `yyresume': `goto' there.
24492 * src/output.c (output_parser): When the `$' is met, skip the end
24493 of its line.
24494 New variable, `number_of_dollar_signs', to check there's exactly
24495 one `$' in the parser skeleton.
24496
24497 2000-10-02 Akim Demaille <akim@epita.fr>
24498
24499 * lib/xstrdup.c: New file, from the fileutils.
24500 * src/reader.c (parse_token_decl, get_type_name, parse_type_decl)
24501 (parse_assoc_decl, parse_thong_decl, get_type): Use `xstrdup'
24502 instead of strlen + xmalloc + strcpy.
24503 * src/symtab.c (copys): Remove, use xstrdup instead.
24504
24505 2000-10-02 Akim Demaille <akim@epita.fr>
24506
24507 * src/gram.h (associativity): New enum type which replaces the
24508 former CPP macros `RIGHT_ASSOC', `LEFT_ASSOC' and `NON_ASSOC' with
24509 `right_assoc', `left_assoc' and `non_assoc'.
24510 Adjust all dependencies.
24511 * src/reader.c: Formatting changes.
24512 (LTYPESTR): Don't define it, use it as a literal in
24513 `reader_output_yylsp'.
24514 * src/symtab.h (symbol_class): New enum type which replaces the
24515 former CPP macros `SUNKNOWN', `STOKEN and `SNTERM' with
24516 `sunknown', `stoken and `snterm'.
24517
24518 2000-10-02 Akim Demaille <akim@epita.fr>
24519
24520 * src/getargs.c (fixed_outfiles): Rename as...
24521 (yaccflag): for consistency and accuracy.
24522 Adjust dependencies.
24523
24524 2000-10-02 Akim Demaille <akim@epita.fr>
24525
24526 Use the more standard files `xalloc.h' and `xmalloc.c' instead of
24527 Bison's `allocate.c' and `alloc.h'. This patch was surprisingly
24528 difficult and introduced a lot of core dump. It turns out that
24529 Bison used an implementation of `xmalloc' based on `calloc', and
24530 at various places it does depend upon the initialization to 0. I
24531 have not tried to isolate the pertinent places, and all the former
24532 calls to Bison's `xmalloc' are now using `XCALLOC'. Someday,
24533 someone should address this issue.
24534
24535 * src/allocate.c, src/alloc.h, m4/bison-decl.m4: Remove.
24536 * lib/xmalloc.c, lib/xalloc.h, m4/malloc.m4, m4/realloc.m4: New
24537 files.
24538 Adjust dependencies.
24539 * src/warshall.h: New file.
24540 Propagate.
24541
24542 2000-10-02 Akim Demaille <akim@epita.fr>
24543
24544 Various anti-`extern in *.c' changes.
24545
24546 * src/system.h: Include `assert.h'.
24547
24548 2000-10-02 Akim Demaille <akim@epita.fr>
24549
24550 * src/state.h (nstates, final_state, first_state, first_shift)
24551 (first_reduction): Move their exportation from here...
24552 * src/LR0.h: to here.
24553 Adjust dependencies.
24554 * src/getargs.c (statisticsflag): New variable.
24555 Add support for `--statistics'.
24556 Adjust dependencies.
24557
24558 Remove a lot of now useless `extern' statements in most files.
24559
24560 2000-10-02 Akim Demaille <akim@epita.fr>
24561
24562 * src/LR0.h: New file.
24563 Propagate its use.
24564
24565 2000-10-02 Akim Demaille <akim@epita.fr>
24566
24567 * src/print.h: New file.
24568 Propagate its use.
24569 * src/print.c: Formatting and ordering changes.
24570 (verbose, terse): Replace with...
24571 (print_results): this new function.
24572 Adjust dependencies.
24573
24574 2000-10-02 Akim Demaille <akim@epita.fr>
24575
24576 * src/conflicts.c (conflict_report): New function.
24577 (conflict_log, verbose_conflict_log): Replace with...
24578 (print_conflicts): this function.
24579 Adjust dependencies.
24580 * src/conflicts.h: New file.
24581 Propagate its inclusion.
24582
24583 2000-10-02 Akim Demaille <akim@epita.fr>
24584
24585 * src/nullable.h: New file.
24586 Propagate its inclusion.
24587 * src/nullable.c: Formatting changes.
24588
24589 2000-10-02 Akim Demaille <akim@epita.fr>
24590
24591 * src/reduce.h: New file.
24592 Propagate its inclusion.
24593 * src/reduce.c: Topological sort and other formatting changes.
24594 (bool, TRUE, FALSE): Move their definition to...
24595 * src/system.h: here.
24596
24597 2000-10-02 Akim Demaille <akim@epita.fr>
24598
24599 * src/files.c: Formatting changes.
24600 (tryopen, tryclose, openfiles): Rename as...
24601 (xfopen, xfclose, open_files): this.
24602 (stringappend): static.
24603 * src/files.h: Complete the list of exported symbols.
24604 Propagate its use.
24605
24606 2000-10-02 Akim Demaille <akim@epita.fr>
24607
24608 * src/reader.h: New file.
24609 Propagate its use instead of tedious list of `extern' and
24610 prototypes.
24611 * src/reader.c: Formatting changes, topological sort,
24612 s/register//.
24613
24614 2000-10-02 Akim Demaille <akim@epita.fr>
24615
24616 * src/lex.h: Prototype `lex.c' exported functions.
24617 * src/reader.c: Adjust.
24618 * src/lex.c: Formatting changes.
24619 (safegetc): Rename as...
24620 (xgetc): this.
24621
24622 2000-10-02 Akim Demaille <akim@epita.fr>
24623
24624 * src/lalr.h: New file.
24625 Propagate its inclusion instead of prototypes and `extern'.
24626 * src/lalr.c: Formatting changes, topological sorting etc.
24627
24628 2000-10-02 Akim Demaille <akim@epita.fr>
24629
24630 * src/output.c (token_actions): Introduce a temporary array,
24631 YYDEFACT, that makes it possible for this function to use
24632 output_short_table.
24633
24634 2000-10-02 Akim Demaille <akim@epita.fr>
24635
24636 `user_toknums' is output as a `short[]' in `output.c', while it is
24637 defined as a `int[]' in `reader.c'. For consistency with the
24638 other output tables, `user_toknums' is now defined as a table of
24639 shorts.
24640
24641 * src/reader.c (user_toknums): Be a short table instead of an int
24642 table.
24643 Adjust dependencies.
24644
24645 Factor the short table outputs.
24646
24647 * src/output.c (output_short_table): New function.
24648 * src/output.c (output_gram, output_stos, output_rule_data)
24649 (output_base, output_table, output_check): Use it.
24650
24651 2000-10-02 Akim Demaille <akim@epita.fr>
24652
24653 * src/output.c (output): Topological sort of the functions, in
24654 order to get rid of the `static' prototypes.
24655 No longer use `register'.
24656 * src/output.h: New file.
24657 Propagate its inclusion in files explicitly prototyping functions
24658 from output.c.
24659
24660 2000-09-21 Akim Demaille <akim@epita.fr>
24661
24662 * src/atgeneral.m4: Update from Autoconf.
24663
24664 2000-09-21 Akim Demaille <akim@epita.fr>
24665
24666 * src/closure.h: New file.
24667 * src/closure.c: Formatting changes, topological sort over the
24668 functions, use of closure.h.
24669 (initialize_closure, finalize_closure): Rename as...
24670 (new_closure, free_closure): these. Adjust dependencies.
24671 * src/LR0.c: Formatting changes, topological sort, use of
24672 cloture.h.
24673 (initialize_states): Rename as...
24674 (new_states): this.
24675 * src/Makefile.am (noinst_HEADERS): Adjust.
24676
24677 2000-09-20 Akim Demaille <akim@epita.fr>
24678
24679 * src/acconfig.h: Don't protect config.h against multiple
24680 inclusion.
24681 Don't define PARAMS.
24682 * src/system.h: Define PARAMS.
24683 Remove some of the ad-hoc CPP magic for DOS, VMS etc.: this is the
24684 purpose of config.h. system.h must not try to fix wrong
24685 definitions in config.h.
24686
24687 2000-09-20 Akim Demaille <akim@epita.fr>
24688
24689 * src/derives.h: New file.
24690 * src/main.c, src/derives.h: Use it.
24691 Formatting changes.
24692 * src/Makefile.am (noinst_HEADERS): Adjust.
24693
24694 2000-09-20 Akim Demaille <akim@epita.fr>
24695
24696 * tests/atgeneral.m4: Update from Autoconf.
24697 * tests/calc.m4 (_AT_DATA_CALC_Y, AT_DATA_CALC_Y, _AT_CHECK_CALC)
24698 (AT_CHECK_CALC): New macros.
24699 Use these macros to test bison with options `', `--raw',
24700 `--debug', `--yacc', `--yacc --debug'.
24701
24702 2000-09-19 Akim Demaille <akim@epita.fr>
24703
24704 * src/output.c: Formatting changes.
24705 * src/machine.h: Remove, leaving its contents in...
24706 * src/system.h: here.
24707 Include stdio.h.
24708 Adjust all dependencies on stdio.h and machine.h.
24709 * src/getargs.h: New file.
24710 Let all `extern' declarations about getargs.c be replaced with
24711 inclusion of `getargs.h'.
24712 * src/Makefile.am (noinst_HEADERS): Adjust.
24713
24714 * tests/calc.m4 (yyin): Be initialized in main, not on the global
24715 scope.
24716 (yyerror): Returns void, not int.
24717 * doc/bison.texinfo: Formatting changes.
24718
24719 2000-09-19 Akim Demaille <akim@epita.fr>
24720
24721 * tests/calc.m4 (calc.y): Do not assign to stdin, as it's not
24722 portable.
24723
24724 2000-09-18 Akim Demaille <akim@epita.fr>
24725
24726 * configure.in: Append WARNING_CFLAGS to CFLAGS.
24727 * src/Makefile.am (INCLUDES): Don't.
24728 Be ready to fetch headers in lib/.
24729
24730 2000-09-18 Akim Demaille <akim@epita.fr>
24731
24732 * doc/bison.texinfo: Update the copyright.
24733 ANSIfy and GNUify the examples.
24734 Remove the old menu.
24735
24736 2000-09-18 Akim Demaille <akim@epita.fr>
24737
24738 First set of tests: use the `calc' example from the documentation.
24739
24740 * src/bison.s1 (yyparse): Condition the code using `yytname' which
24741 is defined only when YYDEBUG is.
24742 * m4/atconfig.m4 (AT_CONFIG): Adjust to Autoconf 2.13.
24743 * src/files.c (tryopen, tryclose): Formatting changes.
24744 Move to the top and be static.
24745 * src/reader.c (read_signed_integer): Likewise.
24746 * tests/calc.m4: New file.
24747 * Makefile.am, suite.m4: Adjust.
24748 * m4/atconfig.m4: Set BISON_SIMPLE and BISON_HAIRY.
24749
24750 2000-09-18 Akim Demaille <akim@epita.fr>
24751
24752 Add support for an Autotest test suite for Bison.
24753
24754 * m4/m4.m4, m4/atconfig.m4: New files.
24755 * m4/Makefile.am (EXTRA_DIST): Adjust.
24756 * tests/suite.m4, tests/Makefile.am, tests/atgeneral.m4: New
24757 files.
24758 * src/getargs.c: Display a more standard --version message.
24759 * src/reader.c (reader): Formatting changes.
24760 No longer depend upon VERSION_STRING.
24761 * configure.in: No longer use `dnl'.
24762 Set up the test suite and the new directory `tests/.
24763 (VERSION_STRING): Remove.
24764
24765 2000-04-14 Akim Demaille <akim@epita.fr>
24766
24767 * src/reader.c (copy_comment2): New function, same as former
24768 `copy_comment', but outputs into two FILE *.
24769 (copy_comment): Use it.
24770 (parse_union_decl): Use it.
24771 (get_type, parse_start_decl): Use the same `invalid' message.
24772 (parse_start_decl, parse_union_decl): Use the same `multiple'
24773 message.
24774 (parse_union_decl, copy_guard, copy_action): Use the same
24775 `unmatched' message.
24776 * m4/Makefile.am (EXTRA_DIST): Add `warning.m4'.
24777
24778 2000-03-31 Akim Demaille <akim@epita.fr>
24779
24780 * src/files.c (tryopen, tryclose): Move to the top.
24781 Be static.
24782
24783 2000-03-31 Akim Demaille <akim@epita.fr>
24784
24785 * src/main.c (main): Don't call `done', exit does it.
24786
24787 2000-03-31 Akim Demaille <akim@epita.fr>
24788
24789 * allocate.c: s/return (foo)/return foo/.
24790 * lalr.c: Likewise.
24791 * LR0.c: Likewise.
24792 * output.c: Likewise.
24793 * reader.c: Likewise.
24794 * symtab.c: Likewise.
24795 * vmsgetargs.c: Likewise.
24796
24797 2000-03-31 Akim Demaille <akim@epita.fr>
24798
24799 Clean up the error reporting functions.
24800
24801 * src/report.c: New file.
24802 * src/report.h: Likewise.
24803 * src/Makefile.am: Adjust.
24804 * m4/error.m4: New file.
24805 * m4/Makefile.am: Adjust.
24806 * configure.in (jm_PREREQ_ERROR): Call it.
24807 * src/main.c (int_to_string, banner, fatal_banner, warn_banner):
24808 Remove.
24809 (fatal, fatals): Remove. All callers use complain.c::fatal.
24810 (warn, warni, warns, warnss, warnss): Remove. All callers use
24811 complain.c::complain.
24812 (toomany): Remove, use fatal instead.
24813 * src/files.c (done): No argument, use complain_message_count.
24814 * src/main.c (main): Register `done' to `atexit'.
24815
24816 * src/getargs.c (usage): More `fputs', less `fprintf'.
24817
24818 2000-03-28 Akim Demaille <akim@epita.fr>
24819
24820 * lib/: New directory.
24821 * Makefile.am (SUBDIRS): Adjust.
24822 * configure.in: Adjust.
24823 (LIBOBJS): Although not used yet, AC_SUBST it, otherwise it's
24824 useless.
24825 * src/alloca.c: Moved to lib/.
24826 * src/getopt.c: Likewise.
24827 * src/getopt1.c: Likewise.
24828 * src/getopt.h: Likewise.
24829 * src/ansi2knr.c: Likewise.
24830 * src/ansi2knr.1: Likewise.
24831 * src/Makefile.am: Adjust.
24832 * lib/Makefile.am: New file.
24833
24834 2000-03-28 Akim Demaille <akim@epita.fr>
24835
24836 * src/getargs.c (usage): Refresh the help message.
24837
24838 2000-03-17 Akim Demaille <akim@epita.fr>
24839
24840 * src/getopt1.c: Updated from textutils 2.0e
24841 * src/getopt.c: Likewise.
24842 * src/getopt.h: Likewise.
24843
24844 2000-03-17 Akim Demaille <akim@epita.fr>
24845
24846 * src/Makefile.am (bison.simple): Fix the awk program: quote only
24847 the file name, not the whole `#line LINE FILE'.
24848
24849 2000-03-17 Akim Demaille <akim@epita.fr>
24850
24851 On syntax errors, report the token on which we choked.
24852
24853 * src/bison.s1 (yyparse): In the label yyerrlab, when
24854 YYERROR_VERBOSE, add yychar in msg.
24855
24856 2000-03-17 Akim Demaille <akim@epita.fr>
24857
24858 * src/reader.c (copy_at): New function.
24859 (copy_guard): Use it.
24860 (copy_action): Use it.
24861
24862 2000-03-17 Akim Demaille <akim@epita.fr>
24863
24864 Be kind to translators, save some useless translations.
24865
24866 * src/main.c (banner): New function.
24867 (fatal_banner): Use it.
24868 (warn_banner): Use it.
24869
24870 2000-03-17 Akim Demaille <akim@epita.fr>
24871
24872 * src/reader.c (copy_definition): Use copy_string and
24873 copy_comment. Removed now unused `match', `ended',
24874 `cplus_comment'.
24875 (copy_comment, copy_string): Moved, to be visible from
24876 copy_definition.
24877
24878 2000-03-17 Akim Demaille <akim@epita.fr>
24879
24880 * src/reader.c (copy_string): Declare `static inline'. No
24881 problems with inline, since it is checked by configure.
24882 (copy_comment): Likewise.
24883
24884 2000-03-17 Akim Demaille <akim@epita.fr>
24885
24886 * src/reader.c (packsymbols): Formatting changes.
24887
24888 2000-03-17 Akim Demaille <akim@epita.fr>
24889
24890 * src/reader.c (copy_comment): New function, factored out from:
24891 (copy_action): Use it. Removed now unused `match', `ended',
24892 `cplus_comment'.
24893 (copy_guard): Likewise.
24894
24895 2000-03-17 Akim Demaille <akim@epita.fr>
24896
24897 * src/reader.c (copy_string): New function, factored out from:
24898 (copy_action): Use it.
24899 (copy_guard): Likewise.
24900
24901 2000-03-17 Akim Demaille <akim@epita.fr>
24902
24903 Change the handling of @s so that they behave exactly like $s.
24904 There is now a pseudo variable @$ (readble and writable), location
24905 of the lhs of the rule (by default ranging from the location of
24906 the first symbol of the rhs, to the location of the last symbol,
24907 or, if the rhs is empty, YYLLOC).
24908
24909 * src/bison.s1 [YYLSP_NEEDED] (yyloc): New variable, twin of
24910 yyval.
24911 (yyparse): When providing a default semantic action, provide a
24912 default location action.
24913 (after the $): No longer change `*YYLSP', just stack YYLOC the
24914 same way you stack YYVAL.
24915 * src/reader.c (read_declarations): Use warns.
24916 (copy_guard, case '@'): Also recognize `@$', expanded as `YYLOC'.
24917 (copy_action, case '@'): Likewise.
24918 Use a standard error message, to save useless work from
24919 translators.
24920
24921 2000-03-17 Akim Demaille <akim@epita.fr>
24922
24923 * src/bison.s1: Formatting and cosmetics changes.
24924 * src/reader.c: Likewise.
24925 Update the Copyright notice.
24926
24927 2000-03-17 Akim Demaille <akim@epita.fr>
24928
24929 * src/bison.s1 (#line): All set to `#line' only, since the
24930 Makefile now handles them.
24931
24932 2000-03-16 Akim Demaille <akim@epita.fr>
24933
24934 * src/output.c (output_rule_data): Output the documentation of
24935 some of the tables.
24936 (Copyright notice): Update.
24937 Formatting changes.
24938
24939 2000-03-16 Akim Demaille <akim@epita.fr>
24940
24941 * src/bison.s1 [!YYDEBUG]: Define yydebug to 0. This allows to
24942 remove most `#if YYDEBUG != 0', since `if (yydebug)' is enough.
24943 One `#if YYDEBUG' remains, since it uses variables which are
24944 defined only if `YYDEBUG != 0'.
24945
24946 2000-03-16 Akim Demaille <akim@epita.fr>
24947
24948 * src/bison.s1 (yyparse): Reorganize the definitions of the stacks
24949 and related variables so that the similarities are highlighted.
24950
24951 2000-03-16 Akim Demaille <akim@epita.fr>
24952
24953 * src/bison.s1: Properly indent CPP directives.
24954
24955 2000-03-16 Akim Demaille <akim@epita.fr>
24956
24957 * src/bison.s1: Properly indent the `alloca' CPP section.
24958
24959 2000-03-16 Akim Demaille <akim@epita.fr>
24960
24961 Do not hard code values of directories in `configure.in'.
24962 Update the `configure' tool chain.
24963
24964 * configure.in (XPFILE, XPFILE1, LOCALEDIR): Remove, handled by
24965 src/makefile.am.
24966 (VERSION_STRING): Use the third arg of AC_DEFINE_UNQUOTED.
24967 (AC_OUTPUT): Add m4/Makefile.
24968 Bump to bison 1.28a, 1.29 has never been released.
24969 * acconfig.h (XPFILE, XPFILE1, LOCALEDIR): Remove, since they are
24970 handled via src/Makefile.am.
24971 (VERSION_STRING, PROTOTYPES, ENABLE_NLS, HAVE_CATGETS,
24972 HAVE_GETTEXT, HAVE_LC_MESSAGES, HAVE_STPCPY): Remove, handled by
24973 autoheader.
24974 * Makefile.am (SUBDIRS): Add m4.
24975 (ACLOCAL_AM_FLAGS): New variable.
24976 (AUTOMAKE_OPTIONS): Add check-news.
24977 * src/Makefile.am (bison.simple): Use awk to replace #line lines with
24978 the proper line number and file name.
24979 (DEFS): Propagate the location of bison library files and of the
24980 locale files.
24981 (INCLUDES): Added `-I ..' so that one can compile with srcdir !=
24982 builddir.
24983 * acinclude.m4: Remove, replaced by the directory m4.
24984 * m4/Makefile.am (EXTRA_DIST): New variable.
24985 * m4/gettext.m4: New file, from the fileutils.
24986 * m4/lcmessage.m4: Likewise
24987 * m4/progtest.m4: Likewise.
24988 * m4/bison-decl.m4: New file, extracted from former acinclude.m4.
24989
24990 2000-03-10 Akim Demaille <akim@epita.fr>
24991
24992 * src/closure.c:
24993 Formatting changes of various comments.
24994 Respect the GNU coding standards at various places.
24995 Don't use `_()' when no translation is needed.
24996
24997 1999-12-13 Jesse Thilo <jthilo@gnu.org>
24998
24999 * src/files.c:
25000 OS/2 honors TMPDIR environment variable.
25001
25002 1999-12-13 Jesse Thilo <jthilo@gnu.org>
25003
25004 * doc/bison.texinfo: Tweaked spelling and grammar.
25005 Updated ISBN.
25006 Removed reference to price of printed copy.
25007 Mention BISON_SIMPLE and BISON_HAIRY.
25008
25009 1999-12-13 Jesse Thilo <jthilo@gnu.org>
25010
25011 * configure.in, NEWS:
25012 Bison 1.29 released.
25013
25014 1999-10-27 Jesse Thilo <jthilo@gnu.org>
25015
25016 * doc/.cvsignore, doc/Makefile.am, doc/refcard.tex:
25017 Added reference card.
25018
25019 1999-07-26 Jesse Thilo <jthilo@gnu.org>
25020
25021 * po/ru.po: Added Russian translation.
25022
25023 1999-07-26 Jesse Thilo <jthilo@gnu.org>
25024
25025 * configure.in: Added Russian translation.
25026
25027 1999-07-06 Jesse Thilo <jthilo@gnu.org>
25028
25029 * configure.in, NEWS, README:
25030 Released version 1.28.
25031
25032 1999-06-14 Jesse Thilo <jthilo@gnu.org>
25033
25034 * src/system.h:
25035 Squashed redefinition warning on some systems.
25036
25037 * src/getargs.c, src/Makefile.am, src/reader.c, src/version.c:
25038 Have configure build version string instead of relying on ANSI string
25039 concatentation.
25040
25041 1999-06-14 Jesse Thilo <jthilo@gnu.org>
25042
25043 * po/POTFILES.in: Got rid of version.c.
25044
25045 1999-06-14 Jesse Thilo <jthilo@gnu.org>
25046
25047 * acconfig.h, configure.in:
25048 Have configure build version string instead of relying on ANSI string
25049 concatentation.
25050
25051 1999-06-08 Jesse Thilo <jthilo@gnu.org>
25052
25053 * doc/bison.1:
25054 Dropped mention of `+' for long-named options.
25055
25056 1999-05-30 Jesse Thilo <jthilo@gnu.org>
25057
25058 * src/files.c: Added <unistd.h> for unlink().
25059
25060 * src/Makefile.am, src/system.h:
25061 I18n fixes.
25062
25063 1999-05-30 Jesse Thilo <jthilo@gnu.org>
25064
25065 * README: Added a FAQ list.
25066
25067 * configure.in, acconfig.h:
25068 I18n fixes.
25069
25070 1999-05-30 Jesse Thilo <jthilo@gnu.org>
25071
25072 * doc/FAQ, doc/Makefile.am:
25073 Added a FAQ list.
25074
25075 1999-05-19 Jesse Thilo <jthilo@gnu.org>
25076
25077 * src/alloc.h, src/symtab.h, src/version.c:
25078 Protected inclusion of "config.h" with HAVE_CONFIG_H.
25079
25080 1999-04-18 Jesse Thilo <jthilo@gnu.org>
25081
25082 * src/.cvsignore, src/Makefile.am:
25083 Reorganized: sources in `src', documentation in `doc'.
25084
25085 * src/lex.c (literalchar):
25086 fixed the code for escaping double quotes (thanks
25087 Jonathan Czisny.)
25088
25089 1999-04-18 Jesse Thilo <jthilo@gnu.org>
25090
25091 * po/de.po, po/es.po, po/fr.po, po/nl.po, po/POTFILES.in:
25092 Adjusted paths to reflect directory reorganization.
25093
25094 1999-04-18 Jesse Thilo <jthilo@gnu.org>
25095
25096 * doc/.cvsignore, doc/Makefile.am:
25097 Reorganized: sources in `src', documentation in `doc'.
25098
25099 1999-04-18 Jesse Thilo <jthilo@gnu.org>
25100
25101 * configure.in:
25102 Updated AC_INIT file to reflect directory reorganization.
25103
25104 * configure.in, .cvsignore, Makefile.am, POTFILES.in:
25105 Reorganized: sources in `src', documentation in `doc'.
25106
25107 1999-04-13 Jesse Thilo <jthilo@gnu.org>
25108
25109 * src/allocate.c:
25110 Don't declare calloc() and realloc() if not necessary.
25111
25112 1999-04-13 Jesse Thilo <jthilo@gnu.org>
25113
25114 * configure.in, acconfig.h, acinclude.m4:
25115 Don't declare calloc() and realloc() if not necessary.
25116
25117 1999-03-23 Jesse Thilo <jthilo@gnu.org>
25118
25119 * po/.cvsignore: Added i18n support.
25120
25121 1999-03-23 Jesse Thilo <jthilo@gnu.org>
25122
25123 * acconfig.h, configure.in, Makefile.am:
25124 Added i18n support.
25125
25126 1999-03-22 Jesse Thilo <jthilo@gnu.org>
25127
25128 * src/bison.s1: Fixed #line numbers.
25129
25130 1999-03-15 Jesse Thilo <jthilo@gnu.org>
25131
25132 * po/es.po, po/fr.po, po/nl.po, po/de.po:
25133 Added PO files from Translation Project.
25134
25135 1999-03-03 Jesse Thilo <jthilo@gnu.org>
25136
25137 * Makefile.am:
25138 Added support for non-ANSI compilers (ansi2knr).
25139
25140 1999-02-16 Jesse Thilo <jthilo@gnu.org>
25141
25142 * configure.in: Bumped version number to 1.27.
25143
25144 * Makefile.am:
25145 Added `bison.simple' to list of files removed by `make distclean'.
25146
25147 1999-02-12 Jesse Thilo <jthilo@gnu.org>
25148
25149 * src/files.c, src/files.h:
25150 Defined locations of parser files in config.h instead of Makefile.
25151
25152 1999-02-12 Jesse Thilo <jthilo@gnu.org>
25153
25154 * acconfig.h, acinclude.m4, configure.in, Makefile.am:
25155 Defined locations of parser files in config.h instead of Makefile.
25156
25157 1999-02-09 Jesse Thilo <jthilo@gnu.org>
25158
25159 * Makefile.am:
25160 Removed inappropriate use of $< macro.
25161
25162 1999-02-05 Jesse Thilo <jthilo@gnu.org>
25163
25164 * po/Makefile.in.in, po/POTFILES.in:
25165 Add `po' directory skeleton.
25166
25167 1999-01-27 Jesse Thilo <jthilo@gnu.org>
25168
25169 * README: Document help-bison list.
25170
25171 * configure.in: Add check for mkstemp().
25172
25173 1999-01-20 Jesse Thilo <jthilo@gnu.org>
25174
25175 * src/conflicts.c, src/LR0.c, src/output.c, src/reader.c:
25176 Hush a few compiler warnings.
25177
25178 * src/files.c:
25179 Add tryclose(), which verifies that fclose was successful.
25180 Hush a couple of compiler warnings.
25181
25182 1999-01-20 Jesse Thilo <jthilo@gnu.org>
25183
25184 * Makefile.am, OChangeLog:
25185 ChangeLog is now automatically generated. Include the old version as
25186 OChangeLog.
25187
25188 1999-01-14 Jesse Thilo <jthilo@gnu.org>
25189
25190 * 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:
25191 Update FSF address.
25192
25193 1999-01-14 Jesse Thilo <jthilo@gnu.org>
25194
25195 * doc/bison.texinfo: Fix formatting glitch.
25196
25197 * doc/bison.texinfo: Update FSF address.
25198
25199 1999-01-14 Jesse Thilo <jthilo@gnu.org>
25200
25201 * acconfig.h: Update FSF address.
25202
25203 1999-01-08 Jesse Thilo <jthilo@gnu.org>
25204
25205 * src/system.h:
25206 Don't define PACKAGE here, since config.h defines it.
25207
25208 1998-12-30 Jesse Thilo <jthilo@gnu.org>
25209
25210 * src/reader.c: Update copyright date.
25211
25212 * src/main.c:
25213 Ditch sprintf to statically-sized buffers in fatal/warn functions in
25214 favor of output directly to stderr (avoids buffer overruns).
25215
25216 * src/reader.c: Some checks for premature EOF.
25217
25218 * 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:
25219 Use prototypes if the compiler understands them.
25220
25221 * src/files.c: Honor TMPDIR on Unix hosts.
25222 Use prototypes if the compiler understands them.
25223
25224 * src/reader.c:
25225 Fix a couple of buffer overrun bugs.
25226 Use prototypes if the compiler understands them.
25227
25228 * src/system.h: Include unistd.h and ctype.h.
25229 Use #ifdef instead of #if for NLS symbols.
25230
25231 1998-12-30 Jesse Thilo <jthilo@gnu.org>
25232
25233 * doc/bison.texinfo:
25234 Delete comment "consider using @set for edition number, etc..." since
25235 we now are doing so.
25236
25237 1998-12-30 Jesse Thilo <jthilo@gnu.org>
25238
25239 * configure.in:
25240 Use prototypes if the compiler understands them.
25241
25242 * NEWS: Document 1.26 highlights.
25243
25244 * Makefile.am: Require Automake 1.3 or later.
25245
25246 * acconfig.h:
25247 Use prototypes if the compiler understands them.
25248
25249 1998-12-29 Jesse Thilo <jthilo@gnu.org>
25250
25251 * src/version.c:
25252 Use VERSION symbol from automake for version number.
25253
25254 1998-12-29 Jesse Thilo <jthilo@gnu.org>
25255
25256 * acconfig.h, configure.in, version.cin:
25257 Use VERSION symbol from automake for version number.
25258
25259 1998-11-28 Jesse Thilo <jthilo@gnu.org>
25260
25261 * Makefile.am:
25262 Distribute original version of simple parser (bison.s1), not built
25263 version (bison.simple).
25264
25265 1998-11-28 Jesse Thilo <jthilo@gnu.org>
25266
25267 * doc/bison.texinfo: Add info dir entry.
25268
25269 * doc/bison.texinfo:
25270 Let automake put version number into documentation.
25271
25272 1998-11-26 Jesse Thilo <jthilo@gnu.org>
25273
25274 * src/bison.cld, src/build.com, src/vmshlp.mar:
25275 Add non-RCS files from /gd/gnu/bison.
25276
25277 1998-11-26 Jesse Thilo <jthilo@gnu.org>
25278
25279 * doc/bison.1:
25280 Document the BISON_HAIRY and BISON_SIMPLE variables.
25281
25282 1998-11-25 Jesse Thilo <jthilo@gnu.org>
25283
25284 * src/version.c: Build version.c automatically.
25285
25286 * src/reader.c:
25287 Fix token numbering (used to start at 258, not 257).
25288
25289 * src/system.h: Include config.h.
25290
25291 * src/getargs.c: Update bug report address.
25292
25293 * src/alloca.c, src/getopt1.c, src/getopt.c, src/getopt.h:
25294 Get latest copies of alloca.c, getopt.c, getopt.h, getopt1.c from gnu.org.
25295
25296 1998-11-25 Jesse Thilo <jthilo@gnu.org>
25297
25298 * Makefile.am:
25299 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
25300
25301 * configure.in, version.cin:
25302 Build version.c automatically.
25303
25304 * AUTHORS: Add AUTHORS file.
25305
25306 * README: Update bug report address.
25307
25308 * bison.simple:
25309 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
25310
25311 * configure.in, Makefile.am, Makefile.in, stamp-h.in:
25312 Add automake stuff.
25313
25314 1998-11-25 Jesse Thilo <jthilo@gnu.org>
25315
25316 * doc/bison.texinfo: Clean up some formatting.
25317
25318 1998-05-05 Richard Stallman <rms@gnu.org>
25319
25320 * doc/bison.texinfo:
25321 Explain better why to make a pure parser.
25322
25323 1998-01-05 Richard Stallman <rms@gnu.org>
25324
25325 * src/files.c (openfiles):
25326 [_WIN32 && !__CYGWIN32__] Use TEMP or Temp to
25327 find a temporary directory, if possible. Do not unlink files while
25328 they are open.
25329
25330 1997-08-25 Richard Stallman <rms@gnu.org>
25331
25332 * src/reader.c (stack_offset;):
25333 Change some warni to warns.
25334
25335 * src/lex.c (literalchar): Use warns, not warni.
25336
25337 1997-06-28 Richard Stallman <rms@gnu.org>
25338
25339 * src/bison.s1: Add a Bison version comment.
25340
25341 * src/main.c (fatal, warn, berror):
25342 Use program_name.
25343
25344 1997-06-28 Richard Stallman <rms@gnu.org>
25345
25346 * Makefile.in (bison_version): New variable.
25347 (dist): Use that variable.
25348 (bison.s1): Substitute the Bison version into bison.simple.
25349
25350 * bison.simple: Add a Bison version comment.
25351
25352 1997-06-18 Richard Stallman <rms@gnu.org>
25353
25354 * src/main.c (fatal, warn, berror):
25355 Make error messages standard.
25356 (toomany): Improve error message text.
25357
25358 * 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:
25359 new.h renamed to alloc.h.
25360
25361 1997-06-18 Richard Stallman <rms@gnu.org>
25362
25363 * Makefile.in: new.h renamed to alloc.h.
25364
25365 1997-05-24 Richard Stallman <rms@gnu.org>
25366
25367 * src/lex.c (literalchar):
25368 Fix the code for escaping \, " and '.
25369
25370 (lex): Avoid trouble when there are many chars
25371 to discard in a char literal with just several chars in it.
25372
25373 1997-05-17 Richard Stallman <rms@gnu.org>
25374
25375 * src/bison.s1:
25376 Use malloc, if using alloca is troublesome.
25377 (YYSTACK_USE_ALLOCA): New flag macro.
25378 Define it for some systems and compilers.
25379 (YYSTACK_ALLOC): New macro.
25380 (yyparse): Use YYSTACK_ALLOC to allocate stack.
25381 If it was malloc'd, free it.
25382
25383 1997-05-17 Richard Stallman <rms@gnu.org>
25384
25385 * bison.simple:
25386 Use malloc, if using alloca is troublesome.
25387 (YYSTACK_USE_ALLOCA): New flag macro.
25388 Define it for some systems and compilers.
25389 (YYSTACK_ALLOC): New macro.
25390 (yyparse): Use YYSTACK_ALLOC to allocate stack.
25391 If it was malloc'd, free it.
25392
25393 1997-04-23 Richard Stallman <rms@gnu.org>
25394
25395 * src/bison.s1:
25396 (alloca) [__hpux]: Always define as __builtin_alloca.
25397
25398 1997-04-23 Richard Stallman <rms@gnu.org>
25399
25400 * bison.simple:
25401 (alloca) [__hpux]: Always define as __builtin_alloca.
25402
25403 1997-04-22 Richard Stallman <rms@gnu.org>
25404
25405 * src/bison.s1:
25406 [__hpux]: Include alloca.h (right for HPUX 10)
25407 instead of declaring alloca (right for HPUX 9).
25408
25409 * src/bison.s1 (__yy_memcpy):
25410 Declare arg `count' as unsigned int.
25411 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
25412
25413 1997-04-22 Richard Stallman <rms@gnu.org>
25414
25415 * bison.simple:
25416 [__hpux]: Include alloca.h (right for HPUX 10)
25417 instead of declaring alloca (right for HPUX 9).
25418
25419 * bison.simple (__yy_memcpy):
25420 Declare arg `count' as unsigned int.
25421 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
25422
25423 1997-01-03 Richard Stallman <rms@gnu.org>
25424
25425 * src/allocate.c: [__STDC__ or _MSC_VER]:
25426 Declare calloc and realloc to return void *.
25427
25428 1997-01-02 Richard Stallman <rms@gnu.org>
25429
25430 * src/system.h:
25431 [_MSC_VER]: Include stdlib.h and process.h.
25432 [_MSC_VER] (getpid): Define as macro--translate it to _getpid.
25433
25434 * src/main.c (main): Return FAILURE as a value.
25435 (printable_version): Declare arg as int, not char.
25436
25437 1997-01-02 Richard Stallman <rms@gnu.org>
25438
25439 * Makefile.in (dist):
25440 Explicitly check for symlinks, and copy them.
25441
25442 1996-12-19 Richard Stallman <rms@gnu.org>
25443
25444 * src/files.c:
25445 [_MSC_VER] (XPFILE, XPFILE1): Define, if not already defined.
25446
25447 1996-12-18 Paul Eggert <eggert@gnu.org>
25448
25449 * src/bison.s1 (yyparse):
25450 If __GNUC__ and YYPARSE_PARAM are both defined,
25451 declare yyparse to have a void * argument.
25452
25453 1996-12-18 Paul Eggert <eggert@gnu.org>
25454
25455 * bison.simple (yyparse):
25456 If __GNUC__ and YYPARSE_PARAM are both defined,
25457 declare yyparse to have a void * argument.
25458
25459 1996-12-17 Richard Stallman <rms@gnu.org>
25460
25461 * src/reduce.c (nbits): Add some casts.
25462
25463 1996-08-12 Richard Stallman <rms@gnu.org>
25464
25465 * src/bison.s1: Test _MSDOS as well as _MSDOS_.
25466
25467 1996-08-12 Richard Stallman <rms@gnu.org>
25468
25469 * bison.simple: Test _MSDOS as well as _MSDOS_.
25470
25471 1996-07-31 Richard Stallman <rms@gnu.org>
25472
25473 * src/bison.s1:
25474 [__sun && __i386]: Include alloca.h.
25475
25476 1996-07-31 Richard Stallman <rms@gnu.org>
25477
25478 * bison.simple:
25479 [__sun && __i386]: Include alloca.h.
25480
25481 1996-07-30 Richard Stallman <rms@gnu.org>
25482
25483 * src/bison.s1: Comment change.
25484
25485 * src/bison.s1: Test _MSDOS_, not MSDOS.
25486
25487 1996-07-30 Richard Stallman <rms@gnu.org>
25488
25489 * bison.simple: Comment change.
25490
25491 * bison.simple: Test _MSDOS_, not MSDOS.
25492
25493 1996-06-01 Richard Stallman <rms@gnu.org>
25494
25495 * 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:
25496 Insert `_' macro around many string constants.
25497
25498 * src/main.c:
25499 Insert `_' macro around many string constants.
25500
25501 (main): Call setlocale, bindtextdomain and textdomain.
25502
25503 * src/system.h: [HAVE_LOCALE_H]: Include locale.h.
25504 [! HAVE_LOCALE_H] (setlocale): Define as no-op.
25505 [ENABLE_NLS]: Include libintl.h.
25506 [ENABLE_NLS] (gettext): Define.
25507 [! ENABLE_NLS] (bintextdomain, textdomain, _): Consolation definitions.
25508 (N_, PACKAGE, LOCALEDIR): New macros.
25509
25510 1996-06-01 Richard Stallman <rms@gnu.org>
25511
25512 * POTFILES.in: New file.
25513
25514 * Makefile.in (allocate.o):
25515 Define target explicitly.
25516
25517 * Makefile.in (CFLAGS): Set to @CFLAGS@.
25518 (LDFLAGS): Set to @LDFLAGS@.
25519 (configure): Run autoconf only if preceding `cd' succeeds.
25520 (bison.s1): Redirect output to temporary file then move the
25521 temporary to the target, rather than redirecting directly to bison.s1.
25522 (clean): Remove config.status and config.log.
25523 (distclean): Don't remove config.status here.
25524
25525 1996-05-12 Richard Stallman <rms@gnu.org>
25526
25527 * src/bison.s1:
25528 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
25529
25530 1996-05-12 Richard Stallman <rms@gnu.org>
25531
25532 * bison.simple:
25533 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
25534
25535 1996-05-11 Richard Stallman <rms@gnu.org>
25536
25537 * src/bison.s1 (__yy_memcpy):
25538 Really reorder the args, as was supposedly done on Feb 14 1995.
25539 (yyparse): Calls changed accordingly.
25540
25541 1996-05-11 Richard Stallman <rms@gnu.org>
25542
25543 * Makefile.in (dist): Don't use $(srcdir).
25544
25545 * bison.simple (__yy_memcpy):
25546 Really reorder the args, as was supposedly done on Feb 14 1995.
25547 (yyparse): Calls changed accordingly.
25548
25549 1996-01-27 Richard Stallman <rms@gnu.org>
25550
25551 * src/output.c (output_rule_data):
25552 Test YYERROR_VERBOSE in the conditional
25553 around the definition of ttyname.
25554
25555 1995-12-29 Richard Stallman <rms@gnu.org>
25556
25557 * src/bison.s1:
25558 Fix line numbers in #line commands.
25559
25560 1995-12-29 Richard Stallman <rms@gnu.org>
25561
25562 * bison.simple:
25563 Fix line numbers in #line commands.
25564
25565 1995-12-27 Richard Stallman <rms@gnu.org>
25566
25567 * src/bison.s1 (YYPARSE_PARAM_DECL):
25568 In C++, make it always null.
25569 (YYPARSE_PARAM_ARG): New macro.
25570 (yyparse): Use YYPARSE_PARAM_ARG.
25571
25572 1995-12-27 Richard Stallman <rms@gnu.org>
25573
25574 * bison.simple (YYPARSE_PARAM_DECL):
25575 In C++, make it always null.
25576 (YYPARSE_PARAM_ARG): New macro.
25577 (yyparse): Use YYPARSE_PARAM_ARG.
25578
25579 1995-11-29 Richard Stallman <rms@gnu.org>
25580
25581 * doc/bison.texinfo:
25582 Describe literal string tokens, %raw, %no_lines, %token_table.
25583
25584 1995-11-29 Daniel Hagerty <hag@gnu.org>
25585
25586 * doc/bison.texinfo: Fixed update date
25587
25588 1995-10-16 Richard Stallman <rms@gnu.org>
25589
25590 * src/version.c: Version 1.25.
25591
25592 1995-10-16 Richard Stallman <rms@gnu.org>
25593
25594 * NEWS: *** empty log message ***
25595
25596 1995-10-16 Richard Stallman <rms@gnu.org>
25597
25598 * doc/bison.1, doc/bison.rnh:
25599 Add new options.
25600
25601 1995-10-15 Richard Stallman <rms@gnu.org>
25602
25603 * src/vmsgetargs.c, src/getargs.c:
25604 Added -n, -k, and -raw switches.
25605 (noparserflag, toknumflag, rawtoknumflag): New variables.
25606
25607 * src/symtab.h (SALIAS):
25608 New #define for adding aliases to %token.
25609 (struct bucket): Added `alias' field.
25610
25611 * src/reduce.c (reduce_grammar):
25612 Revise error message.
25613 (print_notices): Remove final `.' from error message.
25614
25615 * src/reader.c (reader_output_yylsp):
25616 New function.
25617 (readgram): Use `#if 0' around code that accepted %command
25618 inside grammar rules: The documentation doesn't allow it,
25619 and it will fail since the %command processors scan for the next %.
25620 (parse_token_decl): Extended the %token
25621 declaration to allow a multi-character symbol as an alias.
25622 (parse_thong_decl): New function.
25623 (read_declarations): Added %thong declarations.
25624 (read_declarations): Handle NOOP to deal with allowing
25625 % declarations as another means to specify the flags.
25626 (readgram): Allow %prec prior to semantics embedded in a rule.
25627 (skip_to_char, read_declarations, copy_definition)
25628 (parse_token_decl, parse_start_decl, parse_type_decl)
25629 (parse_assoc_decl, parse_union_decl, parse_expect_decl)
25630 (get_type_name, copy_guard, copy_action, readgram)
25631 (get_type, packsymbols): Revised most error messages.
25632 Changed `fatal' to `warnxxx' to avoid aborting for error.
25633 Revised and use multiple warnxxx functions to avoid using VARARGS1.
25634 (read_declarations): Improve the error message for
25635 an invalid character. Do not abort.
25636 (read_declarations, copy_guard, copy_action): Use
25637 printable_version to avoid unprintable characters in printed output.
25638 (parse_expect_decl): Error if argument to %expect exceeds 10 digits.
25639 (parse_token_decl, parse_assoc_decl, parse_type_decl, get_type):
25640 Allow the type of a non-terminal can be given
25641 more than once, as long as all specifications give the same type.
25642
25643 * src/output.c:
25644 (output_headers, output_trailers, output, output_gram)
25645 (output_rule_data): Implement noparserflag variable.
25646 Implement toknumflag variable.
25647 (output): Call reader_output_yylsp to output LTYPESTR.
25648
25649 * src/main.c (main):
25650 If reader sees an error, don't process the grammar.
25651 (fatals): Updated to not use VARARGS1.
25652 (printable_version, int_to_string, warn, warni, warns, warnss)
25653 (warnsss): New error reporting functions. Avoid abort for error.
25654
25655 * src/lex.h:
25656 Added THONG and NOOP for alias processing.
25657 Added SETOPT for the new code that allows setting options with %flags.
25658
25659 * src/lex.c:
25660 Include getopt.h. Add some extern decls.
25661 (safegetc): New function to deal with EOF gracefully.
25662 (literalchar); new function to deal with reading \ escapes.
25663 (lex): Use literalchar.
25664 (lex): Implemented "..." tokens.
25665 (literalchar, lex, parse_percent_token): Made tokenbuffer
25666 always contain the token. This includes growing the token
25667 buffer while reading an integer.
25668 (parse_percent_token): Replaced if-else statement with percent_table.
25669 (parse_percent_token): Added % declarations as another
25670 way to specify the flags -n, -l, and -r. Also added hooks for
25671 -d, -k, -y, -v, -t, -p, -b, -o, but implementation requires
25672 major changes to files.c.
25673 (lex) Retain in the incoming stream a character following
25674 an incorrect '/'.
25675 (skip_white_space, lex): Revised most error messages
25676 and changed fatal to warn to avoid aborting.
25677 (percent_table): Added %thong declarations.
25678
25679 * src/gram.h: Comment changes.
25680
25681 * src/files.c (openfiles, open_extra_files, done):
25682 Add faction flag
25683 and actfile file. Handle noparserflag. Both for -n switch.
25684
25685 * src/conflicts.c (resolve_sr_conflict):
25686 Remove use of alloca.
25687
25688 1995-06-01 Jim Meyering <meyering@gnu.org>
25689
25690 * doc/bison.texinfo: *** empty log message ***
25691
25692 1995-05-06 Richard Stallman <rms@gnu.org>
25693
25694 * src/bison.s1: Comment change.
25695
25696 1995-05-06 Richard Stallman <rms@gnu.org>
25697
25698 * bison.simple: Comment change.
25699
25700 1995-05-03 Richard Stallman <rms@gnu.org>
25701
25702 * src/version.c: Version now 1.24.
25703
25704 * src/bison.s1: Change distribution terms.
25705
25706 * src/version.c: Version now 1.23.
25707
25708 1995-05-03 Richard Stallman <rms@gnu.org>
25709
25710 * doc/bison.texinfo:
25711 Rewrite "Conditions for Using Bison".
25712 Update version to 1.24.
25713
25714 1995-05-03 Richard Stallman <rms@gnu.org>
25715
25716 * bison.simple: Change distribution terms.
25717
25718 1995-02-23 Richard Stallman <rms@gnu.org>
25719
25720 * src/files.c: Test __VMS_POSIX as well as VMS.
25721
25722 1995-02-14 Jim Meyering <meyering@gnu.org>
25723
25724 * src/bison.s1 (__yy_memcpy):
25725 Renamed from __yy_bcopy to avoid
25726 confusion. Reverse FROM and TO arguments to be consistent with
25727 those of memcpy.
25728
25729 1995-02-14 Jim Meyering <meyering@gnu.org>
25730
25731 * bison.simple (__yy_memcpy):
25732 Renamed from __yy_bcopy to avoid
25733 confusion. Reverse FROM and TO arguments to be consistent with
25734 those of memcpy.
25735
25736 1994-11-10 David J. MacKenzie <djm@gnu.org>
25737
25738 * NEWS: reformat
25739
25740 * NEWS: New file.
25741
25742 * Makefile.in (DISTFILES): Include NEWS.
25743
25744 * Makefile.in (DISTFILES):
25745 Include install-sh, not install.sh.
25746
25747 * configure.in: Update to Autoconf v2 macro names.
25748
25749 1994-10-05 David J. MacKenzie <djm@gnu.org>
25750
25751 * Makefile.in: fix typo
25752
25753 * Makefile.in (prefix, exec_prefix):
25754 Let configure set them.
25755
25756 1994-09-28 David J. MacKenzie <djm@gnu.org>
25757
25758 * Makefile.in: Set datadir to $(prefix)/share.
25759
25760 1994-09-15 Richard Stallman <rms@gnu.org>
25761
25762 * src/bison.s1:
25763 Update copyright notice and GPL version.
25764
25765 1994-09-15 Richard Stallman <rms@gnu.org>
25766
25767 * bison.simple:
25768 Update copyright notice and GPL version.
25769
25770 1994-07-12 Richard Stallman <rms@gnu.org>
25771
25772 * src/reduce.c, src/reader.c:
25773 entered into RCS
25774
25775 1994-05-05 David J. MacKenzie <djm@gnu.org>
25776
25777 * Makefile.in: entered into RCS
25778
25779 1994-03-26 Richard Stallman <rms@gnu.org>
25780
25781 * src/bison.s1: entered into RCS
25782
25783 1994-03-26 Richard Stallman <rms@gnu.org>
25784
25785 * bison.simple: entered into RCS
25786
25787 1994-03-25 Richard Stallman <rms@gnu.org>
25788
25789 * src/main.c: entered into RCS
25790
25791 1994-03-24 Richard Stallman <rms@gnu.org>
25792
25793 * src/conflicts.c: entered into RCS
25794
25795 1994-01-02 Richard Stallman <rms@gnu.org>
25796
25797 * Makefile.in: *** empty log message ***
25798
25799 1993-11-21 Richard Stallman <rms@gnu.org>
25800
25801 * src/bison.s1: *** empty log message ***
25802
25803 1993-11-21 Richard Stallman <rms@gnu.org>
25804
25805 * doc/bison.texinfo: entered into RCS
25806
25807 * doc/bison.texinfo: *** empty log message ***
25808
25809 1993-11-21 Richard Stallman <rms@gnu.org>
25810
25811 * bison.simple: *** empty log message ***
25812
25813 1993-10-25 David J. MacKenzie <djm@gnu.org>
25814
25815 * doc/bison.texinfo: *** empty log message ***
25816
25817 1993-10-19 Richard Stallman <rms@gnu.org>
25818
25819 * src/bison.s1: *** empty log message ***
25820
25821 1993-10-19 Richard Stallman <rms@gnu.org>
25822
25823 * bison.simple: *** empty log message ***
25824
25825 1993-10-14 Richard Stallman <rms@gnu.org>
25826
25827 * src/bison.s1: *** empty log message ***
25828
25829 1993-10-14 Richard Stallman <rms@gnu.org>
25830
25831 * bison.simple: *** empty log message ***
25832
25833 1993-09-14 David J. MacKenzie <djm@gnu.org>
25834
25835 * doc/bison.texinfo: *** empty log message ***
25836
25837 1993-09-13 Noah Friedman <friedman@gnu.org>
25838
25839 * Makefile.in: *** empty log message ***
25840
25841 1993-09-10 Richard Stallman <rms@gnu.org>
25842
25843 * src/conflicts.c: *** empty log message ***
25844
25845 * src/system.h: entered into RCS
25846
25847 1993-09-10 Richard Stallman <rms@gnu.org>
25848
25849 * doc/bison.1: entered into RCS
25850
25851 1993-09-06 Noah Friedman <friedman@gnu.org>
25852
25853 * src/version.c: entered into RCS
25854
25855 1993-09-06 Noah Friedman <friedman@gnu.org>
25856
25857 * Makefile.in: *** empty log message ***
25858
25859 1993-07-30 David J. MacKenzie <djm@gnu.org>
25860
25861 * Makefile.in: *** empty log message ***
25862
25863 1993-07-24 Richard Stallman <rms@gnu.org>
25864
25865 * src/bison.s1: *** empty log message ***
25866
25867 1993-07-24 Richard Stallman <rms@gnu.org>
25868
25869 * bison.simple: *** empty log message ***
25870
25871 1993-07-08 David J. MacKenzie <djm@gnu.org>
25872
25873 * Makefile.in: *** empty log message ***
25874
25875 1993-07-04 Richard Stallman <rms@gnu.org>
25876
25877 * src/bison.s1: *** empty log message ***
25878
25879 1993-07-04 Richard Stallman <rms@gnu.org>
25880
25881 * bison.simple: *** empty log message ***
25882
25883 1993-06-26 David J. MacKenzie <djm@gnu.org>
25884
25885 * src/getargs.c: entered into RCS
25886
25887 1993-06-26 David J. MacKenzie <djm@gnu.org>
25888
25889 * doc/bison.texinfo: *** empty log message ***
25890
25891 * doc/bison.1: New file.
25892
25893 1993-06-25 Richard Stallman <rms@gnu.org>
25894
25895 * src/getargs.c: New file.
25896
25897 1993-06-16 Richard Stallman <rms@gnu.org>
25898
25899 * src/bison.s1: *** empty log message ***
25900
25901 1993-06-16 Richard Stallman <rms@gnu.org>
25902
25903 * bison.simple: *** empty log message ***
25904
25905 1993-06-03 Richard Stallman <rms@gnu.org>
25906
25907 * src/bison.s1: New file.
25908
25909 1993-06-03 Richard Stallman <rms@gnu.org>
25910
25911 * doc/bison.texinfo: *** empty log message ***
25912
25913 1993-06-03 Richard Stallman <rms@gnu.org>
25914
25915 * bison.simple: New file.
25916
25917 1993-05-19 Richard Stallman <rms@gnu.org>
25918
25919 * doc/bison.texinfo: New file.
25920
25921 1993-05-07 Noah Friedman <friedman@gnu.org>
25922
25923 * Makefile.in: *** empty log message ***
25924
25925 1993-04-28 Noah Friedman <friedman@gnu.org>
25926
25927 * src/reader.c: *** empty log message ***
25928
25929 1993-04-23 Noah Friedman <friedman@gnu.org>
25930
25931 * src/alloc.h: entered into RCS
25932
25933 1993-04-20 David J. MacKenzie <djm@gnu.org>
25934
25935 * src/version.c: *** empty log message ***
25936
25937 * src/files.c, src/allocate.c:
25938 entered into RCS
25939
25940 * src/reader.c: *** empty log message ***
25941
25942 * src/lex.c: entered into RCS
25943
25944 * src/conflicts.c: New file.
25945
25946 * src/symtab.c: entered into RCS
25947
25948 * src/alloc.h: New file.
25949
25950 * src/LR0.c: entered into RCS
25951
25952 1993-04-18 Noah Friedman <friedman@gnu.org>
25953
25954 * src/reader.c: New file.
25955
25956 * src/version.c: *** empty log message ***
25957
25958 1993-04-18 Noah Friedman <friedman@gnu.org>
25959
25960 * Makefile.in: *** empty log message ***
25961
25962 1993-04-17 Noah Friedman <friedman@gnu.org>
25963
25964 * Makefile.in: *** empty log message ***
25965
25966 1993-04-15 Richard Stallman <rms@gnu.org>
25967
25968 * src/main.c, src/files.c:
25969 New file.
25970
25971 1993-04-15 Noah Friedman <friedman@gnu.org>
25972
25973 * configure.in: entered into RCS
25974
25975 * configure.in: *** empty log message ***
25976
25977 * configure.in: New file.
25978
25979 1993-04-14 Richard Stallman <rms@gnu.org>
25980
25981 * Makefile.in: New file.
25982
25983 1993-04-13 Richard Stallman <rms@gnu.org>
25984
25985 * src/version.c: New file.
25986
25987 1993-03-25 Richard Stallman <rms@gnu.org>
25988
25989 * src/output.c: entered into RCS
25990
25991 1992-09-25 Richard Stallman <rms@gnu.org>
25992
25993 * configure.bat: entered into RCS
25994
25995 1992-06-22 Richard Stallman <rms@gnu.org>
25996
25997 * src/vmsgetargs.c: entered into RCS
25998
25999 1992-06-22 Richard Stallman <rms@gnu.org>
26000
26001 * doc/bison.rnh: entered into RCS
26002
26003 1992-04-20 David J. MacKenzie <djm@gnu.org>
26004
26005 * README: entered into RCS
26006
26007 1992-01-22 Richard Stallman <rms@gnu.org>
26008
26009 * src/machine.h: entered into RCS
26010
26011 1991-12-21 Richard Stallman <rms@gnu.org>
26012
26013 * src/lalr.c, src/closure.c:
26014 entered into RCS
26015
26016 1991-12-20 Richard Stallman <rms@gnu.org>
26017
26018 * src/state.h: entered into RCS
26019
26020 1991-12-18 Richard Stallman <rms@gnu.org>
26021
26022 * src/print.c, src/nullable.c, src/derives.c:
26023 entered into RCS
26024
26025 1991-11-03 David J. MacKenzie <djm@gnu.org>
26026
26027 * src/warshall.c, src/types.h, src/symtab.h, src/lex.h, src/gram.c, src/gram.h, src/files.h:
26028 entered into RCS
26029
26030 1988-09-09 Richard Stallman <rms@gnu.org>
26031
26032 * src/bison.hairy: entered into RCS
26033
26034 1987-12-16 Richard Stallman <rms@gnu.org>
26035
26036 * REFERENCES: entered into RCS
26037
26038
26039 -----
26040
26041 Copyright (C) 1987-1988, 1991-2011 Free Software Foundation,
26042 Inc.
26043
26044 Copying and distribution of this file, with or without
26045 modification, are permitted provided the copyright notice and this
26046 notice are preserved.