]> git.saurik.com Git - bison.git/blob - ChangeLog
parse.lac: implement exploratory stack reallocations.
[bison.git] / ChangeLog
1 2010-12-11 Joel E. Denny <jdenny@clemson.edu>
2
3 parse.lac: implement exploratory stack reallocations.
4 * data/yacc.c: Rename %define variable parse.lac.es-capacity to
5 parse.lac.es-capacity-initial. Accept parse.lac.memory-trace
6 with values of "failures" (default) or "full".
7 (b4_declare_parser_state_variables): Add yyesa, yyes, and
8 yyes_capacity variables.
9 (YYSTACK_USE_ALLOCA): Ignore it if LAC requested.
10 (YYSTACK_ALLOC, YYSTACK_FREE, YYSTACK_ALLOC_MAXIMUM): Define if
11 LAC requested.
12 (YYCOPY_NEEDED): New cpp macro.
13 (YYCOPY): Define if LAC requested.
14 (yy_lac_stack_realloc): New function implementing stack
15 reallocations. Use YYMAXDEPTH for maximum stack size given that
16 the stack should never need to grow larger than the main state
17 stack needs to grow without LAC.
18 (YY_LAC_ESTABLISH): Update yy_lac invocation.
19 (yy_lac): Add arguments for exploratory stack memory data
20 recorded in the main parser. Invoke yy_lac_stack_realloc when
21 reallocation is necessary.
22 (yysyntax_error): Add the same new arguments and pass them to
23 yy_lac.
24 (yypstate_delete): Free yyes if necessary.
25 (yyesa, yyes, yyes_capacity): #define these to yypstate members
26 in the case of push parsing.
27 (yyparse, yypush_parse): Initialize yyes and yyes_capacity.
28 Update yysyntax_error invocations. At yyreturn, free yyes if
29 necessary.
30 * src/parse-gram.y: %define parse.lac full.
31 * tests/input.at (LAC: errors for %define): Extend for
32 parse.lac-memory-trace.
33 * tests/regression.at (LAC: Exploratory stack): Extend to check
34 that stack reallocs happen when expected.
35 (LAC: Memory exhaustion): Update to use YYMAXDEPTH and
36 parse.lac.es-capacity-initial.
37
38 2010-12-11 Joel E. Denny <jdenny@clemson.edu>
39
40 parse.lac: implement as %define variable.
41 LAC = lookahead correction. See discussion at
42 <http://lists.gnu.org/archive/html/bison-patches/2009-09/msg00034.html>.
43 However, one point there must be corrected: because of %nonassoc,
44 LAC is *not* always redundant for lr.type=canonical-lr.
45 * data/yacc.c: Accept values of "none" (default) or "full" for
46 parse.lac. Accept %define parse.lac.es-capacity to specify
47 capacity of LAC's temporary exploratory stack. It defaults to 20
48 and, for now, will not grow dynamically.
49 (b4_lac_flag, b4_lac_if): New m4 macros. Evaluate as true for
50 parse.lac!=none.
51 (YYBACKUP): Invoke YY_LAC_DISCARD.
52 (YY_LAC_ESTABLISH, YY_LAC_DISCARD): New cpp macros that invoke
53 yy_lac and track when it needs to be invoked
54 (yy_lac): New function that, given the current stack, determines
55 whether a token can eventually be shifted. Return status mimics
56 yyparse return status.
57 (yysyntax_error): Change yystate argument to yyssp so stack top
58 can be passed to yy_lac. If LAC is requested, build expected
59 token list by invoking yy_lac for every token instead of just
60 checking the current state for lookaheads. Return 2 if yy_lac
61 exhausts memory.
62 (yyparse, yypush_parse): Use local variable yy_lac_established and
63 cpp macros YY_LAC_ESTABLISH and YY_LAC_DISCARD to implement LAC.
64 Update yysyntax_error invocation. Add yyexhaustedlab code if LAC
65 is requested.
66 * tests/conflicts.at (%nonassoc and eof): Extend to check the
67 effect of each of -Dlr.type=canonical-lr and -Dparse.lac=full.
68 (parse.error=verbose and consistent errors): Likewise.
69 (LAC: %nonassoc requires splitting canonical LR states): New test
70 group demonstrating how LAC can fix canonical LR.
71 * tests/input.at (LAC: Errors for %define): New test group.
72 * tests/regression.at (LAC: Exploratory stack): New test group.
73 (LAC: Memory exhaustion): New test group.
74
75 2010-11-21 Joel E. Denny <jdenny@clemson.edu>
76
77 build: use gnulib's new bootstrap_sync option.
78 Now, whenever we update bison's copy of gnulib, bootstrap will
79 update itself the next time it's run.
80 * bootstrap: Copy from latest gnulib for bootstrap_sync support.
81 * bootstrap.conf (bootstrap_sync): Set to true.
82 * gnulib: Update to latest so bootstrap is in sync now.
83
84 2010-11-07 Joel E. Denny <jdenny@clemson.edu>
85
86 yysyntax_error: fix for consistent error with lookahead.
87 * NEWS (2.5): Document.
88 * data/yacc.c (yysyntax_error): In a verbose syntax error
89 message while in a consistent state with a default action (which
90 must be an error action given that yysyntax_error is being
91 invoked), continue to drop the expected token list, but don't
92 drop the unexpected token unless there actually is no lookahead.
93 Moreover, handle that internally instead of returning 1 to tell
94 the caller to do it. With that meaning of 1 gone, renumber
95 return codes more usefully.
96 (yyparse, yypush_parse): Update yysyntax_error usage. Most
97 importantly, set yytoken to YYEMPTY when there's no lookahead.
98 * data/glr.c (yyreportSyntaxError): As in yacc.c, don't drop the
99 unexpected token unless there actually is no lookahead.
100 * data/lalr1.cc (yy::parser::parse): If there's no lookahead,
101 pass yyempty_ not yyla.type to yysyntax_error_.
102 (yy::parser::yysyntax_error_): Again, don't drop the unexpected
103 token unless there actually is no lookahead.
104 * data/lalr1.java (YYParser::parse): If there's no lookahead,
105 set yytoken to yyempty_ before invoking yysyntax_error.
106 (YYParser::yysyntax_error): Again, don't drop the unexpected
107 token unless there actually is no lookahead.
108 * tests/conflicts.at (parse.error=verbose and consistent
109 errors): Extend test group to further reveal how the previous
110 use of the simple "syntax error" message was too general. Test
111 yacc.c, glr.c, lalr1.cc, and lalr1.java. No longer an expected
112 failure.
113 * tests/java.at (AT_JAVA_COMPILE, AT_JAVA_PARSER_CHECK): Move
114 to...
115 * tests/local.at: ... here.
116 (_AT_BISON_OPTION_PUSHDEFS): Push AT_SKEL_JAVA_IF definition.
117 (AT_BISON_OPTION_POPDEFS): Pop it.
118 (AT_FULL_COMPILE): Extend to handle Java.
119
120 2010-11-07 Joel E. Denny <jdenny@clemson.edu>
121
122 yysyntax_error: more preparation for readability of next patch.
123 There are no behavioral changes here.
124 * data/glr.c (yyreportSyntaxError): Reorganize.
125 * data/lalr1.cc (yy::parser::yysyntax_error_): Reorganize.
126 * tests/conflicts.at (parse.error=verbose and consistent errors):
127 Reorganize.
128
129 2010-11-07 Joel E. Denny <jdenny@clemson.edu>
130
131 yysyntax_error: prepare for readability of next patches.
132 These are purely whitespace changes that result in ugly code
133 but that make the next couple of patches much easier to read.
134 * data/glr.c (yyreportSyntaxError): Reindent.
135 * data/lalr1.cc (yy::parser::yysyntax_error_): Reindent.
136 * data/lalr1.java (YYParser::yysyntax_error): Reindent.
137 * data/yacc.c (yysyntax_error): Reindent.
138
139 2010-10-31 Joel E. Denny <joeldenny@joeldenny.org>
140
141 Fix memory leak.
142 * src/output.c (prepare_rules): Free temporary array.
143
144 2010-10-31 Joel E. Denny <joeldenny@joeldenny.org>
145
146 yysyntax_error: improve invocation readability.
147 * data/yacc.c (yyparse, yypush_parse): For yysyntax_error
148 invocation, get rid of the while loop, which is misleading
149 because there are really at most two iterations.
150
151 2010-10-31 Joel E. Denny <joeldenny@joeldenny.org>
152
153 * ChangeLog: Correct some errors in previous entries.
154
155 2010-10-17 Joel E. Denny <joeldenny@joeldenny.org>
156
157 maint: re-anchor all .gitignore entries.
158 * bootstrap: Copy from gnulib's latest for the fix to
159 automatically anchor entries it constructs.
160 * gnulib: Update to latest just so it has the same bootstrap.
161 * .gitignore, build-aux/.gitignore, doc/.gitignore:
162 * lib/.gitignore, m4/.gitignore, po/.gitignore:
163 * runtime-po/.gitignore: Re-anchor all entries.
164
165 2010-10-08 Paul Eggert <eggert@cs.ucla.edu>
166
167 Fix portability problem on OpenBSD 4.7.
168
169 Jim Meyering reported this in
170 <http://lists.gnu.org/archive/html/bug-bison/2010-10/msg00007.html>.
171 * data/yacc.c: Use EXIT_SUCCESS as a witness for stdlib.h,
172 not _STDLIB_H. EXIT_SUCCESS has been defined by the standard
173 for quite some time.
174 * src/parse-gram.c, src/parse-gram.h: Regenerate.
175 * tests/regression.at: Tamper with the renamed witness.
176
177 Adjust to recent changes to gnulib bootstrap.
178
179 * .cvsignore, build-aux/.cvsignore, doc/.cvsignore, etc/.cvsignore:
180 * examples/calc++/.cvsignore, lib/.cvsignore, m4/.cvsignore:
181 * po/.cvsignore, runtime-po/.cvsignore, src/.cvsignore:
182 * tests/.cvsignore: Remove; I don't use CVS to maintain Bison
183 anymore and don't know of anybody else who does. If someone needs
184 these files, they can resurrect them.
185 * .gitignore, build-aux/.gitignore, doc/.gitignore, lib/.gitignore:
186 * m4/.gitignore, po/.gitignore, runtime-po/.gitignore:
187 Omit leading '/', since bootstrap omits it.
188 Adjust file names to match current contents better.
189 * bootstrap: Sync from gnulib: this contains the new gnulib_mk_hook
190 installed just for us.
191 * bootstrap.conf (excluded_files): Don't exclude codeset.m4,
192 glibc21.m4, inttypes_h.m4, size_max.m4, xsize.m4, as they are now
193 needed somehow. Don't have time to look into why.
194 (gnulib_modules): Change malloc to malloc-gnu. Do we really assume
195 the GNU malloc behavior, where malloc (0) != NULL unless we're
196 out of storage? If not, we can omit malloc-gnu; but for now I left
197 it in to be safe.
198 (vc_ignore): Remove.
199 (gnulib_mk_hook): New function.
200 * README-hacking: Renamed from HACKING, since gnulib bootstrap now
201 uses that convention.
202
203 2010-09-09 Paul Hilfinger <hilfinger@cs.berkeley.edu>
204
205 * data/glr.c (yySymbol): Define as int to avoid compiler warnings about
206 possible change of value.
207
208 2010-09-08 Paul Hilfinger <hilfinger@cs.berkeley.edu>
209
210 * data/glr.c (yy_reduce_print): Change yyrhsVals to yyvsp to remove
211 compiler errors when using %debug.
212 Add declaration of yylow when locations in use to avoid compilation
213 error.
214 (yyglrReduce): Conditionalize message "Parse ... rejected by rule..."
215 on whether we are in split mode, for consistency with behavior of
216 non-GLR parsing.
217
218 2010-09-01 Akim Demaille <demaille@gostai.com>
219
220 Address GCC warnings about shadowed local variables (yyflag).
221 * data/glr.c (YYCHK): Rename yyflag as yychk_flag.
222 (yyprocessOneStack): Reduce the scope of yyaction, yyconflicts,
223 yyrule, and yyflag.
224
225 2010-08-05 Joel E. Denny <joeldenny@joeldenny.org>
226
227 Version 2.4.3.
228 * NEWS (2.4.3): Set date.
229
230 2010-08-04 Joel E. Denny <joeldenny@joeldenny.org>
231
232 maint: add gettext version to release announcements.
233 Suggested by Paul Hilfinger at
234 <http://lists.gnu.org/archive/html/bison-patches/2010-07/msg00019.html>
235 <http://lists.gnu.org/archive/html/bison-patches/2010-08/msg00002.html>.
236 * cfg.mk (bootstrap-tools): Add gettext.
237
238 2010-08-04 Joel E. Denny <joeldenny@joeldenny.org>
239
240 doc: fix -W and %expect documentation some.
241 * NEWS (2.4.3): Mention that there are documentation fixes.
242 * doc/bison.texinfo (Expect Decl): Make it clear that %expect
243 turns conflicts into errors not warnings.
244 (Shift/Reduce): Likewise.
245 (Bison Options): Don't mention -Wsyntax. It doesn't exist.
246
247 2010-08-01 Joel E. Denny <joeldenny@joeldenny.org>
248
249 -Werror: fix for rules useless in parser after conflicts.
250 * NEWS (2.4.3): Document fix.
251 * src/complain.c (error_message): Extend to handle incomplete
252 error messages so warn and warn_at can be used in more cases.
253 * src/gram.c (grammar_rules_useless_report): Use warn_at so that
254 -Werror is always obeyed.
255 * src/reduce.c (reduce_print): Use warn so that the "warnings
256 being treated as errors" message is printed consistently before
257 the first warning message. This makes testing easier.
258 * tests/local.at (AT_BISON_WERROR_MSG): New macro.
259 (AT_BISON_CHECK_NO_XML): Extend to check -Werror and
260 --warnings=error when warnings appear in bison's stderr.
261
262 2010-07-29 Joel E. Denny <joeldenny@joeldenny.org>
263
264 maint: enable gnits only at stable releases.
265 * configure.ac (AM_INIT_AUTOMAKE): Underscore or dash in a
266 version string should disable gnits. Explain in comments.
267
268 2010-07-28 Joel E. Denny <joeldenny@joeldenny.org>
269
270 i18n: update.
271 * po/POTFILES.in: Add src/graphviz.c.
272
273 2010-07-28 Joel E. Denny <joeldenny@joeldenny.org>
274
275 i18n: fix for gnulib.
276 * po/POTFILES.in: Add remaining gnulib files that have
277 translatable strings.
278
279 2010-07-25 Joel E. Denny <joeldenny@joeldenny.org>
280
281 build: fix our adjustments for gnulib files in lib.
282 * configure.ac: For prepending lib/ to the values of config
283 variables, fix detection of empty values. Also, due to recent
284 gnulib changes, add LIBUNISTRING_UNITYPES_H and
285 LIBUNISTRING_UNIWIDTH_H to the list of those variables.
286
287 2010-07-25 Joel E. Denny <joeldenny@joeldenny.org>
288
289 maint: use announce-gen's new --mail-headers.
290 * HACKING (Announce): Update instructions.
291 * cfg.mk (announcement_Cc_): Define.
292 * configure.ac (AM_GNU_GETTEXT_VERSION): Update to 0.18 as
293 required by latest gnulib.
294 * gnulib: Update to latest.
295
296 2010-07-24 Joel E. Denny <joeldenny@joeldenny.org>
297
298 tests: handle Valgrind that complains about >&-.
299 * tests/output.at (AT_CHECK_OUTPUT): Extend to accept pre-tests.
300 (Output files: -dv >&-): Skip test group if running
301 maintainer-check-valgrind.
302
303 2010-07-23 Paul Hilfinger <hilfingr@EECS.Berkeley.EDU>
304
305 * NEWS: Describe new semantic-predicate feature.
306 * data/c.m4 (b4_predicate_case): New definition.
307 * data/java.m4 (b4_predicate_case): New definition.
308 * data/glr.c (yyimmediate): Add definition.
309 (yydoAction): Remove comment, now obsolete.
310 Do YY_REDUCE_PRINT here.
311 (yyglrReduce): Alter comment to indicate that semantic values
312 need not be deferred.
313 Remove YY_REDUCE_PRINT from here; done in yydoAction.
314 (yyprocessOneStack): Pass immediate flag.
315 Delete stacks rejected by predicates in newly split-off parsers.
316 Change handling of yyerr so that only current stack gets deleted
317 when semantic predicate fails.
318 (yyfillin): Don't crash if a semantic value is unresolved (as may
319 happen in predicate rules).
320 Copy lr state as well in debugging mode.
321 Update comment on setting of yysval to include yyloc as well.
322 (yy_reduce_print): Add yynormal argument. Perform fillin properly.
323 Report unresolved RHS values.
324 (yyimmediate): New table.
325 * src/gram.h (struct rule): Add is_predicate field.
326 * src/output.c (user_actions_output): Use b4_predicate_case for
327 predicates.
328 (prepare_symbols): Output yyimmediate.
329 * src/scan-gram.l: Add %? token, SC_PREDICATE state.
330 * src/scan-code.l (code_props_rule_action_init): Add is_predicate
331 argument.
332 * src/scan-code.h (struct code_props): Add is_predicate field.
333 (code_props_rule_action_init): New interface.
334 * src/parse-gram.y (%?{...}): New token.
335 (rhs): Add %?{...} rule.
336 * src/parse-gram.c: Regenerate.
337 * src/parse-gram.h: Regenerate.
338 * src/reader.c (grammar_current_rule_action_append): Add
339 immediate argument.
340 (grammar_midrule_action): Use new interface for
341 code_props_rule_action_init.
342 (grammar_current_rule_action_append): Ditto.
343 (packgram): Transfer is_predicate value.
344 * src/reader.h (grammar_current_rule_action_append): New interface.
345 * doc/bison.texinfo: Document semantic predicates (%?).
346
347 * data/glr.c (yylhsNonterm, yyisDefaultedState,yyDefaultAction)
348 (yygetLRActions,yynewGLRStackItem,yyaddDeferredAction,yyinitStateSet)
349 (yyinitGLRStack,yyexpandGLRStack,yyupdateSplit,yymarkStackDeleted)
350 (yyundeleteLastStack,yyglrShift,yyglrShiftDefer,yydoAction,yyglrReduce)
351 (yyidenticalOptions,yymergeOptionSets,yyresolveStates,yyresolveAction)
352 (yyresolveLocations,yyresolveValue,yyreducePrint): Update parameter
353 names in comments and mention all parameters.
354 (struct yyGLRState): Fix description of yyposn field.
355 (yyresolveLocations): Correct comment so as not to imply action when
356 yyn1==0.
357
358 2010-06-17 Paul Eggert <eggert@cs.ucla.edu>
359
360 Update from GFDL GFDL 1.2 to 1.3.
361 * doc/bison.texinfo: Update GFDL version number.
362 * doc/fdl.texi: Update to version 1.3, taken from:
363 http://www.gnu.org/licenses/fdl.texi
364
365 Do not use date ranges in copyright notices.
366 See http://www.gnu.org/prep/maintain/maintain.html#Copyright-Notices
367
368 * HACKING, Makefile.am, NEWS, PACKAGING, README, README-alpha:
369 * TODO, bootstrap, bootstrap.conf:
370 * build-aux/update-b4-copyright, cfg.mk, configure.ac:
371 * data/README, data/bison.m4, data/c++-skel.m4, data/c++.m4:
372 * data/c-skel.m4, data/c.m4, data/glr.c, data/glr.cc:
373 * data/java-skel.m4, data/java.m4, data/lalr1.cc:
374 * data/lalr1.java, data/local.mk, data/location.cc:
375 * data/stack.hh, data/variant.hh, data/xslt/bison.xsl:
376 * data/xslt/xml2dot.xsl, data/xslt/xml2text.xsl:
377 * data/xslt/xml2xhtml.xsl, data/yacc.c, djgpp/Makefile.maint:
378 * djgpp/README.in, djgpp/config.bat, djgpp/config.sed:
379 * djgpp/config.site, djgpp/config_h.sed, djgpp/djunpack.bat:
380 * djgpp/local.mk, djgpp/subpipe.c, djgpp/subpipe.h:
381 * djgpp/testsuite.sed, doc/bison.texinfo, doc/local.mk:
382 * doc/refcard.tex, etc/README, etc/bench.pl.in, etc/local.mk:
383 * examples/calc++/Makefile.am, examples/extexi:
384 * examples/local.mk, lib/abitset.c, lib/abitset.h:
385 * lib/bbitset.h, lib/bitset.c, lib/bitset.h:
386 * lib/bitset_stats.c, lib/bitset_stats.h, lib/bitsetv-print.c:
387 * lib/bitsetv-print.h, lib/bitsetv.c, lib/bitsetv.h:
388 * lib/ebitset.c, lib/ebitset.h, lib/get-errno.c:
389 * lib/get-errno.h, lib/lbitset.c, lib/lbitset.h:
390 * lib/libiberty.h, lib/local.mk, lib/main.c, lib/timevar.c:
391 * lib/timevar.def, lib/timevar.h, lib/vbitset.c:
392 * lib/vbitset.h, lib/yyerror.c, m4/bison-i18n.m4:
393 * m4/c-working.m4, m4/cxx.m4, m4/subpipe.m4, m4/timevar.m4:
394 * src/AnnotationList.c, src/AnnotationList.h:
395 * src/InadequacyList.c, src/InadequacyList.h, src/LR0.c:
396 * src/LR0.h, src/Sbitset.c, src/Sbitset.h, src/assoc.c:
397 * src/assoc.h, src/closure.c, src/closure.h, src/complain.c:
398 * src/complain.h, src/conflicts.c, src/conflicts.h:
399 * src/derives.c, src/derives.h, src/files.c, src/files.h:
400 * src/flex-scanner.h, src/getargs.c, src/getargs.h:
401 * src/gram.c, src/gram.h, src/graphviz.c, src/ielr.c:
402 * src/ielr.h, src/lalr.c, src/lalr.h, src/local.mk:
403 * src/location.c, src/location.h, src/main.c:
404 * src/muscle-tab.c, src/muscle-tab.h, src/named-ref.c:
405 * src/named-ref.h, src/nullable.c, src/nullable.h:
406 * src/output.c, src/output.h, src/parse-gram.y:
407 * src/print-xml.c, src/print-xml.h, src/print.c, src/print.h:
408 * src/print_graph.c, src/print_graph.h, src/reader.c:
409 * src/reader.h, src/reduce.c, src/reduce.h, src/relation.c:
410 * src/relation.h, src/scan-code.h, src/scan-code.l:
411 * src/scan-gram.h, src/scan-gram.l, src/scan-skel.h:
412 * src/scan-skel.l, src/state.c, src/state.h, src/symlist.c:
413 * src/symlist.h, src/symtab.c, src/symtab.h, src/system.h:
414 * src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h:
415 * tests/actions.at, tests/atlocal.in, tests/c++.at:
416 * tests/calc.at, tests/conflicts.at, tests/cxx-type.at:
417 * tests/existing.at, tests/glr-regression.at:
418 * tests/headers.at, tests/input.at, tests/java.at:
419 * tests/local.at, tests/local.mk, tests/named-refs.at:
420 * tests/output.at, tests/push.at, tests/reduce.at:
421 * tests/regression.at, tests/sets.at, tests/skeletons.at:
422 * tests/synclines.at, tests/testsuite.at, tests/torture.at:
423 Don't use date ranges in copyright notices.
424
425 2010-05-11 Akim Demaille <demaille@gostai.com>
426
427 lalrl1.cc: give a chance to user defined YYLLOC_DEFAULT.
428 * data/lalr1.cc (YYLLOC_DEFAULT): Move its definition from the
429 header file to the implementation file, after the user %code
430 sections.
431 * NEWS (2.5): Document this.
432
433 2010-05-11 Akim Demaille <demaille@gostai.com>
434
435 doc: please Emacs.
436 * doc/bison.texinfo (Local Variables): Move this after the
437 LocalWords, since the latter are looked for in the whole document,
438 while the former are looked for only at its end.
439 Require american spell checking.
440
441 2010-05-10 Akim Demaille <demaille@gostai.com>
442
443 doc: fix lalr1.cc documentation.
444 * doc/bison.texinfo (C++ Scanner Interface): Fix yylex signature.
445 (C++ Bison Interface): Fix lalr1.cc skeleton name.
446 (C++ Parser Interface): Fix semantic_type and location_type names.
447 Document yy::parser::token.
448 Reported by Jerry Quinn.
449
450 2010-05-10 Akim Demaille <demaille@gostai.com>
451
452 c++: use YYRHSLOC.
453 * data/lalr1.cc (YYRHSLOC): New.
454 (YYLLOC_DEFAULT): Use it.
455 * data/glr.cc: If location_type was user defined, do not include
456 location.hh, and do not produce location.hh and position.hh.
457 * tests/calc.at (YYLLOC_DEFAULT): Use YYRHSLOC.
458 Check that glr.cc supports user defined location_type.
459 * NEWS: Document this.
460
461 2010-05-07 Akim Demaille <demaille@gostai.com>
462
463 doc: fix typo.
464 * tests/synclines.at: here.
465
466 2010-05-04 Akim Demaille <demaille@gostai.com>
467
468 tests: enhance AT_SYNCLINES_COMPILE.
469 * tests/synclines.at (AT_SYNCLINES_COMPILE): More distcc patterns.
470 (AT_TEST_SYNCLINE): Remove GCC 4.5 protection which is already
471 taken care of in AT_SYNCLINES_COMPILE.
472
473 2010-05-04 Akim Demaille <demaille@gostai.com>
474
475 lalr1.cc: don't generate location.hh when location_type is defined
476 * data/bison.m4 (b4_percent_define_get): Accept a default value.
477 * data/c++.m4: Do not provide a default value for the %define
478 variable location_type, rather, use b4_percent_define_get with a
479 default argument where its value is needed.
480 * data/lalr1.cc: Do not load location.cc (which outputs both
481 location.hh and position.hh) if the user defined location_type.
482 Do not include location.hh either.
483
484 2010-05-04 Akim Demaille <demaille@gostai.com>
485
486 lalr1.cc: minor refactoring.
487 * data/lalr1.cc: Don't issue empty namespaces.
488
489 2010-05-04 Akim Demaille <demaille@gostai.com>
490
491 tests: fix %printer.
492 Currently, there is no check that %printer ... <foo> (nor
493 %destructor) is about an existing <foo> type. This C++ test had
494 it wrong (<::std::string> vs. <std::string>).
495
496 * tests/c++.at (AT_CHECK_VARIANTS): In list.yy, redefine the
497 pretty-printing of lists into something better for parser traces.
498 Update the expected output.
499 Fix correspondance between %type/%token and %printer.
500
501 2010-05-04 Akim Demaille <demaille@gostai.com>
502
503 lalr1.cc: location_type: make sure we don't depend on loc.(begin|end).
504 * tests/calc.at (Span): Instead of begin/end, as in the built-in
505 location class, use first and last.
506 Define YYLLOC_DEFAULT to adjust to these changes.
507 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Adjust to the
508 location_type changes.
509
510 2010-05-01 Joel E. Denny <joeldenny@joeldenny.org>
511
512 tests: fix maintainer-xml-check.
513 * data/xslt/xml2dot.xsl (xsl:template match="bison-xml-report"):
514 Update output to include comments now produced by --graph.
515 (xsl:template match="automaton"): As for --graph, name the
516 digraph after the grammar file.
517 * src/print-xml.c (escape_bufs): Enlarge array.
518 (print_xml): Add bug-report and url attributes to
519 bison-xml-report element.
520
521 2010-05-01 Joel E. Denny <joeldenny@joeldenny.org>
522
523 In DOT output, convert from "/*" comments to "//" comments.
524 This handles the possibility that a "*/" might appear in
525 variable portions of those comments at some point in the future.
526 * src/graphviz.c (start_graph): Implement.
527
528 2010-04-30 Joel E. Denny <joeldenny@joeldenny.org>
529
530 Document that undefined %prec identifier warnings will remain.
531 * NEWS (2.4.3): Here.
532 (2.4.2): Here.
533
534 2010-04-30 Joel E. Denny <joeldenny@joeldenny.org>
535
536 Revert 2009-12-30 change for undefined %prec token complaints.
537 That is, keep them as warnings because that should be sufficient
538 to satisfy POSIX without creating backward compatibility issues.
539 Suggested by Richard Stallman at
540 <http://lists.gnu.org/archive/html/bison-patches/2010-03/msg00033.html>.
541 * NEWS (2.5): Remove mention of complaint.
542 * src/reader.c (grammar_rule_check): Convert complaint back to
543 warning.
544 * tests/input.at (%prec's token must be defined): Update.
545
546 2010-04-25 Joel E. Denny <joeldenny@joeldenny.org>
547
548 build: don't require src/bison during bootstrap.
549 Suggested by Eric Blake at
550 <http://lists.gnu.org/archive/html/bug-bison/2010-03/msg00003.html>.
551 * bootstrap.conf (bootstrap_epilogue): New function to make sure
552 src/parse-gram.[ch] are stamped later than src/parse-gram.y.
553
554 2010-04-25 Joel E. Denny <joeldenny@joeldenny.org>
555
556 i18n: fix untranslatable string.
557 Reported by Goran Uddeborg at
558 <http://lists.gnu.org/archive/html/bug-bison/2010-03/msg00000.html>.
559 * src/muscle-tab.c (muscle_percent_define_insert): Here.
560
561 2010-04-13 Akim Demaille <demaille@gostai.com>
562
563 tests: calc: minor refactoring.
564 * tests/calc.at (_AT_DATA_CALC_Y): Simplify yylex.
565
566 2010-04-13 Akim Demaille <demaille@gostai.com>
567
568 tests: calc: simplify location management.
569 * tests/local.at (AT_LOC_PUSHDEF, AT_LOC_POPDEF): New.
570 (_AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS): Use them to
571 define the appropriate AT_LOC accessors.
572 * tests/calc.at: Use AT_LOC accessors.
573
574 2010-04-13 Akim Demaille <demaille@gostai.com>
575
576 test location_type.
577 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS):
578 Define AT_LOCATION_TYPE_IF.
579 (_AT_BISON_OPTION_POPDEFS): Undefine AT_LOCATION_TYPE_IF.
580 * tests/calc.at (_AT_DATA_CALC_Y): When %define location_type is
581 used, provide a user location type and use it.
582 (Simple LALR1 C++ Calculator): Add a test case for location_type.
583
584 2010-04-13 Akim Demaille <demaille@gostai.com>
585
586 tests: check fclose's return value.
587 * tests/calc.at (_AT_DATA_CALC_Y): Check fclose's return status.
588
589 2010-04-13 Akim Demaille <demaille@gostai.com>
590
591 tests: don't depend on the actual location type.
592 * tests/calc.at: Use yy::parser::location_type rather than
593 yy::location, since the former is always right, and might point to
594 another type than the latter.
595
596 2010-04-13 Akim Demaille <demaille@gostai.com>
597
598 formatting changes.
599 * tests/calc.at: Formatting changes.
600
601 2010-04-13 Akim Demaille <demaille@gostai.com>
602
603 lalr1.cc: remove useless forward declaration.
604 * data/lalr1.cc: Include location.hh before stack.hh.
605 Remove the useless forward declarations of position and location.
606 Reported by Chris Morley.
607 * data/glr.cc: Likewise.
608
609 2010-04-11 Joel E. Denny <joeldenny@joeldenny.org>
610
611 * NEWS (2.4.3): Mention fix for Sun Studio C++.
612
613 2010-04-10 Joel E. Denny <joeldenny@joeldenny.org>
614
615 tests: fix for newer Sun Studio C++.
616 Reported by Dagobert Michelsen at
617 <http://lists.gnu.org/archive/html/bug-bison/2010-03/msg00023.html>.
618 * THANKS (Dagobert Michelsen): Add.
619 * configure.ac (AC_PREREQ): Set to 2.64 so we get the latest
620 Autoconf macro for handling the restrict keyword.
621 * gnulib: Update to latest, which no longer overrides that macro
622 from Autoconf.
623
624 2010-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
625
626 portability: fix pointer arithmetic to conform to C standard.
627 Reported by Tys Lefering at
628 <http://lists.gnu.org/archive/html/bug-bison/2010-03/msg00035.html>.
629 This fix is already implemented in glr.c and does not apply to
630 lalr1.java.
631 * data/lalr1.cc (yy::parser::parse): Increase size of
632 yyerror_range and adjust subscripting so you don't have to
633 subtract one from the beginning of the array.
634 * data/yacc.c (b4_declare_parser_state_variables,
635 yyparse, yypush_parse): Likewise.
636
637 2010-04-05 Akim Demaille <demaille@gostai.com>
638
639 remove useless include.
640 * src/graphviz.h: Don't include stdbool.h.
641
642 2010-04-05 Akim Demaille <demaille@gostai.com>
643
644 graph: sign the output file.
645 * src/graphviz.c (start_graph): Issue comments about Bison.
646 Suggested by Tys Lefering.
647
648 2010-03-31 Joel E. Denny <jdenny@ces.clemson.edu>
649
650 portability: fix test suite for GCC 4.5's new #error message.
651 Reported by Tys Lefering at
652 <http://lists.gnu.org/archive/html/bug-bison/2010-03/msg00030.html>.
653 * NEWS (2.4.3): Mention.
654 * tests/synclines.at (AT_TEST_SYNCLINE): Implement.
655
656 2010-03-30 Akim Demaille <demaille@gostai.com>
657
658 fix comments.
659 * src/graphviz.h: Add missing license notice.
660 Document.
661
662 2010-03-25 Akim Demaille <demaille@gostai.com>
663
664 tests: fix 250: parse.error=verbose overflow.
665 * tests/regression.at (parse.error=verbose overflow): Avoid the
666 double inclusion of stdlib.h as it triggers hard errors.
667
668 2010-03-23 Joel E. Denny <jdenny@ces.clemson.edu>
669
670 portability: fix for BSD make.
671 Reported by Johan van Selst at
672 <http://lists.gnu.org/archive/html/bug-bison/2010-03/msg00016.html>.
673 * tests/local.mk ($(TESTSUITE)): Qualify package.m4 in
674 this dependency list as in package.m4's target rule.
675
676 2010-03-23 Joel E. Denny <jdenny@ces.clemson.edu>
677
678 portability: fix spawning on at least FreeBSD 8 and FreeBSD 9.
679 Reported by Johan van Selst at
680 <http://lists.gnu.org/archive/html/bug-bison/2010-03/msg00014.html>.
681 * NEWS (2.4.3): New.
682 * THANKS (Johan van Selst): Add.
683 * etc/prefix-gnulib-mk (prefix): Adjust regex for makefile
684 targets so that gnulib's new c++defs.h is matched.
685 * gnulib: Update to latest.
686
687 2010-03-20 Joel E. Denny <jdenny@ces.clemson.edu>
688
689 maint: update for changes to gnulib's announce-gen.
690 * HACKING (Announce): RELEASE_TYPE=major must now be written
691 RELEASE_TYPE=stable.
692
693 2010-03-20 Joel E. Denny <jdenny@ces.clemson.edu>
694
695 Version 2.4.2.
696 * NEWS (2.4.2): Set version and date. For the recent test suite
697 portability fixes, don't be so optimistic about their success
698 given the lack of feedback on the affected platforms.
699
700 2010-02-22 Joel E. Denny <jdenny@ces.clemson.edu>
701
702 tests: fix maintainer-xml-check for recent changes.
703 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): Use
704 AT_BISON_CHECK_NO_XML rather than AT_BISON_CHECK because an
705 output file whose name conflicts with a previous output file
706 is now never generated.
707
708 2010-02-22 Joel E. Denny <jdenny@ces.clemson.edu>
709
710 portability: fix several issues with M4 subprocess.
711
712 M4's output pipe was not being drained upon fatal errors during
713 scan_skel. As a result, broken-pipe messages from M4 were seen
714 on at least AIX, HP-UX, Solaris, and RHEL4, and this caused a
715 failure in the test suite. The problem was that, on platforms
716 where the default disposition for SIGPIPE is ignore instead of
717 terminate, M4 sometimes saw fwrite fail with errno=EPIPE and
718 then reported it. However, there's some sort of race condition,
719 because the new test group occasionally succeeded.
720 Reported by Albert Chin at
721 <http://lists.gnu.org/archive/html/bug-bison/2010-02/msg00004.html>.
722
723 There were also problems with the test suite livelocking on
724 Tru64 5.1b. Reported by Didier Godefroy at
725 <http://lists.gnu.org/archive/html/bug-bison/2009-05/msg00005.html>.
726 Switching to create_pipe_bidi suggested by Akim Demaille.
727
728 To attempt to solve both of these problems, switch to gnulib's
729 create_pipe_bidi and register M4 process as a slave. Along the
730 way, clean up file name conflict handling, which was affected by
731 the broken-pipe problem before the switch.
732 * NEWS (2.4.2): Document.
733 * THANKS (Didier Godefroy): Add.
734 * bootstrap.conf (gnulib_modules): Add pipe.
735 * gnulib: Update to latest to make sure we have all the latest
736 fixes.
737 * lib/local.mk (lib_libbison_a_SOURCES): Remove subpipe.h and
738 subpipe.c.
739 * po/POTFILES.in (lib/subpipe.c): Remove.
740 * src/files.c (compute_output_file_names): Update invocations
741 of output_file_name_check.
742 (output_file_name_check): In the case that the grammar file
743 would be overwritten, use complain instead of fatal, but replace
744 the output file name with /dev/null. Use the /dev/null solution
745 for the case of two conflicting output files as well because it
746 seems safer in case Bison one day tries to open both files at
747 the same time.
748 * src/files.h (output_file_name_check): Update prototype.
749 * src/output.c (output_skeleton): Use create_pipe_bidi and
750 wait_subprocess. Assert that scan_skel completely drains the
751 pipe.
752 * src/scan-skel.l (at_directive_perform): Update
753 output_file_name_check invocation.
754 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): Check that the
755 grammar file actually isn't overwritten.
756 (Conflicting output files: -o foo.y): Update expected output.
757 * tests/skeletons.at (Fatal errors but M4 continues producing
758 output): New test group.
759
760 2010-02-04 Joel E. Denny <jdenny@ces.clemson.edu>
761
762 Update POTFILES.
763 * HACKING (Release Procedure): Add reminder about keeping
764 POTFILES files up-to-date.
765 * po/POTFILES.in (src/muscle-tab.c, src/scan-skel.l): Add.
766
767 2010-02-01 Joel E. Denny <jdenny@clemson.edu>
768
769 Code cleanup.
770 * tests/atlocal.in (abs_top_srcdir): Remove shell variable,
771 which is already defined in atconfig.
772
773 2010-01-22 Joel E. Denny <jdenny@clemson.edu>
774
775 tests: fix missing include caught by g++ 4.4.1.
776 Reported by Tys Lefering.
777 * HACKING (Release checks): Add note about trying a recent GCC.
778 * tests/regression.at (_AT_DATA_DANCER_Y): For C++, include
779 cstdlib for abort.
780 (_AT_DATA_EXPECT2_Y): Likewise.
781
782 2010-01-21 Joel E. Denny <jdenny@clemson.edu>
783
784 * cfg.mk (gnulib_dir): Assume gnulib is a subdirectory.
785
786 2010-01-21 Joel E. Denny <jdenny@clemson.edu>
787
788 maint: automate PACKAGE_COPYRIGHT_YEAR update, and update it.
789 * HACKING (Release Procedure): Update notes on copyright years.
790 * Makefile.am (update-package-copyright-year): New target rule.
791 * build-aux/update-package-copyright-year: New file.
792 * cfg.mk (update-copyright): Add update-package-copyright-year
793 as a dependency.
794
795 2010-01-19 Joel E. Denny <jdenny@clemson.edu>
796
797 * bootstrap: Import improvements from latest gnulib.
798
799 2010-01-19 Joel E. Denny <jdenny@clemson.edu>
800
801 build: require Automake 1.11.1 to avoid a security flaw.
802 * HACKING (Release Procedure): Don't document Automake security
803 flaw here.
804 * configure.ac (AM_INIT_AUTOMAKE): Require 1.11.1, and explain
805 why here.
806
807 2010-01-19 Joel E. Denny <jdenny@clemson.edu>
808
809 gnulib: update to latest.
810
811 2010-01-19 Joel E. Denny <jdenny@clemson.edu>
812
813 ChangeLog (2006-09-15): add Odd Arild Olsen's role for push.c.
814
815 2010-01-15 Joel E. Denny <jdenny@clemson.edu>
816
817 Thank the developer of the initial push parser implementation.
818 This unfortunate oversight is several years old.
819 * THANKS (Odd Arild Olsen): Add.
820
821 2010-01-04 Joel E. Denny <jdenny@clemson.edu>
822
823 Fix some comments concerning LR(0) versus LALR(1).
824
825 Stop equating LR(0) with nondeterminism and LALR(1) with
826 determinism. That is, if all states are consistent, then LR(0)
827 tables are deterministic. On the other hand, LALR(1) tables
828 might be nondeterministic before conflict resolution, and GLR
829 permits LALR(1) tables to remain nondeterministic.
830 * src/LR0.c, src/LR0.h: Here.
831 * src/lalr.c, src/lalr.h: Here.
832 * src/main.c (main): Here.
833 * src/state.c, src/state.h: Here.
834
835 * src/ielr.h (ielr): In preconditions, expect LR(0) not LALR(1)
836 parser tables.
837
838 2010-01-04 Joel E. Denny <jdenny@clemson.edu>
839
840 maint: run "make update-copyright"
841
842 2009-12-30 Joel E. Denny <jdenny@clemson.edu>
843
844 POSIX: complain if %prec's token was not defined.
845 * NEWS (2.5): Document.
846 * src/reader.c (grammar_rule_check): Convert warning to
847 complaint.
848 * tests/input.at (%prec's token must be defined): Update.
849
850 2009-12-30 Joel E. Denny <jdenny@clemson.edu>
851
852 POSIX: warn if %prec's token was not defined.
853 Reported by Florian Krohm at
854 <http://lists.gnu.org/archive/html/bug-bison/2009-12/msg00005.html>.
855 * NEWS (2.4.2): Document.
856 * src/reader.c (grammar_rule_check): Implement.
857 (grammar_current_rule_prec_set): Add comments explaining that we
858 here assume a %prec identifier is a token, but we still manage
859 to support POSIX.
860 * tests/input.at (%prec's token must be defined): New test
861 group.
862
863 2009-12-31 Joel E. Denny <jdenny@clemson.edu>
864
865 * HACKING (Release Procedure): Recommend a secure automake.
866
867 2009-12-29 Joel E. Denny <jdenny@clemson.edu>
868
869 portability: `<' and `>' are not always defined on addresses.
870 Specifically, don't sort objects by their memory addresses when
871 they're not allocated in the same array or other object. Though
872 I haven't found a test case where that fails on my platform, C
873 says the behavior is undefined.
874 * src/AnnotationList.c (AnnotationList__insertInto): Remove
875 FIXME. Use new id field of InadequacyList nodes rather than
876 their memory addresses when sorting.
877 (AnnotationList__compute_from_inadequacies): Add
878 inadequacy_list_node_count argument to pass to
879 InadequacyList__new_conflict.
880 * src/AnnotationList.h
881 (AnnotationList__compute_from_inadequacies): Update prototype
882 and documentation for new argument.
883 * src/InadequacyList.c (InadequacyList__new_conflict): Add
884 node_count argument and use it to assign a unique ID.
885 * src/InadequacyList.h (InadequacyListNodeCount): New typedef.
886 (InadequacyList): Add id field.
887 (InadequacyList__new_conflict): Update prototype and
888 documentation for new argument.
889 * src/ielr.c (ielr_compute_annotation_lists): Update
890 AnnotationList__compute_from_inadequacies invocation.
891
892 2009-12-20 Joel E. Denny <jdenny@clemson.edu>
893
894 Fix handling of yychar manipulation in user semantic actions.
895 The problem was that yacc.c didn't always update the yychar
896 translation afterwards. However, other skeletons appear to be
897 fine. glr.c appears to already translate yychar before every
898 use. lalr1.cc does not define yychar and does not document its
899 replacement, yyla, for users. It does provide yyclearin, but
900 that does not manipulate yyla and thus requires no translation
901 update. In lalr1.java, yychar is out of scope during semantic
902 actions.
903 * NEWS (2.5): Document.
904 * data/yacc.c (YYBACKUP): Don't bother translating yychar into
905 yytoken here.
906 (yyparse, yypush_parse): Instead, translate before every use of
907 yytoken, and add comments explaining this approach.
908 * tests/actions.at (Destroying lookahead assigned by semantic
909 action): New test group checking that translation happens before
910 lookahead destructor calls at parser return. Previously,
911 incorrect destructors were called.
912 * tests/conflicts.at (parse.error=verbose and consistent
913 errors): New test group checking that translation happens at
914 syntax error detection before the associated verbose error
915 message and the associated lookahead destructor calls. While
916 the destructor call is fixed by this patch, the verbose error
917 message is currently incorrect due to another bug (see
918 comments in test group), so this is an expected failure for now.
919
920 2009-12-21 Joel E. Denny <jdenny@clemson.edu>
921
922 YYFAIL: warn about uses and remove from lalr1.java.
923 * NEWS (2.5): Document.
924 * data/lalr1.java (YYParser::YYFAIL): Rename to YYERRLAB,
925 and make it private. Update all uses.
926 * src/scan-code.l (SC_RULE_ACTION): Implement warning.
927
928 2009-12-21 Joel E. Denny <jdenny@clemson.edu>
929
930 YYFAIL: deprecate.
931 * NEWS (2.4.2): Document deprecation and the phase-out plan.
932 * data/lalr1.java (YYParser::YYFAIL): Add comment about
933 deprecation.
934 * data/yacc.c (YYFAIL): Likewise, and suppress warnings about
935 YYFAIL from GCC cpp's -Wunused-macros.
936 * doc/bison.texinfo (Java Action Features): Remove YYFAIL
937 documentation.
938 (LocalWords): Remove YYFAIL.
939
940 2009-12-20 Joel E. Denny <jdenny@clemson.edu>
941
942 tests: cleanup.
943 * tests/c++.at (Syntax error discarding no lookahead): Don't
944 ignore stderr. Instead, eliminate remaining warnings.
945
946 2009-12-18 Joel E. Denny <jdenny@clemson.edu>
947
948 lalr1.cc: don't discard non-existent lookahead on syntax error.
949 * data/lalr1.cc (yy::parser::parse): Check yyempty first.
950 * tests/c++.at (Syntax error discarding no lookahead): New test
951 group.
952
953 2009-12-17 Joel E. Denny <jdenny@clemson.edu>
954
955 Code cleanup.
956 * src/symtab.c, src/symtab.h (symbol_class_get_string): Remove
957 function, which is no longer used.
958
959 2009-12-16 Joel E. Denny <jdenny@clemson.edu>
960
961 Add gcc's -Wundef to test suite and fix another warning from it.
962 * NEWS (2.4.2): Update description of -Wundef fix.
963 * configure.ac (WARN_CXXFLAGS_TEST): New substitution.
964 (WARN_CFLAGS_TEST): New substitution.
965 * data/glr.c: Avoid warning about __STRICT_ANSI__.
966 * tests/atlocal.in (CFLAGS): Use WARN_CFLAGS_TEST instead of
967 WARN_CFLAGS.
968 (NO_WERROR_CFLAGS): Likewise.
969 (CXXFLAGS): Use WARN_CXXFLAGS_TEST instead of WARN_CXXFLAGS.
970
971 2009-12-16 Joel E. Denny <jdenny@clemson.edu>
972
973 * data/yacc.c: Reformat m4 a little.
974
975 2009-12-16 Joel E. Denny <jdenny@clemson.edu>
976
977 Document gcc -Wundef fix.
978 * NEWS (2.4.2): Here.
979 * THANKS (Jonathan Nieder): Add.
980
981 2009-12-15 Jonathan Nieder <jrnieder@gmail.com> (tiny change)
982
983 Simplify y.tab.c when location tracking is disabled.
984 * data/yacc.c: Do not check YYLTYPE_IS_TRIVIAL if location
985 tracking is not enabled. Instead, unconditionally define
986 YY_LOCATION_PRINT as a no-op for backward compatibility.
987
988 2009-12-15 Jonathan Nieder <jrnieder@gmail.com> (tiny change)
989
990 Avoid warnings from gcc -Wundef y.tab.c.
991 * data/glr.c: Check if YYENABLE_NLS and YYLTYPE_IS_TRIVIAL are
992 defined before using them.
993 * data/lalr1.cc: Likewise.
994 * data/yacc.c: Likewise.
995
996 2009-12-15 Joel E. Denny <jdenny@clemson.edu>
997
998 autoconf: update to latest for fix of M4 detection.
999 Reported by Eric Blake.
1000 * submodules/autoconf: Update.
1001
1002 2009-12-15 Joel E. Denny <jdenny@clemson.edu>
1003
1004 portability: use -DGNULIB_POSIXCHECK.
1005 Reported by Eric Blake. See discussions at
1006 <http://lists.gnu.org/archive/html/bug-bison/2009-09/msg00008.html>
1007 and
1008 <http://lists.gnu.org/archive/html/bug-gnulib/2009-10/msg00108.html>.
1009 * HACKING (Release checks): Suggest -DGNULIB_POSIXCHECK.
1010 * bootstrap.conf (gnulib_modules): Add all the printf modules
1011 suggested by -DGNULIB_POSIXCHECK. Add realloc-posix as
1012 suggested by -DGNULIB_POSIXCHECK for gnulib's own vasnprintf.c.
1013 (excluded_files): Remove m4/printf-posix.m4.
1014 * tests/atlocal.in (LIBS): As for LDADD in src/local.mk, add
1015 lib/libbison.a so gnulib libraries can be linked.
1016
1017 2009-12-15 Joel E. Denny <jdenny@clemson.edu>
1018
1019 gnulib: update for fix of fprintf-posix, which we'll use soon.
1020 * etc/prefix-gnulib-mk (prefix): Adjust regex for make file
1021 targets so that gnulib's new arg-nonnull.h and link-warning.h
1022 are matched.
1023 * gnulib: Update.
1024
1025 2009-12-14 Joel E. Denny <jdenny@clemson.edu>
1026
1027 Enable assertion output and --disable-assert for configure.
1028 * bootstrap.conf (gnulib_modules): Add assert module.
1029 * src/system.h (aver): Define as assert, and summarize the
1030 discussion on this issue.
1031
1032 2009-12-14 Joel E. Denny <jdenny@clemson.edu>
1033
1034 Expand GLR acronym in summary of Bison.
1035 Based on discussion with Akim Demaille starting at
1036 <http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00087.html>.
1037 * doc/bison.texinfo (Introduction): Here.
1038 * src/getargs.c (usage): Here.
1039
1040 2009-10-03 Alex Rozenman <rozenman@gmail.com>
1041
1042 Document named references.
1043 * doc/bison.texinfo (Actions): Add new example and xref to
1044 Using Named References node.
1045 (Using Named References): New node.
1046
1047 2009-10-16 Joel E. Denny <jdenny@clemson.edu>
1048
1049 cleanup.
1050 * src/Sbitset.c (Sbitset__new_on_obstack): Use Sbitset instead
1051 of char*.
1052 (Sbitset__isEmpty): Use Sbitset instead of char*.
1053 * src/Sbitset.h (Sbitset): Make it a pointer to unsigned char
1054 instead of char. This helps to avoid casting errors.
1055 (Sbitset__or): Use Sbitset instead of char*.
1056
1057 2009-10-16 Joel E. Denny <jdenny@clemson.edu>
1058
1059 portability: don't assume 8-bit bytes.
1060 That is, use CHAR_BIT and UCHAR_MAX instead of 8 and 0xff.
1061 * src/Sbitset.h (Sbitset__nbytes): Here.
1062 (Sbitset__byteAddress): Here.
1063 (Sbitset__bit_mask): Here.
1064 (Sbitset__last_byte_mask): Here.
1065 (Sbitset__ones): Here.
1066 (SBITSET__FOR_EACH): Here.
1067
1068 2009-10-11 Joel E. Denny <jdenny@clemson.edu>
1069
1070 portability: use va_start and va_end in the same function.
1071 * src/complain.c (error_message): Move va_end from here...
1072 (ERROR_MESSAGE): ... to here.
1073
1074 2009-10-08 Joel E. Denny <jdenny@clemson.edu>
1075
1076 * data/bison.m4: Update comments for rename to muscle-tab.h.
1077
1078 2009-10-07 Joel E. Denny <jdenny@clemson.edu>
1079
1080 Minor code cleanup.
1081 * src/muscle-tab.c (MUSCLE_USER_NAME_CONVERT): Remove macro and
1082 replace all uses with UNIQSTR_CONCAT.
1083 * src/uniqstr.c (uniqstr_vsprintf): New function.
1084 * src/uniqstr.h (uniqstr_vsprintf): Add prototype.
1085 (UNIQSTR_CONCAT, UNIQSTR_GEN_FORMAT, UNIQSTR_GEN_FORMAT_): New
1086 macros.
1087
1088 2009-10-06 Joel E. Denny <jdenny@clemson.edu>
1089
1090 * TODO (Complaint submessage indentation): New.
1091
1092 2009-10-04 Joel E. Denny <jdenny@clemson.edu>
1093
1094 Minor code cleanup.
1095 * src/parse-gram.y: Clean up sorting of declarations.
1096 Use types to simplify %printer declarations where possible.
1097 Provide %printer for BRACKETED_ID and symbol.prec.
1098 * src/symtab.c: Whitespace change.
1099
1100 2009-10-04 Joel E. Denny <jdenny@clemson.edu>
1101
1102 tests: skip tests of file names that platform does not support.
1103 Reported by Michael Raskin at
1104 <http://lists.gnu.org/archive/html/bug-bison/2009-09/msg00001.html>.
1105 * THANKS (Michael Raskin): Add.
1106 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Fix. Cygwin used
1107 to fail at least for file names containing ":" or "\".
1108
1109 2009-09-23 Joel E. Denny <jdenny@clemson.edu>
1110
1111 yysyntax_error: avoid duplicate lookahead collection.
1112 Except when memory reallocation is required, this change
1113 eliminates the need to invoke yysyntax_error twice and thus to
1114 repeat the collection of lookaheads. It also prepares for
1115 future extensions that will make those repetitions more
1116 expensive and that will require additional memory management in
1117 yysyntax_error. Finally, it fixes an obscure bug already
1118 exercised in the test suite.
1119 * data/yacc.c (yysyntax_error): Add arguments for message
1120 buffer variables stored in the parser. Instead of size, return
1121 status similar to yyparse status but indicating success of
1122 message creation. Other than the actual reallocation of the
1123 message buffer, import and clean up memory management code
1124 from...
1125 (yyparse, yypush_parse): ... here.
1126 * tests/regression.at (parse.error=verbose overflow): No longer
1127 an expected failure.
1128
1129 2009-09-23 Joel E. Denny <jdenny@clemson.edu>
1130
1131 yysyntax_error: test memory management more.
1132 * tests/atlocal.in (NO_WERROR_CFLAGS): New cpp macro.
1133 * tests/regression.at (parse.error=verbose and
1134 YYSTACK_USE_ALLOCA): New test group.
1135 (parse.error=verbose overflow): New test group that reveals an
1136 obscure bug. Expected fail for now.
1137
1138 2009-10-04 Joel E. Denny <jdenny@clemson.edu>
1139
1140 benchmarks: use %debug consistently among grammars.
1141 * etc/bench.pl.in (generate_grammar_triangular): Do not activate
1142 %debug by default. It can affect the timings even if yydebug=0.
1143 (generate_grammar_calc): For consistency with other grammars,
1144 use YYDEBUG environment variable to set yydebug.
1145
1146 2009-10-03 Joel E. Denny <jdenny@clemson.edu>
1147
1148 Remove dead code.
1149 * src/symtab.c (symbol_pack): Here because every symbol's number
1150 is always defined by this time.
1151
1152 2009-10-03 Alex Rozenman <rozenman@gmail.com>
1153
1154 Add additional space after periods in NEWS.
1155 * NEWS (2.5): here.
1156
1157 2009-09-29 Joel E. Denny <jdenny@clemson.edu>
1158
1159 Use the correct conversion specifier for size_t.
1160 Reported by Jim Meyering.
1161 * src/Sbitset.h (SBITSET__INDEX__CONVERSION_SPEC): New, "zu"
1162 because Sbitset__Index is size_t.
1163 * src/Sbitset.c (Sbitset__fprint): Use it instead of %d.
1164
1165 2009-09-27 Joel E. Denny <jdenny@clemson.edu>
1166
1167 tests: don't abuse AT_BISON_CHECK.
1168 * tests/regression.at (parse-gram.y: LALR = IELR): Move
1169 additional shell commands outside of AT_BISON_CHECK.
1170
1171 2009-09-26 Joel E. Denny <jdenny@clemson.edu>
1172
1173 tests: check that parse-gram.y's IELR and LALR are identical.
1174 * tests/atlocal.in (abs_top_srcdir): New shell variable.
1175 * tests/regression.at (parse-gram.y: LALR = IELR): New test
1176 group.
1177
1178 2009-09-19 Alex Rozenman <rozenman@gmail.com>
1179
1180 Keep sub-messages aligned. Fix strings for translation.
1181 * src/location.h (location_print): Add return value.
1182 * src/location.c (location_print): Return number of printed
1183 characters.
1184 * src/complain.h (complain_at_indent, warn_at_indent): Prototype
1185 new functions.
1186 * src/complain.cpp (indent_ptr): New static variable.
1187 (error_message, complain_at_indent, warn_at_indent): Implement
1188 the alignment mechanism.
1189 * src/scan-code.l (parse_ref, show_sub_messages): Fix strings
1190 for translations. Use new alignment mechanism.
1191 * tests/named-ref.at: Adjust test-cases.
1192 * NEWS (2.5): Add an announcement about named references.
1193
1194 2009-09-17 Akim Demaille <demaille@gostai.com>
1195
1196 doc: fixes.
1197 * doc/bison.texinfo: here.
1198 Reported by Alex Rozenman.
1199
1200 2009-09-16 Akim Demaille <demaille@gostai.com>
1201
1202 doc: lalr1.cc and variants.
1203 * doc/bison.texinfo (Decl Summary): Document the "lex_symbol" and
1204 "variant" %define variables.
1205 (C++ Semantic Values): Split into...
1206 (C++ Unions, C++ Variants): these.
1207 The latter is new.
1208 (C++ Parser Interface): Fix type names.
1209 Document parser::syntax_error.
1210 Document the fact that locations are not mandatory.
1211 (C++ Scanner Interface): Split into...
1212 (Split Symbols, Complete Symbols): these.
1213 The later is new.
1214 (Calc++ Parsing Driver): Use variants.
1215 Add more comments.
1216 Adjust style.
1217 (Calc++ Parser): Declare all the tokens, no
1218 longer accept raw characters.
1219 Remove %union.
1220 Adjust types and printers.
1221 Remove destructors.
1222 (Calc++ Scanner): Use make_<SYMBOL> functions.
1223 Use strerror in error message.
1224
1225 2009-09-16 Akim Demaille <demaille@gostai.com>
1226
1227 doc: spell checking.
1228 * doc/bison.texinfo: here.
1229
1230 2009-09-16 Akim Demaille <demaille@gostai.com>
1231
1232 doc: comment changes.
1233 * doc/bison.texinfo: Comment changes.
1234
1235 2009-09-16 Akim Demaille <demaille@gostai.com>
1236
1237 lalr1.cc: factor the yytranslate_ invocation in make_SYMBOLS.
1238 * data/c++.m4, data/lalr1.cc (parser::symbol_type): Change the
1239 constructor to take a token_type instead of the (internal) symbol
1240 number.
1241 Call yytranslate_.
1242 * data/variant.hh (b4_symbol_constructor_define_): Therefore,
1243 don't call yytranslate_ here.
1244
1245 2009-09-16 Akim Demaille <demaille@gostai.com>
1246
1247 TODO: statistics.
1248 * TODO (Figures): New.
1249
1250 2009-09-13 Joel E. Denny <jdenny@clemson.edu>
1251
1252 tests: clean up push.at test group titles.
1253 * tests/push.at: Remove "Push Parsing: " from test group titles
1254 because these are already under the banner "Push Parsing Tests".
1255
1256 2009-09-12 Alex Rozenman <rozenman@gmail.com>
1257
1258 Provide an additional sub-message for clarity.
1259 Add "symbol not found in production" error message when
1260 an "invalid reference" is detected in named references
1261 resolution.
1262 * src/scan-code.l: Update "invalid reference" case.
1263 * tests/named-ref.at: Adjust test-cases.
1264
1265 2009-09-10 Joel E. Denny <jdenny@clemson.edu>
1266
1267 Clean up yacc.c a little.
1268 * data/yacc.c: Clean up M4 for readability, and make output
1269 whitespace more consistent. For the main parse function
1270 comment, instead of saying "yyparse or yypush_parse", say either
1271 "yyparse" or "yypush_parse" depending on which it actually is.
1272
1273 2009-09-10 Joel E. Denny <jdenny@clemson.edu>
1274
1275 Fix --enable-gcc-warnings.
1276 * src/parse-gram.y (%printer <param>): Handle param_none.
1277
1278 2009-09-09 Akim Demaille <demaille@gostai.com>
1279
1280 lalr1.cc: syntax_error as exceptions.
1281 It is common to use sort of factories in the user actions. These
1282 factories may check some "syntactic" constraints that are not
1283 enforced by the grammar itself. This is possible using YYERROR
1284 within the action itself. Provide the user with a means to throw
1285 a syntax_error exception.
1286
1287 * data/c++.m4 (b4_public_types_declare, b4_public_types_define):
1288 Declare and define yy::parser::syntax_error.
1289 * data/lalr1.cc: Include stdexcept.
1290 (yy::parser::parse): Wrap the user action within a try/catch.
1291 * data/glr.cc: Include stdexcept.
1292
1293 2009-09-09 Akim Demaille <demaille@gostai.com>
1294
1295 lalr1.cc: add missing "inline".
1296 * data/c++.m4 (b4_public_types_define): Add missing inline to
1297 implementations provided in headers.
1298
1299 2009-09-09 Akim Demaille <demaille@gostai.com>
1300
1301 %param: documentation.
1302 * NEWS (2.6): Document %param, %lex-param, and %parse-param
1303 changes.
1304 * doc/bison.texinfo: Document that %lex-param and %parse-param
1305 are n-ary.
1306 Changes some examples to demonstrate it.
1307 (Calc++ Parser): Use %param.
1308
1309 2009-09-09 Akim Demaille <demaille@gostai.com>
1310
1311 Regen.
1312
1313 2009-09-09 Akim Demaille <demaille@gostai.com>
1314
1315 style changes.
1316 * src/parse-gram.y (add_param): Scope changes.
1317
1318 2009-09-09 Akim Demaille <demaille@gostai.com>
1319
1320 %parse: support several arguments.
1321 * src/parse-gram.y (current_param): New.
1322 (param_type): Add param_none.
1323 (params): New nonterminal.
1324 Use it.
1325
1326 2009-09-09 Akim Demaille <demaille@gostai.com>
1327
1328 Regen.
1329
1330 2009-09-09 Akim Demaille <demaille@gostai.com>
1331
1332 %param.
1333 Provide a means to factor lex-param and parse-param common
1334 declarations.
1335
1336 * src/parse-gram.y (param_type): New.
1337 Define a %printer for it.
1338 (add_param): Use it.
1339 (%parse-param, %lex-param): Merge into...
1340 (%parse): this new token.
1341 Adjust the grammar to use it.
1342 * src/scan-gram.l (RETURN_VALUE): New.
1343 (RETURN_PERCENT_FLAG): Use it.
1344 (RETURN_PERCENT_PARAM): New.
1345 Use it to support %parse-param, %lex-param and %param.
1346
1347 2009-09-03 Joel E. Denny <jdenny@clemson.edu>
1348
1349 Use aver not assert.
1350 * src/output.c: Don't include assert.h.
1351 (output_skeleton): Use aver not assert.
1352 * src/system.h (aver): In documentation of why, add links to
1353 Paul Eggert's explanations in the mailing lists.
1354
1355 2009-09-05 Alex Rozenman <rozenman@gmail.com>
1356
1357 Use "Unresolved reference" error message when no symbols were found
1358 in a symbolic reference resolution. Remove .expr and -expr from
1359 the shown reference when the reference is unresolved.
1360 * src/scan-code.l: Change the error message, adjust location columns,
1361 rename variable "exact_mode" to "explicit_bracketing".
1362 * tests/named-ref.at: Adjust existing tests and add a new one.
1363
1364 2009-09-04 Akim Demaille <demaille@gostai.com>
1365
1366 Adjust synclines in src/parse-gram.[ch].
1367 * tests/bison.in: Do some magic (including working around issues
1368 with ylwrap) when this wrapper is used to compile
1369 src/parse-gram.y.
1370
1371 2009-09-03 Joel E. Denny <jdenny@clemson.edu>
1372
1373 Complain about unused %define variables and %code qualifiers.
1374 * NEWS (2.5): Document.
1375 * data/bison.m4 (b4_check_user_names): Complain instead of warn.
1376 * doc/bison.texinfo (Decl Summary): Document complaint, and
1377 improve %define documentation a little otherwise.
1378 * tests/input.at (Reject unused %code qualifiers): Update.
1379 (%define errors): Update.
1380 (%define, --define, --force-define): Update.
1381 (%define backward compatibility): Update.
1382 (Unused %define api.pure): Update.
1383 * tests/push.at (Push Parsing: Unsupported Skeletons): Update.
1384
1385 2009-09-03 Joel E. Denny <jdenny@clemson.edu>
1386
1387 Don't suppress warnings about unused parse.error.
1388 * data/bison.m4 (b4_error_verbose_flag): Don't examine value of
1389 %define variable parse.error unless b4_error_verbose_flag is
1390 actually expanded in a skeleton.
1391
1392 2009-09-03 Akim Demaille <demaille@gostai.com>
1393
1394 * NEWS (2.4.2): Add "Internationalization" item.
1395
1396 2009-09-03 Akim Demaille <demaille@gostai.com>
1397
1398 bootstrap: fix/improve find_tool.
1399 * bootstrap (find_tool): Improve error messages.
1400 Fix typo about find_tool_names.
1401
1402 2009-08-29 Joel E. Denny <jdenny@clemson.edu>
1403
1404 Fix gcc 3.4.4 shadowing warning reported by Eric Blake.
1405 See
1406 <http://lists.gnu.org/archive/html/bison-patches/2009-08/msg00093.html>.
1407 * src/scan-code.h (code_props_rule_action_init): Rename
1408 named_ref arg to name so it doesn't shadow named_ref type. This
1409 makes it consistent with the function definition in scan-code.l
1410 anyway.
1411
1412 2009-08-28 Joel E. Denny <jdenny@clemson.edu>
1413
1414 %define: accept unquoted values.
1415 * NEWS (2.5): Group all %define changes together, and document
1416 this one. Remove quotes in IELR and canonical LR entry.
1417 * doc/bison.texinfo: Remove quotes in most examples throughout.
1418 (Decl Summary): Update %define documentation.
1419 (Table of Symbols): Likewise.
1420 * src/ielr.c (LrType): Update documentation.
1421 * src/parse-gram.y (content.opt): Add production for ID.
1422 * tests/actions.at: Remove quotes in most tests.
1423 * tests/calc.at: Likewise.
1424 * tests/existing.at: Likewise.
1425 * tests/input.at: Likewise.
1426 * tests/local.at: Likewise.
1427 * tests/push.at: Likewise.
1428 * tests/reduce.at: Likewise.
1429 * tests/torture.at: Likewise.
1430
1431 2009-08-28 Joel E. Denny <jdenny@clemson.edu>
1432
1433 %define lr.type: make values lowercase IDs.
1434 That is, "LALR" => "lalr", "IELR" => "ielr", and
1435 "canonical LR" => "canonical-lr".
1436 * NEWS (2.5): Update documentation.
1437 * doc/bison.texinfo (Decl Summary): Likewise.
1438 * src/ielr.c (ielr): Use new values.
1439 * src/ielr.h (ielr): Update documentation.
1440 * src/reader.c (prepare_percent_define_front_end_variables): Use
1441 and validate new values.
1442 * tests/existing.at (AT_TEST_EXISTING_GRAMMAR): Update test
1443 grammars.
1444 * tests/reduce.at (AT_TEST_LR_TYPE): Likewise.
1445
1446 2009-08-27 Eric Blake <ebb9@byu.net>
1447
1448 scan-gram: avoid portability trap with ctype usage.
1449 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
1450 Avoid compiler warning.
1451
1452 2009-08-27 Joel E. Denny <jdenny@clemson.edu>
1453
1454 tests: use perl for printing special sequences to files.
1455 And skip tests if perl is not available. This is better than
1456 playing tricks with shell portability. Suggested by Akim
1457 Demaille.
1458 * tests/input.at (Bad character literals): Use it here for
1459 omitting final newlines.
1460 (Bad escapes in literals): Use it here for special characters.
1461
1462 2009-08-26 Joel E. Denny <jdenny@clemson.edu>
1463
1464 tests: show a use of %define lr.default-reductions "consistent"
1465 * tests/conflicts.at (%nonassoc and eof): Extend to test that it
1466 prevents the omission of expected tokens for %error-verbose.
1467
1468 2009-08-26 Akim Demaille <demaille@gostai.com>
1469
1470 tests: portability fix.
1471 * tests/input.at (Bad escapes in literals): Don't expect "echo
1472 '\0'" to output \ then 0.
1473
1474 2009-08-26 Joel E. Denny <jdenny@clemson.edu>
1475
1476 Actually handle the yytable zero value correctly this time.
1477 * data/bison.m4 (b4_integral_parser_tables_map): Don't mention
1478 zero values in the YYTABLE comments.
1479 * data/glr.c (yytable_value_is_error): Don't check for zero
1480 value.
1481 * data/lalr1.cc (yy_table_value_is_error_): Likewise.
1482 * data/yacc.c (yytable_value_is_error): Likewise.
1483 * data/lalr1.java (yy_table_value_is_error_): Likewise.
1484 (yysyntax_error): Fix typo in code: use yytable_ not yycheck_.
1485 * src/tables.h: In header comments, explain why it's useless to
1486 check for a zero value in yytable.
1487
1488 2009-08-25 Joel E. Denny <jdenny@clemson.edu>
1489
1490 More fixes related to last two patches.
1491 * data/bison.m4 (b4_integral_parser_tables_map): Fix YYTABLE
1492 comments: zero indicates syntax error not default action.
1493 * data/c.m4 (b4_table_value_equals): Comment that YYID must be
1494 defined.
1495 * data/glr.c (yyis_pact_ninf): Rename to...
1496 (yypact_value_is_default): ... this.
1497 (yyisDefaultedState): Update for rename.
1498 (yyis_table_ninf): Rename to...
1499 (yytable_value_is_error): ... this, and check for value zero
1500 besides just YYTABLE_NINF.
1501 (yygetLRActions): Check for default value from yypact. It
1502 appears that this check is always performed before this function
1503 is invoked, and so adding the check here is probably redundant.
1504 However, the code may evolve after this subtlety is forgotten.
1505 Also, update for rename to yytable_value_is_error. Because that
1506 macro now checks for zero, a different but equivalent branch of
1507 the if-then-else here is evaluated.
1508 (yyreportSyntaxError): Update for rename to
1509 yytable_value_is_error. The zero condition was mishandled
1510 before.
1511 (yyrecoverSyntaxError): Update for renames. No behavioral
1512 changes.
1513 * data/lalr1.cc, data/lalr1.java (yy_pact_value_is_default_):
1514 New function.
1515 (yy_table_value_is_error_): New function.
1516 (parse): Use new functions where possible. No behavioral
1517 changes.
1518 (yysyntax_error_, yysyntax_error): Use yy_table_value_is_error_.
1519 The zero condition was mishandled before.
1520 * data/yacc.c (yyis_pact_ninf): Rename to...
1521 (yypact_value_is_default): ... this.
1522 (yyis_table_ninf): Rename to...
1523 (yytable_value_is_error): ... this, and check for value zero
1524 besides just YYTABLE_NINF.
1525 (yysyntax_error): Update for rename to yytable_value_is_error.
1526 The zero condition was mishandled before.
1527 (yyparse): Update for renames. No behavioral changes.
1528 * src/tables.h: Improve comments about yypact, yytable, etc.
1529 more. Most importantly, say yytable value of zero means syntax
1530 error not default action.
1531
1532 2009-08-25 Joel E. Denny <jdenny@clemson.edu>
1533
1534 Fix %error-verbose for conflicts resolved by %nonassoc.
1535 * NEWS (2.5): Document.
1536 * data/glr.c (yyreportSyntaxError): Fix this by checking
1537 yyis_table_ninf.
1538 * data/yacc.c (yysyntax_error): Likewise.
1539 * data/lalr1.cc (yysyntax_error_): Fix this by checking
1540 yytable_ninf_.
1541 * data/lalr1.java (yysyntax_error): Likewise.
1542 * tests/conflicts.at (%nonassoc and eof): Update expected output
1543 and remove FIXME.
1544
1545 2009-08-25 Joel E. Denny <jdenny@clemson.edu>
1546
1547 Some code and documentation improvements.
1548 * data/c.m4 (b4_table_value_equals): New macro to capture
1549 some repeated code.
1550 * data/glr.c (yyis_pact_ninf): Use it here.
1551 (yyis_table_ninf): Likewise.
1552 (yyreportSyntaxError): Improve internal comments.
1553 * data/yacc.c (yyis_pact_ninf): New macro copied from glr.c.
1554 Use it everywhere possible.
1555 (yyis_table_ninf): Likewise.
1556 (yysyntax_error): Improve internal comments.
1557 * data/lalr1.cc (yysyntax_error_): Likewise.
1558 * data/lalr1.java (yysyntax_error): Likewise.
1559 * src/tables.h: Improve comments about yypact, yytable, etc.
1560
1561 2009-08-21 Joel E. Denny <jdenny@clemson.edu>
1562
1563 Use locale when quoting.
1564 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER): Use
1565 quote rather than implementing quoting here.
1566
1567 2009-08-20 Eric Blake <ebb9@byu.net>
1568
1569 Make previous patch more robust.
1570 * src/output.c (ARRAY_CARDINALITY): New macro, copied from
1571 argmatch.h.
1572 (output_skeleton): Use it.
1573 Suggested by Akim Demaille.
1574
1575 Import latest m4/m4.m4.
1576 * submodules/autoconf: Update to autoconf 2.64.
1577 * configure.ac (M4_GNU_OPTION): New define.
1578 * src/output.c (output_skeleton): Use it to resolve FIXME.
1579 * NEWS: Mention this.
1580
1581 2009-08-19 Joel E. Denny <jdenny@clemson.edu>
1582
1583 Fix complaints about escape sequences.
1584 Discussed starting at
1585 <http://lists.gnu.org/archive/html/bison-patches/2009-08/msg00036.html>.
1586 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER):
1587 For a \0 and similar escape sequences meaning the null
1588 character, report an invalid escape sequence instead of an
1589 invalid null character because the latter does not actually
1590 appear in the user's input.
1591 In all escape sequence complaints, don't escape the initial
1592 backslash, and don't quote when the sequence appears at the end
1593 of the complaint line unless there's whitespace that quotearg
1594 won't escape.
1595 Consistently say "invalid" not "unrecognized".
1596 Consistently prefer "empty character literal" over "extra
1597 characters in character literal" warning for invalid escape
1598 sequences; that is, consistently discard those sequences.
1599 * tests/input.at (Bad escapes in literals): New.
1600
1601 2009-08-19 Akim Demaille <demaille@gostai.com>
1602
1603 doc: fixes.
1604 * doc/bison.texinfo: Fix minor Texinfo errors.
1605
1606 2009-08-19 Akim Demaille <demaille@gostai.com>
1607
1608 tests: distcc compliance.
1609 * tests/synclines.at (AT_SYNCLINES_COMPILE): Discard distcc's
1610 error messages from the output.
1611
1612 2009-08-19 Akim Demaille <demaille@gostai.com>
1613
1614 variables: simplify the upgrade of namespace into api.namespace.
1615
1616 This patch simplifies "variables: rename namespace as
1617 api.namespace", commit 67501061076ba46355cfd9f9361c7eed861b389c.
1618 Suggested by Joel E. Denny in
1619 http://lists.gnu.org/archive/html/bison-patches/2009-07/msg00006.html
1620
1621 * src/muscle-tab.c (muscle_percent_variable_update): New.
1622 (muscle_percent_define_insert): Use it in replacement of the
1623 previous tr invocation.
1624 Remove variable_tr, no longer needed.
1625 * data/bison.m4 (b4_percent_define_copy_, b4_percent_define_copy):
1626 Remove.
1627 * data/c++.m4: No longer handle namespace -> api.namespace.
1628 * tests/input.at (%define backward compatibility): Check that
1629 namespace is treated as api.namespace.
1630
1631 2009-08-19 Akim Demaille <demaille@gostai.com>
1632
1633 doc: %initial-action to initialize yylloc.
1634 Reported by Bill Allombert.
1635 * doc/bison.texinfo: Set fill-column to 76.
1636 (Location Type): Document the use of %initial-action to initialize
1637 yylloc.
1638
1639 2009-08-19 Akim Demaille <demaille@gostai.com>
1640
1641 lalr1.cc: use state_type.
1642 * data/lalr1.cc (yysyntax_error_): Use state_type.
1643 Move argument names into yy*.
1644
1645 2009-08-19 Akim Demaille <demaille@gostai.com>
1646
1647 lalr1.cc: get rid of yyparse's yystate.
1648 yystate and yystack_[0].state are equal, keep only the latter.
1649 The former was also used as a temporary variable to compute the
1650 post-reduction state. Move this computation into an auxiliary
1651 function.
1652
1653 * data/glr.c (yyLRgotoState): Fuse variable definition and first
1654 assignment.
1655 * data/lalr1.cc (yy_lr_goto_state_): New.
1656 (yyparse): Use it.
1657 Replace remaining uses of yystate by yystate_[0].state.
1658 Remove the former.
1659
1660 2009-08-19 Akim Demaille <demaille@gostai.com>
1661
1662 lalr1.cc: destroy $$ when YYERROR is called.
1663 * data/lalr1.cc (yyreduce): Compute the resulting state before
1664 running the user action so that yylhs is a valid symbol.
1665 (yyerrorlab): Since yylhs is complete (it knows its type), we can
1666 simply call yy_destroy_ to destroy $$ on YYERROR invocations.
1667 * tests/c++.at (AT_CHECK_VARIANTS): Test YYERROR with variants.
1668
1669 2009-08-18 Joel E. Denny <jdenny@clemson.edu>
1670
1671 maint: update for gnulib's recent update-copyright changes
1672 * gnulib: Update.
1673 * .x-update-copyright (COPYING): Add as it's no longer implied
1674 when .x-update-copyright is present.
1675 * cfg.mk (update-copyright-local): Remove, now ignored.
1676 (update-copyright): Declare update-b4-copyright as a dependency.
1677
1678 2009-08-17 Akim Demaille <demaille@gostai.com>
1679
1680 build: require gettext 0.17.
1681
1682 Suggested by Bruno Haible.
1683 http://lists.gnu.org/archive/html/bug-bison/2009-08/msg00009.html
1684 * configure.ac: require gettext 0.17 to ensure compatibility with
1685 gnulib.
1686
1687 2009-08-17 Akim Demaille <demaille@gostai.com>
1688
1689 build: lower gettext requirements.
1690
1691 Bison was uselessly requiring the formatstring macros from
1692 gettext, which resulted in mo files not being installed on systems
1693 that perfectly supported Bison mo files. Lower the requirement.
1694 http://lists.gnu.org/archive/html/bug-bison/2009-08/msg00006.html
1695
1696 * configure.ac: Require need-ngettext instead of
1697 need-formatstring-macros.
1698 Reported by Martin Jabocs.
1699 Suggested by Bruno Haible.
1700 * INSTALL: Restructure.
1701 (Internationalization): New.
1702
1703 2009-08-14 Joel E. Denny <jdenny@clemson.edu>
1704
1705 maint: fix use of copyright year intervals.
1706 * gnulib: Update.
1707 * bootstrap.conf (gnulib_modules): Update getopt to getopt-gnu
1708 as now recommended in gnulib/NEWS.
1709 * build-aux/update-b4-copyright: Fix.
1710 * cfg.mk (update-copyright-env): Configure update-copyright.
1711
1712 2009-08-13 Joel E. Denny <jdenny@clemson.edu>
1713
1714 Make it easier to write deterministic tests.
1715 Continues Akim's work from his 2009-06-10 commits.
1716 * src/reader.c (check_and_convert_grammar): Don't add any
1717 symbols after the first symbols_do invocation.
1718 * src/symtab.c (symbols_sorted): New static global.
1719 (user_token_number_redeclaration): Update comments.
1720 (symbol_from_uniqstr): If a new symbol is being created, assert
1721 that symbols_sorted hasn't been allocated yet.
1722 (symbols_free): Free symbols_sorted.
1723 (symbols_cmp, symbols_cmp_qsort): New functions.
1724 (symbols_do): Sort symbol_table into symbols_sorted on first
1725 invocation.
1726 * tests/input.at (Numbered tokens): Recombine tests now that the
1727 output should be deterministic across multiple numbers.
1728
1729 2009-08-12 Akim Demaille <demaille@gostai.com>
1730
1731 tests: GCC 4.5 compliance.
1732 * tests/synclines.at (AT_SYNCLINES_COMPILE): Adjust to GCC 4.5's
1733 messages about #error.
1734
1735 2009-08-12 Akim Demaille <demaille@gostai.com>
1736
1737 build: fix the generation of the documentation.
1738 Some of our targets use "bison --help", but they can't depend on
1739 "bison" itself (to avoid additional requirements on the user), so
1740 they used to call "make src/bison" in the commands. Then
1741 concurrent builds may fail: one make might be aiming one of its
1742 jobs at compiling src/bison, and another job at generating the man
1743 page. If the latter is faster than the former, then we have two
1744 makes that concurrently try to compile src/bison.
1745
1746 This might also be a more convincing explanation for the failure
1747 described in the patch "build: fix paths".
1748
1749 * Makefile.am (SUFFIXES): Initialize.
1750 * build-aux/move-if-change: New, symlink to gnulib's.
1751 * build-aux/local.mk: Ship it.
1752 * doc/common.x: Remove, merged into...
1753 * doc/bison.x: here.
1754 * doc/local.mk (doc/bison.help): New.
1755 ($(CROSS_OPTIONS_TEXI)): Depend on it.
1756 Use src/bison.
1757 (.x.1): Replace with...
1758 (doc/bison.1): this explicit, simpler, target.
1759 (common_dep): Remove, inlined where appropriate.
1760 (SUFFIXES, PREPATH): Remove, unused.
1761
1762 2009-08-12 Akim Demaille <demaille@gostai.com>
1763
1764 gnulib: improve prefixing.
1765 * configure.ac (gl_PREFIXED_LIBOBJS): Don't rename it, rather,
1766 change the value of...
1767 (gl_LIBOBJS): this.
1768 Adjust more variables.
1769 * etc/prefix-gnulib-mk (prefix_assignment): Don't rename
1770 gl_LIBOBJS.
1771 (prefix): Also transform rules whose targets have slashes.
1772 Use $prefix liberally.
1773 Map @MKDIR_P@ to $(MKDIR_P).
1774 Prefix directories that are mkdir'd.
1775
1776 2009-08-12 Akim Demaille <demaille@gostai.com>
1777
1778 build: fix paths.
1779 When using $(top_builddir) inconsistently, Make (including GNU
1780 Make) is sometimes confused. As a result it may want to build
1781 lib/libbison.la and $(top_builddir)/lib/libbison.la (the same
1782 file, different names) concurrently, which, amusingly enough,
1783 might end with:
1784
1785 ranlib lib/libbison.a
1786 ranlib lib/libbison.a
1787 make[2]: *** [lib/libbison.a] Segmentation fault
1788
1789 on OS X.
1790
1791 * doc/local.mk, src/local.mk: Do not use $(top_builddir) when not
1792 needed.
1793
1794 2009-08-12 Akim Demaille <demaille@gostai.com>
1795
1796 distcheck: fix.
1797
1798 * examples/calc++/Makefile.am: (EXTRA_DIST): Ship calc.stamp.
1799
1800 2009-08-10 Joel E. Denny <jdenny@clemson.edu>
1801
1802 * tests/local.mk (TESTSUITE_AT): Add named-refs.at.
1803
1804 2009-08-10 Joel E. Denny <jdenny@clemson.edu>
1805
1806 Miscellaneous code readability improvements.
1807
1808 * src/reader.c (reader): Move %define front-end variable
1809 defaults and checking into...
1810 (prepare_percent_define_front_end_variables): ... this new
1811 function.
1812
1813 * src/scan-gram.l (INITIAL): For consistency with string
1814 literals, don't store open quote on character literal. It's
1815 discarded before returning anyway.
1816 (SC_ESCAPED_CHARACTER): Similarly, don't store close quote.
1817 Make length test more readable, and make the character stored
1818 for an empty literal more obvious while consistent with the
1819 previous behavior.
1820
1821 * src/symtab.c, src/symtab.h: Rename USER_NUMBER_ALIAS to
1822 USER_NUMBER_HAS_STRING_ALIAS throughout.
1823 * src/symtab.c (symbol_make_alias): Remove comment from symtab.c
1824 that is repeated in symtab.h. Improve argument names to make it
1825 clear which side of the symbol-string alias pair is which.
1826 (symbol_check_alias_consistency): Improve local variable names
1827 for the same purpose.
1828 * src/symtab.h (struct symbol): Make comments about aliases
1829 clearer.
1830 (symbol_make_alias): Improve comments and argument name.
1831 * src/output.c (token_definitions_output): Update for rename to
1832 USER_NUMBER_HAS_STRING_ALIAS and improve comments about aliases.
1833
1834 2009-08-08 Alex Rozenman <rozenman@gmail.com>
1835
1836 Convert "misleading reference" messages to warnings.
1837 * src/scan-code.l: New function 'show_sub_messages', more
1838 factoring.
1839 * tests/named-ref.at: Adjust tests.
1840
1841 2009-08-06 Joel E. Denny <jdenny@clemson.edu>
1842
1843 maint: run "make update-copyright"
1844
1845 2009-08-06 Joel E. Denny <jdenny@clemson.edu>
1846
1847 maint: make update-b4-copyright easier to use
1848 * build-aux/update-b4-copyright: In warnings, report line
1849 numbers rather than character positions.
1850 * cfg.mk (update-copyright-local): Set to update-b4-copyright so
1851 that update-copyright runs it.
1852 * gnulib: Update.
1853
1854 2009-08-05 Joel E. Denny <jdenny@clemson.edu>
1855
1856 maint: clean up update-b4-copyright code
1857 * build-aux/update-b4-copyright: Do not accept 2-digit
1858 UPDATE_COPYRIGHT_YEAR, which was not handled correctly.
1859 Don't accept a `[' in a b4_copyright argument.
1860 Format code more consistently.
1861 Don't assume b4*copyright never occurs.
1862
1863 2009-08-04 Joel E. Denny <jdenny@clemson.edu>
1864
1865 maint: automate b4_copyright updates.
1866 * Makefile.am (update-b4-copyright): New target rule.
1867 * build-aux/local.mk (EXTRA_DIST): Add update-b4-copyright.
1868 * build-aux/update-b4-copyright: New.
1869 * data/yacc.c: Remove stray characters around b4_copyright
1870 invocations.
1871
1872 2009-08-04 Joel E. Denny <jdenny@clemson.edu>
1873
1874 maint: automate annual package-wide copyright-year update.
1875 * .x-update-copyright: New.
1876 * Makefile.am (EXTRA_DIST): Remove maint.mk.
1877 * bootstrap.conf (gnulib_modules): Add maintainer-makefile and
1878 update-copyright. Remove gnumakefile, which is implied by
1879 maintainer-makefile.
1880 * cfg.mk (bootstrap-tools): Copy from old maint.mk.
1881 * gnulib: Update.
1882 * maint.mk: Remove, now copied from gnulib.
1883 * examples/extexi: Add missing "(C)" in copyright statement so
1884 update-copyright can recognize it.
1885 * src/LR0.h: Likewise.
1886 * src/print.h: Likewise.
1887 * src/print_graph.h: Likewise.
1888 * src/gram.c: Add missing comma in copyright statement.
1889 * src/gram.h: Likewise.
1890
1891 2009-08-04 Joel E. Denny <jdenny@clemson.edu>
1892
1893 Fix "make distcheck".
1894 * examples/calc++/Makefile.am: Say $(srcdir)/calc.stamp instead
1895 of just calc.stamp.
1896
1897 2009-08-01 Joel E. Denny <jdenny@clemson.edu>
1898
1899 Pacify "gcc -Wunused" for the input function from Flex.
1900 Reported by Alex Rozenman. This warning shows up with gcc-4.3.0
1901 and later.
1902 * src/scan-code.l: Add "%option noinput", which I cannot find in
1903 the Flex manual, but which Flex has supported since at least as
1904 far back as 2.5.4. However, if any of our developers still use
1905 Flex 2.5.4, they'll need to stop configuring with
1906 --enable-gcc-warnings because "%option noinput" didn't work
1907 correctly until Flex 2.5.6.
1908 * src/scan-gram.l: Likewise.
1909 * src/scan-skel.l: Likewise.
1910
1911 2009-07-31 Alex Rozenman <rozenman@gmail.com>
1912
1913 Fix --enable-gcc-warnings problems.
1914 * src/reader.c: Adjust variable names.
1915 * src/scan-code.l: Fix prototypes and adjust names.
1916 * src/named-ref.c: Remove redundant "if".
1917
1918 2009-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
1919
1920 Fix a --enable-gcc-warnings problem.
1921 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Actually use length
1922 variable.
1923
1924 2009-07-24 Joel E. Denny <jdenny@ces.clemson.edu>
1925
1926 Warn about character literals not of length one.
1927 * NEWS (2.5): Document.
1928 * src/scan-gram.l (INITIAL): Remove comment that we don't check
1929 the length.
1930 (SC_ESCAPED_CHARACTER): Warn if length is wrong.
1931 * tests/input.at (Bad character literals): New test group.
1932
1933 2009-07-24 Alex Rozenman <rozenman@gmail.com>
1934
1935 Fix some memory leaks.
1936 * src/named-ref.c: Add a pointer check (named_ref_free).
1937 * src/scan-code.l: New function (variant_table_free). Called in
1938 code_scanner_free.
1939 * src/symlist.c: Call to named_ref_free (symbol_list_free).
1940
1941 2009-07-24 Joel E. Denny <jdenny@ces.clemson.edu>
1942
1943 * src/lalr.c (state_lookahead_tokens_count): Correct comment.
1944
1945 2009-07-22 Joel E. Denny <jdenny@ces.clemson.edu>
1946
1947 Some M4 cleanup in the testsuite.
1948 Suggested by Eric Blake at
1949 <http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00083.html>.
1950 * tests/existing.at (_AT_TEST_EXISTING_GRAMMAR): Do not
1951 complicate the code by distinguishing between a missing value
1952 and an empty string value for an optional argument. This fix is
1953 allowed by the similar fix in AT_TEST_TABLES_AND_PARSE below.
1954 * tests/local.at (_AT_TEST_TABLES_AND_PARSE): Merge into...
1955 (AT_TEST_TABLES_AND_PARSE): ... this now that the special
1956 arguments are not needed because of the following changes.
1957 Fix stale comments.
1958 Bison developers should use GNU M4 and should not use
1959 POSIXLY_CORRECT when building the test suite, so do not
1960 complicate the code by avoiding $10 and above.
1961 Do not quote an empty string value for an optional argument, and
1962 do not distinguish between a missing value and an empty string
1963 value.
1964
1965 2009-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
1966
1967 Revert unnecessary column realignment in --help output.
1968 Reported by Akim Demaille at
1969 <http://lists.gnu.org/archive/html/bison-patches/2009-06/msg00010.html>.
1970 * src/getargs.c (usage): Here.
1971
1972 2009-07-04 Alex Rozenman <rozenman@gmail.com>
1973
1974 Alphabetical order in src/local.mk.
1975 * src/local.mk: Adjust.
1976
1977 2009-07-04 Alex Rozenman <rozenman@gmail.com>
1978
1979 Style changes and factoring.
1980 * src/named-ref.h: Add comments.
1981 * src/parse-gram.y: Readability and style changes.
1982 * src/reader.c: Factoring: assign_named_ref function.
1983 * src/scan-code.l: Factoring and style changes. Rename
1984 parse_named_ref to parse_ref. Use "c-ctype.h" from gnulib.
1985 Use "unsigned" type for variant index. Improve readablity.
1986 * src/scan-gram.l: Change error messages and add comments.
1987 * src/symlist.h: symbol_list_null: New function decl.
1988 * src/symlist.c: symbol_list_null: Implement here.
1989 * tests/named-refs.at: Adjust for new error messages.
1990
1991 2009-06-29 Eric Blake <ebb9@byu.net>
1992
1993 scan-code: avoid compiler warnings
1994 * src/scan-code.l (parse_named_ref): Use correct specifiers.
1995
1996 2009-06-29 Akim Demaille <demaille@gostai.com>
1997
1998 build: avoid concurrent extraction of calc++.
1999 * examples/calc++/Makefile.am (calc.stamp): New.
2000 Depend on it to create the sources of calc++ so that concurrent
2001 builds don't launch several "extexi" in parallel.
2002 Not only this is inefficient, this also builds incorrect sources
2003 with several extractions mixed together.
2004
2005 2009-06-29 Akim Demaille <demaille@gostai.com>
2006
2007 parse.error: fix.
2008 * data/bison.m4: Move code related to specific variables after the
2009 definition of the variable-maintaining macros so that we don't
2010 "invoke" b4_percent_define_check_values before it is defined.
2011
2012 2009-06-29 Akim Demaille <demaille@gostai.com>
2013
2014 variables: parse.error
2015
2016 Implement, document, and test the replacement of %error-verbose
2017 by %define parse.error "verbose".
2018 * data/bison.m4 (b4_error_verbose_if): Reimplement to track the
2019 values of the parse.error variable.
2020 Make "simple" its default value.
2021 Check the valid values.
2022 * src/parse-gram.y: Use %define parse.error.
2023 (PERCENT_ERROR_VERBOSE): New token.
2024 Support it.
2025 * src/scan-gram.l: Support %error-verbose.
2026
2027 * doc/bison.texinfo (Decl Summary): Replace the documentation of
2028 %define error-verbose by that of %define parse.error.
2029 * NEWS: Document it.
2030
2031 * tests/actions.at, tests/calc.at: Use parse.error instead of
2032 %error-verbose.
2033
2034 2009-06-27 Alex Rozenman <rozenman@gmail.com>
2035
2036 Implement support for named symbol references.
2037 * src/parse-gram.y: Add new syntax (named_ref.opt).
2038 * src/reader.c: Store named refs in symbol lists.
2039 * src/reader.h: New argument for symbol_append and
2040 action_append functions.
2041 * src/scan-code.h: Add new field (named_ref) into
2042 code_props data structure. Keeps named ref of midrule
2043 actions.
2044 * src/scan-code.l: Support for named refs in semantic
2045 action code. New function 'parse_named_ref'.
2046 * src/scan-gram.l: Support bracketed id.
2047 * src/symlist.c: Store named refs in symbol lists.
2048 * src/symlist.h: New field in symbol list: named_ref.
2049 * src/named-ref.h: New file, a struct for named_ref.
2050 * src/named-ref.cp: New file, named_ref_new function.
2051 * src/local.mk: Add two new files.
2052 * tests/testsuite.at: Include new test group:
2053 * tests/named-refs.at: this new file.
2054
2055 2009-06-25 Akim Demaille <demaille@gostai.com>
2056
2057 hash: check insertion for memory exhaustion.
2058 * src/uniqstr.c (uniqstr_new): New.
2059
2060 2009-06-24 Akim Demaille <demaille@gostai.com>
2061
2062 variables: rename namespace as api.namespace.
2063 Discussed in
2064 http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00033.html
2065
2066 * data/bison.m4 (b4_percent_define_copy_, b4_percent_define_copy):
2067 New.
2068 (b4_percent_define_use): New.
2069 Use it where applicable.
2070 * data/c++.m4: Replace uses of the variable "namespace" by
2071 "api.namespace".
2072 Default the latter to the former.
2073 * doc/bison.texinfo (Decl Summary): Document "namespace" as
2074 obsolete.
2075 Document api.namespace.
2076 Use @samp to document %define uses, keep @code for identifiers.
2077 * NEWS: Likewise.
2078 * tests/c++.at, tests/input.at: Test api.namespace instead of
2079 namespace. (The tests passed with namespace.)
2080
2081 2009-06-11 Akim Demaille <demaille@gostai.com>
2082
2083 style changes.
2084 * data/xslt/xml2dot.xsl, data/xslt/xml2xhtml.xsl: Space changes.
2085 * src/print-xml.c: Style changes.
2086 * tests/conflicts.at: Comment changes.
2087
2088 2009-06-11 Akim Demaille <demaille@gostai.com>
2089
2090 xml: beware of user strings used to give a %prec to rules.
2091 * tests/conflicts.at (%prec with user strings): New.
2092 * src/gram.c (grammar_rules_print_xml): Escape the precedence for
2093 XML output.
2094
2095 2009-06-11 Akim Demaille <demaille@gostai.com>
2096
2097 hash: check insertion for memory exhaustion.
2098 * src/muscle-tab.c (muscle_insert, muscle_grow)
2099 * src/state.c (state_hash_insert): Check the return value of
2100 hash_insert.
2101
2102 2009-06-11 Akim Demaille <demaille@gostai.com>
2103
2104 tests: honor TESTSUITEFLAGS in every check target.
2105 * tests/local.mk (RUN_TESTSUITE): New.
2106 (check-local, installcheck-local, maintainer-check-g++)
2107 (maintainer-check-posix, maintainer-check-valgrind): Use it.
2108
2109 2009-06-10 Akim Demaille <demaille@gostai.com>
2110
2111 deterministic test suite.
2112 Some consistency checks on symbols are performed after all the
2113 symbols were read, by an iteration over the symbol table. This
2114 traversal is nondeterministic, which can be a problem for test
2115 cases.
2116 Avoid this.
2117 Addresses another form of nondeterminism reported by Joel E. Denny.
2118 http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00023.html
2119
2120 * tests/input.at (Numbered tokens): Split the hexadecimal/decimal
2121 test in two.
2122 Use different file names for the three tests to make the
2123 maintenance easier.
2124
2125 2009-06-10 Akim Demaille <demaille@gostai.com>
2126
2127 gnulib: update.
2128 * gnulib: Update to latest.
2129 * lib/.cvsignore, lib/.gitignore, m4/.cvsignore,
2130 * m4/.gitignore: Regen.
2131 * src/symtab.c (symbol_from_uniqstr, semantic_type_from_uniqstr):
2132 Call xalloc_die on hash_insert failures.
2133 Requested by the new __warn_unused_result__ attribute of
2134 hash_insert.
2135
2136 2009-06-10 Akim Demaille <demaille@gostai.com>
2137
2138 deterministic user-token-number redeclaration errors.
2139 Address nondeterminism reported by Joel E. Denny.
2140 http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00023.html
2141
2142 * src/uniqstr.h: Comment changes.
2143 * src/location.h (boundary_cmp, location_cmp): New.
2144 * src/symtab.c (user_token_number_redeclaration): New.
2145 (symbol_translation): Use it.
2146 * tests/input.at (Numbered tokens): Adjust the expected output.
2147
2148 2009-05-25 Akim Demaille <demaille@gostai.com>
2149
2150 build: avoid ignored errors.
2151 * doc/local.mk ($(CROSS_OPTIONS_TEXI)): Don't generate ignored
2152 errors, they pollute the output.
2153
2154 2009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
2155
2156 Convert multiple variable definition warnings to complaints.
2157 * NEWS (2.5): Add a new entry for that change.
2158 * doc/bison.texinfo (Decl Summary): Update %define entry.
2159 (Bison Options): Update -D/--define/-F/--force-define entry.
2160 * src/muscle-tab.c (muscle_percent_define_insert): Implement.
2161 * src/muscle-tab.h (muscle_percent_define_insert): Update
2162 comments.
2163 * tests/input.at (`%define errors'): Update.
2164 (`%define, --define, --force-define'): Update.
2165
2166 2009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
2167
2168 -F/--force-define and relative %define/-D/--define priorities.
2169 * NEWS (2.5): Add documentation to -D/--define entry.
2170 * build-aux/cross-options.pl: Hard-code association of
2171 --force-define with %define.
2172 * doc/bison.texinfo (Decl Summary): In %define entry,
2173 cross-reference command-line options.
2174 (Bison Options): Add documentation to -D/--define entry.
2175 (Option Cross Key): Widen column for --force-define row.
2176 * src/getargs.c (usage): Document -F/--force-define. Realign
2177 options in output.
2178 (short_options, long_options, getargs): Parse -F/--force-define,
2179 and update muscle_percent_define_insert invocations.
2180 * src/muscle-tab.h (muscle_percent_define_how): New enum type.
2181 (muscle_percent_define_insert): Add argument with that type.
2182 * src/muscle-tab.c (muscle_percent_define_insert): Implement
2183 -F/--force-define behavior and priorities.
2184 (muscle_percent_define_ensure): Update
2185 muscle_percent_define_insert invocation.
2186 * src/parse-gram.y (prologue_declaration): Update
2187 muscle_percent_define_insert invocations.
2188 * tests/input.at (`%define, --define'): Rename to...
2189 (`%define, --define, --force-define'): ... this and extend.
2190
2191 2009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
2192
2193 Update some comments to make sense for -D.
2194 * data/bison.m4 (b4_check_user_names): In header comments, say
2195 "user occurrence" instead of "grammar occurrence".
2196 * src/muscle-tab.h (muscle_percent_define_insert): Likewise.
2197 (muscle_percent_code_grow): Likewise just for consistency.
2198
2199 2009-05-20 Joel E. Denny <jdenny@ces.clemson.edu>
2200
2201 * data/c++.m4 (b4_namespace_close): Simplify slightly.
2202
2203 2009-05-19 Joel E. Denny <jdenny@ces.clemson.edu>
2204
2205 Handle a trailing `:' in a user-supplied C++ namespace better.
2206 * data/c++.m4 (b4_namespace_close): Don't let it be printed
2207 among the closing braces here. This fix might make the
2208 generated code easier to debug, but otherwise it should be
2209 insignificant because a trailing `:' is a C++ error already.
2210
2211 2009-05-19 Akim Demaille <demaille@gostai.com>
2212
2213 remove useless variable.
2214 * src/getargs.c (skeleton_arg): Remove now useless variable.
2215 Should help the compiler see that this printf-like call is sane.
2216
2217 2009-05-15 Akim Demaille <demaille@gostai.com>
2218
2219 Rename token.prefix as api.tokens.prefix.
2220 Discussed here.
2221 http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00024.html.
2222
2223 * NEWS, data/bison.m4, data/c.m4, data/java.m4, doc/bison.texinfo,
2224 * tests/c++.at, tests/calc.at, tests/java.at, tests/local.at
2225 (token.prefix): Rename as...
2226 (api.tokens.prefix): this.
2227
2228 2009-05-11 Akim Demaille <demaille@gostai.com>
2229
2230 doc: use C++ headers.
2231 * doc/bison.texinfo (Calc++ Scanner): Prefer C++ headers to C
2232 headers.
2233
2234 2009-05-11 Akim Demaille <demaille@gostai.com>
2235
2236 doc: token.prefix
2237 * doc/bison.simple (Decl Summary): Document token.prefix.
2238 (Calc++ Parser): Various fixes.
2239 Formatting changes.
2240 Use token.prefix.
2241 Introduce a macro TOKEN to shorten the code and make it more
2242 readable.
2243 (Calc++ Scanner): Adjust.
2244 * NEWS (Variable token.prefix): New.
2245
2246 2009-05-04 Akim Demaille <demaille@gostai.com>
2247
2248 bison: catch bad symbol names.
2249 * src/scan-gram.l({int}{id}): Report as an invalid identifier.
2250 * tests/input.at: Adjust.
2251
2252 2009-05-04 Akim Demaille <demaille@gostai.com>
2253
2254 identifiers: dashes are letters.
2255 Dashes can now start identifiers (symbols and directives).
2256
2257 * src/scan-gram.l ({letter}): Add dash.
2258 ({id}): Remove it.
2259 * tests/input.at (Symbols): Adjust.
2260 Remove stray comment.
2261 * tests/regression.at (Invalid inputs): Adjust error message.
2262 * doc/bison.texinfo (Symbols): Update.
2263
2264 2009-05-01 Joel E. Denny <jdenny@ces.clemson.edu>
2265
2266 Declare %code to be a permanent feature.
2267 * NEWS (2.4.2): Here.
2268 * doc/bison.texinfo (Prologue Alternatives): Don't say it's
2269 experimental.
2270 (Decl Summary): Likewise.
2271
2272 2009-04-30 Joel E. Denny <jdenny@ces.clemson.edu>
2273
2274 Convert underscores to dashes in some %define variable names.
2275 For now, just api.push-pull and lr.keep-unreachable-states.
2276 Maintain old names for backward compatibility.
2277 * NEWS (2.5): Document.
2278 * data/c.m4 (b4_identification): Update comment.
2279 * data/yacc.c: Update access.
2280 * doc/bison.texinfo: Update.
2281 * etc/bench.pl.in (bench_push_parser): Update use.
2282 * src/files.c (tr): Move to...
2283 * src/getargs.c, src/getargs.h (tr): ... here because I can't
2284 think of a better place to expose it. My logic is that, for all
2285 uses of tr so far, command-line arguments can be involved, and
2286 getargs.h is already included.
2287 * src/main.c (main): Update access.
2288 * src/muscle_tab.c (muscle_percent_define_insert): Convert old
2289 variable names to new variable names before assigning value.
2290 * src/reader.c (reader): Update setting default.
2291 * tests/calc.at: Update uses.
2292 * tests/conflicts.at (Unreachable States After Conflict
2293 Resolution): Update use.
2294 * tests/input.at (%define enum variables): Update use.
2295 (%define backward compatibility): New test group.
2296 * tests/push.at: Update uses.
2297 * tests/reduce.at: Update uses.
2298 * tests/torture.at: Update uses.
2299
2300 2009-04-30 Joel E. Denny <jdenny@ces.clemson.edu>
2301
2302 Set all front-end %define defaults in one place.
2303 * src/main.c (main): Move lr.keep_unreachable_states default...
2304 * src/reader.c (reader): ... to here.
2305
2306 2009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
2307
2308 Rename lr.default_reductions to lr.default-reductions.
2309 * NEWS (2.5): Here.
2310 * doc/bison.texinfo: Here.
2311 * src/lalr.c (initialize_LA): Here.
2312 * src/print.c (print_reductions): Here.
2313 * src/reader.c (reader): Here.
2314 * src/tables.c (action_row): Here.
2315 * tests/input.at (%define enum variables): Here.
2316 * tests/reduce.at (AT_TEST_LR_DEFAULT_REDUCTIONS): Here.
2317
2318 2009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
2319
2320 Pacify ./configure --enable-gcc-warnings.
2321 * tests/input.at (Symbols): Prototype yyerror and yylex.
2322
2323 2009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
2324
2325 Document how `%define "var" "value"' is not M4-friendly.
2326 * src/parse-gram.y (variable): In comments here.
2327
2328 2009-04-24 Joel E. Denny <jdenny@ces.clemson.edu>
2329
2330 Clean up recent patches a little.
2331 Reported by Akim Demaille.
2332 * doc/bison.texinfo (Understanding): Fix typos.
2333 * src/print.c (print_reductions): Don't use negated variable.
2334
2335 2009-04-24 Joel E. Denny <jdenny@ces.clemson.edu>
2336
2337 List accepted values for a %define enum variable with an invalid value.
2338 Suggested by Akim Demaille at
2339 <http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00082.html>.
2340 * data/bison.m4 (_b4_percent_define_check_values): Implement.
2341 * src/muscle-tab.c (muscle_percent_define_check_values): Implement.
2342 * tests/input.at (%define lr.default_reductions invalid values): Merge
2343 into...
2344 (%define enum variables): ... here, and update output.
2345
2346 2009-04-23 Joel E. Denny <jdenny@ces.clemson.edu>
2347
2348 Rename "default rule" to "default reduction".
2349 This includes changing variable names in code, changing
2350 comments, and renaming %define lr.default_rules to %define
2351 lr.default_reductions.
2352 * NEWS (2.5): Update IELR documentation.
2353 * data/bison.m4 (b4_integral_parser_tables_map): Adjust YYDEFACT
2354 documentation.
2355 * data/glr.c, data/lalr1.java: Sync copyright dates.
2356 * doc/bison.texinfo (Decl Summary): Adjust lr.default_reductions
2357 and lr.type documentation. Make some other wording
2358 improvements.
2359 (Glossary): Adjust cross-references and Default Reduction
2360 definition.
2361 * src/lalr.c (state_lookahead_tokens_count): Adjust code.
2362 Remove a confusing comment pointed out by Akim Demaille.
2363 (initialize_LA): Adjust code.
2364 * src/print-xml.c (print_reductions): Adjust code.
2365 * src/print.c (print_reductions): Adjust code.
2366 * src/reader.c (reader): Adjust code.
2367 * src/tables.c (action_row): Adjust code.
2368 (token_actions): Adjust code.
2369 * src/tables.h: Adjust YYDEFACT documentation.
2370 * tests/input.at (%define lr.default_rules invalid values):
2371 Rename test group to...
2372 (%define lr.default_reductions invalid values): ... this, and
2373 update grammar file and expected output.
2374 * tests/reduce.at (AT_TEST_LR_DEFAULT_RULES): Rename to...
2375 (AT_TEST_LR_DEFAULT_REDUCTIONS): ... this, and update.
2376
2377 2009-04-21 Akim Demaille <demaille@gostai.com>
2378
2379 tests: check the use of dashes and periods in symbols.
2380 * tests/input.at (Symbol): New test group.
2381
2382 2009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
2383
2384 Document %define lr.type and lr.default_rules.
2385 * NEWS (2.5): Add an entry.
2386 * src/getargs.c (usage): Mention IELR(1) and canonical LR(1)
2387 besides just LALR(1) and GLR(1).
2388 * doc/bison.texinfo (Introduction): Likewise.
2389 (Language and Grammar): Bison is no longer limited to LALR(1)
2390 restrictions.
2391 (GLR parsing): Say deterministic or LR(1) rather than LALR(1)
2392 when trying to distinguish from GLR. Talk about LR(1) grammars
2393 rather than LALR(1) grammars.
2394 (Decl Summary): In %define api.push_pull entry, say it applies
2395 to deterministic parsers in C rather than LALR(1) parsers in C.
2396 Add lr.default_rules entry.
2397 Add lr.type entry.
2398 (Mystery Conflicts): Bison is no longer limited to LALR(1)
2399 restrictions.
2400 (Generalized LR Parsing): Same changes as for the previous GLR
2401 section.
2402 (Memory Management): Say deterministic rather than LALR(1).
2403 (Understanding): Correct some bison output.
2404 Index discussion of "accepting state".
2405 Say deterministic rather than LALR(1).
2406 (Bison Options): In --yacc entry, say deterministic rather than
2407 LALR(1).
2408 In --report, --graph, and --xml entries, just don't mention
2409 LALR(1).
2410 (C++ Parsers): Say deterministic rather than LALR(1).
2411 (Table of Symbols): Likewise in YYSTACK_USE_ALLOCA entry.
2412 (Glossary): Add Accepting State, Consistent State, Default Rule,
2413 and IELR(1) definitions.
2414 In Generalized LR (GLR) definition, make same changes as in
2415 previous GLR sections.
2416 In LALR(1) definition, say Bison uses LALR(1) by default rather
2417 than implying Bison is limited to LALR(1).
2418 (LocalWords): Add IELR.
2419
2420 2009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
2421
2422 Finish implementing %define lr.type.
2423 Its value can be "LALR", "IELR", or "canonical LR".
2424 * lib/timevar.def (TV_IELR_PHASE1): New var.
2425 (TV_IELR_PHASE2): New var.
2426 (TV_IELR_PHASE3): New var.
2427 (TV_IELR_PHASE4): New var.
2428 * src/Makefile.am (bison_SOURCES): Add AnnotationList.c,
2429 AnnotationList.h, InadequacyList.c, InadequacyList.h, Sbitset.c,
2430 Sbitset.h, ielr.h, and ielr.c.
2431 * src/getargs.h, src/getargs.c (enum trace, trace_args,
2432 trace_types): Add trace_ielr.
2433 * src/lalr.h, src/lalr.c (ngotos): Export it.
2434 (F): Rename to...
2435 (goto_follows): ... this, update all uses, and export it.
2436 (set_goto_map): Export it.
2437 (map_goto): Export it.
2438 (compute_lookahead_tokens): Don't free goto_follows yet. Now
2439 handled in ielr.
2440 (initialize_LA): Export it. Move lookback allocation to...
2441 (lalr): ... here because, for canonical LR, initialize_LA must
2442 be invoked but lookback and much of the rest of LALR isn't
2443 needed.
2444 * main.c (main): Instead of lalr, invoke ielr, which invokes
2445 lalr.
2446 * src/reader.c (reader): Default lr.type to "LALR".
2447 Default lr.default_rules to "accepting" if lr.type is "canonical
2448 LR". Leave the default as "all" otherwise.
2449 Check for a valid lr.type value.
2450 * src/state.h, src/state.c (struct state_list): Add state_list
2451 member.
2452 (state_new): Initialize state_list member to NULL.
2453 (state_new_isocore): New function, exported.
2454 * tests/existing.at (AT_TEST_EXISTING_GRAMMAR): New macro that
2455 exercises all values of lr.type.
2456 (GNU AWK Grammar): Rename test group to...
2457 (GNU AWK 3.1.0 Grammar): ... this, and extend to use
2458 AT_TEST_EXISTING_GRAMMAR.
2459 (GNU Cim Grammar): Extend to use AT_TEST_EXISTING_GRAMMAR.
2460 (GNU pic Grammar): Rename test group to...
2461 (GNU pic (Groff 1.18.1) Grammar): ... this, and extend to use
2462 AT_TEST_EXISTING_GRAMMAR.
2463 * tests/reduce.at (AT_TEST_LR_TYPE): New macro that exercises
2464 all values of lr.type.
2465 (Single State Split): New test groups using AT_TEST_LR_TYPE.
2466 (Lane Split): Likewise.
2467 (Complex Lane Split): Likewise.
2468 (Split During Added Lookahead Propagation): Likewise.
2469
2470 2009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
2471
2472 Add new files for IELR and canonical LR implementation.
2473 * src/AnnotationList.c: New.
2474 * src/AnnotationList.h: New.
2475 * src/InadequacyList.c: New.
2476 * src/InadequacyList.h: New.
2477 * src/Sbitset.c: New.
2478 * src/Sbitset.h: New.
2479 * src/ielr.c: New.
2480 * src/ielr.h: New.
2481
2482 2009-04-20 Joel E. Denny <jdenny@ces.clemson.edu>
2483
2484 Implement %define lr.default_rules.
2485 Its value describes the states that are permitted to contain
2486 default rules: "all", "consistent", or "accepting".
2487 * src/reader.c (reader): Default lr.default_rules to "all".
2488 Check for a valid lr.default_rules value.
2489 * src/lalr.c (state_lookahead_tokens_count): If lr.default_rules
2490 is "accepting", then only mark the accepting state as
2491 consistent.
2492 (initialize_LA): Tell state_lookahead_tokens_count whether
2493 lr.default_rules is "accepting".
2494 * src/tables.c (action_row): If lr.default_rules is not "all",
2495 then disable default rules in inconsistent states.
2496 * src/print.c (print_reductions): Use this opportunity to
2497 perform some assertions about whether lr.default_rules was
2498 obeyed correctly.
2499 * tests/local.at (AT_TEST_TABLES_AND_PARSE): New macro that
2500 helps with checking the parser tables for a grammar.
2501 * tests/input.at (%define lr.default_rules invalid values): New
2502 test group.
2503 * tests/reduce.at (AT_TEST_LR_DEFAULT_RULES): New macro using
2504 AT_TEST_TABLES_AND_PARSE.
2505 (`no %define lr.default_rules'): New test group generated by
2506 AT_TEST_LR_DEFAULT_RULES.
2507 (`%define lr.default_rules "all"'): Likewise.
2508 (`%define lr.default_rules "consistent"'): Likewise.
2509 (`%define lr.default_rules "accepting"'): Likewise.
2510
2511 2009-04-20 Akim Demaille <demaille@gostai.com>
2512
2513 Formatting change.
2514
2515 2009-04-20 Akim Demaille <demaille@gostai.com>
2516
2517 bison: factoring.
2518 * src/output.c (token_definitions_output): Use symbol_id_get
2519 instead of duplicating its logic.
2520 * TODO (YYERRCODE): Extend.
2521
2522 2009-04-20 Akim Demaille <demaille@gostai.com>
2523
2524 variables: prefer error-verbose to error_verbose.
2525 * data/bison.m4 (b4_error_verbose_if): Based on error-verbose
2526 instead of error_verbose.
2527 * src/scan-gram.l (%error-verbose): Map to the error-verbose
2528 variable.
2529 * doc/bison.texinfo: Promote %define error-verbose instead of
2530 %error-verbose.
2531 * tests/actions.at: Prefer %define error-verbose to %error-verbose.
2532
2533 2009-04-15 Akim Demaille <demaille@gostai.com>
2534
2535 variables: accept dashes.
2536 * data/bison.m4 (b4_percent_define_if_define_): Also map dashes to
2537 underscores.
2538 * src/scan-gram.l ({id}): Also accept dashes after the initial
2539 letter.
2540 ({directive}): Use {id}.
2541 * src/parse-gram.y: Comment and formatting changes.
2542 * doc/bison.texinfo (Symbols): Adjust the lexical definitions of
2543 symbols.
2544 * src/complain.h, src/complain.c (yacc_at): New.
2545 * src/symtab.c (symbol_new): Use yacc_at to report inappropriate
2546 symbol names.
2547 * src/output.c (token_definitions_output): Do not #define token
2548 names with dashes.
2549
2550 2009-04-20 Akim Demaille <demaille@gostai.com>
2551
2552 Consistently refer to Yacc, not YACC.
2553 * src/getargs.c (usage, warnings_args): s/YACC/Yacc/.
2554
2555 2009-04-17 Joel E. Denny <jdenny@ces.clemson.edu>
2556
2557 Pacify make maintainer-check-posix.
2558 * tests/input.at (%define, --define): Move bison command-line
2559 options before grammar file name.
2560
2561 2009-04-04 Joel E. Denny <jdenny@ces.clemson.edu>
2562
2563 Document semicolon warnings.
2564 * NEWS (2.5): Here.
2565
2566 2009-04-14 Akim Demaille <demaille@gostai.com>
2567
2568 variables: use `parse.assert' instead of `assert'.
2569 * TODO (assert): Remove.
2570 * data/bison.m4 (b4_assert_if): Replace with...
2571 (b4_parse_assert_if): this.
2572 * data/lalr1.cc, data/variant.hh, tests/c++.at: Adjust.
2573 * doc/bison.texinfo (Decl Summary): Document parse.assert.
2574
2575 2009-04-14 Akim Demaille <demaille@gostai.com>
2576
2577 variables: use `parse.trace' instead of `debug'.
2578 * src/getargs.c (getargs): Map -t to %define trace.parse.
2579 * src/scan-gram.l (%debug): Map to %define trace.parse.
2580 * data/bison.m4 (b4_percent_define_if_define): Map `.' in variable
2581 names to `_' in macro names.
2582 (b4_debug_if): Replace with...
2583 (b4_parse_trace_if): this.
2584 * data/glr.c, data/glr.cc, data/lalr1.cc, data/lalr1.java,
2585 * data/yacc.c: Adjust.
2586 * doc/bison.texinfo (Decl Summary): Document %debug as obsoleted.
2587 Use @code to label the variable list.
2588 Document the variable parse.trace.
2589 (Tracing): Promote the parse.trace variable.
2590 * TODO: %printer is not documented.
2591
2592 2009-04-14 Akim Demaille <demaille@gostai.com>
2593
2594 doc: minor fixes.
2595 * doc/bison.texinfo (Decl Summary): Fix entry about %debug.
2596 (Table of Symbols): Remove duplicate entry for %debug.
2597
2598 2009-04-10 Eric Blake <ebb9@byu.net>
2599
2600 submodules: update to latest
2601 * submodules/autoconf: Use latest upstream Autoconf.
2602
2603 2009-04-06 Eric Blake <ebb9@byu.net>
2604
2605 Work around autoconf 2.63b bug in testsuite.
2606 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Avoid tripping
2607 autoconf bug related to # in test.
2608
2609 2009-04-06 Joel E. Denny <jdenny@ces.clemson.edu>
2610
2611 * NEWS (2.5): New section. Describe new -D/--define feature.
2612
2613 2009-04-06 Akim Demaille <demaille@gostai.com>
2614
2615 Regen.
2616 * src/parse-gram.h, src/parse-gram.c: Regen.
2617
2618 2009-04-06 Akim Demaille <demaille@gostai.com>
2619
2620 rename muscle_tab.* as muscle-tab.* for consistency.
2621 * src/muscle_tab.h, src/muscle_tab.c: Rename as...
2622 * src/muscle-tab.h, src/muscle-tab.c: these.
2623 * src/getargs.c, src/local.mk, src/main.c, src/output.c,
2624 * src/parse-gram.y, src/reader.c, src/scan-code.l: Adjust.
2625
2626 2009-04-06 Akim Demaille <demaille@gostai.com>
2627
2628 Makefile: introduce $(BISON).
2629 * src/local.mk (BISON): New.
2630 (YACC): Use it.
2631
2632 2009-04-06 Akim Demaille <demaille@gostai.com>
2633
2634 parser: handle %locations as %define locations.
2635 * src/getargs.h, src/getargs.c (locations_flag): Remove.
2636 * src/getargs.c, src/scan-code.l: Use muscle_percent_define_ensure
2637 to set "locations" to true.
2638 * src/output.c (prepare): Don't output "locations".
2639 * src/scan-gram.l (%locations): Handle it as a %<flag>.
2640 * src/parse-gram.y: It's no longer a token.
2641 Don't handle it.
2642 * data/bison.m4 (b4_locations_if): Define it with
2643 b4_percent_define_if_define.
2644 * data/c.m4, data/glr.cc: Adjust.
2645
2646 2009-04-06 Akim Demaille <demaille@gostai.com>
2647
2648 Regen.
2649 * src/parse-gram.c: Regen.
2650
2651 2009-04-06 Akim Demaille <demaille@gostai.com>
2652
2653 muscle: factor the handling of obsolete of obsolete directives.
2654 Suggested by Joel E. Denny.
2655
2656 * src/muscle_tab.h, src/muscle_tab.c (muscle_percent_define_ensure):
2657 New, extracted from...
2658 * src/parse-gram.y (prologue_declaration: pure-parser): here.
2659 Remove it.
2660 (prologue_declaration: "%<flag>"): Use
2661 muscle_percent_define_ensure.
2662 (%error-verbose, %pure-parser): No longer tokens.
2663 * src/scan-gram.l (pure-parser): Return as a %<flag>.
2664
2665 2009-04-06 Joel E. Denny <jdenny@ces.clemson.edu>
2666
2667 Fix options documentation.
2668 * build-aux/cross-options.pl: As in --help output, write optional
2669 arguments as [=ARG] not =[ARG].
2670 * doc/bison.texinfo (Bison Options): Add -W/--warnings argument.
2671
2672 2009-04-04 Joel E. Denny <jdenny@ces.clemson.edu>
2673
2674 Replace BISON_PROG_GNU_M4 with Autoconf's AC_PROG_GNU_M4.
2675 If the first m4 in $PATH is wrong, it keeps looking. Moreover, its
2676 requirements for a correct m4 are stricter.
2677 * m4/m4.m4: Make it a symbolic link to submodules/autoconf/m4/m4.m4.
2678 * configure.ac: Update to use AC_PROG_GNU_M4.
2679 Reported by Eric Blake.
2680
2681 2009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
2682
2683 Help with updating web manual.
2684 * HACKING: Incorporate instructions from gnulib/doc/README.
2685 * bootstrap.conf (gnulib_modules): Add gendocs.
2686
2687 2009-04-03 Akim Demaille <demaille@gostai.com>
2688
2689 Regen.
2690 * src/parse-gram.h, src/parse-gram.c: Regen.
2691
2692 2009-04-03 Akim Demaille <demaille@gostai.com>
2693
2694 Factor %FLAG at scan level.
2695 * src/parse-gram.y (PERCENT_DEBUG, PERCENT_ERROR_VERBOSE): Token
2696 definitions and associated rules, replaced by....
2697 (PERCENT_FLAG): this new token type, and rule.
2698 * src/scan-gram.l (RETURN_PERCENT_FLAG): New.
2699 Use it for %debug and %error-verbose.
2700
2701 2009-04-03 Akim Demaille <demaille@gostai.com>
2702
2703 Regen.
2704 * src/parse-gram.h, src/parse-gram.c: Regen.
2705
2706 2009-04-03 Akim Demaille <demaille@gostai.com>
2707
2708 Treat %debug as %define debug.
2709 * data/bison.m4 (b4_debug_if): New.
2710 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c,
2711 * data/lalr1.java: Use it instead of b4_debug_flag.
2712 * src/getargs.h, src/getargs.c (debug_flag): Remove.
2713 * src/output.c (prepare): Don't output it.
2714 * src/parse-gram.y: Treat %debug as %define debug.
2715
2716 2009-04-03 Akim Demaille <demaille@gostai.com>
2717
2718 Treat %error-verbose as %define error_verbose.
2719 This allows to pass -Derror_verbose on the command line. Better
2720 yet, it allows to pass -Derror_verbose=$(ERROR_VERBOSE), with
2721 ERROR_VERBOSE being defined as false or true.
2722 * data/bison.m4 (b4_percent_define_if_define): Instead of relying
2723 on b4_percent_define_ifdef, for does not check the defined value,
2724 but only whether the symbol is defined, rely on
2725 b4_percent_define_flag_if, so that a value of "false" is processed
2726 as a false.
2727 If not defined, define the flag to "false".
2728 (b4_error_verbose_if): New.
2729 * data/glr.c, data/lalr1.cc, data/yacc.c: Use it instead of
2730 b4_error_verbose_flag.
2731 * src/getargs.h, src/getargs.c (error_verbose_flag): Remove.
2732 * src/output.c (prepare): Don't output it.
2733 * src/parse-gram.y (%error-verbose): Treat as %define error_verbose.
2734
2735 2009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
2736
2737 Fix strange %define locations for default values.
2738 Reported by Akim Demaille at
2739 <http://lists.gnu.org/archive/html/bug-bison/2007-12/msg00001.html>
2740 and discussed again starting at
2741 <http://lists.gnu.org/archive/html/bison-patches/2008-11/msg00102.html>.
2742 * data/bison.m4 (b4_percent_define_default): Leave syncline blank
2743 because location information is bogus.
2744 Use angle brackets to delimit fake file name because square brackets
2745 look like underexpanded m4. Choose a better fake file name.
2746 Use negative line numbers.
2747 * src/muscle_tab.c (muscle_percent_define_default): Likewise.
2748 * src/location.c (location_print): If line for a boundary is negative,
2749 only print that boundary's file name.
2750 * src/location.h: Document that.
2751 * tests/skeletons.at (%define Boolean variables: invalid skeleton
2752 defaults): Update output.
2753
2754 2009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
2755
2756 Pacify ./configure --enable-gcc-warnings.
2757 * Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS) because many files
2758 in lib won't compile with it.
2759 * src/local.mk (src_bison_CFLAGS): Use $(WERROR_CFLAGS) here only.
2760
2761 2009-03-31 Akim Demaille <demaille@gostai.com>
2762
2763 bootstrap: --help to stdout.
2764 * bootstrap (usage): Don't send --help to stderr.
2765 Use a here doc instead of a long string.
2766
2767 2009-03-31 Akim Demaille <demaille@gostai.com>
2768
2769 bootstrap: README-hacking no longer exists
2770 * bootstrap (checkout_only_file): Set to HACKING.
2771
2772 2009-03-26 Akim Demaille <demaille@gostai.com>
2773
2774 doc: merge HACKING and README-hacking.
2775 Two files is confusing.
2776 Reported by Alexandre Duret-Lutz.
2777
2778 * README-hacking: Merge into...
2779 * HACKING (Working from the repository): here.
2780
2781 2009-03-26 Akim Demaille <demaille@gostai.com>
2782
2783 doc: update README-hacking.
2784 * README-hacking: We now use git and git submodules.
2785 Reported by Ralf Wildenhues and Alexandre Duret-Lutz.
2786
2787 2009-03-26 Akim Demaille <demaille@gostai.com>
2788
2789 lalr1.cc: avoid GCC 4.3 warnings.
2790 GCC 4.3 now warns about "a || b && c" and asks for explicit
2791 parentheses.
2792 Reported by Alexandre Duret-Lutz.
2793 * data/location.cc: Update copyright years.
2794 (Position::operator==): Use parens to make precedence explicit.
2795 Compare lines and columns first, as they are more likely to be
2796 different, and they are faster to compare.
2797
2798 2009-03-26 Akim Demaille <demaille@gostai.com>
2799
2800 gnulib: update.
2801 * gnulib: Update to latest.
2802 * src/local.mk (AM_CFLAGS): Move to...
2803 * Makefile.am: here.
2804 * etc/prefix-gnulib-mk (prefix_assignment): Also transform
2805 AM_CFLAGS.
2806
2807 2009-03-02 Akim Demaille <demaille@gostai.com>
2808
2809 Comment changes.
2810
2811 2009-03-02 Akim Demaille <demaille@gostai.com>
2812
2813 Share b4_yytranslate_define.
2814 * data/lalr1.cc (b4_yytranslate_define): Move to...
2815 * data/c++.m4: here.
2816
2817 2009-03-02 Akim Demaille <demaille@gostai.com>
2818
2819 Use locations in the variant example.
2820 Yes, this obfuscates the point of this example, variants only.
2821 But glr.cc cannot work (yet?) without locations. This change
2822 makes it easier to use this example with glr.cc.
2823
2824 * examples/variant.yy (assert): %define it.
2825 (locations): Request them.
2826 (yylex): Bind the location to the stage.
2827
2828 2009-03-02 Akim Demaille <demaille@gostai.com>
2829
2830 Dub make_TOKEN as a public type interface.
2831 * data/c++.m4 (b4_symbol_constructor_declare)
2832 (b4_symbol_constructor_define): New empty stubs.
2833 (b4_public_types_declare, b4_public_types_define): Use them.
2834 * data/lalr1.cc (b4_symbol_constructor_declare)
2835 (b4_symbol_constructor_declare_)
2836 (b4_symbol_constructor_define_, b4_symbol_constructor_define):
2837 Move to...
2838 * data/variant.hh: here.
2839 Remove the "b4_variant_if" parts, as variant.hh is loaded only if
2840 needed.
2841 * data/lalr1.cc: No longer invoke b4_symbol_constructor_define and
2842 b4_symbol_constructor_declare, as it is now done by
2843 b4_public_types_define and b4_public_types_declare.
2844
2845 2009-03-02 Akim Demaille <demaille@gostai.com>
2846
2847 Coding style changes.
2848 * data/lalr1.cc (b4_symbol_constructor_declaration_)
2849 (b4_symbol_constructor_declarations)
2850 (b4_symbol_constructor_definition_)
2851 (b4_symbol_constructor_definitions)
2852 (b4_yytranslate_definition): Rename as...
2853 (b4_symbol_constructor_declare_)
2854 (b4_symbol_constructor_declare)
2855 (b4_symbol_constructor_define_)
2856 (b4_symbol_constructor_define)
2857 (b4_yytranslate_define): these.
2858 * data/variant.hh (b4_variant_definition): Rename as...
2859 (b4_variant_define): this.
2860
2861 2009-03-02 Akim Demaille <demaille@gostai.com>
2862
2863 Factor b4_assert_if, b4_lex_symbol_if, and b4_variant_if.
2864 * data/bison.m4 (b4_percent_define_if_define): New.
2865 * data/c++.m4 (b4_variant_if): Move to...
2866 * data/bison.m4: Here, using b4_percent_define_if_define.
2867 * data/lalr1.cc (b4_assert_if, b4_lex_symbol_if): Move to...
2868 * data/bison.m4: Here, using b4_percent_define_if_define.
2869
2870 2009-03-02 Akim Demaille <demaille@gostai.com>
2871
2872 Dub symbol_type_base as a public type.
2873 * data/c++.m4 (b4_public_types_declare): Now define
2874 symbol_type_base and symbol_type.
2875 (b4_public_types_define): New.
2876 In both cases, the definitions are taken verbatim from lalr1.cc.
2877 * data/lalr1.cc: Adjust.
2878
2879 2009-03-02 Akim Demaille <demaille@gostai.com>
2880
2881 b4_public_types_declare.
2882 * data/c++.m4 (b4_public_types_declare): New.
2883 * data/glr.cc, data/lalr1.cc: Use it.
2884
2885 2009-03-02 Akim Demaille <demaille@gostai.com>
2886
2887 b4_semantic_type_declare.
2888 * data/c++.m4 (b4_semantic_type_declare): New.
2889 Factors and generalizes what was in glr.cc and lalr1.cc.
2890 * data/variant.hh (b4_semantic_type_declare): Redefine it for
2891 variants.
2892 * data/lalr1.cc, data/glr.cc: Use it.
2893
2894 2009-02-26 Akim Demaille <demaille@gostai.com>
2895
2896 Upgrade gnulib.
2897 * gnulib: Upgrade from master.
2898 * lib/.cvsignore, lib/.gitignore, m4/.cvsignore, m4/.gitignore:
2899 Regen.
2900
2901 2009-02-25 Akim Demaille <demaille@gostai.com>
2902
2903 Remove useless arguments.
2904 * data/glr.c (yy_reduce_print): $$ and @$ are not used and not
2905 relevant.
2906
2907 2009-02-25 Akim Demaille <demaille@gostai.com>
2908
2909 Comment changes.
2910 * data/lalr1.cc: here.
2911
2912 2009-02-25 Akim Demaille <demaille@gostai.com>
2913
2914 Fix glr.cc's debug level handling.
2915 * data/glr.cc (yydebug_): Remove, as it is actually yydebug from
2916 glr.c which is used.
2917 (debug_level, set_debug_level): Adjust.
2918
2919 2009-02-25 Akim Demaille <demaille@gostai.com>
2920
2921 Copyright years.
2922 * data/glr.c: Add 2007 and 2008 here, consistenly with the comments.
2923
2924 2009-02-25 Akim Demaille <demaille@gostai.com>
2925
2926 Style changes.
2927 * etc/bench.pl.in (generate_grammar_list): Consitently use
2928 location_type, not yy::location.
2929
2930 2009-02-25 Akim Demaille <demaille@gostai.com>
2931
2932 Comment change.
2933 * data/lalr1.cc: here.
2934
2935 2009-02-19 Akim Demaille <demaille@gostai.com>
2936
2937 Make yyparser::error public.
2938 * data/lalr1.cc: here.
2939 There is no good reason to keep it private (and it is convenient
2940 to use it from the scanner for instance). It is already public in
2941 glr.cc.
2942
2943 2009-02-19 Akim Demaille <demaille@gostai.com>
2944
2945 Comment changes.
2946 * data/glr.cc: here.
2947
2948 2009-02-19 Akim Demaille <demaille@gostai.com>
2949
2950 Remove trailing blanks.
2951 The epilogue has its own ending \n, no need to add another.
2952
2953 * data/glr.c, data/lalr1.java, data/yacc.c: dnl when outputing the
2954 epilogue.
2955 * data/glr.cc: dnl when extending the epilogue.
2956 Remove stray "private:".
2957
2958 2009-02-19 Akim Demaille <demaille@gostai.com>
2959
2960 Use b4_c_modern.
2961 * data/c.m4 (b4_c_function_decl): Here.
2962
2963 2009-02-19 Akim Demaille <demaille@gostai.com>
2964
2965 Comment changes.
2966 * data/lalr1.cc: here.
2967
2968 2009-02-19 Akim Demaille <demaille@gostai.com>
2969
2970 Extract variant.hh
2971 * data/variant.hh: New, extracted from...
2972 * data/lalr1.cc: here.
2973 Adjust.
2974 * data/local.mk: Adjust.
2975
2976 2009-02-19 Akim Demaille <demaille@gostai.com>
2977
2978 Extract stack.hh from lalr1.cc.
2979 * data/stack.hh: New.
2980 * data/lalr1.cc: Extract from here.
2981 * data/local.mk: Adjust.
2982
2983 2009-02-03 Joel E. Denny <jdenny@ces.clemson.edu>
2984
2985 Add reminder about uploading public key to keys.gnupg.net.
2986 * HACKING (Release Procedure): Here.
2987
2988 2009-01-28 Akim Demaille <demaille@gostai.com>
2989
2990 * NEWS: Update information about 2.4.1 and 2.4.2.
2991
2992 2008-11-04 Akim Demaille <demaille@gostai.com>
2993
2994 Reformat NEWS.
2995 * NEWS: Use more outline-mode markup.
2996 Suggested by Jim Meyering.
2997
2998 2009-01-08 Akim Demaille <demaille@gostai.com>
2999
3000 Fix grep portability issues.
3001 Grep on Solaris does not support -q.
3002 Reported by Summum Bonum.
3003
3004 * NEWS: Add a stub for 2.4.2.
3005 * THANKS: Add Summum Bonum.
3006 * tests/atlocal.in (EGREP): New.
3007 (CC, CXX, XSLTPROC): Make it possible to override them via
3008 envvars.
3009 * tests/java.at: Use $EGREP instead of egrep.
3010 Use AT_CHECK's ignore instead of grep's -q.
3011
3012 2008-12-11 Akim Demaille <demaille@gostai.com>
3013
3014 Pass the token type to yysyntax_error.
3015 * data/yacc.c (yysyntax_error): Take the transated token instead
3016 of the raw number.
3017 Adjust callers.
3018 * TODO: Update.
3019
3020 2008-12-11 Akim Demaille <demaille@gostai.com>
3021
3022 Formatting changes.
3023 * data/glr.c: Formatting changes.
3024
3025 2008-12-11 Akim Demaille <demaille@gostai.com>
3026
3027 Propagate i18n changes into glr.c.
3028 * TODO: Update.
3029 * data/glr.c (yyreportSyntaxError): Use "switch" instead of
3030 building the error message format dynamically.
3031 * data/lalr1.java: Formatting changes.
3032
3033 2008-12-11 Akim Demaille <demaille@gostai.com>
3034
3035 Use testsuite -C.
3036 * tests/local.mk: Replace "cd && testsuite" by "testsuite -C".
3037 Solves problems when top_srcdir is an absolute path.
3038 Suggested by Eric Blake.
3039 * configure.ac: Require Autoconf 2.62.
3040
3041 2008-12-11 Akim Demaille <demaille@gostai.com>
3042
3043 Simplify the i18n of the error messages.
3044 * data/lalr1.cc: Comment changes.
3045 * data/yacc.c (yysyntax_error): Rewrite, using a switch as in
3046 lalr1.cc instead of building dynamically the format string.
3047
3048 2008-12-08 Akim Demaille <demaille@gostai.com>
3049
3050 Fix portability issue in the test suite.
3051 * tests/local.at (AT_MATCHES_CHECK): New.
3052 Based on Perl instead of Sed. Sed has too many portability
3053 pitfalls, not ever Sed is GNU Sed.
3054 * tests/actions.at (Fix user actions without a trailing semicolon):
3055 Use it.
3056
3057 2008-12-08 Akim Demaille <demaille@gostai.com>
3058
3059 Update data/README.
3060 * data/README: Document glr.cc, lalr1.java, m4sugar and xslt.
3061
3062 2008-12-08 Akim Demaille <demaille@gostai.com>
3063
3064 Install autoconf as a submodule to get m4sugar.
3065 * .gitmodules: Add submodules/autoconf.
3066 * data/m4sugar/foreach.m4, data/m4sugar/m4sugar.m4: Now links into
3067 submodules/autoconf.
3068
3069 2008-12-08 Akim Demaille <demaille@gostai.com>
3070
3071 Test token.prefix in all the skeletons.
3072 * data/java.m4 (b4_token_enum): Use the token.prefix.
3073 * tests/local.at (AT_BISON_OPTION_PUSHDEFS): Define AT_TOKEN_PREFIX.
3074 * tests/calc.at (_AT_DATA_CALC_Y): Use it.
3075 Add checks for yacc.c, glr.c, lalr1.cc and glr.cc.
3076 * tests/java.at: Comment changes.
3077 (AT_CHECK_JAVA_MINIMAL): Define the END token.
3078 (Java parser class and package names): Add token.prefix check.
3079
3080 2008-12-08 Akim Demaille <demaille@gostai.com>
3081
3082 Fix regeneration of atconfig.
3083 * tests/local.mk (tests/atconfig): The rule was incorrect, but
3084 remove it: now that there is no tests/Makefile.am, the top-level
3085 Makefile properly updates atconfig when needed.
3086
3087 2008-12-07 Di-an Jan <dianj@freeshell.org>
3088
3089 Implement the FIXME that ends an user action with a semicolon
3090 if it seems necessary.
3091 * src/scan-code.l (flex rules section): Flag cpp directive from
3092 any `#' to the first unescaped end-of-line. Semicolon is not
3093 needed after `;', `{', '}', or cpp directives and is needed after
3094 any other token (whitespaces and comments have no effect).
3095 * tests/actions.at (Fix user actions without a trailing semicolon):
3096 New test.
3097 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add semicolons to
3098 to make user actions complete statements.
3099 Adjust column numbers in error messages.
3100 * tests/regression.at (Fix user actions without a trailing semicolon):
3101 Remove. Covered by new test.
3102
3103 2008-12-07 Akim Demaille <demaille@gostai.com>
3104
3105 Update gnulib.
3106 * gnulib: Update from master.
3107
3108 2008-12-05 Eric Blake <ebb9@byu.net>
3109
3110 Avoid compiler warning.
3111 * src/output.c (muscle_insert_item_number_table): Delete unused
3112 function.
3113
3114 2008-12-02 Eric Blake <ebb9@byu.net>
3115
3116 Build testsuite with newer autoconf.
3117 * tests/output.at (m4_expand): Don't override in newer autoconf,
3118 where the underlying implementation changed.
3119 * tests/cxx-type.at (_AT_RESOLVED_GLR_OUTPUT)
3120 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT)
3121 (_AT_AMBIG_GLR_OUTPUT_WITH_LOC, _AT_GLR_STDERR)
3122 (_AT_VERBOSE_GLR_STDERR): Expand to double-quoted strings,
3123 since some of them contain unbalanced ')'.
3124
3125 2008-12-01 Akim Demaille <demaille@gostai.com>
3126
3127 Use b4_symbol for printers and destructors everywhere.
3128 * data/bison.m4 (b4_symbol_action_location): New.
3129 * data/c.m4 (b4_symbol_actions): Remove.
3130 Adjust all callers to use by b4_symbol_foreach and the corresponding
3131 b4_symbol_printer/destructor macro.
3132 * data/glr.cc: Adjust.
3133 * data/lalr1.java: Adjust the %destructor sanity check.
3134 * src/output.c (symbol_code_props_output): Remove, we no longer
3135 need the b4_symbol_printers/destructors tables.
3136
3137 2008-12-01 Akim Demaille <demaille@gostai.com>
3138
3139 Use b4_symbol_case_.
3140 * data/lalr1.cc, data/bison.m4 (b4_symbol_action): Use
3141 b4_symbol_case_.
3142
3143 2008-12-01 Akim Demaille <demaille@gostai.com>
3144
3145 Move b4_symbol based macro to bison.m4.
3146 * data/lalr1.cc (b4_symbol_, b4_symbol, b4_symbol_if)
3147 (b4_symbol_action, b4_symbol_destructor, b4_symbol_printer)
3148 (b4_symbol_case_, b4_symbol_foreach, b4_type_action_)
3149 (b4_type_foreach): Move to...
3150 * data/bison.m4: Here.
3151 * data/lalr1.cc (b4_symbol_action): Specialize for C++: use
3152 b4_symbol_value_template instead of b4_symbol_value.
3153
3154 2008-12-01 Akim Demaille <demaille@gostai.com>
3155
3156 b4_symbol/type_foreach.
3157 * data/lalr1.cc (b4_symbol_foreach, b4_type_foreach): New.
3158 Use them.
3159
3160 2008-12-01 Akim Demaille <demaille@gostai.com>
3161
3162 Use the symbol properties to output the printer/destructor for lalr1.cc.
3163 Instead of defining complex list of tuples to define various
3164 properties of the symbols, we now prefer to define symbols as
3165 "structs" in m4: using the symbol key (its number), and the
3166 property name, b4_symbol gives it value. Use this to handle
3167 destructors and printers.
3168
3169 * src/output.c (CODE_PROP): New.
3170 (prepare_symbol_definitions): Use it to define the printer and
3171 destructor related attributes of the symbols.
3172 * data/lalr1.cc (b4_symbol_actions): Rename as...
3173 (b4_symbol_action): this.
3174 Use b4_symbol instead of 6 arguments.
3175 (b4_symbol_printer, b4_symbol_destructor): New.
3176 Use them instead of b4_symbol_actions.
3177
3178 2008-12-01 Akim Demaille <demaille@gostai.com>
3179
3180 Avoid capturing variables too easily.
3181 * src/muscle_tab.h (MUSCLE_INSERT_BOOL, MUSCLE_OBSTACK_SGROW): Use
3182 v__ and p__ instead of v and p.
3183
3184 2008-12-01 Akim Demaille <demaille@gostai.com>
3185
3186 Remove spurious empty line before syncline.
3187 * data/bison.m4 (b4_syncline): Don't output an empty line before
3188 the output.
3189
3190 2008-11-26 Akim Demaille <demaille@gostai.com>
3191
3192 Convert lib/Makefile.am into lib/local.mk.
3193 The real problem is rather gnulib.mk, which itself is extracted
3194 from a Makefile.am that gnulib expects to the "recursive". The
3195 tool prefix-gnulib-mk converts such a gnulib.mk to be
3196 non-recursive. Also, some AC_SUBST variables need to be adjusted.
3197
3198 * etc/prefix-gnulib-mk: New.
3199 * bootstrap (slurp): Use it to convert further gnulib.mk.
3200 No longer try to avoid re-creation of lib/gnulib.mk as the changes
3201 are deeper.
3202 * lib/Makefile.am: Rename as...
3203 * lib/local.mk: this.
3204 Adjust to be prefixed.
3205 * Makefile.am, configure.ac: Adjust.
3206 * src/local.mk (AM_CPPFLAGS): Extend it, don't define it.
3207
3208 2008-11-26 Akim Demaille <demaille@gostai.com>
3209
3210 s/_FLAGS/FLAGS/.
3211 * tests/local.mk (TESTSUITE_FLAGS, AUTOTEST_FLAGS): Rename as...
3212 (TESTSUITEFLAGS, AUTOTESTFLAGS): these to compy with the GCS.
3213 Reported by Eric Blake.
3214
3215 2008-11-26 Akim Demaille <demaille@gostai.com>
3216
3217 Use b4_parser_tables_define in glr.cc.
3218 * data/glr.c: Use b4_parser_tables_define instead of defining the
3219 (deterministic integral) tables by hand.
3220
3221 2008-11-26 Akim Demaille <demaille@gostai.com>
3222
3223 Use b4_parser_tables_define in Java.
3224 * data/java.m4 (b4_typed_parser_table): Rename as...
3225 (b4_typed_parser_table_define): this, for consistency.
3226 Accept a comment as $4.
3227 Move $2 into yy*_.
3228 (b4_integral_parser_table): Rename as...
3229 (b4_integral_parser_table_define): this.
3230 * data/lalr1.java: Adjust all uses.
3231 Use b4_parser_tables_define instead of generation by hand.
3232
3233 2008-11-26 Akim Demaille <demaille@gostai.com>
3234
3235 Prepare the convergence bw C style and Java table generation.
3236 * data/bison.m4 (b4_tables_map, b4_tables_declare)
3237 (b4_tables_define): Rename as...
3238 (b4_integral_parser_tables_map, b4_parser_tables_declare)
3239 (b4_parser_tables_define): these.
3240 * data/c.m4 (b4_table_define): Rename as...
3241 (b4_integral_parser_table_define): this.
3242 * data/lalr1.cc: Adjust.
3243 (b4_table_define, b4_table_declare): Rename as...
3244 (b4_integral_parser_table_define)
3245 (b4_integral_parser_table_declare): these.
3246 (yyrline_): Move the comment where it is actually used.
3247 * data/yacc.c: Adjust.
3248 (yyrline): Use b4_integral_parser_table_define.
3249
3250 2008-11-26 Akim Demaille <demaille@gostai.com>
3251
3252 Regen.
3253 * src/parse-gram.h, src/parse-gram.c: Regen.
3254
3255 2008-11-26 Akim Demaille <demaille@gostai.com>
3256
3257 Factor the generation of the (integral) tables bw yacc.c and lalr1.cc.
3258 * data/lalr1.cc (b4_tables_map): Move to...
3259 * data/bison.m4: here.
3260 Update the comment for yytable during the flight.
3261 (b4_tables_declare, b4_tables_define): New.
3262 * data/lalr1.cc: Use them.
3263 * data/c.m4 (b4_table_define): New.
3264 * data/yacc.c: Use b4_tables_define instead of output the tables
3265 by hand.
3266 * tests/regression.at (Web2c Actions): Adjust the expected output,
3267 the order of the tables changed.
3268
3269 2008-11-26 Akim Demaille <demaille@gostai.com>
3270
3271 Get rid of (yy)rhs and (yy)prhs.
3272 These tables are no longer needed in the parsers, and they don't seem to
3273 be useful. They are not documented either.
3274
3275 * src/output.c (prepare_rules): Get rid of rhs and prhs.
3276 Adjust the computation of (yy)r2.
3277
3278 2008-11-26 Akim Demaille <demaille@gostai.com>
3279
3280 Rule length is unsigned.
3281 * src/gram.h, src/gram.c (rule_rhs_length): Return a size_t.
3282
3283 2008-11-26 Akim Demaille <demaille@gostai.com>
3284
3285 Get rid of lalr1-split.cc.
3286 It was no longer maintainer.
3287
3288 * data/lalr1-split.cc: Remove.
3289 * etc/bench.pl.in (bench_fusion_parser): Remove.
3290 Adjust.
3291
3292 2008-11-26 Akim Demaille <demaille@gostai.com>
3293
3294 Use yy* consistently.
3295 * data/glr.c: Now that yyrhs no longer exists as a global
3296 variable, rename local "rhs" variables into "yyrhs" for
3297 consistency.
3298
3299 2008-11-25 Akim Demaille <demaille@gostai.com>
3300
3301 Get rid of yyrhs and yyprhs in glr.c.
3302 * data/glr.c (yyrhs, yyprhs): Remove.
3303 Instead, use the state stack and yystos.
3304
3305 2008-11-25 Akim Demaille <demaille@gostai.com>
3306
3307 Flag glr tests.
3308 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): If glr, declare it
3309 as an Autotest keyword.
3310
3311 2008-11-25 Akim Demaille <demaille@gostai.com>
3312
3313 Prefer TESTSUITE_FLAGS.
3314 TESTSUITEFLAGS is barely readable.
3315
3316 * tests/local.mk (TESTSUITE_FLAGS): Default to $(TESTSUITEFLAGS)
3317 for backward compatibility.
3318 Use the former instead of the latter.
3319
3320 2008-11-25 Akim Demaille <demaille@gostai.com>
3321
3322 Get rid of yyrhs and yyprhs in larl1.java.
3323 * data/lalr1.java (yyrhs_, yyprhs_): Remove.
3324 (yy_reduce_print): Rather, use yystos_ and the state stack.
3325
3326 2008-11-25 Akim Demaille <demaille@gostai.com>
3327
3328 Formatting changes.
3329
3330 2008-11-25 Akim Demaille <demaille@gostai.com>
3331
3332 Get rid of yyrhs and yyprhs in yacc.c.
3333 They were used to get the symbol types, given a rule number, when
3334 displaying the top of the stack before a reduction. But the
3335 symbol type is available from the state stack. This has two be
3336 benefits: two tables less in the parser (making it smaller), and a
3337 more consistent use of the three stacks which will help to fuse
3338 them.
3339
3340 * data/yacc.c (yyprhs, yyrhs): Remove.
3341 (YY_REDUCE_PRINT): Pass yyssp to yy_reduce_print.
3342 (yy_reduce_print): Take yyssp as argument.
3343 Use it, together with yystos, to get the symbol type.
3344 * tests/regression.at (Web2c Report): Remove these tables from the
3345 expected output.
3346
3347 2008-11-25 Akim Demaille <demaille@gostai.com>
3348
3349 b4_tables_map.
3350 The point is to factor the generation of the tables across skeletons.
3351 This is language dependant.
3352
3353 * data/c.m4 (b4_comment_): New.
3354 Should be usable to define how to generate tables independently of
3355 the language.
3356 (b4_c_comment): New.
3357 (b4_comment): Bounce to b4_c_comment.
3358 Now support $2 = [PREFIX] for indentation.
3359 * data/lalr1.cc (b4_table_declare): Don't output a comment if
3360 there is no comment.
3361 Indent it properly when there is one.
3362 Output the ending semicolon.
3363 (b4_table_define): Space changes.
3364 Output the ending semicolon.
3365 (b4_tables_map): New.
3366 Use it twice instead of declaring and defining the (integral)
3367 tables by hand.
3368
3369 2008-11-25 Akim Demaille <demaille@gostai.com>
3370
3371 b4_table_declare.
3372 * data/lalr1.cc (b4_table_declare): New.
3373 Use it to declare the tables defined with b4_table_define.
3374 (b4_table_define): Declare a third arg to match b4_table_declare
3375 signature.
3376 Move all the comments around invocations of b4_table_define into
3377 the invocations itselves.
3378 Move things around to have the order for declarations and
3379 definitions.
3380
3381 2008-11-25 Akim Demaille <demaille@gostai.com>
3382
3383 Formatting changes.
3384 * data/lalr1.java: here.
3385
3386 2008-11-25 Akim Demaille <demaille@gostai.com>
3387
3388 b4_args is more general than only C++.
3389 * data/lalr1.cc (b4_args, _b4_args): Move to...
3390 * data/bison.m4: here.
3391
3392 2008-11-21 Di-an Jan <dianj@freeshell.org>
3393
3394 Implement no-XXX arguments for --warnings, --report, --trace.
3395 * src/getargs.c (flags_argmatch): Handles no-XXX.
3396 Fix typo in doxygen comment.
3397
3398 2008-11-21 Akim Demaille <demaille@gostai.com>
3399
3400 Display the changes in cross-options.texi.
3401 * build-aux/cross-options.pl ($sep): New, to separate items.
3402 * doc/local.mk ($(CROSS_OPTIONS_TEXI)): Use diff to display the
3403 changes.
3404
3405 2008-11-20 Di-an Jan <dianj@freeshell.org>
3406
3407 Improves options in the manual.
3408 * doc/bison.texinfo (-g, -x): Add space before argument.
3409 (Option Cross Key): Implement FIXME: listing directives also.
3410 * build-aux/cross-options.pl: Read from <STDIN> rather than <>.
3411 (Short Option): Special case -d. Put arguments inside @option.
3412 (Bison Directive): Add column, automatically extracted from
3413 src/scan-gram.l (actual name passed as the first argument)
3414 with special case for %define.
3415 * doc/local.mk (doc/cross-options.texi): Pass src/scan-gram.l
3416 to build-aux/cross-options.pl.
3417 * src/getargs.c (usage): Document limitations of cross-options.pl.
3418 * src/scan-gram.l: Likewise.
3419
3420 2008-11-18 Joel E. Denny <jdenny@ces.clemson.edu>
3421
3422 Fix unexpanded macros in GLR defines file.
3423 Reported by Csaba Raduly at
3424 <http://lists.gnu.org/archive/html/bug-bison/2008-11/msg00048.html>.
3425 * THANKS (Csaba Raduly): Add.
3426 * data/glr.c: Fix overquoting on b4_prefix for yylval and yylloc.
3427 * tests/calc.at (_AT_DATA_CALC_Y): If %defines is specified, generate
3428 lexer in a separate module that includes the defines file.
3429 (AT_CHECK_CALC): From AT_FULL_COMPILE, request compilation of lexer
3430 source.
3431 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_DEFINES_IF.
3432 Adjust AT_LOC and AT_VAL to use AT_NAME_PREFIX.
3433 (AT_BISON_OPTION_POPDEFS): Pop AT_DEFINES_IF.
3434 (AT_DATA_SOURCE_PROLOGUE): New.
3435 (AT_DATA_GRAMMAR_PROLOGUE): Use AT_DATA_SOURCE_PROLOGUE.
3436 (AT_DATA_SOURCE): New.
3437 (AT_FULL_COMPILE): Extend to support an additional source file.
3438
3439 2008-11-18 Akim Demaille <demaille@gostai.com>
3440
3441 More TODO.
3442 * TODO: More short term issues.
3443
3444 2008-11-18 Akim Demaille <demaille@gostai.com>
3445
3446 Regen.
3447 * src/parse-gram.h, src/parse-gram.c: Regen.
3448
3449 2008-11-18 Akim Demaille <demaille@gostai.com>
3450
3451 Use b4_subtract where possible.
3452 * data/lalr1.cc (b4_subtract): Move to...
3453 * data/bison.m4: here.
3454 * data/glr.c (b4_rhs_data): Use it.
3455 * data/yacc.c (b4_rhs_value, b4_rhs_location): Use it.
3456
3457 2008-11-18 Akim Demaille <demaille@gostai.com>
3458
3459 Remove incorrect mode specification.
3460 * data/glr.cc: Don't pretend it's C code.
3461
3462 2008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
3463
3464 Simplify last patch slightly.
3465 * src/getargs.c (getargs): Here.
3466
3467 2008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
3468
3469 Fix last warning from --enable-gcc-warnings.
3470 * src/getargs.c (getargs): Don't assign const address to non-const
3471 pointer.
3472
3473 2008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
3474
3475 Don't let maintainer-*-check targets force a version update.
3476 * cfg.mk (_is-dist-target): Implement. maintainer-check* was already
3477 handled.
3478
3479 2008-11-17 Di-an Jan <dianj@freeshell.org>
3480
3481 * doc/bison.texinfo: Synchronize ``Detail Node Listing''.
3482 Align menus. Adjust word wrapping. Use node names for menu names.
3483 (Examples): Don't abbreviate node names.
3484 (LocalWords): Remove abbreviations.
3485 (Copying): Make description a sentence.
3486 (Java Action Features): Remove period to match the rest of menu.
3487
3488 2008-11-17 Di-an Jan <dianj@freeshell.org>
3489
3490 Handles several --enable-gcc-warnings.
3491 * src/getargs.c (command_line_location): Set parameters to void.
3492 * src/output.c (symbol_type_name_cmp): Make static.
3493 (symbols_by_type_name): Set parameters to void.
3494 (symbol_definitions_output): Remove unused parameter. Rename as...
3495 (prepare_symbol_definitions): this.
3496 (muscles_output): Move symbol_definitions_output to...
3497 (output): here as prepare_symbol_definitions.
3498 * tests/c++.at (AT_CHECK_VARIANTS): Remove unused parameters of main.
3499 (AT_CHECK_NAMESPACE): Make unused parameter lloc unnamed.
3500
3501 2008-11-17 Di-an Jan <dianj@freeshell.org>
3502
3503 * tests/c++.at (AT_CHECK_VARIANTS): Fixes tests 198-202.
3504 Use AT_DATA_GRAMMAR instead of AT_DATA for compiled tests.
3505
3506 2008-11-16 Akim Demaille <demaille@gostai.com>
3507
3508 Add missing $(EXEEXT).
3509 * doc/local.mk ($(CROSS_OPTIONS_TEXI)): The target is
3510 "src/bison$(EXEEXT)".
3511 Reported by Di-an Jan.
3512
3513 2008-11-15 Akim Demaille <demaille@gostai.com>
3514
3515 * TODO: Update.
3516
3517 2008-11-15 Akim Demaille <demaille@gostai.com>
3518
3519 Formatting changes.
3520 * tests/input.at: here.
3521
3522 2008-11-15 Akim Demaille <demaille@gostai.com>
3523
3524 Remove duplicate header inclusion.
3525 * src/LR0.c: here.
3526
3527 2008-11-15 Akim Demaille <demaille@gostai.com>
3528
3529 * src/parse-gram.h, src/parse-gram.c: Regen.
3530
3531 2008-11-15 Akim Demaille <demaille@gostai.com>
3532
3533 Support parametric types.
3534
3535 There are two issues to handle: first scanning nested angle
3536 bracket pairs to support types such as std::pair< std::string,
3537 std::list<std::string> > >.
3538
3539 Another issue is to address idiosyncracies of C++: do not glue two
3540 closing angle brackets together (otherwise it's operator>>), and
3541 avoid sticking blindly a TYPE to the opening <, as it can result
3542 in '<:' which is a digraph for '['.
3543
3544 * src/scan-gram.l (brace_level): Rename as...
3545 (nesting): this.
3546 (SC_TAG): New.
3547 Implement support for complex tags.
3548 (tag): Accept
3549 , but not <.
3550 * data/lalr1.cc (b4_symbol_value, b4_symbol_value_template)
3551 (b4_symbol_variant): Leave space around types as parameters.
3552 * examples/variant.yy: Use nested template types and leading ::.
3553 * src/parse-gram.y (TYPE, TYPE_TAG_ANY, TYPE_TAG_NONE, type.opt):
3554 Rename as...
3555 (TAG, TAG_ANY, TAG_NONE, tag.opt): these.
3556 * tests/c++.at: Test parametric types.
3557
3558 2008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
3559
3560 Test token.prefix.
3561 This is not sufficient, but we test at least that the make_SYMBOL
3562 interface is not affected by token.prefix. A more general test
3563 will be implemented when the support of token.prefix is generalized
3564 to more skeletons.
3565
3566 * tests/c++.at: One more variant test, using token.prefix.
3567
3568 2008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
3569
3570 Test the make_TOKEN interface.
3571 * tests/c++.at (AT_CHECK_VARIANTS): Require and use locations.
3572 Factor the common code in yylex.
3573 Use it to test "%define lex_symbol".
3574
3575 2008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
3576
3577 Formatting change.
3578
3579 2008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
3580
3581 Simplify code for variants bench marks.
3582 * etc/bench.pl.in (&generate_grammar_list): Define and use
3583 location_type.
3584 Factor the common code in yylex.
3585
3586 2008-11-15 Akim Demaille <demaille@gostai.com>
3587
3588 Better error message.
3589 * bootstrap (find_tool): Fix the error message.
3590
3591 2008-11-15 Akim Demaille <demaille@gostai.com>
3592
3593 Update variant.yy to newest interface.
3594 * examples/variant.yy: Define lex_symbol.
3595 Adjust.
3596
3597 2008-11-15 Akim Demaille <demaille@gostai.com>
3598
3599 Don't use locations in variant.yy.
3600 * examples/variant.yy: Adjust to not using locations.
3601
3602 2008-11-15 Akim Demaille <demaille@gostai.com>
3603
3604 Comment changes.
3605 * data/local.mk, etc/local.mk, examples/local.mk: Use Automake
3606 comments for the license.
3607
3608 2008-11-15 Akim Demaille <demaille@gostai.com>
3609
3610 Remove tests/Makefile.am.
3611 * tests/Makefile.am: Rename as...
3612 * tests/local.mk: this.
3613 * Makefile.am, configure.ac: Adjust.
3614 * Makefile.am (DISTCLEANFILES): Define.
3615 (maintainer-check, maintainer-xml-check, maintainer-push-check):
3616 Remove, we no longer need to bounce to the real targets.
3617
3618 2008-11-15 Akim Demaille <demaille@gostai.com>
3619
3620 Comment changes.
3621
3622 2008-11-15 Akim Demaille <demaille@gostai.com>
3623
3624 djgpp/local.mk.
3625 * Makefile.am (EXTRA_DIST): Move djgpp related part to...
3626 * djgpp/local.mk: this new file.
3627
3628 2008-11-15 Akim Demaille <demaille@gostai.com>
3629
3630 Remove doc/Makefile.am.
3631 * doc/Makefile.am: Rename as...
3632 * doc/local.mk: this.
3633 Adjust paths
3634 * Makefile.am, configure.ac: Adjust.
3635 * Makefile.am (MOSTLYCLEANFILES): New.
3636 * src/local.mk: Adjust.
3637
3638 2008-11-15 Akim Demaille <demaille@gostai.com>
3639
3640 Move sc_tight_scope into maint.mk.
3641 It does not work, and I don't know how it was supposed to work: it
3642 seems to be looking for sources in the build tree. I just moved
3643 it at a better place, fixing it is still required.
3644
3645 * src/local.mk (echo): Remove.
3646 (sc_tight_scope): Move to...
3647 * maint.mk: here.
3648
3649 2008-11-15 Akim Demaille <demaille@gostai.com>
3650
3651 Regen.
3652 * src/parse-gram.h, src/parse-gram.h: Regen.
3653
3654 2008-11-15 Akim Demaille <demaille@gostai.com>
3655
3656 Remove src/Makefile.am.
3657 * src/Makefile.am: Rename as...
3658 * src/local.mk: this.
3659 Prefix all the paths with src/.
3660 (AUTOMAKE_OPTIONS): Build object files in the sub dirs.
3661 (AM_CPPFLAGS): Find find in builddir/src.
3662 (YACC): Move the flags into...
3663 (AM_YFLAGS): here.
3664 * maint.mk (sc_tight_scope): Disable.
3665 It used to bounce to the version in src/Makefile.am which is now
3666 part of this very Makefile.
3667 * Makefile.am, configure.ac: Adjust.
3668 * src/scan-code-c.c, src/scan-code.l: We can no longer rely on
3669 include "..." to find files "here": we are no longer in src/, so
3670 qualify the includes with src/.
3671 * doc/Makefile.am (PREPATH): No longer include the top_builddir
3672 prefix.
3673 (.x.1): Adjust to be able to create src/foo from the top level
3674 Makefile, instead of going bounce to src/Makefile the creation of
3675 foo.
3676
3677 2008-11-15 Akim Demaille <demaille@gostai.com>
3678
3679 Remove useless variable.
3680 * doc/Makefile.am (srcsrcdir): Remove.
3681
3682 2008-11-15 Akim Demaille <demaille@gostai.com>
3683
3684 Remove data/Makefile.am.
3685 * data/Makefile.am: Rename as...
3686 * data/local.mk: this.
3687 Adjust paths.
3688 * Makefile.am, configure.ac: Adjust.
3689
3690 2008-11-15 Akim Demaille <demaille@gostai.com>
3691
3692 Remove etc/Makefile.am.
3693 * etc/Makefile.am: Rename as...
3694 * etc/local.mk: this.
3695 Adjust.
3696 * Makefile.am, configure.ac: Adjust.
3697
3698 2008-11-15 Akim Demaille <demaille@gostai.com>
3699
3700 Remove examples/local.mk.
3701 examples/calc++/Makefile.am might be interesting to keep as is, since
3702 it is an example in itself.
3703
3704 * examples/Makefile.am: Rename as...
3705 * examples/local.mk: this.
3706 Adjust.
3707 * Makefile.am, configure.ac: Adjust.
3708
3709 2008-11-15 Akim Demaille <demaille@gostai.com>
3710
3711 Remove build-aux/Makefile.am.
3712 Recursive Makefiles are really way too slow, let's get rid of some of
3713 them.
3714
3715 * build-aux/Makefile.am: Rename as...
3716 * build-aux/local.mk: this.
3717 Adjust paths.
3718 * Makefile.am, configure.ac: Adjust.
3719
3720 2008-11-15 Akim Demaille <demaille@gostai.com>
3721
3722 Provide convenience constructors for locations and positions.
3723 * data/location.cc (position::position): Accept file, line and
3724 column as arguments with default values.
3725 Always qualify initial line and column literals as unsigned.
3726 (location::location): Provide convenience constructors.
3727
3728 2008-11-15 Akim Demaille <demaille@gostai.com>
3729
3730 Instead of using make_symbol<TOK_FOO>, generate make_FOO for each
3731 token type.
3732 Using template buys us nothing, and makes it uselessly complex to
3733 construct a symbol. Besides, it could not be generalized to other
3734 languages, while make_FOO would work in C/Java etc.
3735
3736 * data/lalr1.cc (b4_symbol_): New.
3737 (b4_symbol): Use it.
3738 (b4_symbol_constructor_declaration_)
3739 (b4_symbol_constructor_definition_): Instead of generating
3740 specializations of an overloaded template function, just generate
3741 several functions whose names are forged from the token names
3742 without the token.prefix.
3743 (b4_symbol_constructor_declarations): Generate them for all the
3744 symbols, not just by class of symbol type, now that instead of
3745 specializing a function template by the token, we generate a
3746 function named after the token.
3747 (b4_symbol_constructor_specialization_)
3748 (b4_symbol_constructor_specializations): Remove.
3749 * etc/bench.pl.in: Adjust to this new API.
3750
3751 2008-11-13 Akim Demaille <demaille@gostai.com>
3752
3753 %define token.prefix.
3754 Provide a means to add a prefix to the name of the tokens as
3755 output in the generated files. Because of name clashes, it is
3756 good to have such a prefix such as TOK_ that protects from names
3757 such as EOF, FILE etc. But it clutters the grammar itself.
3758
3759 * data/bison.m4 (token.prefix): Empty by default.
3760 * data/c.m4 (b4_token_enum, b4_token_define): Use it.
3761 * data/lalr1.cc (b4_symbol): Ditto.
3762
3763 2008-11-13 Akim Demaille <demaille@gostai.com>
3764
3765 Compute at M4 time some of the subtractions.
3766 * data/lalr1.cc (b4_subtract): New.
3767 (b4_rhs_data): Use it.
3768
3769 2008-11-13 Akim Demaille <demaille@gostai.com>
3770
3771 symbol::token.
3772 This allows the user to get the type of a token returned by yylex.
3773
3774 * data/lalr1.cc (symbol::token): New.
3775 (yytoknum_): Define when %define lex_symbol, independently of
3776 %debug.
3777 (yytoken_number_): Move into...
3778 (symbol::token): here, since that's the only use.
3779 The other one is YYPRINT which was not officially supported
3780 by lalr1.cc, and anyway it did not work since YYPRINT uses this
3781 array under a different name (yytoknum).
3782
3783 2008-11-13 Akim Demaille <demaille@gostai.com>
3784
3785 YYERRCODE.
3786 * TODO (YYERRCODE): Mention the case of $undef.
3787
3788 2008-11-13 Akim Demaille <demaille@gostai.com>
3789
3790 TODO: YYPRINT.
3791 * TODO (YYPRINT): New.
3792
3793 2008-11-13 Akim Demaille <demaille@gostai.com>
3794
3795 Comment changes.
3796 * data/lalr1.cc, data/yacc.c: Fix the description of the
3797 yytranslate and yytoknum tables.
3798
3799 2008-11-13 Akim Demaille <demaille@gostai.com>
3800
3801 Define make_symbol in the header.
3802 To reach good performances these functions should be inlined (yet
3803 this is to measure precisely). To this end they must be available
3804 to the caller.
3805
3806 * data/lalr1.cc (b4_symbol_constructor_definition_): Qualify
3807 location_type with the class name.
3808 Since will now be output in the header, declare "inline".
3809 No longer use b4_symbol_constructor_specializations, but
3810 b4_symbol_constructor_definitions in the header.
3811 Don't call it in the *.cc file.
3812
3813 2008-11-13 Akim Demaille <demaille@gostai.com>
3814
3815 Define yytranslate in the header for lex_symbol.
3816 * data/lalr1.cc: Move the invocation of b4_yytranslate_definition
3817 into the header file when using %define lex_symbol.
3818 (yytranslate_): Declare inline.
3819
3820 2008-11-13 Akim Demaille <demaille@gostai.com>
3821
3822 Define the constructors of symbol_type in
3823 b4_symbol_constructor_definitions.
3824 The constructors are called by the make_symbol functions, which a
3825 forthcoming patch will move elsewhere. Hence the interest of
3826 putting them together.
3827
3828 The stack_symbol_type does not need to be moved, it is used only
3829 by the parser.
3830
3831 * data/lalr1.cc: Move symbol_type and symbol_base_type
3832 constructors into...
3833 (b4_symbol_constructor_definitions): here.
3834 Adjust.
3835
3836 2008-11-13 Akim Demaille <demaille@gostai.com>
3837
3838 Make it easier to move the definition of yytranslate_.
3839 Forthcoming changes will make it possible to use yytranslate_
3840 from outside the parser implementation file.
3841
3842 * data/lalr1.cc (b4_yytranslate_definition): New.
3843 Use it.
3844
3845 2008-11-13 Akim Demaille <demaille@gostai.com>
3846
3847 Remove useless class specification.
3848 * data/lalr1.cc (b4_symbol_constructor_specialization_): No need
3849 to refer to the class name to use a type defined by the class for
3850 arguments of member functions.
3851
3852 2008-11-13 Akim Demaille <demaille@gostai.com>
3853
3854 Finer input type for yytranslate.
3855 This patch is debatable: the tradition expects yylex to return an int
3856 which happens to correspond to token_number (which is an enum). This
3857 allows for instance to return characters (such as '*' etc.). But this
3858 goes against the stronger typing I am trying to have with the new
3859 lex interface which return a symbol_type. So in this case, feed
3860 yytranslate_ with a token_type.
3861
3862 * data/lalr1.cc (yytranslate_): When in %define lex-symbol,
3863 expect a token_type.
3864
3865 2008-11-13 Akim Demaille <demaille@gostai.com>
3866
3867 Honor lex-params in %define lex_symbol mode.
3868 * data/lalr1.cc: Use b4_lex_param.
3869
3870 2008-11-13 Akim Demaille <demaille@gostai.com>
3871
3872 Simplify names.
3873 * src/output.c (symbol_definitions_output): Rename symbol
3874 attributes type_name and has_type_name as type and has_type.
3875 * data/lalr1.cc: Adjust uses.
3876
3877 2008-11-13 Akim Demaille <demaille@gostai.com>
3878
3879 Use b4_type_names for the union type.
3880 The union used to compute the size of the variant used to iterate
3881 over the type of all the symbols, with a lot of redundancy. Now
3882 iterate over the lists of symbols having the same type-name.
3883
3884 * data/lalr1.cc (b4_char_sizeof_): New.
3885 (b4_char_sizeof): Use it.
3886 Adjust to be called with a list of numbers instead of a single
3887 number.
3888 Adjust its caller for new-line issues.
3889
3890 2008-11-13 Akim Demaille <demaille@gostai.com>
3891
3892 Define the "identifier" of a symbol.
3893 Symbols may have several string representations, for instance if
3894 they have an alias. What I call its "id" is a string that can be
3895 used as an identifier. May not exist.
3896
3897 Currently the symbols which have the "tag_is_id" flag set are
3898 those that don't have an alias. Look harder for the id.
3899
3900 * src/output.c (is_identifier): Move to...
3901 * src/symtab.c (is_identifier): here.
3902 * src/symtab.h, src/symtab.c (symbol_id_get): New.
3903 * src/output.c (symbol_definitions_output): Use it to define "id"
3904 and "has_id".
3905 Remove the definition of "tag_is_id".
3906 * data/lalr1.cc: Use the "id" and "has_id" whereever "tag" and
3907 "tag_is_id" were used to produce code.
3908 We still use "tag" for documentation.
3909
3910 2008-11-11 Akim Demaille <demaille@gostai.com>
3911
3912 Locations are no longer required by lalr1.cc.
3913 * data/lalr1.cc (_b4_args, b4_args): New.
3914 Adjust all uses of locations to make them optional.
3915 * tests/c++.at (AT_CHECK_VARIANTS): No longer use the locations.
3916 (AT_CHECK_NAMESPACE): Check the use of locations.
3917 * tests/calc.at (_AT_DATA_CALC_Y): Adjust to be usable with or
3918 without locations with lalr1.cc.
3919 Test these cases.
3920 * tests/output.at: Check lalr1.cc with and without location
3921 support.
3922 * tests/regression.at (_AT_DATA_EXPECT2_Y, _AT_DATA_DANCER_Y):
3923 Don't use locations.
3924
3925 2008-11-11 Akim Demaille <demaille@gostai.com>
3926
3927 AT_FULL_COMPILE.
3928 * tests/local.at (AT_FULL_COMPILE): New.
3929 * tests/actions.at, tests/calc.at, tests/regression.at: Use it.
3930
3931 2008-11-11 Akim Demaille <demaille@gostai.com>
3932
3933 Support parens in calc++.
3934 * doc/bison.texinfo (Calc++ Scanner, Calc++ Parser): Support parens.
3935 * examples/calc++/test (run): Check the expected output.
3936 Adjust callers.
3937 Check parens too.
3938
3939 2008-11-11 Akim Demaille <demaille@gostai.com>
3940
3941 Simplify lalr1.cc since %defines is mandatory.
3942 * data/lalr1.cc: Remove useless calls to b4_defines_if.
3943
3944 2008-11-11 Akim Demaille <demaille@gostai.com>
3945
3946 TODO: yyfmt.
3947 * TODO (yysyntax_error): New item.
3948
3949 2008-11-11 Akim Demaille <demaille@gostai.com>
3950
3951 Prefer M4 to CPP.
3952 * data/lalr1.cc: Use b4_error_verbose_if instead of #if
3953 YYERROR_VERBOSE.
3954
3955 2008-11-11 Akim Demaille <demaille@gostai.com>
3956
3957 Support i18n of the parse error messages.
3958 * TODO (lalr1.cc/I18n): Remove.
3959 * data/lalr1.cc (yysyntax_error_): Support the translation of the
3960 error messages, as done in yacc.c.
3961 Stay within the yy* pseudo namespace.
3962
3963 2008-11-11 Akim Demaille <demaille@gostai.com>
3964
3965 More TODO.
3966 * TODO (single stack, yysyntax_error): New.
3967
3968 2008-11-11 Akim Demaille <demaille@gostai.com>
3969
3970 Make it possible to return a symbol_type from yylex.
3971 * data/lalr1.cc (b4_lex_symbol_if): New.
3972 (parse): When lex_symbol is defined, expected yylex to return the
3973 complete lookahead.
3974 * etc/bench.pl.in (generate_grammar_list): Extend to support this
3975 yylex interface.
3976 (bench_variant_parser): Exercise it.
3977
3978 2008-11-11 Akim Demaille <demaille@gostai.com>
3979
3980 Remove useless bench case.
3981 * etc/bench.pl.in (bench_variant_parser): VARIANT_DESTROY is
3982 no longer used.
3983
3984 2008-11-11 Akim Demaille <demaille@gostai.com>
3985
3986 Improve display of directives.
3987 * etc/bench.pl.in (parse_term): Don't add useless eol.
3988
3989 2008-11-11 Akim Demaille <demaille@gostai.com>
3990
3991 Use string_cast in the bench.
3992 * etc/bench.pl.in (generate_grammar_list): Define and use
3993 string_cast.
3994
3995 2008-11-11 Akim Demaille <demaille@gostai.com>
3996
3997 Replace yychar with a Boolean.
3998 * data/lalr1.cc (parse::yychar): Replace by...
3999 (parse::yyempty): this.
4000
4001 2008-11-11 Akim Demaille <demaille@gostai.com>
4002
4003 Factor the tables.
4004 * TODO: New item.
4005
4006 2008-11-11 Akim Demaille <demaille@gostai.com>
4007
4008 Let yytranslate handle the eof case.
4009 * data/lalr1.cc (yytranslate_): Handle the EOF case.
4010 Adjust callers.
4011 No longer expect yychar to be equal to yyeof_, rather, test the
4012 lookahead's (translated) kind.
4013
4014 2008-11-11 Akim Demaille <demaille@gostai.com>
4015
4016 yychar cannot be empty in yyerrlab.
4017 * TODO (yychar == yyempty_): New.
4018 * data/lalr1.cc: Remove the handling of this case.
4019 This eases forthcoming changes related to yychar and yytranslate.
4020
4021 2008-11-11 Akim Demaille <demaille@gostai.com>
4022
4023 Bench: syntactic sugar for %define/#define.
4024 * etc/bench.pl.in (parse_dirs): Support %d and #d with arguments.
4025 (&bench_push_parser, bench_variant_parser): Use this feature.
4026 (&eat): New.
4027 Use it.
4028
4029 2008-11-11 Akim Demaille <demaille@gostai.com>
4030
4031 Less memory pressure on the "list" bench.
4032 * etc/bench.pl.in (generate_grammar_list): Do not accumulate all
4033 the values, to limit memory pressure.
4034
4035 2008-11-11 Akim Demaille <demaille@gostai.com>
4036
4037 Introduce make_symbol.
4038 make_symbol provides a means to construct a full symbol (kind,
4039 value, location) in a single shot. It is meant to be a Symbol
4040 constructor, parameterized by the symbol kind so that overloading
4041 would prevent incorrect kind/value pairs. Unfortunately
4042 parameterized constructors do not work well in C++ (unless the
4043 parameter also appears as an argument, which is not acceptable),
4044 hence the use of a function instead of a constructor.
4045
4046 * data/lalr1.cc (b4_symbol_constructor_declaration_)
4047 (b4_symbol_constructor_declarations)
4048 (b4_symbol_constructor_specialization_)
4049 (b4_symbol_constructor_specializations)
4050 (b4_symbol_constructor_definition_)
4051 (b4_symbol_constructor_definitions): New.
4052 Use them where appropriate to generate declaration, declaration of
4053 the specializations, and implementations of the templated
4054 overloaded function "make_symbol".
4055 (variant::variant): Always define a default ctor.
4056 Also provide a copy ctor.
4057 (symbol_base_type, symbol_type): New ctor overloads for value-less
4058 symbols.
4059 (symbol_type): Now public, so that functions such as yylex can use
4060 it.
4061
4062 2008-11-11 Akim Demaille <demaille@gostai.com>
4063
4064 Inform m4 whether a tag is a valid id.
4065 * src/output.c (is_identifier): New.
4066 (symbol_definitions_output): Use it to define tag_is_id.
4067 But maybe this should be done at m4 level?
4068
4069 2008-11-11 Akim Demaille <demaille@gostai.com>
4070
4071 Test 214 was failing: it greps with a pattern containing [ ]*
4072 which obviously meant to catch spaces and tabs, but contained only
4073 spaces. Tabulations in sources are a nuisance, so to simplify the
4074 matter, get rid of all the tabulations in the Java sources. The
4075 other skeletons will be treated equally later.
4076
4077 * data/java.m4, data/lalr1.java: Untabify.
4078 * tests/java.at: Simplify AT_CHECK_JAVA_GREP invocations:
4079 tabulations are no longer generated.
4080
4081 2008-11-11 Paolo Bonzini <bonzini@gnu.org>
4082
4083 * bootstrap.conf: Replace m4/warning.m4 with warnings module.
4084 * configure.ac: Adjust usage.
4085 * lib/Makefile.am: Replace $(WARNING_CFLAGS) with $(WARN_CFLAGS).
4086 * src/Makefile.am: Replace $(WARNING_CFLAGS) with $(WARN_CFLAGS).
4087 * tests/atlocal.in: Replace $(WARNING_*FLAGS) with $(WARN_*FLAGS).
4088
4089 2008-11-10 Di-an Jan <dianj@freeshell.org>
4090
4091 Workaround Java's ``code too large'' problem for parser tables
4092 in most cases, by using one function per initialization.
4093 * data/java.m4 (b4_typed_parser_table, b4_integral_parser_table): New.
4094 * data/lalr1.java (yypact_, yydefact_, yypgoto_, yydefgoto_,
4095 yytable_, yycheck_, yystos_, yytoken_number_, yyr1_, yyr2_, yyrhs_
4096 yyprhs_, yyrline_, yytranslate_table_): Use b4_integral_parser_table.
4097 (yytname_): Use b4_typed_parser_table.
4098 * doc/bison.texinfo (Java Bison Interface): Add note on Java's
4099 ``code too large'' error.
4100
4101 2008-11-10 Di-an Jan <dianj@freeshell.org>
4102
4103 * NEWS: Document them.
4104
4105 General Java skeleton improvements.
4106 * configure.ac (gt_JAVACOMP): Request target of 1.4, which allows
4107 using gcj < 4.3 in the testsuite, according to comments in
4108 gnulib/m4/javacomp.m4.
4109 * data/java.m4 (stype, parser_class_name, lex_throws, throws,
4110 location_type, position_type): Remove extraneous brackets from
4111 b4_percent_define_default.
4112 (b4_lex_param, b4_parse_param): Remove extraneous brackets from
4113 m4_define and m4_define_default.
4114 * data/lalr1.java (b4_pre_prologue): Change to b4_user_post_prologue,
4115 which marks the end of user code with appropriate syncline, like all
4116 the other skeletons.
4117 (b4_user_post_prologue): Add. Don't silently drop.
4118 (yylex): Remove.
4119 (parse): Inline yylex.
4120 * doc/bison.texinfo (bisonVersion, bisonSkeleton): Document.
4121 (%{...%}): Fix typo of %code imports.
4122 * tests/java.at (AT_JAVA_COMPILE): Add "java" keyword.
4123
4124 Support annotations on parser class with %define annotations.
4125 * data/lalr1.java (annotations): Add to parser class modifier.
4126 * doc/bison.texinfo (Java Parser Interface): Document
4127 %define annotations.
4128 (Java Declarations Summary): Document %define annotations.
4129 * tests/java.at (Java parser class modifiers): Test annotations.
4130
4131 Do not generate code for %error-verbose unless requested.
4132 * data/lalr1.java (errorVerbose): Rename to yyErrorVerbose.
4133 Make private. Make conditional on %error-verbose.
4134 (getErrorVerbose, setErrorVerbose): New.
4135 (yytnamerr_): Make conditional on %error-verbose.
4136 (yysyntax_error): Make some code conditional on %error-verbose.
4137 * doc/bison.texinfo (Java Bison Interface): Remove the parts
4138 about %error-verbose having no effect.
4139 (getErrorVerbose, setErrorVerbose): Document.
4140
4141 Move constants for token names to Lexer interface.
4142 * data/lalr1.java (Lexer): Move EOF, b4_token_enums(b4_tokens) here.
4143 * data/java.m4 (b4_token_enum): Indent for move to Lexer interface.
4144 (parse): Qualify EOF to Lexer.EOF.
4145 * doc/bison.texinfo (Java Parser Interface): Move documentation of
4146 EOF and token names to Java Lexer Interface.
4147 * tests/java.at (_AT_DATA_JAVA_CALC_Y): Remove Calc qualifier.
4148
4149 Make yyerror public.
4150 * data/lalr1.java (Lexer.yyerror): Use longer parameter name.
4151 (yyerror): Change to public. Add Javadoc comments. Use longer
4152 parameter names. Make the body rather than the declarator
4153 conditional on %locations.
4154 * doc/bison.texinfo (yyerror): Document. Don't mark as protected.
4155
4156 Allow user to add code to the constructor with %code init.
4157 * data/java.m4 (b4_init_throws): New, for %define init_throws.
4158 * data/lalr1.java (YYParser.YYParser): Add b4_init_throws.
4159 Add %code init to the front of the constructor body.
4160 * doc/bison.texinfo (YYParser.YYParser): Document %code init
4161 and %define init_throws.
4162 (Java Declarations Summary): Document %code init and
4163 %define init_throws.
4164 * tests/java.at (Java %parse-param and %lex-param): Adjust grep.
4165 (Java constructor init and init_throws): Add tests.
4166
4167 2008-11-10 Akim Demaille <demaille@gostai.com>
4168
4169 Update TODO.
4170 * TODO (-D): is implemented.
4171 (associativity): Same precedence must have the same associativity.
4172 For instance, how can a * b / c be parsed if * is %left and / is
4173 %right?
4174 (YYERRORCODE, YYFAIL, YYBACKUP): New.
4175
4176 2008-11-10 Akim Demaille <demaille@gostai.com>
4177
4178 Formatting changes.
4179
4180 2008-11-10 Akim Demaille <demaille@gostai.com>
4181
4182 More information about the symbols.
4183 * src/output.c (type_names_output): Document all the symbols,
4184 including those that don't have a type-name.
4185 (symbol_definitions_output): Define "is_token" and
4186 "has_type_name".
4187 * data/lalr1.cc (b4_type_action_): Skip symbols that have an empty
4188 type-name, now that they are defined too in b4_type_names.
4189
4190 2008-11-10 Akim Demaille <demaille@gostai.com>
4191
4192 Regen.
4193
4194 2008-11-10 Akim Demaille <demaille@gostai.com>
4195
4196 Make parser::yytranslate static.
4197 Small speedup (1%) on the list grammar. And makes yytranslate_
4198 available in non member functions.
4199
4200 * data/lalr1.cc (yytranslate_): Does not need to be a instance
4201 function.
4202
4203 2008-11-10 Akim Demaille <demaille@gostai.com>
4204
4205 Avoid trailing spaces.
4206 * data/c.m4: b4_comment(TEXT): Don't indent empty lines.
4207 * data/lalr1.cc: Don't indent before rule and symbol actions, as
4208 they can be empty, and anyway this incorrectly indents the first
4209 action.
4210
4211 2008-11-10 Akim Demaille <demaille@gostai.com>
4212
4213 Comment changes.
4214
4215 2008-11-10 Akim Demaille <demaille@gostai.com>
4216
4217 Use "enum" for integral constants.
4218 This is just nicer to read, I observed no speedup.
4219
4220 * data/lalr1.cc (yyeof_, yylast_, yynnts_, yyempty_, yyfinal_)
4221 (yterror_, yyerrcode_, yyntokens_): Define as members of an enum.
4222 (yyuser_token_number_max_, yyundef_token_): Move into...
4223 (yytranslate_): here.
4224
4225 2008-11-10 Akim Demaille <demaille@gostai.com>
4226
4227 Shortcuts in bench directives.
4228 * etc/bench.pl.in (parse_dirs): New.
4229 Use it.
4230 (bench_variant_parser, bench_fusion_parser): Use %s and %d.
4231 Create the benches in "benches/".
4232
4233 2008-11-10 Akim Demaille <demaille@gostai.com>
4234
4235 Formatting changes.
4236 * data/lalr1.cc: here.
4237
4238 2008-11-10 Akim Demaille <demaille@gostai.com>
4239
4240 Adjust verbose message to using emacs.
4241 * etc/bench.pl.in: Inform compilation-mode when we change the
4242 directory.
4243 (generate_grammar_list): Recognize %define "variant" in addition
4244 to %define variant.
4245
4246 2008-11-10 Akim Demaille <demaille@gostai.com>
4247
4248 Classify symbols by type-name.
4249 * src/uniqstr.h (UNIQSTR_CMP): New.
4250 * src/output.c (symbol_type_name_cmp, symbols_by_type_name)
4251 (type_names_output): New.
4252 (muscles_output): Use it.
4253 * data/lalr1.cc (b4_symbol_action_): Remove.
4254 (b4_symbol_case_, b4_type_action_): New.
4255 Adjust uses of b4_symbol_action_ to use b4_type_action_.
4256
4257 2008-11-10 Akim Demaille <demaille@gostai.com>
4258
4259 Change the handling of the symbols in the skeletons.
4260 Before we were using tables which lines were the symbols and which
4261 columns were things like number, tag, type-name etc. It is was
4262 difficult to extend: each time a column was added, all the numbers had
4263 to be updated (you asked for colon $2, not for "tag"). Also, it was
4264 hard to filter these tables when only a subset of the symbols (say the
4265 tokens, or the nterms, or the tokens that have and external number
4266 *and* a type-name) was of interest.
4267
4268 Now instead of monolithic tables, we define one macro per cell. For
4269 instance "b4_symbol(0, tag)" is a macro name which contents is
4270 self-decriptive. The macro "b4_symbol" provides easier access to
4271 these cells.
4272
4273 * src/output.c (type_names_output): Remove.
4274 (symbol_numbers_output, symbol_definitions_output): New.
4275 (muscles_output): Call them.
4276 (prepare_symbols): Define b4_symbols_number.
4277
4278 2008-11-10 Akim Demaille <demaille@gostai.com>
4279
4280 --trace=muscles
4281 * src/getargs.h, src/getargs.c (trace_muscle): New.
4282 (trace_types, trace_args): Support it.
4283 * src/output.c (output_skeleton): Use it.
4284
4285 2008-11-10 Akim Demaille <demaille@gostai.com>
4286
4287 muscles_output.
4288 * src/output.c (muscles_output): New, extracted from...
4289 (output_skeleton): here.
4290 Adjust.
4291
4292 2008-11-10 Akim Demaille <demaille@gostai.com>
4293
4294 Formatting changes.
4295
4296 2008-11-10 Akim Demaille <demaille@gostai.com>
4297
4298 Update the variant example.
4299 * examples/variant.yy: Formatting changes.
4300 One stage build.
4301
4302 2008-11-10 Akim Demaille <demaille@gostai.com>
4303
4304 Support constructor with an argument.
4305 This improves the "list" bench by 2%.
4306
4307 * data/lalr1.cc (variant::build): Add an overloaded version with
4308 an argument.
4309 * tests/c++.at (AT_CHECK_VARIANT): Check it.
4310
4311 2008-11-10 Akim Demaille <demaille@gostai.com>
4312
4313 Test variants.
4314 * tests/c++.at (AT_CHECK_VARIANTS): New.
4315 Use it with and without %define assert.
4316
4317 2008-11-10 Akim Demaille <demaille@gostai.com>
4318
4319 Add %precedence support.
4320 Unfortunately it is not possible to reuse the %prec directive. This
4321 is because to please POSIX, we do not require to end the rules with a
4322 semicolon. As a result,
4323
4324 foo: bar %prec baz
4325
4326 is ambiguous: either a rule which precedence is that of baz, or a rule,
4327 and then a declaration of the precedence of the token baz.
4328
4329 * doc/bison.texinfo: Document %precedence.
4330 (Precedence Only): New.
4331 * src/assoc.h, src/assoc.c (precedence_assoc): New.
4332 * src/conflicts.c (resolve_sr_conflict): Support it.
4333 * src/scan-gram.l, src/parse-gram.y (%precedence): New token.
4334 Parse it.
4335 * tests/calc.at: Use %precedence for NEG.
4336 * tests/conflicts.at (%precedence does not suffice)
4337 (%precedence suffices): New tests.
4338
4339 2008-11-09 Akim Demaille <demaille@gostai.com>
4340
4341 Make benches in a sub dirs.
4342 * etc/bench.pl.in ($dir): New.
4343 Use it.
4344 Check the use of constructors with an argument.
4345 (bench_variant_parser): Fix.
4346
4347 2008-11-09 Akim Demaille <demaille@gostai.com>
4348
4349 fix eof condition
4350
4351 2008-11-09 Akim Demaille <demaille@gostai.com>
4352
4353 Fix --help.
4354
4355 2008-11-09 Akim Demaille <demaille@gostai.com>
4356
4357 Require the generation of parse-gram.output.
4358 * src/Makefile.am (YACC): Pass --report=all.
4359
4360 2008-11-09 Akim Demaille <demaille@gostai.com>
4361
4362 Formatting changes.
4363
4364 2008-11-09 Akim Demaille <demaille@gostai.com>
4365
4366 Update TODO.
4367 * TODO: Remove obsolete items.
4368 Update others.
4369
4370 2008-11-09 Akim Demaille <demaille@gostai.com>
4371
4372 Enhance bench.pl.
4373 * etc/bench.pl.in (parse, parse_expr, parse_term, parse_fact)
4374 (@token, $grammar, $bench): New.
4375 (generate_grammar_variant): Rename as...
4376 (generate_grammar_list): this.
4377 (generate_grammar): Adjust.
4378 (bench_grammar): Rename as...
4379 (bench): this.
4380 Use it in the various bench-marking routines.
4381 (-b, -g): New options.
4382
4383 2008-11-09 Akim Demaille <demaille@gostai.com>
4384
4385 Use a static hierarchy for symbols in the C++ parser.
4386 * data/lalr1.cc (symbol_base_type, symbol_type)
4387 (stack_symbol_type): Make it a static hierarchy.
4388 Adjust dependencies.
4389
4390 2008-11-09 Akim Demaille <demaille@gostai.com>
4391
4392 bench.pl -d, --directive.
4393 * etc/bench.pl.in (@directive): New.
4394 (&bench_grammar): Use it.
4395 (&bench_list_grammar): New, to provide access to the "variant"
4396 grammar.
4397 Use it.
4398 (getopts): Support -d, --directive.
4399
4400 2008-11-09 Akim Demaille <demaille@gostai.com>
4401
4402 Use inline for small operations.
4403 * data/lalr1.cc (symbol_base_type, symbol_type)
4404 (stack_symbol_type): Declare constructor and other operations as
4405 inline.
4406 (yy_destroy_): Inline.
4407
4408 2008-11-09 Akim Demaille <demaille@gostai.com>
4409
4410 Introduce a hierarchy for symbols.
4411 * data/lalr1.cc (symbol_base_type, symbol_type): New.
4412 (data_type): Rename as...
4413 (stack_symbol_type): this.
4414 Derive from symbol_base_type.
4415 (yy_symbol_value_print_): Merge into...
4416 (yy_symbol_print_): this.
4417 Rename as...
4418 (yy_print_): this.
4419 (yydestruct_): Rename as...
4420 (yy_destroy_): this.
4421 (b4_symbols_actions, YY_SYMBOL_PRINT): Adjust.
4422 (parser::parse): yyla is now of symbol_type.
4423 Use its type member instead of yytoken.
4424
4425 2008-11-09 Akim Demaille <demaille@gostai.com>
4426
4427 Rename data_type and stack_symbol_type.
4428 * data/lalr1.cc (data_type): Rename as...
4429 (stack_symbol_type): this.
4430
4431 2008-11-09 Akim Demaille <demaille@gostai.com>
4432
4433 Handle semantic value and location together.
4434 * data/lalr1.cc (b4_symbol_actions): Bounce $$ and @$ to
4435 yydata.value and yydata.location.
4436 (yy_symbol_value_print_, yy_symbol_print_, yydestruct_)
4437 (YY_SYMBOL_PRINT): Now take semantic value and location as a
4438 single arg.
4439 Adjust all callers.
4440 (yydestruct_): New overload for a stack symbol.
4441
4442 2008-11-09 Akim Demaille <demaille@gostai.com>
4443
4444 Push a complete symbol, not connected parts.
4445 * data/lalr1.cc (yypush_): Take a data_type&, not disconnected
4446 state, value and location.
4447 Adjust callers.
4448
4449 2008-11-09 Akim Demaille <demaille@gostai.com>
4450
4451 Agregate yylval and yylloc.
4452 * data/lalr1.cc (parser::yylval, parser::yylloc): Replace by...
4453 (parser::yyla): this.
4454
4455 2008-11-09 Akim Demaille <demaille@gostai.com>
4456
4457 Rely on the state stack to display reduction traces.
4458 To display rhs symbols before a reduction, we used information
4459 about the rule reduced, which required the tables yyrhs and
4460 yyprhs. Now use rely only on the state stack to get the same
4461 information.
4462
4463 * data/lalr1.cc (b4_rhs_data, b4_rhs_state): New.
4464 Use them.
4465 (parser::yyrhs_, parser::yyprhs_): Remove.
4466 (parser::yy_reduce_print_): Use the state stack.
4467
4468 2008-11-09 Akim Demaille <demaille@gostai.com>
4469
4470 Fuse yyval and yyloc into yylhs.
4471 * data/lalr1.cc (b4_lhs_value, b4_lhs_location): Adjust to using
4472 yylhs.
4473 (parse): Replace yyval and yyloc with yylhs.value and
4474 yylhs.location.
4475 After a user action, compute yylhs.state earlier.
4476 (yyerrlab1): Do not play tricks with yylhs.location, rather, use a
4477 fresh error_token.
4478
4479 2008-11-09 Di-an Jan <dianj@freeshell.org>
4480
4481 Remove unused variable.
4482 * src/output.c (type_names_output): Remove unused variable sep.
4483
4484 2008-11-09 Paolo Bonzini <bonzini@gnu.org>
4485
4486 Change tests/output.at quoting.
4487 * tests/output.at (AT_CHECK_OUTPUT): Use conventional m4 quoting when
4488 expanding arguments.
4489
4490 2008-11-07 Joel E. Denny <jdenny@ces.clemson.edu>
4491
4492 Don't add a semicolon to actions for %skeleton or %language.
4493 It breaks Java test cases as reported by Akim Demaille.
4494 * src/scan-code.l: Implement.
4495
4496 2008-11-07 Joel E. Denny <jdenny@ces.clemson.edu>
4497
4498 Clean up %skeleton and %language priority implementation.
4499 * src/getargs.c (skeleton_prio): Use default_prio rather than 2, and
4500 remove static qualifier because others will soon need to see it.
4501 (language_prio): Likewise.
4502 (getargs): Use command_line_prio rather than 0.
4503 * src/getargs.h (command_line_prio, grammar_prio, default_prio): New
4504 enum fields.
4505 (skeleton_prio): Extern it.
4506 (language_prio): Extern it.
4507 * src/parse-gram.y: Use grammar_prio rather than 1.
4508
4509 2008-11-07 Akim Demaille <demaille@gostai.com>
4510
4511 Moving push traces into yypush_.
4512 * data/lalr1.cc (yypush_): Now takes a optional trace message.
4513 Adjust all uses.
4514
4515 2008-11-07 Akim Demaille <demaille@gostai.com>
4516
4517 The single-stack C++ parser is now the standard one.
4518 * data/lalr1.cc: Rename as...
4519 * data/lalr1-split.cc: this.
4520 * data/lalr1-fusion.cc: Rename as...
4521 * data/lalr1.cc: this.
4522 * etc/bench.pl.in: Adjust.
4523
4524 2008-11-07 Akim Demaille <demaille@gostai.com>
4525
4526 Avoid empty-if warnings.
4527 Reported by Quentin Hocquet.
4528
4529 * data/lalr1-fusion.cc (YY_SYMBOL_PRINT, YY_REDUCE_PRINT)
4530 (YY_STACK_PRINT): Provide some contents even when !YYDEBUG.
4531
4532 2008-11-07 Akim Demaille <demaille@gostai.com>
4533
4534 Pass command line location to skeleton_arg and language_argmatch.
4535 * src/getargs.h, src/getargs.c (skeleton_arg, language_argmatch):
4536 The location argument is now mandatory.
4537 Adjust all dependencies.
4538 (getargs): Use command_line_location.
4539
4540 2008-11-07 Akim Demaille <demaille@gostai.com>
4541
4542 -D, --define.
4543 * src/getargs.c (usage): Document -D.
4544 Fix help string for --locations.
4545 (command_line_location): New.
4546 (short_options, long_options, getargs): Support -D, --define.
4547 (getargs): Move -d support at the right place.
4548 * doc/bison.texinfo (Bison Options): Update.
4549 * tests/input.at (%define, --define): New.
4550
4551 2008-11-07 Akim Demaille <demaille@gostai.com>
4552
4553 Initialize the muscle table before parsing the command line.
4554 * src/getargs.c (quotearg.h, muscle_tab.h): Include.
4555 (getargs): Define file_name.
4556 * src/main.c (main): Initialize muscle_tab before calling
4557 getargs.
4558 * src/muscle_tab.c (muscle_init): No longer define file_name, as
4559 its value is not available yet.
4560
4561 2008-11-07 Akim Demaille <demaille@gostai.com>
4562
4563 Locations without columns for command line arguments.
4564 * src/location.c (location_print): Don't display negative columns.
4565 * src/location.h: Document this.
4566
4567 2008-11-07 Akim Demaille <demaille@gostai.com>
4568
4569 Fix --help.
4570 * src/getargs.c (usage): Fix help string for -W.
4571
4572 2008-11-07 Akim Demaille <demaille@gostai.com>
4573
4574 Handle more general types of option arguments.
4575 * build-aux/cross-options.pl: The argument ends at the first
4576 space, not the first non-symbol character.
4577 Use @var for each word appearing the argument description.
4578
4579 2008-11-07 Akim Demaille <demaille@gostai.com>
4580
4581 Destroy the variants that remain on the stack in case of error.
4582 * data/lalr1-fusion.cc (yydestruct_): Invoke the variant's
4583 destructor.
4584 Display the value only if yymsg is nonnull.
4585 (yyreduce): Invoke yydestruct_ when popping lhs symbols.
4586
4587 2008-11-07 Akim Demaille <demaille@gostai.com>
4588
4589 Add "%define assert" to variants.
4590 This is used to help the user catch cases where some value gets
4591 ovewritten by a new one. This should not happen, as this will
4592 probably leak.
4593
4594 Unfortunately this uncovered a bug in the C++ parser itself: the
4595 lookahead value was not destroyed between two calls to yylex. For
4596 instance if the previous lookahead was a std::string, and then an int,
4597 then the value of the std::string was correctly taken (i.e., the
4598 lookahead was now an empty string), but std::string structure itself
4599 was not reclaimed.
4600
4601 This is now done in variant::build(other&) (which is used to take the
4602 value of the lookahead): other is not only stolen from its value, it
4603 is also destroyed. This incurs a new performance penalty of a few
4604 percent, and union becomes faster again.
4605
4606 * data/lalr1-fusion.cc (variant::build(other&)): Destroy other.
4607 (b4_variant_if): New.
4608 (variant::built): New.
4609 Use it whereever the status of the variant changes.
4610 * etc/bench.pl.in: Check the penalty of %define assert.
4611
4612 2008-11-07 Akim Demaille <demaille@gostai.com>
4613
4614 Use "%define variant" in bench.pl.
4615 * etc/bench.pl.in: No longer use the pseudo directive %variants,
4616 just use %define variants.
4617
4618 2008-11-07 Akim Demaille <demaille@gostai.com>
4619
4620 Regen.
4621 * src/parse-gram.h, src/parse-gram.c: Regen.
4622
4623 2008-11-04 Joel E. Denny <jdenny@ces.clemson.edu>
4624
4625 Fix user actions without a trailing semicolon.
4626 Reported by Sergei Steshenko at
4627 <http://lists.gnu.org/archive/html/bug-bison/2008-11/msg00001.html>.
4628 * THANKS (Sergei Steshenko): Add.
4629 * src/scan-code.l (SC_RULE_ACTION): Fix it.
4630 * tests/regression.at (Fix user actions without a trailing semicolon):
4631 New test case.
4632
4633 2008-11-04 Akim Demaille <demaille@gostai.com>
4634
4635 Use b4_copyright_years.
4636 * data/yacc.c (b4_copyright_years): New.
4637 Fix its value according to the comments in the file.
4638 Use it and undefine it.
4639
4640 2008-11-04 Akim Demaille <demaille@gostai.com>
4641
4642 Formatting changes.
4643 * data/lalr1-fusion.cc, src/parse-gram.y: here.
4644
4645 2008-11-04 Akim Demaille <demaille@gostai.com>
4646
4647 Formatting changes.
4648 * data/lalr1-fusion.cc: here.
4649
4650 2008-11-04 Akim Demaille <demaille@gostai.com>
4651
4652 Use strict on bench.pl.
4653 * etc/bench.pl.in (&run, &generate_grammar): New.
4654 Rename the grammar generating functions for consistency.
4655 Change the interface so that the list of benches to run is passed
4656 as (optionless) arguments.
4657 (&compile): Use &run.
4658
4659 2008-11-04 Akim Demaille <demaille@gostai.com>
4660
4661 Remove spurious initial empty lines.
4662 * data/glr.c, data/glr.cc, data/lalr1.cc, data/lalr1.java,
4663 * data/yacc.c: End the @output lines with an @.
4664
4665 2008-11-04 Akim Demaille <demaille@gostai.com>
4666
4667 Improve the display of sizes.
4668 * etc/bench.p.in: Higher precision.
4669 Sort by decreasing size.
4670
4671 2008-11-04 Akim Demaille <demaille@gostai.com>
4672
4673 Don't memcpy C++ structures.
4674 * data/lalr1-fusion.cc (b4_symbol_variant): Adjust additional
4675 arguments.
4676 (variant::build): New overload for
4677 copy-construction-that-destroys.
4678 (variant::swap): New.
4679 (parser::yypush_): Use it in variant mode.
4680
4681 2008-11-04 Akim Demaille <demaille@gostai.com>
4682
4683 Better defaults for bench.pl.
4684 * etc/bench.pl.in ($verbose, $cflags, $iterations): Change the
4685 default values.
4686 Adjust &verbose uses.
4687 (-q, --quiet): New.
4688
4689 2008-11-04 Akim Demaille <demaille@gostai.com>
4690
4691 Make variant.yy more complex.
4692 std::list cannot be copied via memcpy, they are more demanding than
4693 std::string. Use one std::list to strengthen the test.
4694
4695 * examples/variant.yy: Use lalr1-fusion.cc, not lalr1.cc.
4696 Adjust.
4697 Create a list of strings, instead of a single large string.
4698
4699 2008-11-04 Akim Demaille <demaille@gostai.com>
4700
4701 bench.pl --bench.
4702 * etc/bench.pl.in (--bench, $bench): New.
4703
4704 2008-11-04 Akim Demaille <demaille@gostai.com>
4705
4706 Sort methods.
4707 * data/lalr1-fusion.cc (destroy): Use as() in its definition.
4708 Define it after as().
4709
4710 2008-11-04 Akim Demaille <demaille@gostai.com>
4711
4712 Useless parens.
4713 * data/lalr1-fusion.cc (b4_rhs_location): Remove useless parens.
4714
4715 2008-11-04 Akim Demaille <demaille@gostai.com>
4716
4717 Issue missing synclines after user actions.
4718 * data/c.m4 (b4_case): Issue synclines on the output file.
4719
4720 2008-11-04 Akim Demaille <demaille@gostai.com>
4721
4722 Remove trailing empty line.
4723 * data/lalr1-fusion.cc: Don't add an empty line after the user's
4724 epilogue.
4725
4726 2008-11-04 Akim Demaille <demaille@gostai.com>
4727
4728 Fix output of copyright years.
4729 * data/bison.m4 (b4_copyright): Fix the indentation of the
4730 copyright year paragraph.
4731 Use b4_copyright_years when no years are given.
4732 * data/lalr1.cc, data/lalr1-fusion.cc, data/location.cc
4733 (b4_copyright_years): New.
4734 Use it.
4735
4736 2008-11-04 Akim Demaille <demaille@gostai.com>
4737
4738 Avoid the spurious initial empty line.
4739 * data/lalr1-fusion.cc, data/location.cc: Put a trailing "@" at
4740 the end of @output request to suppress the empty line that
4741 results.
4742
4743 2008-11-04 Akim Demaille <demaille@gostai.com>
4744
4745 Remove parser::rhs_number_type.
4746 * data/lalr1-fusion.cc (rhs_number_type): No longer define it.
4747 (yyrhs_): Use b4_table_define.
4748
4749 2008-11-04 Akim Demaille <demaille@gostai.com>
4750
4751 Fix iteration type.
4752 * data/lalr1-fusion.cc: Use an int to iterate up to an int.
4753
4754 2008-11-04 Akim Demaille <demaille@gostai.com>
4755
4756 Factor the declaration of the integer tables.
4757 * data/lalr1-fusion.cc (b4_table_define): New.
4758 Use it.
4759
4760 2008-11-03 Akim Demaille <demaille@gostai.com>
4761
4762 Fix indentation of tables in lalr1.cc
4763 * data/lalr1-fusion.cc: Fix the indentation.
4764
4765 2008-11-03 Akim Demaille <demaille@gostai.com>
4766
4767 Destroy the lhs symbols after reduction.
4768 * data/lalr1-fusion.cc (parse): After the user action, when in
4769 variant mode, destroy the lhs symbols.
4770
4771 2008-11-03 Akim Demaille <demaille@gostai.com>
4772
4773 Simplify yysyntax_error_ use.
4774 * data/lalr1-fusion.cc (yysyntax_error_): Always pass it the token
4775 type, but make it unnamed in the declaration when it is not used.
4776
4777 2008-11-03 Akim Demaille <demaille@gostai.com>
4778
4779 Let yy::variant::build return an lvalue.
4780 * data/lalr1-fusion.cc (variant::build): Return a reference to the
4781 object.
4782
4783 2008-11-03 Akim Demaille <demaille@gostai.com>
4784
4785 Define yy::variant only when needed.
4786 * data/lalr1-fusion.cc (yy::variant): Define only if variants are
4787 used.
4788
4789 2008-11-03 Akim Demaille <demaille@gostai.com>
4790
4791 Bench the three-stack lalr1.cc.
4792 * etc/bench.pl.in: Bench the three-stack lalr1.cc vs. the
4793 one-stack one.
4794
4795 2008-11-03 Akim Demaille <demaille@gostai.com>
4796
4797 Fail on parse error in calc++.
4798 * doc/bison.texinfo (calc++.cc): Propagate failures to the exit
4799 status.
4800 * examples/calc++/test ($me, $number, $exit, run): New.
4801 Use them to propagate errors to the exit status.
4802
4803 2008-11-03 Akim Demaille <demaille@gostai.com>
4804
4805 Don't specify the skeleton twice in the example.
4806 * examples/calc++/Makefile.am: Don't pass -S to Bison, the grammar
4807 file does what is needed.
4808
4809 2008-11-03 Akim Demaille <demaille@gostai.com>
4810
4811 bench: Improve output.
4812 * etc/bench.pl.in (bench_grammar): Tune the printf format.
4813
4814 2008-11-03 Akim Demaille <demaille@gostai.com>
4815
4816 bench: check impact of %debug on variants.
4817 * etc/bench.pl.in (variant_grammar): Fix the computation of
4818 $variant.
4819 Generate a grammar file that can work with or without %debug.
4820 Do use the @directive.
4821 (bench_variant_parser): Check impact of %debug.
4822 (@directives): Rename all the occurrences to...
4823 (@directive): this, for consistency.
4824
4825 2008-11-03 Akim Demaille <demaille@gostai.com>
4826
4827 bench: report the size too.
4828 * etc/bench.pl.in ($iterations): Defaults to -3.
4829 (&bench_grammar): Require hireswallclock.
4830 Compute and display the size of the result.
4831 More comments.
4832
4833 2008-11-03 Akim Demaille <demaille@gostai.com>
4834
4835 bench: More use of the verbosity level.
4836 * etc/bench.pl.in ($verbose, &verbose): New.
4837 Use them.
4838 More POD documentation.
4839
4840 2008-11-03 Akim Demaille <demaille@gostai.com>
4841
4842 bench.pl: a command line interface
4843 * etc/bench.pl.in: More doc.
4844 Some fixes in the documentation.
4845 ($cflags, $iterations, &help, &getopt): New.
4846 Use them.
4847 (&variant_grammar): Let the number of stages be 10 times what is
4848 specified.
4849
4850 2008-11-03 Akim Demaille <demaille@gostai.com>
4851
4852 Bench the use of Boost.Variants.
4853 * etc/bench.pl.in ($cxx, &variant_grammar, &bench_variant_parser):
4854 New.
4855 (&compile): Be ready to compile C++ parsers.
4856 (&bench_push_parser): Move debug information to the outermost
4857 level.
4858 * THANKS: Add Michiel De Wilde.
4859
4860 2008-11-03 Akim Demaille <demaille@gostai.com>
4861
4862 bench.pl: Pass directives as a list instead of as a string.
4863 * etc/bench.pl.in (&directives): New.
4864 (&triangular_grammar, &calc_grammar): Use it to format the Bison
4865 directives.
4866 (&triangular_grammar): Do use the directives (were ignored).
4867 (&bench_grammar, &bench_push_parser): Adjust to pass lists of
4868 directives.
4869
4870 2008-11-03 Akim Demaille <demaille@gostai.com>
4871
4872 Improve genericity of bench.pl.
4873 * etc/bench.pl.in (&bench_grammar): Take the set of benches as
4874 argument.
4875 (&bench_push_parser): New.
4876 Call it.
4877
4878 2008-11-03 Akim Demaille <demaille@gostai.com>
4879
4880 Add documentation to bench.pl.
4881 * etc/bench.pl.in: Comment changes.
4882
4883 2008-11-03 Akim Demaille <demaille@gostai.com>
4884
4885 Fuse the three stacks into a single one.
4886
4887 In order to make it easy to perform benchmarks to ensure that
4888 there are no performance loss, lalr1.cc is forked into
4889 lalr1-fusion.cc. Eventually, lalr1-fusion.cc will replace
4890 lalr1.cc.
4891
4892 Meanwhile, to make sure that lalr1-fusion.cc is correctly
4893 exercized by the test suite, the user must install a symbolic link
4894 from lalr1.cc to it.
4895
4896 Instead of having three stacks (state, value, location), use a
4897 stack of triples. This considerably simplifies the code (and it
4898 will be easier not to require locations as currently does the C++
4899 parser), and also gives a 10% speedup according to
4900 etc/bench (probably mainly since memory allocation is done once
4901 instead of three times).
4902
4903 Another motivation is to make it easier to destruct properly
4904 semantic values: now that they are bound to their state (hence
4905 symbol type) it will be easier to call the appropriate destructor.
4906
4907 These changes should probably benefit the C parser too.
4908
4909 * data/lalr1.cc: Copy as...
4910 * data/lalr1-fusion.cc: this new file.
4911 (b4_rhs_value, b4_rhs_location): New definitions overriding those
4912 from c++.m4.
4913 (state_stack_type, semantic_stack_type, location_stack_type)
4914 (yystate_stack_, yysemantic_stack_, yylocation_stack_): Remove.
4915 (data_type, stack_type, yystack_): New.
4916 (YYLLOC_DEFAULT, yypush_): Adjust.
4917 (yyerror_range): Now based on data_type, not location_type.
4918
4919 2008-11-03 Akim Demaille <demaille@gostai.com>
4920
4921 Push the state, value, and location at the same time.
4922 This is needed to prepare a forthcoming patch that fuses the three
4923 stacks into one.
4924
4925 * data/lalr1.cc (parser::yypush_): New.
4926 (parser::yynewstate): Change the semantics: instead of arriving to
4927 this label when value and location have been pushed, but yystate
4928 is to be pushed on the state stack, now the three of them must
4929 have been pushed before. yystate still must be the new state.
4930 This allows to use yypush_ everywhere instead of individual
4931 handling of the stacks.
4932
4933 2008-11-03 Akim Demaille <demaille@gostai.com>
4934
4935 Prefer references to pointers.
4936 * data/lalr1.cc (b4_symbol_actions): New, overrides the default C
4937 definition to use references instead of pointers.
4938 (yy_symbol_value_print_, yy_symbol_print_, yydestruct_):
4939 Take the value and location as references.
4940 Adjust callers.
4941
4942 2008-11-03 Akim Demaille <demaille@gostai.com>
4943
4944 stack::size instead of stack::height.
4945 * data/lalr1.cc (stack::height): Rename as...
4946 (stack::size): this.
4947 Fix the output type.
4948 Comment changes.
4949
4950 2008-11-03 Akim Demaille <demaille@gostai.com>
4951
4952 Use variants to support objects as semantic values.
4953 This patch was inspired by work by Michiel De Wilde. But he used
4954 Boost variants which (i) requires Boost on the user side, (ii) is
4955 slow, and (iii) has useless overhead (the parser knows the type of
4956 the semantic value there is no reason to duplicate this
4957 information as Boost.Variants do).
4958
4959 This implementation reserves a buffer large enough to store the
4960 largest objects. yy::variant implements this buffer. It was
4961 implemented with Quentin Hocquet.
4962
4963 * src/output.c (type_names_output): New.
4964 (output_skeleton): Invoke it.
4965 * data/c++.m4 (b4_variant_if): New.
4966 (b4_symbol_value): If needed, provide a definition for variants.
4967 * data/lalr1.cc (b4_symbol_value, b4_symbol_action_)
4968 (b4_symbol_variant, _b4_char_sizeof_counter, _b4_char_sizeof_dummy)
4969 (b4_char_sizeof, yy::variant): New.
4970 (parser::parse): If variants are requested, define
4971 parser::union_type, parser::variant, change the definition of
4972 semantic_type, construct $$ before running the user action instead
4973 of performing a default $$ = $1.
4974 * examples/variant.yy: New.
4975 Based on an example by Michiel De Wilde.
4976
4977 2008-11-03 Akim Demaille <demaille@gostai.com>
4978
4979 Parameterize the extraction of semantic values.
4980 To make future changes easier, no longer rely on ".TYPE" being the
4981 way to get a semantic value.
4982
4983 * data/c.m4 (b4_symbol_value): New.
4984 Use it.
4985 * data/c++.m4, data/yacc.c: Use it.
4986 * data/glr.c: Use b4_symbol_value.
4987 (b4_rhs_data): New.
4988 Use it.
4989
4990 2008-11-03 Akim Demaille <demaille@gostai.com>
4991
4992 Prepare easier M4 changes.
4993 * data/lalr1.cc: Use escaped [] instead of literals to prepare
4994 future changes.
4995
4996 2008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
4997
4998 Initiate further development.
4999 * NEWS: Create an empty section for new entries.
5000 * gnulib: Update submodule to HEAD.
5001
5002 2008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
5003
5004 * NEWS: Version 2.4.
5005
5006 2008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
5007
5008 Prepare for next release.
5009 * NEWS: Briefly mention changes since 2.3b.
5010 * README: Say GNU m4 1.4.6, which we've been requiring in release
5011 announcements already, not 1.4.3, which breaks the build.
5012
5013 2008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
5014
5015 Say %language is experimental.
5016 We're thinking of extending it's effect on output file naming. See the
5017 thread at
5018 <http://lists.gnu.org/archive/html/bison-patches/2008-10/msg00003.html>.
5019 * NEWS: Say it's experimental.
5020 * doc/bison.texinfo (Decl Summary): Say it's experimental, and so don't
5021 recommend it over %skeleton for now.
5022 (Bison Options): Likewise.
5023 (C++ Bison Interface): Use %skeleton not %language.
5024 (Calc++ Parser): Use %skeleton not %language.
5025 * src/getargs.c (usage): Say it's experimental.
5026
5027 2008-11-01 Di-an Jan <dianj@freeshell.org>
5028 Paolo Bonzini <bonzini@gnu.org>
5029
5030 Support all Java parser class modifiers.
5031 * data/java.m4 (b4_percent_define_get3): New.
5032 (b4_final_if, b4_strictfp_if): New.
5033 * data/lalr1.java (final, strictfp, extends, implements): Support.
5034 * doc/bison.texinfo (final, strictfp, extends, implements): Add
5035 documentation.
5036 * tests/java.at (AT_CHECK_JAVA_MINIMAL): New.
5037 (AT_CHECK_JAVA_MINIMAL_W_LEXER): New.
5038 (AT_CHECK_JAVA_GREP): New.
5039 (Java parser class modifiers): New test.
5040 (Java parser class extends and implements): New test.
5041
5042 Model exception propagation better with throws and lex_throws.
5043 * data/java.m4 (b4_list2): New.
5044 (throws): Change default.
5045 * data/lalr1.java (yyaction): Add throws.
5046 (parse): Add lex_throws in addition to throws.
5047 * doc/bison.texinfo (throws, lex_throws): Add documentation.
5048 * tests/java.at (Java throws specifications): New test.
5049
5050 Improve documentation for Java parsers.
5051 * doc/bison.texinfo (Java Parsers): Add subsections.
5052 Don't quote first argument of %define.
5053 (Java Bison Interface): Document output files. Move documentation
5054 of parser class and merge into Java Parser Interface. Document
5055 features that error out. Document directives with no effect.
5056 Move note about Javadoc higher.
5057 (Java Semantic Values): Explicitly mention stype.
5058 Document that generic types cannot be used.
5059 (Java Location Values): Use @deftypeivar. Document constructors.
5060 Correct return value for toString.
5061 (Java Parser Interface): List undocumented constants/fields.
5062 Move documentation of fields added by %parse-param closer to list
5063 of members. Document that token names are added as fields.
5064 Document constructors accurately. Remove error method.
5065 (Java Scanner Interface): Move note on %pure-parser to Java Bison
5066 Interface. Describe %code lexer and yylex accutately.
5067 Remove documentation that does not match the code.
5068 (Java Action Features): New.
5069 (Java Differences): Add reference. Add item on semantic values.
5070 Add note about @{ ... @}. Clarify %% epilogue placement.
5071 (Java Declarations Summary): New.
5072
5073 Fix Java skeleton.
5074 * data/java.m4 (b4_prefix): Correct quoting for m4_define_default.
5075 (b4_remove_comma): Quote test argument.
5076 (b4_identification): Remove "bison" field.
5077 * tests/java.at (Java parser class and package names): New test.
5078 (Java %parse-param and %lex-param): New test.
5079 (Java stype, position_class and location_class): New test.
5080
5081 2008-10-31 Di-an Jan <dianj@freeshell.org>
5082
5083 * data/lalr1.jave: Update copyright years.
5084 (YYParser): Correct name of "generated from" file in Javadoc:
5085 use b4_file_name instead of @ofile@.
5086 (Location constructor): Correct Javadoc parameter name.
5087 (yylloc): Add missing opening m4 quote after b4_location_if.
5088 This removes a stray [ in the Javadoc of Lexer.getStartPos.
5089 (Lexer.yyerror): Fix incorrect m4 and Javadoc.
5090 (YYParser constructor): Correct Javadoc parameter name.
5091
5092 2008-10-30 Joel E. Denny <jdenny@ces.clemson.edu>
5093
5094 Always put auxiliary code files in the same dir as other output files.
5095 * src/files.c (compute_file_name_parts): When the user specifies
5096 --output but not --file-prefix, extract the directory prefix from the
5097 file prefix not from the grammar file name. This affects the location
5098 of files like location.hh generated by the C++ skeleton. The includes
5099 in the other output files require this fix.
5100 * tests/output.at (AT_CHECK_OUTPUT): Automatically create directories
5101 for expected output files.
5102 (Output files): Add a test for the above.
5103
5104 2008-10-29 Joel E. Denny <jdenny@ces.clemson.edu>
5105
5106 * gnulib: Update submodule to HEAD.
5107
5108 2008-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
5109
5110 Update copyright year.
5111 * src/files.c: Here.
5112
5113 2008-10-28 Di-an Jan <dianj@freeshell.org> (tiny change)
5114
5115 Don't overwrite the input file.
5116 * src/files.c (output_file_name_check): Fatal error if using input file
5117 for output.
5118 * tests/output.at: (AT_CHECK_CONFLICTING_OUTPUT): Add return status
5119 argument.
5120 (Conflicting output files): Add test.
5121
5122 2008-10-28 Akim Demaille <demaille@gostai.com>
5123
5124 Space changes.
5125 * data/lalr1.cc: Formatting changes.
5126
5127 2008-10-28 Akim Demaille <demaille@gostai.com>
5128
5129 Don't define debugging functions when !YYDEBUG.
5130 * data/lalr1.cc (debug_stream, set_debug_stream)
5131 (debug_level_type, debug_level, set_debug_level): Don't
5132 declare them when YYDEBUG is not defined.
5133 The implementation are already YYDEBUG-aware.
5134
5135 2008-10-28 Akim Demaille <demaille@gostai.com>
5136
5137 Prefer "continue" for empty loop bodies.
5138 * etc/bench.pl.in: Use "continue" instead of {}.
5139
5140 2008-10-28 Akim Demaille <demaille@gostai.com>
5141
5142 Space and comments changes.
5143 * data/c++.m4, data/glr.c, data/lalr1.cc: Copyright year changes.
5144 * data/c.m4, data/lalr1.cc: Space changes.
5145
5146 2008-10-28 Akim Demaille <demaille@gostai.com>
5147
5148 Make gnulib a submodule.
5149 * gnulib: New.
5150 * .gitmodules (gnulib): New.
5151
5152 2008-10-18 Joel E. Denny <jdenny@ces.clemson.edu>
5153
5154 Fix yyerror_range for user-defined location type in C++. Reported by
5155 Georg Sauthoff at
5156 <http://lists.gnu.org/archive/html/bug-bison/2008-08/msg00008.html>.
5157 * data/lalr1.cc (parse): Change type of yyerror_range to location_type.
5158 * THANKS (Georg Sauthoff): Add.
5159
5160 2008-10-18 Joel E. Denny <jdenny@ces.clemson.edu>
5161
5162 Update several administrative files mainly to facilitate releasing.
5163 * HACKING (Administrivia): Make the git-merge-changelog notes more
5164 helpful.
5165 (Test suite): Don't say lalr1.cc is not exercised in the test suite.
5166 (Release Procedure): Update for git and add numerous details that were
5167 previously missing.
5168 * Makefile.am (EXTRA_DIST): Remove Makefile.cfg and Makefile.maint.
5169 * maint.mk (announcement): Don't list bison as a bootstrap tool so
5170 that announcements don't claim we bootstrapped with whatever bison
5171 happened to be in PATH. Add flex as a bootstrap tool.
5172 * Makefile.maint: Remove, previously replaced by maint.mk.
5173 * Makefile.cfg: Remove, and migrate settings to...
5174 * cfg.mk: ... here for the sake of `make announcement'.
5175 * bootstrap.conf (gnulib_modules): Add announce-gen.
5176 * README: Say GNU Bison instead of just Bison. Suggested by Karl
5177 Berry.
5178
5179 2008-10-08 Di-an Jan <dianj@freeshell.org> (tiny change)
5180
5181 Small but important bugfixes for the Java skeleton.
5182 * data/lalr1.java (yyerror): Change Location to b4_location_type.
5183 (yy_symbol_print): Call toString on yyvaluep.
5184
5185 2008-08-29 Akim Demaille <demaille@gostai.com>
5186
5187 Clarify UPDATED use.
5188 * doc/bison.texinfo: It refers to the last edition of this file,
5189 not to the release date of Bison.
5190 Reported by Joel E. Denny.
5191
5192 2008-08-29 Akim Demaille <demaille@gostai.com>
5193
5194 * README: Update FAQ pointer.
5195 Reported by Joel E. Denny.
5196
5197 2008-08-27 Eric Blake <ebb9@byu.net>
5198
5199 Resync m4sugar from autoconf.
5200 * data/m4sugar/m4sugar.m4 (m4_defn, m4_popdef, m4_undefine)
5201 (m4_init): Adjust to latest m4.git changes.
5202 (m4_mapall_sep, _m4_list_cmp, m4_version_compare): Reduce side
5203 effects.
5204 * data/m4sugar/foreach.m4 (_m4_shiftn): Fix off-by-one bug.
5205 (_m4_list_cmp): Reduce side effects.
5206
5207 2008-08-27 Akim Demaille <demaille@gostai.com>
5208
5209 Check yyerrok in calc.at.
5210 * tests/calc.at (calc.y): Use yyerrok on "( error )".
5211 (AT_CHECK_CALC): Add a check that ensures that yyerrok works as
5212 expected.
5213
5214 2008-08-27 Akim Demaille <demaille@gostai.com>
5215
5216 Support yyerrok in lalr1.cc.
5217 YYBACKUP is still to import back into lalr1.cc.
5218 * data/lalr1.cc (yyerrork, yyclearin, YYRECOVERING): Define.
5219
5220 2008-08-26 Joel E. Denny <jdenny@ces.clemson.edu>
5221
5222 For maintainer-check*, don't recompile for a $(VERSION) update.
5223 * cfg.mk: New file.
5224 (_is-dist-target): Override the one in GNUmakefile.
5225 * Makefile.am (EXTRA_DIST): Add cfg.mk.
5226
5227 2008-08-26 Joel E. Denny <jdenny@ces.clemson.edu>
5228
5229 Update for recent change to gnulib.
5230 * src/parse-gram.y: Don't include strverscmp.h. It comes from
5231 string.h now.
5232
5233 2008-08-15 Eric Blake <ebb9@byu.net>
5234
5235 Remaining m4sugar merge from autoconf.
5236 * data/m4sugar/m4sugar.m4: Copy entire file from autoconf.
5237 * data/m4sugar/foreach.m4: New file, copied from autoconf.
5238 * data/Makefile.am (dist_m4sugar_DATA): Distribute it.
5239 * src/output.c (output_skeleton): Tell m4 how to find it.
5240
5241 Partial m4sugar merge from autoconf: m4_map.
5242 * data/m4sugar/m4sugar.m4 (m4_fst): Delete.
5243 (m4_map, m4_map_sep, _m4_map): Rewrite more efficiently.
5244 (m4_apply, _m4_apply, m4_mapall, m4_mapall_sep): New macros.
5245 * data/java.m4 (b4_token_enums): Use more efficient short-circuit
5246 for empty list.
5247 * data/c.m4 (b4_token_defines, b4_token_enums, b4_c_ansi_formals):
5248 Likewise.
5249 (b4_parse_param_for): Avoid m4_fst, now that autoconf no longer
5250 declares it.
5251
5252 2008-08-07 Joel E. Denny <jdenny@ces.clemson.edu>
5253
5254 Keep .version and PACKAGE_VERSION in sync.
5255 * Makefile.am ($(top_srcdir)/.version): Declare configure as a
5256 dependency, and add comments justifying this in more detail. Discussed
5257 starting at
5258 <http://lists.gnu.org/archive/html/bison-patches/2008-07/msg00022.html>.
5259
5260 2008-08-06 Eric Blake <ebb9@byu.net>
5261
5262 Partial m4sugar merge from autoconf: m4_shiftn.
5263 * data/m4sugar/m4sugar.m4 (m4_shiftn): Faster implementation.
5264 (m4_shift2, m4_shift3): New macros.
5265 (m4_case, m4_bmatch, m4_bpatsubsts, m4_join): Adjust clients.
5266 * data/c.m4 (b4_c_function_def, b4_c_ansi_function_def)
5267 (b4_c_ansi_function_decl, b4_c_function_call): Likewise.
5268 * data/java.m4 (b4_remove_comma): Likewise.
5269
5270 Partial m4sugar merge from autoconf: m4_wrap vs. m4 1.6.
5271 * data/m4sugar/m4sugar.m4 (m4_unquote, m4_wrap_lifo): New macros.
5272 (m4_wrap): Guarantee FIFO order, in spite of m4 1.6.
5273 (m4_init): Consolidate wrapped text into single m4_wrap.
5274 * data/bison.m4 (b4_check_user_names_wrap): Stick with LIFO order
5275 in wrapped text.
5276
5277 2008-08-05 Eric Blake <ebb9@byu.net>
5278
5279 Partial m4sugar merge from autoconf: builtins, version.m4.
5280 * data/m4sugar/m4sugar.m4 (changeword): Nuke.
5281 (m4_prepend): Remove, as it is unused and inherently quadratic,
5282 whereas m4_append is linear in newer m4.
5283 (m4_mkstemp): New builtin.
5284 (m4_symbols): Make rename conditional.
5285 (m4_version_prereq): Ensure fatal error if used in bison, which
5286 intentionally lacks version.m4.
5287
5288 Fix comments in m4sugar.
5289 * data/m4sugar/m4sugar.m4: Comment changes, borrowed from autoconf.
5290
5291 2008-08-02 Joel E. Denny <jdenny@ces.clemson.edu>
5292
5293 Update for recent .gitignore fix in Gnulib.
5294 * bootstrap: Back out 2008-07-18 hack now that gnulib-tool creates
5295 anchored .gitignore entries.
5296
5297 2008-08-02 Joel E. Denny <jdenny@ces.clemson.edu>
5298
5299 Set gnu or gnits strictness.
5300 * configure.ac (AM_INIT_AUTOMAKE): Set gnu strictness during
5301 development and gnits strictness for releases. Based on Eric Blake's
5302 suggestion at
5303 <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00019.html>.
5304
5305 2008-07-31 Paolo Bonzini <bonzini@gnu.org>
5306
5307 * NEWS: Clarify documentation of %language.
5308
5309 2008-07-31 Paolo Bonzini <bonzini@gnu.org>
5310
5311 Support usage of git-merge-changelog.
5312 * .gitattributes: New.
5313 * HACKING: Document usage of git-merge-changelog.
5314 * bootstrap: Install git-merge-changelog entries in .git/config
5315 if appropriate.
5316
5317 2008-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
5318
5319 Remove remaining dependence on CVS Id keyword.
5320 * ChangeLog: For the sake of people still using CVS, don't use dollars
5321 when mentioning Id.
5322 * data/xslt/bison.xsl: Remove Id from header comments, where it was
5323 unusual anyway.
5324 * data/xslt/xml2dot.xsl: Likewise.
5325 * data/xslt/xml2text.xsl: Likewise.
5326 * data/xslt/xml2xhtml.xsl: Likewise.
5327 * doc/Doxyfile.in (PROJECT_NUMBER): Don't use ID.
5328 * doc/Makefile.am (neutralize): Remove, no longer needed.
5329 (.x.1): Don't use neutralize.
5330 (edit): Don't substitute for ID.
5331 (Doxyfile): Don't define Id, and thus don't depend on ChangeLog.
5332
5333 2008-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
5334
5335 Fix dependence on computed configure variables.
5336 * doc/Makefile.am (common_dep): Depend on $(top_srcdir)/configure not
5337 $(top_srcdir)/configure.ac so that changes to computed variables, such
5338 as PACKAGE_VERSION, are seen.
5339 * tests/Makefile.am ($(srcdir)/package.m4): Likewise.
5340
5341 2008-07-20 Joel E. Denny <jdenny@ces.clemson.edu>
5342
5343 Update copyright dates for recent changes.
5344 * Makefile.am: Here.
5345 * src/Makefile.am: Here.
5346 * src/reduce.c: Here.
5347 * tests/reduce.at: Here.
5348
5349 2008-07-18 Joel E. Denny <jdenny@ces.clemson.edu>
5350
5351 Use git-version-gen for version names between releases.
5352 * .cvsignore (.tarball-version, GNUmakefile, *~): Add.
5353 * .gitignore (/.tarball-version, /GNUmakefile, /*~): Add.
5354 * .prev-version: New.
5355 * .version.in: Remove.
5356 * ChangeLog: Remove the Id previously used for capturing the CVS
5357 revision.
5358 * GNUmakefile: Remove, now copied from Gnulib.
5359 * Makefile.am: Add code suggested by comments in
5360 build-aux/git-version-gen.
5361 (EXTRA_DIST): Remove GNUmakefile, handled by Gnulib. Add maint.mk,
5362 .prev-version, and .version.
5363 * NEWS (2.3b+): Rename to...
5364 (?.?): ... this because we're dropping the "+" version naming scheme,
5365 but, in general, we still can't be sure of our next release name.
5366 * bootstrap: Add a quick hack to remove from .gitignore the
5367 GNUmakefile entry that gnulib adds. We already have a /GNUmakefile
5368 entry. This should really be fixed in gnulib instead.
5369 * bootstrap.conf (gnulib_modules): Add gnumakefile.
5370 * configure.ac (AC_INIT): Set version name by invoking
5371 build-aux/git-version-gen.
5372 (AC_CONFIG_FILES): Remove .version, now generated by
5373 build-aux/git-version-gen.
5374 * maint.mk: New, copied from coreutils.
5375 * doc/.cvsignore (bison.1): Add.
5376 * doc/.gitignore (/bison.1): Add.
5377 * doc/bison.1: Remove, generated.
5378 * src/.cvsignore (revision.c): Remove.
5379 * src/.gitignore (/revision.c): Remove.
5380 * src/Makefile.am (bison_SOURCES): Remove revision.c and revision.h.
5381 (BUILT_SOURCES): Remove revision.c.
5382 (revision.c): Remove.
5383 * src/getargs.c (version): Don't print revision after the VERSION.
5384 * src/revision.h: Remove.
5385
5386 2008-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
5387
5388 Fix untranslatable composition of sentences. Reported by Goran
5389 Uddeborg at
5390 <http://lists.gnu.org/archive/html/bug-bison/2008-06/msg00000.html>.
5391 * THANKS (Goran Uddeborg): Add.
5392 * src/reduce.c (reduce_print): Report the number of nonterminals and
5393 rules useless in the grammar in separate sentences.
5394 * tests/reduce.at (Useless Rules): Update output.
5395 (Reduced Automaton): Likewise.
5396 (Underivable Rules): Likewise.
5397 (Empty Language): Likewise.
5398
5399 2008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
5400
5401 Fix some .gitignore and .cvsignore problems.
5402 * bootstrap (insert_sorted_if_absent): Replace all uses with...
5403 (insert_vc_ignore): ... this new function, which prepends `/' to all
5404 .gitignore entries before passing them to insert_sorted_if_absent.
5405 * bootstrap.conf (vc_ignore): Set to '.cvsignore .gitignore' so that
5406 .cvsignore files are maintained even though Bison developers run
5407 bootstrap while using Git.
5408 * .cvsignore (*.patch *.log log patches applied): Remove, apparently
5409 unneeded by Bison.
5410 (gnulib): Add.
5411 * .gitignore (/*.patch *.log log patches applied): Remove, broken and
5412 unneeded. Reported by Eric Blake.
5413 * lib/.gitignore (/*~): Add.
5414 * po/.cvsignore, runtime-po/.cvsignore: Sync with .gitignore.
5415 * examples/calc++/.gitignore (/calc++.exe): Add. Reported by Eric
5416 Blake.
5417 * src/.gitignore (/bison.exe): Add. Reported by Eric Blake.
5418
5419 2008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
5420
5421 Improve forward-compatibility with GNU M4. Reported by Eric Blake at
5422 <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00000.html>.
5423 * bootstrap.conf (gnulib_modules): Add unsetenv.
5424 * lib/.gitignore, lib/.cvsignore (/unsetenv.c): Add.
5425 * m4/.gitignore, m4/.cvsignore (/environ.m4): Add.
5426 (/setenv.m4): Add.
5427 * src/output.c (output_skeleton): For the m4 invocation, pass -dV as
5428 the first argument because it may become position-dependent, and unset
5429 POSIXLY_CORRECT so Bison's skeletons have access to GNU M4 extensions.
5430 Add comments explaining these issues in more detail.
5431
5432 2008-07-14 Joel E. Denny <jdenny@ces.clemson.edu>
5433
5434 Add .gitignore everywhere based on .cvsignore.
5435 * .gitignore: New.
5436 * build-aux/.gitignore: New.
5437 * data/.gitignore: New.
5438 * doc/.gitignore: New.
5439 * etc/.gitignore: New.
5440 * examples/.gitignore: New.
5441 * examples/calc++/.gitignore: New.
5442 * lib/.gitignore: New.
5443 * m4/.gitignore: New.
5444 * po/.gitignore: New.
5445 * runtime-po/.gitignore: New.
5446 * src/.gitignore: New.
5447 * tests/.gitignore: New.
5448
5449 2008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
5450
5451 * NEWS (2.3b+): New section, empty for now.
5452 * configure.ac (AC_INIT): 2.3b -> 2.3b+.
5453
5454 2008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
5455
5456 * NEWS (2.3b): Update release date since there has been a delay in
5457 getting the announcements and tarballs out.
5458
5459 2008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
5460
5461 * NEWS: Version 2.3b.
5462 * configure.ac (AC_INIT): Likewise.
5463 (PACKAGE_COPYRIGHT_YEAR): Update to 2008.
5464
5465 2008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
5466
5467 * HACKING: Don't say don't mention HACKING in the ChangeLog. We've
5468 been doing it for years.
5469 (Test suite): Mention maintainer-push-check and maintainer-xml-check.
5470 (Release Procedure): Add FIXME about make alpha being unmaintained.
5471
5472 2008-05-13 Joel E. Denny <jdenny@ces.clemson.edu>
5473
5474 * data/yacc.c: Reformat m4 a little for readability.
5475 * src/lalr.c (build_relations): Correct comment.
5476
5477 2008-05-12 Juan Manuel Guerrero <juan.guerrero@gmx.de>
5478
5479 DJGPP specific issue.
5480 * djgpp/config.sed: Fixes required to run configure scripts generated
5481 by autoconf 2.62.
5482
5483 2008-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
5484
5485 * HACKING (Release Procedure): translation@iro.umontreal.ca is now
5486 coordinator@translationproject.org.
5487
5488 2008-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
5489
5490 * THANKS: Add Eric Blake.
5491
5492 2008-04-23 Eric Blake <ebb9@byu.net>
5493
5494 Revert prior patch, by working around autoconf regression.
5495 * tests/output.at (m4_expand): Add workaround for autoconf 2.62.
5496 ("Output file name: ("): Uncomment test.
5497 ("Output file name: )"): Likewise.
5498 Based on an idea from Noah Misch.
5499
5500 2008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
5501
5502 Work-around an Autoconf 2.62 AT_SETUP bug that was not present in
5503 2.61. Reported by Juan Manuel Guerrero at
5504 <http://lists.gnu.org/archive/html/bug-bison/2008-04/msg00011.html>.
5505 * tests/output.at ("Output file name: ("): Comment out test case for
5506 now.
5507 ("Output file name: )"): Likewise.
5508
5509 2008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
5510
5511 * GNUmakefile: Update git-version-gen invocation so make dist
5512 succeeds.
5513
5514 2008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
5515
5516 Update to the current gnulib CVS repository, and fix trigraph handling
5517 in Bison.
5518 * bootstrap: Update gnulib CVS repository URL.
5519 (symlink_to_dir): Encapsulate the code that guarantees the destination
5520 directory exists into...
5521 (check_dst_dir): ... this new function, and...
5522 (cp_mark_as_generated): ... reuse it here so that bootstrap doesn't
5523 fail when copying files into lib/uniwidth/.
5524 * src/output.c (prepare_symbols): When writing yytname muscles, where
5525 symbol names will be encoded in C-string literals, tell quotearg to
5526 escape trigraphs. This used to be the default in gnulib.
5527 * tests/regression.at (Token definitions): Because of the change in
5528 gnulib's quotearg behavior, string_as_id in parse-gram.y no longer
5529 escapes trigraphs in symbol names. Thus, yytname no longer has
5530 trigraphs unnecessarily doubly escaped. Update test case output.
5531 Extend test case to be sure Bison's own error messages will no longer
5532 have trigraphs in symbol names unnecessarily escaped once.
5533
5534 2008-04-20 Joel E. Denny <jdenny@ces.clemson.edu>
5535
5536 Fix make dist infinite loop reported by Juan Manuel Guerrero at
5537 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00009.html>.
5538 * .cvsignore: Add .version.
5539 * .version.in: New.
5540 * bootstrap.conf (gnulib_modules): Add git-version-gen.
5541 * configure.ac (AC_CONFIG_FILES): Add .version.
5542 * build-aux/.cvsignore: Add git-version-gen.
5543
5544 2008-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
5545
5546 * NEWS (2.3a+): Mention that -g now takes an argument.
5547 * doc/bison.texinfo (Bison Options): Reword -W entry a little for
5548 consistency. Update the -g and -x entries now that they take
5549 arguments. Use brackets to indicate optional arguments.
5550 * src/getargs.c (usage): Explain the relationship between arguments of
5551 long and short options more completely. Document --defines and -d
5552 separately since the former takes an argument but, for POSIX Yacc, the
5553 latter does not.
5554 (short_options): Let -W take an optional argument like --warnings.
5555 (getargs): Sort cases.
5556
5557 2008-02-28 Akim Demaille <demaille@gostai.com>
5558
5559 * doc/bison.texinfo: Fix a few typos.
5560
5561 2008-02-28 Akim Demaille <akim@epita.fr>
5562
5563 * doc/bison.texinfo (Bison Options): Document -W.
5564 Based on Joel E. Denny's NEWS entry, and Automake's documentation.
5565
5566 2008-02-28 Akim Demaille <akim@epita.fr>
5567
5568 * src/getargs.c (short_options): Split and sort for readability.
5569 -g and -x take optional arguments, just like their long options.
5570 * build-aux/cross-options.pl: Use /x to make the regexp easier to
5571 understand.
5572 Fix the handling of $opt which resulted in all the argument to be
5573 considered as optional.
5574
5575 2008-02-22 Joel E. Denny <jdenny@ces.clemson.edu>
5576
5577 * NEWS (2.3a+): Don't say %language is experimental. Mention Java and
5578 say its interface is experimental.
5579 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
5580 Java.
5581 (Bison Options): In the -L and --language entry, mention Java.
5582 (Java Bison Interface): Say the interface is experimental.
5583 * src/getargs.c (usage): Mention -L and --language.
5584
5585 * NEWS (2.3a+): Say the push parsing interface is experimental.
5586 * doc/bison.texinfo (Push Decl): Likewise.
5587 (Decl Summary): Likewise in the "%define api.push_pull" entry.
5588 (Push Parser Function): Likewise.
5589 (Pull Parser Function): Likewise.
5590 (Parser Create Function): Likewise.
5591 (Parser Delete Function): Likewise.
5592 (Table of Symbols): Likewise in the yypstate_delete, yypstate_new,
5593 yypull_parse, and yypush_parse entries.
5594
5595 * NEWS (2.3a+): Mention XML support, and say the schema is
5596 experimental.
5597 * doc/bison.texinfo (Bison Options): Mention -x and --xml.
5598 * src/getargs.c (usage): Say the XML schema is experimental.
5599
5600 * NEWS (2.3a+): Say option instead of flag.
5601
5602 2008-02-21 Wojciech Polak <polak@gnu.org>
5603
5604 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Change footer
5605 text.
5606
5607 2008-02-20 Joel E. Denny <jdenny@ces.clemson.edu>
5608
5609 Fix impure push parser compile error reported by Bob Rossi at
5610 <http://lists.gnu.org/archive/html/help-bison/2008-02/msg00023.html>.
5611 * data/yacc.c: Clean up whitespace in the output a little.
5612 (yypstate_allocated): Define for impure push parsers regardless of
5613 whether the pull interface is also requested.
5614 * tests/push.at (Push Parsing: Multiple impure instances): Extend to
5615 check impure push parsers without the pull interface.
5616
5617 * data/yacc.c (yypstate_new): Don't try to invoke yyerror since
5618 yyerror takes arguments specified by %parse-param while yypstate_new
5619 does not.
5620 * doc/bison.texinfo (Parser Create Function): Document that
5621 yypstate_new returns 0 for multiple impure parser instances.
5622 * tests/push.at (Push Parsing: Multiple impure instances): Update
5623 expected stderr output.
5624
5625 2008-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
5626
5627 * runtime-po/POTFILES.in (push.c): Remove.
5628
5629 2008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
5630
5631 * data/Makefile.am (dist_pkgdata_DATA): Remove push.c.
5632 * data/push.c: Rename to...
5633 * data/yacc.c: ... this, overwriting it.
5634 * etc/bench.pl.in (bench_grammar): `%pure-parser'-> `%define api.pure'.
5635 `%push-pull-parser' -> `%define api.push_pull "both"'.
5636 Remove old yacc.c tests, and update push.c tests to yacc.c.
5637
5638 2008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
5639
5640 * data/bison.m4 (b4_percent_code_get): Output %code block comments like
5641 `"%code top" blocks' instead of `%code "top" blocks'.
5642 * data/push.c: Import yacc.c changes from 2008-01-09 and 2007-08-03.
5643 Clean up whitespace in the output a little.
5644
5645 2008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
5646
5647 Fix documentation problems reported by Tim Josling at
5648 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00013.html>.
5649 * NEWS (2.3a+): Mention removal of --no-parser, -n, and %no-parser.
5650 * doc/bison.texinfo (Token Decl): Token numbers are *nonnegative*
5651 integers. Explain the effect of literal string aliases on error
5652 messages. Copy token 0 documentation from the C++ skeleton
5653 documentation.
5654
5655 2008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
5656
5657 Accept a token number in a %left, %right, or %nonassoc for POSIX
5658 conformance. Reported by Tim Josling at
5659 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00010.html>.
5660 * NEWS (2.3a+): Mention.
5661 * doc/bison.texinfo (Precedence Decl): Describe how literal strings
5662 and code numbers are treated by precedence declarations.
5663 * src/parse-gram.y (precedence_declaration): Use symbols.prec instead
5664 of symbols.1.
5665 (symbols.prec): New, just like symbols.1 but uses symbol.prec instead
5666 of symbol.
5667 (symbol.prec): New, just like symbol but allows INT.
5668 * src/symtab.c (symbol_user_token_number_set): Remove an aver that no
5669 longer holds.
5670 * tests/regression.at (Token number in precedence declaration): New
5671 test case.
5672
5673 2008-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
5674
5675 DJGPP specific issues.
5676 * djgpp/config.bat: Add filenames that are not 8.3 clean and that must
5677 be changed. Copyright timestamp adjusted.
5678 * djgpp/config.sed: Add filenames that are not 8.3 clean and that must
5679 be changed. Copyright timestamp adjusted.
5680 * djgpp/config.site: Copyright timestamp adjusted.
5681 * djgpp/config_h.sed: Copyright timestamp adjusted.
5682 * djgpp/djunpack.bat: Copyright timestamp adjusted.
5683 * djgpp/fnchnage.lst: Add filenames that are not 8.3 clean to the
5684 filename translation list.
5685 * djgpp/subpipe.c (init_subpipe): Check the environment variables
5686 TMPDIR, TMP and TEMP, in that order, to determinate where the temp
5687 files shall be created. Before trying to use the temp dir where the
5688 environment variable points to check that the dir really exists. If
5689 not default to the cwd as temp dir. Copyright timestamp adjusted.
5690 * djgpp/subpipe.h: Copyright timestamp adjusted.
5691 * djgpp/testsuite.sed: Copyright timestamp adjusted.
5692
5693 2008-01-30 Paul Eggert <eggert@cs.ucla.edu>
5694
5695 * doc/bison.texinfo: Update Back-Cover text to reflect new GNU wording.
5696
5697 2008-01-09 Paul Eggert <eggert@cs.ucla.edu>
5698
5699 * data/yacc.c (yyparse): Correct the comment when locations aren't used.
5700 Problem reported by Claudio Saavedra in
5701 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00003.html>.
5702
5703 2008-01-05 Wojciech Polak <polak@gnu.org>
5704
5705 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Precede an XHTML
5706 document's title with the input grammar file name.
5707
5708 2007-12-22 Joel E. Denny <jdenny@ces.clemson.edu>
5709
5710 Automate regression testing of the XML/XSLT implementation. Discussed
5711 starting at
5712 <http://lists.gnu.org/archive/html/bison-patches/2007-11/msg00021.html>.
5713 * configure.ac (XSLTPROC): New substitution.
5714 * Makefile.am (maintainer-xml-check): New phony target invoking...
5715 * tests/Makefile.am (maintainer-xml-check): ... this new phony target
5716 invoking make maintainer-check with BISON_TEST_XML=1.
5717 * tests/atlocal.in (XSLTPROC): New.
5718 * tests/local.at (AT_BISON_CHECK): New macro to (1) instruct Valgrind
5719 not to report reachable memory when Bison is expected to have a
5720 non-zero exit status and (2) to compare XML/XSLT output with --graph
5721 and --report=all output for every working grammar when
5722 BISON_TEST_XML=1.
5723 (AT_BISON_CHECK_NO_XML): Likewise, but skip XML checks.
5724 (AT_BISON_CHECK_XML): New.
5725 (AT_QUELL_VALGRIND): New.
5726 * tests/testsuite.at (ORIGINAL_AT_CHECK): Remove this and...
5727 (AT_CHECK): ... don't redefine this since this was the old way to
5728 quell Valgrind.
5729 * tests/actions.at: Rewrite all AT_CHECK invocations for bison as
5730 AT_BISON_CHECK invocations.
5731 * tests/c++.at: Likewise.
5732 * tests/calc.at: Likewise.
5733 * tests/conflicts.at: Likewise.
5734 * tests/cxx-type.at: Likewise.
5735 * tests/existing.at: Likewise.
5736 * tests/glr-regression.at: Likewise.
5737 * tests/headers.at: Likewise.
5738 * tests/input.at: Likewise.
5739 * tests/java.at: Likewise.
5740 * tests/output.at: Likewise.
5741 * tests/push.at: Likewise.
5742 * tests/reduce.at: Likewise.
5743 * tests/regression.at: Likewise.
5744 * tests/sets.at: Likewise.
5745 * tests/skeletons.at: Likewise.
5746 * tests/synclines.at: Likewise.
5747 * tests/torture.at: Likewise.
5748 (Big triangle): Use AT_BISON_CHECK_NO_XML instead since this grammar
5749 tends to hang xsltproc.
5750 (Big horizontal): Likewise.
5751
5752 2007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
5753
5754 In XML output, remove redundant class attribute on symbol element.
5755 * data/xslt/bison.xsl (xsl:key name="bison:symbolByName"): New.
5756 * data/xslt/xml2xhtml.xsl (xsl:template match="symbol"): Use it to
5757 look up a symbol to determine whether it's a nonterminal or terminal.
5758 * src/gram.c (rule_rhs_print_xml): Remove class attribute.
5759 * src/state.c (state_rule_lookahead_tokens_print_xml): Likewise.
5760
5761 Add prec/assoc information to XML output.
5762 * src/gram.c (grammar_rules_print_xml): For each rule that has a
5763 %prec, add a percent_prec attribute.
5764 * src/print-xml.c (print_grammar): For each terminal that has a
5765 precedence or associativity, add a prec or assoc attribute.
5766 (xml_indent): New.
5767 (xml_puts): Use xml_indent.
5768 (xml_printf): Use xml_indent.
5769 * src/print-xml.h (xml_indent): Prototype.
5770
5771 * tests/existing.at (GNU pic Grammar): Fix a rule miscopied from
5772 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
5773
5774 2007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
5775
5776 * data/xslt/bison.xsl (bison:ruleNumber): Rename to...
5777 (bison:ruleByNumber): ... this for clarity.
5778 * data/xslt/xml2dot.xsl (xsl:template match="item"): Update.
5779 * data/xslt/xml2text.xsl (xsl:template match="item"): Update.
5780 (xsl:template match="reduction"): Update.
5781 (xsl:template match="item"): Update.
5782 (xsl:template match="reduction"): Update.
5783
5784 In the XML output, don't print the list of rules where symbols appear.
5785 Compute it in XSLT instead. Discussed at
5786 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00024.html>.
5787 * data/xslt/bison.xsl (bison:ruleByLhs): New.
5788 (bison:ruleByRhs): New.
5789 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Use
5790 bison:ruleByRhs.
5791 (xsl:template match="terminal/rule"): Remove.
5792 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
5793 bison:ruleByRhs.
5794 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
5795 Remove.
5796 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Use
5797 bison:ruleByRhs and mode="number-link" for rule template.
5798 (xsl:template match="terminal/rule"): Remove.
5799 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
5800 bison:ruleByRhs and mode="number-link" for rule template.
5801 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
5802 Rewrite as...
5803 (xsl:template match="rule" mode="number-link"): ... this.
5804 * src/print-xml.c (print_grammar): Don't print the list of rules.
5805
5806 2007-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
5807
5808 Don't let --report affect XML output; always print all information.
5809 Discussed at
5810 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00020.html>.
5811 * src/conflicts.c (log_resolution): Implement.
5812 * src/print-xml.c (print_core): Implement.
5813 (print_state): Implement.
5814 (print_xml): Implement.
5815
5816 * NEWS (2.3a+): Fix quotes.
5817 * src/parse-gram.y (prologue_declaration): For consistency with -v,
5818 don't let %verbose clear the list specified by --report.
5819
5820 2007-11-26 Akim Demaille <akim@epita.fr>
5821
5822 * data/Makefile.am (dist_pkgdata_DATA): Ship and install bison.xsl.
5823
5824 2007-11-24 Joel E. Denny <jdenny@ces.clemson.edu>
5825
5826 In the XML output, list useless and unused symbols and rules with the
5827 useful ones and add a "usefulness" attribute. Discussed starting at
5828 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00017.html>.
5829 * src/gram.c (grammar_rules_partial_print_xml): Remove.
5830 (grammar_rules_print_xml): Print all rules instead of just those
5831 useful in the grammar, and add a "usefulness" attribute.
5832 * src/gram.h (grammar_rules_partial_print_xml): Remove prototype.
5833 * src/print-xml.c (print_rules_useless_in_parser): Remove.
5834 (print_grammar): Print all nonterminals instead of just useful ones,
5835 and add a "usefulness" attribute to nonterminals and terminals.
5836 (print_xml): Don't print a separate "reductions" or
5837 "rules-useless-in-parser" element.
5838 * src/reduce.c (reduce_output): Use reduce_token_unused_in_grammar.
5839 (reduce_xml): Remove.
5840 (reduce_token_unused_in_grammar): New.
5841 (reduce_nonterminal_useless_in_grammar): New.
5842 * src/reduce.h (reduce_xml): Remove prototype.
5843 (reduce_token_unused_in_grammar): Add prototype.
5844 (reduce_nonterminal_useless_in_grammar): Add prototype.
5845 * data/xslt/xml2text.xsl: Update for XML changes.
5846 * data/xslt/xml2xhtml.xsl: Update for XML changes.
5847 * tests/reduce.at (Useless Terminals): Update output.
5848 (Useless Rules): Update output.
5849 (Reduced Automaton): Update output.
5850
5851 Say "Terminals unused in grammar" instead of "Unused terminals".
5852 * NEWS (2.3a+): Update.
5853 * doc/bison.texinfo (Understanding): Update example output.
5854 * src/reduce.c (reduce_output): Implement.
5855 * data/xslt/xml2text.xsl: Implement.
5856 * data/xslt/xml2xhtml.xsl: Implement.
5857
5858 2007-11-18 Joel E. Denny <jdenny@ces.clemson.edu>
5859
5860 Accept --report-file=FILE to override the default `.output' filename.
5861 * NEWS (2.3a+): Mention.
5862 * doc/bison.texinfo (Bison Options): Add an entry.
5863 * src/files.c (compute_output_file_names): Don't override
5864 spec_verbose_file if already set.
5865 * src/getargs.c (usage): Document --report-file.
5866 (REPORT_FILE_OPTION): New anonymous enum member.
5867 (long_options): Add entry for it.
5868 (getargs): Add case for it setting spec_verbose_file.
5869
5870 * build-aux/cross-options.pl: Don't record a short option just because
5871 there's an arg.
5872 * doc/.cvsignore: Add yacc.1.
5873
5874 2007-11-14 Akim Demaille <akim@epita.fr>
5875
5876 * doc/yacc.1.in: New.
5877 * configure.ac, doc/Makefile.am: Adjust.
5878 * configure.ac (PACKAGE_COPYRIGHT_YEAR): New substitution, and new
5879 config.h symbol.
5880 Use AC_SUBST for assignments too.
5881 * src/getargs.c (version): Use PACKAGE_COPYRIGHT_YEAR.
5882
5883 2007-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
5884
5885 * src/gram.c: Remove comments that duplicate comments in gram.h.
5886
5887 When reporting useless rules and nonterminals, say "useless in grammar"
5888 instead of "useless", and say "useless in parser" instead of "never
5889 reduced". Discussed starting at
5890 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00033.html>.
5891 * NEWS (2.3a+): Mention this change.
5892 * data/xslt/xml2text.xsl: Update output text and expected input XML
5893 element names to match changes below.
5894 * data/xslt/xml2xhtml.xsl: Likewise.
5895 (xsl:template match="bison-xml-report"): Add missing entry in Table of
5896 Contents: "Rules useless in parser due to conflicts".
5897 * doc/bison.texinfo (Decl Summary): Reword a little.
5898 (Understanding): Update example output for changes below.
5899 * src/gram.c: (rule_useful_p): Rename to...
5900 (rule_useful_in_grammar_p): ... this.
5901 (rule_useless_p): Rename to...
5902 (rule_useless_in_grammar_p): ... this.
5903 (rule_never_reduced_p): Rename to...
5904 (rule_useless_in_parser_p): ... this.
5905 (grammar_rules_print): Update for renames.
5906 (grammar_rules_print_xml): Update for renames.
5907 (grammar_rules_never_reduced_report): Rename to...
5908 (grammar_rules_useless_report): ... this since it is used for either
5909 kind of useless rule.
5910 * src/gram.h: Reword comments and update function names in prototypes.
5911 * src/main.c (main): Say "rule useless in parser due to conflicts".
5912 * src/print-xml.c (print_rules_never_reduced): Rename to...
5913 (print_rules_useless_in_parser): ... this, and rename output XML
5914 element "rules-never-reduced" to "rules-useless-in-parser".
5915 (print_xml): Update for rename.
5916 * src/print.c (print_results): Say "Rules useless in parser due to
5917 conflicts".
5918 * src/reduce.c (reduce_grammar_tables): Say "rule useless in grammar".
5919 (nonterminals_reduce): Say "nonterminal useless in grammar".
5920 (reduce_output): Say "Nonterminals useless in grammar".
5921 Say "Rules useless in grammar".
5922 (reduce_xml): Rename output XML element "useless" to
5923 "useless-in-grammar".
5924 (reduce_print): Don't report the count of grammatically useless rules
5925 as "rules never reduced" just because %yacc is specified.
5926 In the correct report of this count, say nonterminal(s) and rule(s)
5927 "useless in grammar".
5928 * tests/conflicts.at (S/R in initial): Update expected output.
5929 (Defaulted Conflicted Reduction): Likewise.
5930 (Unreachable States After Conflict Resolution): Likewise.
5931 * tests/existing.at (GNU pic Grammar): Likewise.
5932 * tests/reduce.at (Useless Nonterminals): Likewise.
5933 (Useless Rules): Likewise.
5934 (Reduced Automaton): Likewise.
5935 (Underivable Rules): Likewise.
5936 (Empty Language): Likewise.
5937
5938 2007-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
5939
5940 * data/bison.m4 (b4_cat): Put a newline after the end delimiter of the
5941 here document and before the EOF so that BSD's implementation of Bourne
5942 shell doesn't parse the delimiter as part of the here document.
5943 * doc/.cvsignore: Add cross-options.texi.
5944 * src/getargs.c (usage): Add a blank line after the warning categories.
5945
5946 2007-11-08 Paolo Bonzini <bonzini@gnu.org>
5947
5948 * data/lalr1.java (Lexer): Remove usage of b4_pure_if.
5949
5950 2007-11-05 Akim Demaille <akim@epita.fr>
5951
5952 Remove Id: from bison.1.
5953 * doc/Makefile.am (remove_time_stamp): Include the sed invocation.
5954 (perl -0777 -pi -e 's/\.PP\nId): New.
5955 (.x.1): Use it to ignore the version control revision.
5956
5957 2007-11-05 Akim Demaille <demaille@gostai.com>
5958
5959 * build-aux/Makefile.am: Ship cross-options.pl.
5960 * doc/Makefile.am: Always refer to cross-options.texi with
5961 $(srcdir).
5962 (MAINTAINERCLEANFILES): Add it.
5963
5964 2007-11-04 Akim Demaille <demaille@gostai.com>
5965
5966 Generate the long/short option cross-table.
5967 * build-aux/cross-options.pl: New.
5968 * doc/Makefile.am (cross-options.texi): New.
5969 * doc/bison.texinfo: Use it.
5970
5971 2007-11-04 Akim Demaille <demaille@gostai.com>
5972
5973 Generate bison.1 using help2man.
5974 * doc/common.x, doc/bison.x: New.
5975 * doc/Makefile.am (bison.1, .x.1): New.
5976 The code is taken from autoconf-2.61/man/Makefile.am.
5977 * configure.ac: Look for help2man.
5978
5979 2007-11-04 Akim Demaille <demaille@gostai.com>
5980
5981 Complete --help.
5982 * src/getargs.c (usage): Document -W, make it clear that -d,
5983 -g and -x have optional arguments.
5984
5985 2007-11-04 Akim Demaille <demaille@gostai.com>
5986
5987 Find sha1sum when named gsha1sum.
5988 * bootstrap (find_tool): New.
5989 ($SHA1SUM): New.
5990
5991 2007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
5992
5993 Deprecate %pure-parser and add `%define api.pure'. Discussed starting
5994 at
5995 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00006.html>.
5996 * NEWS (2.3a+): Mention.
5997 * data/bison.m4 (b4_pure_if): Don't define it here.
5998 * data/c.m4 (b4_identification): Depend on individual skeletons to
5999 define b4_pure_flag, b4_push_flag, or b4_pull_flag if they use the
6000 values of the %define variables api.pure or api.push_pull. Define
6001 YYPURE, YYPUSH, and YYPULL accordingly.
6002 * data/glr.c: Define b4_pure_if based on `%define api.pure' unless
6003 glr.cc has already defined b4_pure_flag.
6004 * data/push.c: Define b4_pure_if based on `%define api.pure'.
6005 Remove YYPUSH and YYPULL since they're back in b4_identification again.
6006 * data/yacc.c: Define b4_pure_if based on `%define api.pure'.
6007 * doc/bison.texinfo (Pure Decl): Update.
6008 (Push Decl): Update.
6009 (Decl Summary): Add api.pure to %define entry.
6010 In %pure-parser entry, say it's deprecated and reference %define.
6011 (Pure Calling): Update.
6012 (Error Reporting): Update.
6013 (C++ Scanner Interface): Update.
6014 (How Can I Reset the Parser): Update.
6015 (Table of Symbols): In %pure-parser entry, say it's deprecated and
6016 reference %define.
6017 * src/getargs.c (pure_parser): Remove global variable.
6018 * src/getargs.h (pure_parser): Remove extern.
6019 * src/output.c (prepare): Don't define pure_flag muscle.
6020 * src/parse-gram.y (prologue_declaration): Implement %pure-parser as a
6021 wrapper around `%define api.pure'.
6022 * tests/calc.at (Simple LALR Calculator): Update.
6023 (Simple GLR Calculator): Update.
6024 * tests/cxx-type.at (GLR: Resolve ambiguity, pure, no locations):
6025 Update.
6026 (GLR: Resolve ambiguity, pure, locations): Update.
6027 (GLR: Merge conflicting parses, pure, no locations): Update.
6028 (GLR: Merge conflicting parses, pure, locations): Update.
6029 * tests/glr-regression.at (Uninitialized location when reporting
6030 ambiguity): Update
6031 * tests/input.at (Unused %define api.pure): New test case.
6032 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Update definition for
6033 AT_PURE_IF and AT_PURE_AND_LOC_IF.
6034 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
6035
6036 2007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
6037
6038 %define push_pull -> %define api.push_pull. Discussed starting at
6039 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00005.html>.
6040 * data/push.c: Expect the new name.
6041 * data/yacc.c: Likewise.
6042 * doc/bison.texinfo (Push Decl): Update.
6043 (Decl Summary): Update %define entry.
6044 (Push Parser Function): Update.
6045 (Pull Parser Function): Update.
6046 (Parser Create Function): Update.
6047 (Parser Delete Function): Update.
6048 * tests/calc.at (Simple LALR Calculator): Update.
6049 * tests/input.at (%define enum variables): Update.
6050 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
6051 (Push Parsing: Multiple impure instances): Update.
6052 (Push Parsing: Unsupported Skeletons): Update.
6053 * tests/torture.at (Exploding the Stack Size with Alloca): Update.
6054 (Exploding the Stack Size with Malloc): Update.
6055
6056 * NEWS (2.3a+): Add an entry for the push parser, and clean up the
6057 other entries some.
6058
6059 2007-10-27 Joel E. Denny <jdenny@ces.clemson.edu>
6060
6061 For the XML output's terminal element, rename @number to @token-number,
6062 and add @symbol-number. In the nonterminal element, rename @number to
6063 @symbol-number. Discussed starting at
6064 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00040.html>.
6065 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Update for
6066 renames.
6067 (xsl:template match="nonterminal"): Likewise.
6068 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Likewise.
6069 (xsl:template match="nonterminal"): Likewise.
6070 * src/print-xml.c (print_grammar): Implement.
6071
6072 2007-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
6073
6074 * data/xslt/xml2dot.xsl (xsl:template match="automaton/state"): After
6075 2007-10-11 change, the child elements here are items not rules.
6076 (xsl:template match="item"): New.
6077 (xsl:template match="rule"): Update for new reduced itemset.
6078 (xsl:template match="point"): Remove.
6079 (xsl:template match="empty"): For consistency with --graph, don't
6080 output "/* empty */".
6081 * data/xslt/xml2text.xsl (xsl:template match="terminal"): When invoking
6082 line-wrap, don't pass a negative value as first-line-length since this
6083 won't work with the following changes.
6084 (xsl:template name="line-wrap"): Simplify slightly.
6085 (xsl:template name="ws-search"): Eliminate recursion.
6086 * src/print_graph.c (print_core): Don't print a reduction's lookahead
6087 set next to an item whose dot is not at the end of the RHS even if it
6088 happens to be associated with the same rule.
6089
6090 2007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
6091
6092 Add %define lr.keep_unreachable_states.
6093 * NEWS (2.3a+): Mention it in the entry for unreachable state removal.
6094 * doc/bison.texinfo (Decl Summary): Mention it in the %define entry.
6095 * src/main.c (main): Implement it.
6096 * tests/conflicts.at (Unreachable States After Conflict Resolution):
6097 Extend to test it, and fix a typo.
6098
6099 2007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
6100
6101 * NEWS (2.3a+): Add entry for recent .output file lookahead set fix.
6102 * doc/bison.texinfo (Understanding): Remove a bogus lookahead set in
6103 the example .output text.
6104 * tests/regression.at (Extra lookahead sets in report): Improve wording
6105 of comments.
6106
6107 2007-10-17 Wojciech Polak <polak@gnu.org>
6108
6109 * src/print-xml.c (print_grammar): Renamed
6110 <terminal> and <nonterminal> attributes:
6111 "type" to "number" and "symbol" to "name".
6112 * data/xslt/xml2text.xsl (xsl:template match="terminal"):
6113 Use new attribute names.
6114 (xsl:template match="nonterminal"): Likewise.
6115 * data/xslt/xml2xhtml.xsl: Likewise.
6116
6117 2007-10-17 Joel E. Denny <jdenny@ces.clemson.edu>
6118
6119 * doc/bison.texinfo (Bison Options): Add entry for --print-datadir.
6120 (Option Cross Key): Likewise.
6121
6122 * src/print-xml.c (print_core): Don't print a reduction's lookahead set
6123 next to an item whose dot is not at the end of the RHS even if it
6124 happens to be associated with the same rule.
6125 * src/print.c (print_core): Likewise.
6126 * tests/conflicts.at (Unresolved SR Conflicts): Update output.
6127 (Resolved SR Conflicts): Update output.
6128 * tests/regression.at (Extra lookahead sets in report): New test case.
6129
6130 2007-10-11 Wojciech Polak <polak@gnu.org>
6131
6132 * src/print-xml.c (print_core): Remove item set
6133 redundancy.
6134 * data/xslt/bison.xsl (bison:ruleNumber): New key.
6135 Improve processing time. Suggested by Joel E. Denny.
6136 * data/xslt/xml2dot.xsl (xsl:template name="escape"):
6137 Write xsl:param "required" attribute as comment.
6138 * data/xslt/xml2text.xsl (xsl:template match="item"): New.
6139 (xsl:template match="rule"): Support new reduced itemset.
6140 (xsl:template match="point"): Remove.
6141 * data/xslt/xml2xhtml.xsl: Likewise.
6142
6143 2007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
6144
6145 * src/getargs.c (version): Update copyright year.
6146
6147 2007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
6148
6149 Make xml2dot.xsl and --graph produce the same output.
6150 * data/xslt/xml2dot.xsl (xsl:template match="rule"): Use a `&#10;'
6151 instead of a `\n'. That is, don't add escapes yet or they'll be doubly
6152 escaped later.
6153 (xsl:template name="output-node"): Use the new escape template instead
6154 of the string-replace template directly.
6155 (xsl:template name="output-edge"): Likewise.
6156 (xsl:template name="escape"): New, escapes backslashes and newlines in
6157 addition to quotation marks.
6158 * src/graphviz.c (start_graph, output_node, output_edge): Add
6159 whitespace to output for legibility.
6160
6161 Make xml2text.xsl and --report produce the same output, and remove the
6162 XML "conflicts" element since a conflict summary is easily extracted
6163 from the automaton.
6164 * data/xslt/bison.xsl: New.
6165 (xsl:template match="state" mode="bison:count-conflicts): New.
6166 * data/xslt/xml2text.xsl: Import bison.xsl.
6167 (xsl:template match="bison-xml-report"): Instead of styling the
6168 "conflicts" element, style the "automaton" element with mode
6169 "conflicts". Unlike the former, the latter lists S/R and R/R
6170 conflicts for a state on the same line.
6171 (xsl:template match="conflicts"): Remove.
6172 (xsl:template match="conflict"): Remove.
6173 (xsl:template match="terminal"): Line-wrap the list of rules in which
6174 the terminal is used.
6175 (xsl:template match="nonterminal"): Likewise for nonterminals.
6176 (xsl:template match="automaton" mode="conflicts"): New.
6177 (xsl:template match="state" mode="conflicts"): New.
6178 (xsl:template name="line-wrap"): New.
6179 (xsl:template name="ws-search"): New.
6180 * data/xslt/xml2xhtml.xsl: Import bison.xsl.
6181 (xsl:template match="bison-xml-report"): Instead of styling the
6182 "conflicts" element, style the "automaton" element with mode
6183 "conflicts."
6184 (xsl:template match="conflicts"): Remove.
6185 (xsl:template match="conflict"): Remove.
6186 (xsl:template match="automaton" mode="conflicts"): New.
6187 (xsl:template match="state" mode="conflicts): New.
6188 * src/conflicts.c (conflicts_output_xml): Remove.
6189 * src/conflicts.h (conflicts_output_xml): Remove prototype.
6190 * src/print-xml.c (print_xml): Don't invoke conflicts_output_xml.
6191 * src/print.c (print_grammar): Consistently wrap at the 66th column so
6192 the corresponding XSLT is easier. Also, never wrap between a word and
6193 the comma that follows it.
6194
6195 2007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
6196
6197 Improve C++ namespace support. Discussed starting at
6198 <http://lists.gnu.org/archive/html/help-bison/2007-09/msg00016.html>.
6199 * data/c++.m4: (b4_namespace_ref, b4_namespace_open,
6200 b4_namespace_close): New macros that interpret the %define variable
6201 "namespace" so its value can contain "::" to indicate nested
6202 namespaces.
6203 * data/glr.cc (b4_namespace): Don't define, and replace all uses with
6204 the above macros.
6205 * data/lalr1.cc (b4_namespace): Likewise.
6206 * data/location.cc (b4_namespace): Likewise.
6207 * doc/bison.texinfo (Decl Summary): Move `%define push_pull' entry
6208 inside a new table in the general %define entry. Document `%define
6209 namespace' there as well. Point the %name-prefix entry to it since it
6210 explains it more completely in the case of C++.
6211 (C++ Bison Interface): Mention `%define namespace' instead of
6212 %name-prefix.
6213 (Table of Symbols): Remove the `%define push_pull' entry. The %define
6214 entry suffices.
6215 * tests/c++.at (Relative namespace references): New test case.
6216 (Absolute namespace references): New test case.
6217 (Syntactically invalid namespace references): New test case.
6218 * tests/input.at (C++ namespace reference errors): New test case.
6219
6220 2007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
6221
6222 Add syncline support and location accessor to internal %define
6223 interfaces.
6224 * data/bison.m4 (b4_percent_define_get_loc): New.
6225 (b4_percent_define_get_syncline): New.
6226 (b4_percent_define_flag_if): Use b4_percent_define_get_loc.
6227 (b4_percent_define_default): Record defining location as line 1 rather
6228 than 0 for the sake of synchronizing #line's, and define
6229 b4_percent_define_syncline(VARIABLE).
6230 (b4_percent_define_check_values): Use b4_percent_define_get_loc.
6231 * src/muscle_tab.c (muscle_syncline_grow): New.
6232 (muscle_code_grow): Use muscle_syncline_grow.
6233 (muscle_percent_define_insert): Use muscle_percent_define_get_loc, and
6234 define b4_percent_define_syncline(VARIABLE).
6235 (muscle_percent_define_get_loc): New.
6236 (muscle_percent_define_get_syncline): New.
6237 (muscle_percent_define_flag_if): Use muscle_percent_define_get_loc, and
6238 remove some unused variables.
6239 (muscle_percent_define_default): Record defining location as line 1
6240 rather than 0 for the sake of synchronizing #line's, and define
6241 b4_percent_define_syncline(VARIABLE).
6242 (muscle_percent_define_check_values): Use
6243 muscle_percent_define_get_loc.
6244 * src/muscle_tab.h (muscle_percent_define_get_loc): Prototype.
6245 (muscle_percent_define_get_syncline): Prototype.
6246 * tests/skeletons.at (%define Boolean variables: invalid skeleton
6247 defaults): Update output for location change.
6248 (Complaining during macro argument expansion): Extend to test
6249 b4_percent_define_get_loc and b4_percent_define_get_syncline errors.
6250
6251 2007-10-07 Joel E. Denny <jdenny@ces.clemson.edu>
6252
6253 Fix some error-reporting macro bugs.
6254 * data/bison.m4 (b4_cat): New.
6255 (b4_error, b4_error_at): Use b4_cat to send error directives directly
6256 to stdout so they don't become arguments to other macros. Update
6257 comments and add examples.
6258 (b4_warn, b4_warn_at, b4_complain, b4_complain_at): Update comments and
6259 add examples.
6260 (b4_fatal, b4_fatal_at): Likewise, and invoke m4_exit(1) immediately
6261 after printing the error directive so that M4 doesn't report subsequent
6262 problems that are induced by this problem.
6263 * src/scan-skel.l: Recognize @` digraph outside of directive arguments
6264 instead of just in them. Recognize @\n in both places. Both expand to
6265 the empty string. Needed by b4_cat.
6266 * tests/skeletons.at (Complaining during macro argument expansion):
6267 New test case.
6268 (Fatal errors make M4 exit immediately): New test case.
6269
6270 2007-10-04 Joel E. Denny <jdenny@ces.clemson.edu>
6271
6272 Implement --print-datadir.
6273 * src/getargs.c (usage): Mention.
6274 (PRINT_DATADIR_OPTION): New anonymous enum member.
6275 (long_options): Add entry for it.
6276 (getargs): Add case for it calling compute_pkgdatadir.
6277 * src/output.c (output_skeleton): Encapsulate data directory
6278 computation from here...
6279 (prepare): ... and from here...
6280 (compute_pkgdatadir): ... into this new function.
6281 * src/output.h (compute_pkgdatadir): Prototype.
6282
6283 2007-09-29 Joel E. Denny <jdenny@ces.clemson.edu>
6284
6285 * src/print-xml.c (escape_bufs): New static global variable
6286 replacing...
6287 (xml_escape_n): ... the static local variable buf here.
6288 (print_xml): Free memory for escape_bufs.
6289 * src/reduce.c (reduce_xml): XML-escape terminal symbol tags.
6290
6291 2007-09-25 Joel E. Denny <jdenny@ces.clemson.edu>
6292
6293 Replace `%push-parser' and `%push-pull-parser' with
6294 `%define push_pull "push"' and `%define push_pull "both"'.
6295 `%define push_pull "pull"' is the default.
6296 * doc/bison.texinfo (Push Decl, Push Parser Function,
6297 Pull Parser Function, Parser Create Function, Parser Delete Function):
6298 Update declarations.
6299 (Decl Summary, Table of Symbols): Replace %push-parser and
6300 %push-pull-parser entries with a %define push_pull entry.
6301 * data/bison.m4 (b4_percent_define_check_values): New macro.
6302 (b4_pull_if, b4_push_if, b4_use_push_for_pull_if): Move these
6303 definitions...
6304 * data/c.m4 (b4_identification): ... and the YYPUSH and YYPULL cpp
6305 definitions...
6306 * data/push.c: ... to here and compute them from the value of the
6307 %define variable push_pull.
6308 * data/c-skel.m4: Instead of choosing the push.c skeleton for push
6309 parsing requests here...
6310 * data/yacc.c: ... hack this to switch to push.c any time
6311 b4_use_push_pull_flag or the %define variable push_pull is set. This
6312 will go away when we mv push.c yacc.c.
6313 * data/c++-skel.m4, data/glr.c, data/java-skel.m4: Don't report that
6314 push parsing is not supported since unused %define variables are
6315 reported anyway.
6316 * src/getargs.c, src/getargs.h (pull_parser, push_parser): Remove.
6317 * src/muscle_tab.h (muscle_percent_define_check_values): Update
6318 comments for consistency with b4_percent_define_check_values.
6319 * src/output.c (prepare): Don't insert b4_pull_flag and b4_push_flag
6320 muscles.
6321 * src/parse-gram.y (PERCENT_PUSH_PARSER, PERCENT_PUSH_PULL_PARSER):
6322 Remove.
6323 (prologue_declaration): Remove %push-parser and %push-pull-parser
6324 rules.
6325 * src/scan-gram.l (%push-parser, %push-pull-parser): Remove rules.
6326 * tests/calc.at: Update declarations.
6327 * tests/input.at (%define enum variables): New test case.
6328 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update
6329 declaration.
6330 (Push Parsing: Multiple impure instances): Update declaration.
6331 (Push Parsing: Unsupported Skeletons): New test case.
6332 * tests/torture.at (Exploding the Stack Size with Alloca): Update
6333 declaration.
6334 (Exploding the Stack Size with Malloc): Update declaration.
6335
6336 2007-09-24 Wojciech Polak <polak@gnu.org>
6337
6338 Add XSLT transformations.
6339
6340 * data/xslt/xml2dot.xsl: Transform XML into DOT.
6341 * data/xslt/xml2text.xsl: Transform XML into plain text.
6342 * data/xslt/xml2xhtml.xsl: Transform XML into XHTML.
6343 * data/Makefile.am (xsltdir): New variable.
6344 (dist_xslt_DATA): Add xslt/*.xsl files.
6345
6346 2007-09-23 Paul Eggert <eggert@cs.ucla.edu>
6347
6348 * src/conflicts.c (log_resolution): Fix indenting bugs I introduced.
6349 Problem reported by Wojciech Polak.
6350 * src/print-xml.c (xml_puts): Work even if LEVEL exceeds INT_MAX/2.
6351 (xml_printf): Undo change I made on 21 September; that is,
6352 indent 2 spaces, not 1.
6353
6354 2007-09-23 Joel E. Denny <jdenny@ces.clemson.edu>
6355
6356 Pacify ./configure --enable-gcc-warnings.
6357 * src/print-xml.c, src/print-xml.h (xml_puts): Make third argument
6358 `char const *' instead of `char *'.
6359 * src/state.c (state_rule_lookahead_tokens_print_xml): Remove unused
6360 local variable `sep'.
6361
6362 2007-09-21 Paul Eggert <eggert@cs.ucla.edu>
6363
6364 * src/gram.c (rule_rhs_print_xml): Now static, since it isn't used
6365 elsewhere.
6366 * src/print-xml.c: Prefer "const" after types; that's more consistent.
6367 (xml_printf): Indent just 1 space for level.
6368 (e_char, xlate_char): Remove.
6369 (xml_escape_string): Rewrite to avoid undefined behavior (used
6370 storage that was freed from the stack).
6371 (xml_escape_n): Don't bother checking for subscript error.
6372
6373 2007-09-21 Wojciech Polak <polak@gnu.org>
6374
6375 Add Bison XML Automaton Report.
6376
6377 Add support for an -x option to generate an XML report.
6378 It is not documented yet.
6379 * src/print-xml.c: New file.
6380 * src/print-xml.h: Likewise.
6381 * lib/timevar.def (TV_XML): New var.
6382 * src/Makefile.am (bison_SOURCES): Add print-xml.c, print-xml.h.
6383 * src/conflicts.c: Include print-xml.h.
6384 (solved_conflicts_xml_obstack): New var.
6385 (log_resolution, conflicts_solve, conflicts_free):
6386 Add support for XML report.
6387 (conflicts_output_val): New function.
6388 * src/conflicts.h (conflicts_output_val): New decl.
6389 * src/files.c (spec_xml_file): New var.
6390 (compute_output_file_names, output_file_names_free): Add XML support.
6391 * src/files.h (spec_xml_file): New decl.
6392 * src/getargs.c (xml_flag): New var.
6393 (usage, short_options, long_options, getargs): Add XML support.
6394 * src/getargs.h (xml_flag): New decl.
6395 * src/gram.c: Include print-xml.h.
6396 (rule_lhs_print_xml, rule_rhs_print_xml):
6397 (grammar_rules_partial_print_xml, grammar_rules_print_xml):
6398 New functions.
6399 * src/gram.h: Declare external ones.
6400 * src/main.c: Include print-xml.h.
6401 (main): Add XML support.
6402 * src/reduce.c: Include print-xml.h.
6403 (reduce_xml): New function.
6404 * src/reduce.h: Declare it.
6405 * src/state.c: Include print-xml.h.
6406 (state_new): Add XML support.
6407 (state_rule_lookahead_tokens_print_xml): New function.
6408 * src/state.h: Declare it.
6409 (struct state): New member solved_conflicts_xml.
6410 * src/symtab.c (symbol_class_get_string): New function.
6411 * src/symtab.h: Declare it.
6412
6413 2007-09-21 Paul Eggert <eggert@cs.ucla.edu>
6414
6415 * GNUmakefile: Switch to coreutils's version.
6416 * bootstrap: Likewise.
6417 * Makefile.cfg: Adjust to new GNUmakefile.
6418 * README-hacking: Likewise.
6419
6420 Import from gnulib:
6421
6422 2006-08-18 Paul Eggert <eggert@cs.ucla.edu>
6423 Bruno Haible <bruno@clisp.org>
6424
6425 * m4/bison-i18n.m4 (BISON_I18N): Also handle the case where yacc exists
6426 and is a script that invokes bison. Tighten the code. Add comments.
6427
6428 2007-08-28 Joel E. Denny <jdenny@ces.clemson.edu>
6429
6430 Spell "boolean" as "Boolean". Reported by Akim Demaille.
6431 * data/bison.m4 (b4_percent_define_flag_if): Fix complaint.
6432 * doc/bison.texinfo (Decl Summary): Fix.
6433 * src/muscle_tab.c (muscle_percent_define_flag_if): Fix complaint.
6434 * tests/input.at (Boolean %define variables): Update output.
6435 * tests/skeletons.at (%define boolean variables: invalid skeleton
6436 defaults): Rename to...
6437 (%define Boolean variables: invalid skeleton defaults): ... this and
6438 update output.
6439
6440 2007-08-17 Joel E. Denny <jdenny@ces.clemson.edu>
6441
6442 In impure push mode, don't allow more than one yypstate to be allocated
6443 since multiple impure parsers would corrupt yynerrs.
6444 * data/push.c (yypstate_allocated): New static global variable
6445 initialized to 0.
6446 (yypull_parse): If yypstate_new returns 0, don't report it as memory
6447 exhaustion if yypstate_allocated is 1, but still return 2.
6448 (yypstate_new): Invoke yyerror and return 0 if yypstate_allocated is
6449 already 1. Otherwise, set it to 1.
6450 (yypstate_delete): Set it to 0.
6451 * tests/push.at (Push Parsing: Multiple impure instances): New test
6452 case.
6453
6454 2007-08-17 Bob Rossi <bob@brasko.net>
6455
6456 * doc/bison.texinfo (Push Decl): Document the push parser.
6457 (Table of Symbols): Ditto.
6458 (Pure Decl): Ditto.
6459 (Decl Summary): Ditto.
6460 (Multiple Parsers, Push Parser Function, Pull Parser Function,
6461 Parser Create Function, Parser Delete Function):
6462 Add new push parser symbols.
6463 (Table of Symbols): Document push-parser, push-pull-parser,
6464 yypush_parse, yypull_parse, yypstate_new and yypstate_delete.
6465
6466 2007-08-15 Paul Eggert <eggert@cs.ucla.edu>
6467
6468 Update to GPLv3.
6469 * doc/gpl-3.0.texi: New file.
6470 * doc/gpl.texi: Remove.
6471 * COPYING, GNUmakefile, HACKING, Makefile.am, Makefile.cfg:
6472 * Makefile.maint, NEWS, PACKAGING, README, README-alpha:
6473 * README-hacking, TODO, bootstrap, bootstrap.conf:
6474 * configure.ac, data/Makefile.am, data/README, data/bison.m4:
6475 * data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4:
6476 * data/glr.c, data/glr.cc, data/java-skel.m4, data/java.m4:
6477 * data/lalr1.cc, data/lalr1.java, data/location.cc:
6478 * data/push.c, data/yacc.c, data/m4sugar/m4sugar.m4:
6479 * djgpp/Makefile.maint, djgpp/README.in, djgpp/config.bat:
6480 * djgpp/config.sed, djgpp/config.site, djgpp/config_h.sed:
6481 * djgpp/djunpack.bat, djgpp/subpipe.c, djgpp/subpipe.h:
6482 * djgpp/testsuite.sed, doc/Makefile.am, doc/bison.texinfo:
6483 * doc/fdl.texi, doc/refcard.tex, etc/Makefile.am, etc/README:
6484 * etc/bench.pl.in, examples/Makefile.am, examples/extexi:
6485 * examples/calc++/Makefile.am, lib/Makefile.am, lib/abitset.c:
6486 * lib/abitset.h, lib/bbitset.h, lib/bitset.c, lib/bitset.h:
6487 * lib/bitset_stats.c, lib/bitset_stats.h, lib/bitsetv-print.c:
6488 * lib/bitsetv-print.h, lib/bitsetv.c, lib/bitsetv.h:
6489 * lib/ebitset.c, lib/ebitset.h, lib/get-errno.c:
6490 * lib/get-errno.h, lib/lbitset.c, lib/lbitset.h:
6491 * lib/libiberty.h, lib/main.c, lib/subpipe.c, lib/subpipe.h:
6492 * lib/timevar.c, lib/timevar.def, lib/timevar.h:
6493 * lib/vbitset.c, lib/vbitset.h, lib/yyerror.c:
6494 * m4/c-working.m4, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4:
6495 * m4/timevar.m4, src/LR0.c, src/LR0.h, src/Makefile.am:
6496 * src/assoc.c, src/assoc.h, src/closure.c, src/closure.h:
6497 * src/complain.c, src/complain.h, src/conflicts.c:
6498 * src/conflicts.h, src/derives.c, src/derives.h, src/files.c:
6499 * src/files.h, src/flex-scanner.h, src/getargs.c:
6500 * src/getargs.h, src/gram.c, src/gram.h, src/graphviz.c:
6501 * src/lalr.c, src/lalr.h, src/location.c, src/location.h:
6502 * src/main.c, src/muscle_tab.c, src/muscle_tab.h:
6503 * src/nullable.c, src/nullable.h, src/output.c, src/output.h:
6504 * src/parse-gram.c, src/parse-gram.h, src/parse-gram.y:
6505 * src/print.c, src/print.h, src/print_graph.c:
6506 * src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c:
6507 * src/reduce.h, src/relation.c, src/relation.h:
6508 * src/revision.h, src/scan-code.h, src/scan-code.l:
6509 * src/scan-gram.h, src/scan-gram.l, src/scan-skel.h:
6510 * src/scan-skel.l, src/state.c, src/state.h, src/symlist.c:
6511 * src/symlist.h, src/symtab.c, src/symtab.h, src/system.h:
6512 * src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h:
6513 * tests/Makefile.am, tests/actions.at, tests/c++.at:
6514 * tests/calc.at, tests/conflicts.at, tests/cxx-type.at:
6515 * tests/existing.at, tests/glr-regression.at:
6516 * tests/headers.at, tests/input.at, tests/java.at:
6517 * tests/local.at, tests/output.at, tests/push.at:
6518 * tests/reduce.at, tests/regression.at, tests/sets.at:
6519 * tests/skeletons.at, tests/synclines.at, tests/testsuite.at:
6520 * tests/torture.at:
6521 Update to GPLv3.
6522
6523 2007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
6524
6525 Get rid of broken %no-parser, -n, and --no-parser implementation and
6526 documentation.
6527 * TODO: Don't mention them.
6528 * doc/bison.1: Likewise.
6529 * doc/bison.texinfo (Decl Summary): Likewise.
6530 (Bison Options): Likewise.
6531 (Option Cross Key): Likewise.
6532 * src/getargs.c (no_parser_flag): Remove global variable.
6533 (usage): Don't print description of -n and --no-parser.
6534 (long_options): Remove --no-parser entry here.
6535 (getargs): Remove -n case in the switch here.
6536 * src/getargs.h (no_parser_flag): Remove extern.
6537 * tests/regression.at (Web2c Actions): Remove comment that mentions
6538 --no-parser.
6539
6540 2007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
6541
6542 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Do not
6543 name user variables starting with `yy'. Just pass NULL instead of a
6544 dummy local &yylval to yypush_parse.
6545 * tests/torture.at (AT_DATA_STACK_TORTURE): Do not name user variables
6546 starting with `yy'.
6547
6548 2007-08-03 Joel E. Denny <jdenny@ces.clemson.edu>
6549
6550 * data/yacc.c (yyexhaustedlab): Define it when YYERROR_VERBOSE is
6551 true since it's then always used regardless of whether yyoverflow is
6552 defined. Reported by Christian Burger at
6553 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00031.html>.
6554 * THANKS: Add Christian Burger.
6555
6556 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
6557 node names: say "Decl Summary" not "Bison Declaration Summary".
6558
6559 2007-07-28 Joel E. Denny <jdenny@ces.clemson.edu>
6560
6561 * src/muscle_tab.c (muscle_percent_define_flag_if): In order to
6562 determine whether this function has already complained about an invalid
6563 value for a %define boolean variable, don't check whether Bison has
6564 ever examined the value. As written, the check was a tautology.
6565 Instead, record and check for this complaint using a separate muscle.
6566
6567 2007-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
6568
6569 Fix push parsing memory leak reported by Brandon Lucia at
6570 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00032.html>.
6571 * THANKS: Add Brandon Lucia.
6572 * data/push.c (yypstate_delete): Free the stack if it was reallocated
6573 but the parse never completed and thus freed it.
6574 * tests/Makefile.am (TESTSUITE_AT): Add push.at.
6575 * tests/testsuite.at: Include push.at.
6576 * test/push.at: New.
6577 (Push Parsing: Memory Leak for Early Deletion): New test case.
6578
6579 2007-07-17 Joel E. Denny <jdenny@ces.clemson.edu>
6580
6581 Improve handling of multiple S/R conflicts in the same state and of S/R
6582 conflicts involving multiple reductions.
6583 * src/conflicts.c (resolve_sr_conflict): Don't assign the error action
6584 set for a state here or Bison will abort if it is reassigned on a
6585 later conflicted reduction in the same state.
6586 Similarly, don't finalize and assign the solved conflicts report here
6587 or it will be lost if it is reassigned on a later conflicted reduction
6588 in the same state.
6589 (set_conflicts): Instead, assign them both here after all S/R conflicts
6590 in the state have been fully examined.
6591 * src/print.c (shift_set): Rename to...
6592 (no_reduce_set): ... this.
6593 (print_reductions): Update for rename, and add %nonassoc error action
6594 tokens to no_reduce_set so that, when printing the first remaining
6595 reduction on an error action token, the reduction is enclosed in
6596 brackets.
6597 (print_results): Update for rename.
6598 * tests/conflicts.at (Solved conflicts report for multiple reductions
6599 in a state): New test case.
6600 (%nonassoc error actions for multiple reductions in a state): New test
6601 case.
6602
6603 * src/main.c (main): Don't depend on C99 features.
6604
6605 2007-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
6606
6607 * build-aux/.cvsignore: Add compile.
6608 * lib/.cvsignore: Add charset.alias, ref-add.sed, ref-del.sed, and
6609 uniwidth.
6610
6611 2007-07-10 Joel E. Denny <jdenny@ces.clemson.edu>
6612
6613 * bootstrap (slurp): Create target directories that don't exist.
6614 Specifically, we need lib/uniwidth/ because of recent Gnulib changes.
6615
6616 2007-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
6617
6618 * LR0.c (new_itemsets): Fix wording in comments: say item index rather
6619 than item number.
6620 * closure.c (closure): Likewise.
6621 * state.h (reductions): Comment sorting of rules.
6622 (state): Comment sorting of items.
6623
6624 2007-07-02 Joel E. Denny <jdenny@ces.clemson.edu>
6625
6626 Fix C++ test cases after recent Gnulib changes. Discussed starting at
6627 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00000.html>.
6628 * examples/calc++/Makefile.am (DEFAULT_INCLUDES): Override Automake's
6629 definition in order to avoid Gnulib headers since we don't use config.h
6630 here.
6631 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Use AT_DATA_GRAMMAR
6632 rather than AT_DATA so that config.h is included.
6633
6634 2007-07-01 Joel E. Denny <jdenny@ces.clemson.edu>
6635
6636 * data/glr.c (yy_yypstack, yypstates, yypdumpstack): Use YYFPRINTF
6637 instead of fprintf. Guard these functions with #if YYDEBUG instead of
6638 #ifdef YYDEBUG for consistency with all other uses of YYDEBUG in Bison
6639 and so that YYFPRINTF is guaranteed to be defined here.
6640
6641 2007-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
6642
6643 * src/muscle_tab.c (muscle_percent_define_invalid_value): Replace
6644 with...
6645 (muscle_percent_define_check_values): ... this more helpful function.
6646 Again, it's not used yet, but it will be.
6647 * src/muscle_tab.h: Likewise.
6648
6649 Improve some comments in parser table construction.
6650 * src/LR0.c (new_itemsets): Explain sorting of itemset and kernel_base.
6651 (generate_states): Don't mention ruleset, which is internal to closure.
6652 * src/closure.c (closure): Explain sorting of core and itemset, which
6653 is required for this function to behave correctly.
6654 * src/closure.h (closure): Mention sorting.
6655
6656 2007-05-28 Joel E. Denny <jdenny@ces.clemson.edu>
6657
6658 * src/lalr.c (state_lookahead_tokens_count): For code readability,
6659 move the check for disabled transitions to an aver since conflict
6660 resolution hasn't happened yet.
6661
6662 * src/lalr.c (state_lookahead_tokens_count): Remove the check that
6663 labels a state as inconsistent just because it has error transitions.
6664 The original form of this check appeared in revision 1.1 of lalr.c,
6665 which was committed on 1991-12-21. Now (at least), changing the
6666 consistency label on such a state appears to have no useful effect in
6667 any of the places it is examined, which I enumerate below. The key
6668 point to understanding each item in this enumeration is that a state
6669 with an error transition is labelled consistent in the first place only
6670 if it has no rules, so the check cannot matter for states that have
6671 rules. (1) Labelling a state as inconsistent will cause set_conflicts
6672 to try to identify its conflicts, and a state must have *rules* to have
6673 conflicts. (2) Labelling a state as inconsistent will affect how
6674 action_row sets the default *rule* for the state. (3) Labelling a
6675 state as inconsistent will cause build_relations to add lookback edges
6676 to *rules* in that state.
6677 * src/state.h (struct state): Word the comment for member consistent
6678 more carefully.
6679
6680 2007-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
6681
6682 Don't depend on C99 features.
6683 * src/conflicts.c (conflicts_update_state_numbers): Fix for-loop.
6684 * src/lalr.c (lalr_update_state_numbers): Fix for-loop.
6685 * src/reader.c (check_and_convert_grammar): Fix for-loop.
6686 * src/state.c (state_mark_reachable_states): Fix for-loop.
6687 (state_remove_unreachable_states): Fix for-loop.
6688
6689 Don't widen struct state with member reachable just to temporarily
6690 record reachability. Instead, use a local bitset.
6691 * src/state.h (struct state): Remove member.
6692 * src/state.c (state_new): Don't initialize it.
6693 (state_mark_reachable_states): Rename to...
6694 (state_record_reachable_states): ... this, and use bitset.
6695 (state_remove_unreachable_states): Use bitset.
6696
6697 2007-05-26 Joel E. Denny <jdenny@ces.clemson.edu>
6698
6699 * src/Makefile.am (yacc): Quote target action commands properly so
6700 that the yacc script isn't corrupt. Reported by Hans Aberg at
6701 <http://lists.gnu.org/archive/html/bug-bison/2007-05/msg00003.html>.
6702
6703 * data/glr.c (yylval): As in yacc.c, don't extern in the header for
6704 the case of pure parsers. Reported by Frans Englich at
6705 <http://lists.gnu.org/archive/html/help-bison/2007-05/msg00018.html>.
6706 * THANKS: Add Frans Englich.
6707
6708 * NEWS (2.3a+): In the %code entry, reference section `Bison
6709 Declaration Summary' from the manual now since the %code summary has
6710 moved there.
6711 * doc/bison.texinfo (Prologue Alternatives): Mention that directives
6712 in the rules section must be terminated by semicolons.
6713
6714 2007-05-20 Joel E. Denny <jdenny@ces.clemson.edu>
6715
6716 Extend the front-end API for %define variables to more completely
6717 mirror the back-end. This will be useful in the future.
6718 * data/bison.m4 (b4_percent_define_get, b4_percent_define_ifdef):
6719 Update comments to mention the new front-end counterparts of these
6720 macros.
6721 * src/muscle_tab.c (MUSCLE_COMMON_DECODE): New macro with common code
6722 for muscle_string_decode and muscle_location_decode.
6723 (muscle_string_decode): New static function.
6724 (muscle_location_decode): Use MUSCLE_COMMON_DECODE.
6725 (muscle_percent_define_get, muscle_percent_define_ifdef): New
6726 functions.
6727 (muscle_percent_define_flag_if): Use muscle_percent_define_ifdef and
6728 muscle_percent_define_get to mimic the b4_percent_define_flag_if
6729 implementation more closely.
6730 (muscle_percent_define_invalid_value): New function.
6731 * src/muscle_tab.h (muscle_percent_define_get,
6732 muscle_percent_define_ifdef, muscle_percent_define_invalid_value):
6733 Prototype.
6734
6735 2007-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
6736
6737 * NEWS (2.3a+): Mention yesterday's state-removal change.
6738 (2.3a): Remove the %language entry, which was added after 2.3a.
6739 * src/LR0.c, src/closure.c, src/closure.h, src/conflicts.c,
6740 src/conflicts.h, src/lalr.c, src/lalr.h, src/print.c,
6741 src/print_graph.c, src/state.c, src/state.h, tests/conflicts.at,
6742 tests/existing.at: Update copyright date.
6743
6744 2007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
6745
6746 If conflict resolution makes states unreachable, remove those states,
6747 report rules that are then unused, and don't report conflicts in those
6748 states.
6749 * src/conflicts.c, src/conflicts.h (conflicts_update_state_numbers):
6750 New global function.
6751 * src/lalr.c, src/lalr.h (lalr_update_state_numbers): New global
6752 function.
6753 * src/main.c (main): After conflict resolution, remove the unreachable
6754 states and update all data structures that reference states by number.
6755 * src/state.c (state_new): Initialize each state's reachable member to
6756 false.
6757 (state_mark_reachable_states): New static function.
6758 (state_remove_unreachable_states): New global function.
6759 * src/state.h (struct state): Add member bool reachable.
6760 (state_remove_unreachable_states): Prototype.
6761 * tests/conflicts.at (Unreachable States After Conflict Resolution):
6762 New test case.
6763 * tests/existing.at (GNU pic Grammar): Update test case output now that
6764 an unused rule is discovered.
6765
6766 2007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
6767
6768 Minor code cleanup in parser table construction.
6769 * src/LR0.c (new_itemsets): Use item_number_is_symbol_number.
6770 (new_itemsets, save_reductions): Update for rename to nitemset.
6771 * src/closure.c (nritemset): Rename to...
6772 (nitemset): ... this since the "r" appears to meaningless and isn't
6773 used in the comments.
6774 (closure): Update for rename.
6775 * src/closure.h (nritemset): Update extern to...
6776 (nitemset): ... this.
6777 * src/lalr.c (LA): Fix a typo in comments.
6778 * src/print.c (print_core): Update for rename to nitemset.
6779 * src/print_graph.c (print_graph): Likewise.
6780 * src/state.h: Fix some typos in header comments.
6781
6782 2007-04-04 Paul Eggert <eggert@cs.ucla.edu>
6783
6784 * THANKS: Use ASCII for Sebastien Fricker's name. Bison source
6785 still sticks to ASCII. Sorry!
6786
6787 * README-hacking: New file, taken mostly from coreutils, with changes
6788 for Bison. Contains much of the contents of:
6789 * README-cvs: Remove.
6790 * bootstrap: Sync from gnulib.
6791 * build-aux/.cvsignore: Remove *.t, mkinstalldirs.
6792 * lib/.cvsignore: Add wchar.h, wctype.h. Remove exit.h.
6793
6794 2007-03-10 Joel E. Denny <jdenny@ces.clemson.edu>
6795
6796 * doc/bison.texinfo (Destructor Decl): Fix typo reported by Sebastian
6797 Setzer.
6798 (Java Differences): Fix some typos.
6799 * THANKS: Add Sebastian Setzer.
6800
6801 2007-03-07 Paolo Bonzini <bonzini@gnu.org>
6802
6803 * data/java.m4 (b4_single_class_if): Remove.
6804 (b4_abstract_if): Look at "%define abstract".
6805 (b4_lexer_if): New.
6806 (b4_union_name): Rename...
6807 (b4_yystype): ... to this. Map to "%define stype".
6808 (b4_rhs_value, b4_parse_param_decl, b4_lex_param_decl,
6809 b4_maybe_throws): Fix quoting.
6810 (b4_lex_param_call): Move below to keep b4_*_param_decl close.
6811 * data/lalr1.java (Lexer interface): Always define.
6812 (Lexer interface within parser class): Remove.
6813 (YYLexer class): New, used when "%code lexer" is present.
6814 (constructor): When "%code lexer" is used, pass %lex-param
6815 to the lexer constructor.
6816 (yylex, yyparse): Remove %lex-param from method invocations
6817 (YYStack, yyaction, yyparse): Rename b4_union_name to b4_yystype.
6818
6819 * doc/bison.texinfo (Java Bison Interface): Mention "%define
6820 abstract". Rename "%define union_name" to "%define stype".
6821 Rename method names according to previous patch.
6822 (Java Scanner Interface): Describe "%code lexer" instead of
6823 "%pure-parser" and "%define single_class".
6824 (Java Differences): Mention "%code lexer".
6825
6826 * tests/java.at (_AT_DATA_JAVA_CALC_Y): Remove final argument.
6827 Include scanner here, using macros from tests/local.at.
6828 (AT_DATA_CALC_Y): Remove final argument.
6829 (_AT_CHECK_JAVA_CALC): Likewise.
6830 (AT_CHECK_JAVA_CALC): Likewise. Test all four combinations
6831 of %locations and %error-verbose.
6832 (main): Test with and without %lex-param.
6833 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_LEXPARAM_IF.
6834 (AT_BISON_OPTION_POPDEFS): Pop it.
6835
6836 2007-03-07 Juan Manuel Guerrero <juan.guerrero@gmx.de>
6837
6838 DJGPP spefic issue. Inhibit the use of disallowed characters for
6839 file name genertion on Win98, WinXP, etc. These are |<>":?*\
6840 and concern testsuite case 46.
6841 * Makefile.am: djgpp/testsuite.sed added to EXTRA_DIST
6842 * djgpp/testsuite.sed: Inhibit the use of disallowed characters.
6843 * djgpp/config.bat: Inhibit the use of disallowed characters.
6844
6845 2007-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
6846
6847 Miscellaneous %define and %code cleanup.
6848 * data/bison.m4 (b4_percent_define_flag_if): Correct comments on how
6849 values are interpreted.
6850 * doc/bison.texinfo (Decl Summary): Clean up and extend %define
6851 documentation a little more.
6852 * src/muscle_tab.c (MUSCLE_USER_NAME_CONVERT,
6853 muscle_percent_define_insert, muscle_percent_code_grow): New
6854 functions/macros.
6855 * src/muscle_tab.h (muscle_percent_define_insert,
6856 muscle_percent_code_grow): Prototype.
6857 * src/parse-gram.y (prologue_declaration): Use
6858 muscle_percent_define_insert and muscle_percent_code_grow when parsing
6859 %define and %code directives.
6860
6861 Make it easy to share %define boolean variables between the front-end
6862 and back-end. Though not used yet, this will be useful in the future.
6863 * data/bison.m4 (b4_check_user_names): Rewrite comments to talk about
6864 Bison uses of names rather than just skeleton uses of names.
6865 (b4_percent_define_get, b4_percent_define_ifdef): Rename
6866 b4_percent_define_skeleton_variables(VARIABLE) to
6867 b4_percent_define_bison_variables(VARIABLE).
6868 (b4_percent_code_get, b4_percent_code_ifdef): Rename
6869 b4_percent_code_skeleton_qualifiers(QUALIFIER) to
6870 b4_percent_code_bison_qualifiers(QUALIFIER).
6871 (b4_check_user_names_wrap): Update for renames.
6872 * src/muscle_tab.c, src/muscle_tab.h (muscle_percent_define_flag_if,
6873 muscle_percent_define_default): New functions mimicking
6874 b4_percent_define_flag_if and b4_percent_define_default.
6875
6876 For %define variables, report locations for invalid values and
6877 redefinitions.
6878 * data/bison.m4 (b4_percent_define_flag_if): Read
6879 b4_percent_define_loc(VARIABLE) to report the location of an invalid
6880 value for VARIABLE.
6881 (b4_percent_define_default): Save a special location in
6882 b4_percent_define_loc(VARIABLE) in case the default value for VARIABLE
6883 must later be reported as invalid.
6884 * src/muscle_tab.c (muscle_location_grow, muscle_location_decode): New
6885 functions.
6886 (muscle_percent_define_insert): Record the location of VARIABLE in
6887 muscle percent_define_loc(VARIABLE), and use it to report the previous
6888 location for a redefinition.
6889 (muscle_percent_define_flag_if): Update like b4_percent_define_flag_if.
6890 (muscle_percent_define_default): Update like b4_percent_define_default.
6891 (muscle_grow_user_name_list): Rename to...
6892 (muscle_user_name_list_grow): ... this for consistency and use
6893 muscle_location_grow.
6894 * src/muscle_tab.h (muscle_location_grow): Prototype.
6895 * tests/input.at (%define errors): Update expected output.
6896 * tests/skeletons.at (%define boolean variables: invalid skeleton
6897 defaults): New test case.
6898
6899 2007-02-28 Joel E. Denny <jdenny@ces.clemson.edu>
6900
6901 * src/print.c (lookahead_set, state_default_rule): Remove.
6902 (print_reductions): Replace state_default_rule invocation with
6903 equivalent use of yydefact, which was computed in token_actions in
6904 tables.c.
6905 (print_results): Don't allocate lookahead_set.
6906
6907 2007-02-27 Paolo Bonzini <bonzini@gnu.org>
6908
6909 * data/lalr1.java: Prefix all private members with yy.
6910
6911 2007-02-24 Joel E. Denny <jdenny@ces.clemson.edu>
6912
6913 Use YYFPRINTF instead of fprintf where appropriate. Reported by
6914 Sebastien Fricker at
6915 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00035.html>.
6916 * THANKS: Add Sebastien Fricker.
6917 * data/glr.c, data/push.c, data/yacc.c (yy_reduce_print): Implement.
6918 * doc/bison.texinfo (Tracing): Make it clearer that YYFPRINTF must
6919 accept a variable number of arguments.
6920
6921 2007-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
6922
6923 * bootstrap: Remove occurrences of .#bootmp from lib/Makefile.
6924
6925 2007-02-13 Juan Manuel Guerrero <juan.guerrero@gmx.de>
6926
6927 * djgpp/config.bat: Adjustments concerning the use of autoconf 2.61.
6928 * djgpp/config.sed: Adjustments concerning the use of autoconf 2.61.
6929 * djgpp/config.site: Adjustments concerning the use of autoconf 2.61.
6930
6931 2007-02-11 Paul Eggert <eggert@cs.ucla.edu>
6932
6933 Undo my 2007-02-07 change, switching back to the c-strcase module
6934 introduced in the 2007-02-03 change. Bruno Haible reported that
6935 the 2007-02-07 change would be dangerous in Turkish if we add a
6936 language whose name contains "i", since "i" is not lowercase "I"
6937 in Turkish.
6938 * bootstrap.conf (gnulib_modules): Add c-strcase. Remove strcase.
6939 * lib/.cvsignore: Add c-ctype.c, c-ctype.h, c-strcase.h,
6940 c-strcasecomp.c, c-strncasecmp.c. Remove strcasecmp.c, strncasecmp.c.
6941 * m4/.cvsignore: Remove strcase.m4.
6942 * src/getargs.c: Revert 2007-02-07 change, as follows.
6943 Include c-strcase.h.
6944 (language_argmatch): Use c_strcasecmp rather than strcasecmp.
6945
6946 2007-02-11 Bruno Haible <bruno@clisp.org>
6947
6948 Enable the Java related testsuite tests when the only Java compiler
6949 found is a gcj < 4.3. Discussed at
6950 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00016.html>.
6951 * configure.ac (gt_JAVACOMP): Don't specify a target_version.
6952
6953 2007-02-11 Joel E. Denny <jdenny@ces.clemson.edu>
6954
6955 * data/Makefile.am: Update copyright date.
6956 * data/push.c (yypull_parse): Report memory exhaustion and return 2 if
6957 yypstate_new returns NULL.
6958 (yypstate_new): Return NULL if malloc does.
6959 * src/reader.c (packgram): Move translation of rule actions from the
6960 beginning of packgram to...
6961 (check_and_convert_grammar): ... here right before packgram is invoked
6962 so it's easier to write more complete comments, and remove redundant
6963 code.
6964
6965 2007-02-10 Joel E. Denny <jdenny@ces.clemson.edu>
6966
6967 As in semantic actions, make @$ in %initial-action, %destructor, and
6968 %printer imply %locations.
6969 * src/scan-code.l (SC_SYMBOL_ACTION): Set locations_flag = true when
6970 scanning @$.
6971 * tests/actions.at (AT_CHECK_ACTION_LOCATIONS): New macro supporting...
6972 (@$ in %initial-action implies %locations,
6973 @$ in %destructor implies %locations,
6974 @$ in %printer implies %locations): ... these new test cases.
6975
6976 2007-02-07 Paul Eggert <eggert@cs.ucla.edu>
6977
6978 Undo most of the 2007-02-03 change, switching to the strcase module
6979 now that gnulib strcase has been fixed.
6980 * bootstrap.conf (gnulib_modules): Remove c-strcase. Add strcase.
6981 * lib/.cvsignore: Remove c-ctype.c, c-ctype.h, c-strcase.h,
6982 c-strcasecomp.c, c-strncasecmp.c. Add strcasecmp.c, strncasecmp.c
6983 * m4/.cvsignore: Add strcase.m4.
6984 * src/getargs.c: Revert 2007-02-03 change, as follows.
6985 Don't include c-strcase.h.
6986 (language_argmatch): Use strcasecmp rather than c_strcasecmp.
6987 strcasecmp has "unspecified behavior" outside the POSIX locale,
6988 but it works fine in practice if at least one argument is ASCII,
6989 as is the case in Bison.
6990
6991 2007-02-07 Paolo Bonzini <bonzini@gnu.org>
6992
6993 * tests/java.at: Skip tests if only one of javac/java is present.
6994 Reported by Joel E. Denny.
6995 * tests/atlocal.in: Adjust copyright years.
6996
6997 2007-02-05 Paolo Bonzini <bonzini@gnu.org>
6998
6999 * data/lalr1.java (Stack): Work around old verifiers that disallow
7000 access to the private fields of an inner class, from the outer class.
7001 We can make Stack's fields public because user code doesn't have access
7002 to the instance of Stack used by parse(). Reported by Paul Eggert.
7003
7004 2007-02-03 Paul Eggert <eggert@cs.ucla.edu>
7005
7006 * .cvsignore: Add javacomp.sh, javaexec.sh. Is this really
7007 the right spot for these files?
7008 * bootstrap.conf (gnulib_modules): Add c-strcase.
7009 * lib/.cvsignore: Add c-ctype.c c-ctype.h, c-strcasecomp.c,
7010 c-strncasecmp.c.
7011 * src/getargs.c: Include c-strcase.h.
7012 (language_argmatch): Use c_strcasecmp rather than strcasecmp,
7013 to avoid unspecified behavior.
7014
7015 2007-02-01 Joel E. Denny <jdenny@ces.clemson.edu>
7016
7017 * doc/bison.texinfo (Decl Summary): Correct typo.
7018
7019 2007-01-30 Paolo Bonzini <bonzini@gnu.org>
7020
7021 * data/bison.m4 (b4_percent_define_flag_if): Don't treat 0 as false.
7022 Complain if the value does not match empty, "true" or "false".
7023 * data/c++.m4: Adjust default definitions of %define variables.
7024 * data/java.m4: Adjust default definitions of %define variables.
7025 * doc/bison.texinfo (Decl Summary): Adjust the %define entry according
7026 to above behavior.
7027 * tests/input.at (Boolean %define variables): Test new behavior.
7028
7029 2007-01-29 Paolo Bonzini <bonzini@gnu.org>
7030
7031 * NEWS: Mention java.
7032 * TODO: Remove things that are done.
7033 * bootstrap.conf: Add javacomp-script and javaexec-script.
7034 * configure.ac: Invoke gt_JAVACOMP and gt_JAVAEXEC.
7035
7036 * data/Makefile.am: Add new files.
7037 * data/java-skel.m4: New.
7038 * data/java.m4: New.
7039 * data/lalr1.java: New.
7040
7041 * doc/bison.texinfo: Put "A Complete C++ Example" under
7042 C++ Parsers. Add Java Parsers. Put C++ Parsers and Java Parsers
7043 under Other Languages.
7044
7045 * src/getargs.c (valid_languages): Add Java.
7046 * src/getargs.h (struct bison_language): Update size of string fields.
7047
7048 * tests/Makefile.am: Add java.at.
7049 * tests/atlocal.in: Add CONF_JAVA and CONF_JAVAC.
7050 * tests/java.at: New.
7051 * tests/testsuite.at: Include it.
7052
7053 2007-01-28 Joel E. Denny <jdenny@ces.clemson.edu>
7054
7055 Clean up.
7056 * src/scan-skel.l (at_directive_perform): Add at_directive_argc and
7057 at_directive_argv arguments so these no longer have to be global
7058 variables. Also, update the implementation for the following changes.
7059 (fail_for_at_directive_too_many_args,
7060 fail_for_at_directive_too_few_args): Add at_directive_name argument.
7061 (at_directive_name): Remove as at_directive_argv[0] will be used for
7062 this now.
7063 (AT_DIRECTIVE_ARGC_MAX): Increment to make space in at_directive_argv
7064 for the directive name.
7065 (at_directive_argc, at_directive_argv): Make these local within
7066 skel_lex instead of global.
7067 (INITIAL): Update directive start action for above changes.
7068 (SC_AT_DIRECTIVE_ARG): Rename to...
7069 (SC_AT_DIRECTIVE_ARGS): ... this, and update for above changes.
7070 (SC_AT_DIRECTIVE_SKIP_WS): Update.
7071 (scan_skel): Move yylex_destroy to...
7072 (skel_scanner_free): ... here.
7073 * tests/skeletons.at (installed skeleton file name): Rename to...
7074 (installed skeleton file names): ... this.
7075
7076 2007-01-27 Joel E. Denny <jdenny@ces.clemson.edu>
7077
7078 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
7079 node names: say "Table of Symbols" not "Bison Symbols", and say "Decl
7080 Summary" not "Directives".
7081 * doc/bison.texinfo (Decl Summary, Calc++ Parser): Cross-reference the
7082 %code entry in "Decl Summary" rather than the one in "Table of Symbols"
7083 since the former is now the more complete one.
7084 (Prologue Alternatives): Likewise and do the same for %defines.
7085 (Table of Symbols): Add summary of %code, add summary of %define, and
7086 move full %code documentation to...
7087 (Decl Summary): ... here for consistency with other entries in these
7088 sections.
7089 Move %define entry in order to keep this list alphabetized.
7090 Reword %define entry a little to put less emphasis on the skeleton
7091 concept, which most users shouldn't have to think about.
7092
7093 2007-01-26 Paul Eggert <eggert@cs.ucla.edu>
7094
7095 Adjust to recent gnulib changes.
7096 * lib/.cvsignore: Remove stpcpy.h, strndup.h, strnlen.h.
7097 Add string.h, string_.h, unistd_.h, wchar_.h.
7098 * m4/.cvsignore: Add gnulib-common.m4, string_h.m4, wchar.m4.
7099 * src/system.h: Don't include <stpcpy.h>; this is now done by
7100 <string.h>.
7101
7102 2007-01-23 Paolo Bonzini <bonzini@gnu.org>
7103
7104 Simplify implementation of unqualified %code, implement macros for
7105 uniform treatment of boolean %define flags. Document %define.
7106 * data/bison.m4 (b4_percent_define_ifdef, b4_percent_define_flag_if,
7107 b4_percent_code_ifdef): New.
7108 (b4_percent_code_get): Map unqualified %code to b4_percent_code().
7109 * data/c++.m4: Define default value for global_tokens_and_yystype.
7110 * data/glr.cc: Likewise.
7111 * data/location.cc: Use b4_percent_define_flag_if.
7112
7113 * doc/bison.texinfo (Decl Summary): Document %define.
7114
7115 * src/parse-gram.y (Unqualified %code): Change muscle name to
7116 b4_percent_code().
7117 (content.opt): Default to empty.
7118
7119 2007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
7120
7121 Implement support for relative and absolute skeleton file names.
7122 Discussed starting at
7123 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00071.html>.
7124 * doc/bison.texinfo (Decl Summary): Document in %skeleton entry.
7125 (Bison Options): Document in --skeleton entry.
7126 * src/output.c (output_skeleton): Use strncpy rather than strcpy since
7127 full_skeleton can't necessarily hold all of pkgdatadir.
7128 If the specified skeleton file name contains a `/', don't prepend
7129 pkgdatadir.
7130 * src/parse-gram.y (prologue_declaration): If the specified skeleton
7131 file name contains a `/', prepend the grammar file directory.
7132 * tests/Makefile.am (TESTSUITE_AT): Add skeletons.at.
7133 * skeletons.at: New file.
7134 (relative skeleton file names): New test case.
7135 (installed skeleton file names): New test case.
7136 * tests/testsuite.at: Include skeletons.at.
7137
7138 * bootstrap: Update copyright to 2007.
7139
7140 2007-01-17 Paolo Bonzini <bonzini@gnu.org>
7141
7142 * bootstrap: Remove occurrences of .#bootmp from the files.
7143
7144 2007-01-17 Akim Demaille <akim@epita.fr>
7145
7146 * doc/bison.texinfo (Calc++ Parser): Don't try to alias
7147 nonterminals.
7148 Use per-type %printer.
7149
7150 2007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
7151
7152 * NEWS, data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4,
7153 data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
7154 djgpp/config.site, src/files.c, src/files.h, src/main.c,
7155 src/muscle_tab.c, src/muscle_tab.h, src/parse-gram.y, src/reader.h,
7156 src/scan-skel.h, src/scan-skel.l, tests/actions.at, tests/calc.at,
7157 tests/glr-regression.at, tests/input.at, tests/local.at,
7158 tests/output.at, tests/torture.at: Update copyright to 2007.
7159
7160 2007-01-16 Akim Demaille <akim@epita.fr>
7161
7162 * doc/bison.texinfo (Calc++ Parsing Driver): Let "parse" return an
7163 error code.
7164 (Calc++ Scanner): Exit with failure if we can't open the input
7165 file.
7166 Accept "-" standing for stdin.
7167 (Calc++ Top Level): Print the result only if the parsing was
7168 successful.
7169
7170 2007-01-16 Akim Demaille <akim@epita.fr>
7171
7172 * data/lalr1.cc (yy_reduce_print_): Add a missing end-of-line.
7173
7174 2007-01-15 Paolo Bonzini <bonzini@gnu.org>
7175 and Joel E. Denny <jdenny@ces.clemson.edu>
7176
7177 Clean up %define and %code implementation in M4 some. Most
7178 importantly, rename all related macros to be in the b4_percent_define
7179 and b4_percent_code namespaces. Also, complete support for `.' in
7180 %define variable names and %code qualifiers.
7181 * data/bison.m4 (b4_check_user_names): Check for special
7182 "SKELETON-NAMESPACE(name)" macros instead of using two nested
7183 m4_foreach loops.
7184 (b4_get_percent_define, b4_get_percent_code): Rename to...
7185 (b4_percent_define_get, b4_percent_code_get): ... these.
7186 Extend documentation with examples.
7187 For SKELETON-NAMESPACE (as documented for b4_check_user_names), use
7188 b4_percent_define_skeleton_variables and
7189 b4_percent_code_skeleton_qualifiers.
7190 Expect any value for the %define variable `foo' to be stored in the
7191 macro named `b4_percent_define(foo)'; expect any %code blocks for the
7192 qualifier `foo' to be stored in a macro named `b4_percent_code(foo)';
7193 expect any unqualified %code blocks to be stored in a macro named
7194 `b4_percent_code_unqualified'.
7195 Use m4_indir so that %define variable names and %code qualifiers can
7196 contain `.', which is allowed by the grammar parser.
7197 (b4_percent_define_default): New macro to set a default value for a
7198 %define variable.
7199 (m4_wrap): Update wrapped code, and fix some underquoting.
7200 (b4_check_user_names_wrap): Update and define outside the m4_wrap.
7201 Expect grammar uses of %define variables and %code qualifiers to be
7202 defined in b4_percent_define_user_variables and
7203 b4_percent_code_user_qualifiers.
7204 * data/c++.m4: Use b4_percent_define_default rather than
7205 m4_define_default. Fix some underquoting. Skeleton usage of %define
7206 variable define_location_comparison now implies skeleton usage of
7207 %define variable filename_type.
7208 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
7209 data/push.c, data/yacc.c: Update macro names.
7210 * src/parse-gram.y (prologue_declaration, grammar_declaration): Update
7211 muscle names.
7212
7213 2007-01-14 Juan Manuel Guerrero <juan.guerrero@gmx.de>
7214
7215 DJGPP specific issues.
7216
7217 * djgpp/config.site: Set ac_cv_path_mkdir to a sane DJGPP specific
7218 default. Set gl_cv_absolute_wctype_h to a sane DJGPP specific default.
7219
7220 2007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
7221
7222 * tests/glr-regression.at: Use AT_PARSER_CHECK rather than AT_CHECK to
7223 run parsers in all tests so that Valgrind is invoked during
7224 maintainer-check-valgrind.
7225 (Duplicate representation of merged trees): Free all semantic values.
7226 (Duplicated user destructor for lookahead): Likewise.
7227
7228 2007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
7229
7230 * tests/local.at (AT_PARSER_CHECK): Add a PRE argument to specify a
7231 command-line prefix.
7232 * tests/torture.at (Exploding the Stack Size with Alloca): Stderr is
7233 ignored, so use that PRE to set --log-fd=1 in VALGRIND_OPTS so we don't
7234 miss Valgrind messages.
7235 (Exploding the Stack Size with Malloc): Likewise.
7236
7237 2007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
7238
7239 Ignore YYSTACK_USE_ALLOCA for push parsers since the stacks can't be
7240 locals. Reported by Juan Manuel Guerrero at
7241 <http://lists.gnu.org/archive/html/bug-bison/2007-01/msg00000.html>.
7242 * data/push.c: Enclose the #ifdef YYSTACK_USE_ALLOCA in b4_push_if.
7243 Fix some indentation also.
7244 * tests/torture.at (Exploding the Stack Size with Alloca): Add comment
7245 explaining this issue.
7246
7247 2007-01-09 Paolo Bonzini <bonzini@gnu.org>
7248 and Joel E. Denny <jdenny@ces.clemson.edu>
7249
7250 Simplify union and prologue handling, and escape union and lex/parse
7251 params with digraphs.
7252 * data/bison.m4 (b4_pre_prologue, b4_post_prologue): Set their default
7253 values to the empty string since these are no longer guaranteed
7254 initialized by the front-end.
7255 * data/glr.c, data/glr.cc, data/lalr1.cc, data/push.c, data/yacc.c: Add
7256 braces around b4_user_stype since this is no longer done by the
7257 front-end.
7258 * src/files.c, src/files.h (pre_prologue_obstack,
7259 post_prologue_obstack): Remove.
7260 * src/muscle_tab.c (muscle_pair_list_grow): Don't duplicate header
7261 comments here. Use MUSCLE_OBSTACK_SGROW so that values are escaped
7262 with digraphs. This fixes lex params and parse params.
7263 * src/muscle_tab.h (muscle_pair_list_grow): Update comments.
7264 * src/output.c (prepare): Remove muscle insertion of the prologues.
7265 (output): Remove freeing of pre_prologue_obstack and
7266 post_prologue_obstack.
7267 * src/parse-gram.y (prologue_declaration): Use muscle_code_grow rather
7268 than prologue_augment for prologue parsing so you don't need prologue
7269 obstacks.
7270 (grammar_declaration): For %union RHS, use `braceless' instead of
7271 "{...}" so that braces are already stripped and code is escaped with
7272 digraphs.
7273 * src/reader.c (prologue_augment): Remove.
7274 (reader): Remove initialization of pre_prologue_obstack and
7275 post_prologue_obstack.
7276 * src/reader.h (prologue_augment): Remove.
7277
7278 * data/c.m4: Remove stray parenthesis.
7279
7280 2007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
7281
7282 Remove quotes from variables names in %define directives and from
7283 qualifiers in %code directives, and restrict the characters that are
7284 allowed in them to M4-friendly ones. For %define, continue to support
7285 the quoted form as a deprecated feature. Discussed starting at
7286 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00023.html>.
7287 * NEWS (2.3a+): Add entry for the change to %define. Update entry for
7288 %code.
7289 * doc/bison.texinfo (Prologue Alternatives): Update.
7290 (Decl Summary): In %defines entry, update mention of `%code requires'
7291 and `%code provides'.
7292 (C++ Location Values): Update %define uses.
7293 (Calc++ Parser Interface): Likewise.
7294 (Calc++ Parser): Likewise, and update `%code requires' uses.
7295 (Table of Symbols): Update %code documentation.
7296 * src/parse-gram.y (prologue_declaration): For %define variables, use
7297 `variable' instead of `STRING'.
7298 (grammar_declaration): For %code qualifiers, use `ID' instead of
7299 `STRING'.
7300 (variable): New nonterminal that takes an `ID' or a `STRING'.
7301 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update %code
7302 and %define uses.
7303 * tests/calc.at (_AT_DATA_CALC_Y): Update %define use.
7304 * tests/input.at (Reject unused %code qualifiers): Update %code uses.
7305 (%define errors): Update %define uses.
7306
7307 2007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
7308
7309 * src/parse-gram.y (prologue_declaration): Use MUSCLE_INSERT_STRING
7310 instead of muscle_insert for %define values so that M4-special
7311 characters are replaced with digraphs.
7312 * tests/input.at (%define errors): Extend to check weird values.
7313
7314 2007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
7315
7316 Instead of having skeletons declare all valid %define variables and
7317 %code qualifiers, provide macros that retrieve the associated values
7318 and build these lists automatically. Thus Bison will now warn when a
7319 variable or qualifier is not used by the skeleton in the current
7320 invocation regardless of whether it might sometimes be used by that
7321 skeleton in other invocations. Also, move all %define value macros to
7322 the b4_percent_define_ namespace, and remove the %define "NAME" {CODE}
7323 form, which is replaced by %code.
7324 * data/bison.m4 (b4_check_for_unrecognized_names): Rename to...
7325 (b4_check_user_names): ... this, and change the series of valid name
7326 arguments to a single list argument for names used in the skeleton
7327 similar to the existing list argument for names used in the grammar.
7328 Warn instead of complaining.
7329 (b4_get_percent_define, b4_get_percent_code): New to retrieve %define
7330 values and %code code, to format %code code properly, and to build
7331 lists of all %define variables and %code qualifiers used in the
7332 skeleton: b4_skeleton_percent_define_variables and
7333 b4_skeleton_percent_code_qualifiers.
7334 (b4_check_percent_define_variables, b4_check_percent_code_qualifiers):
7335 Remove, and...
7336 (m4_wrap): ... m4_wrap b4_check_user_names invocations instead so that
7337 the skeleton names lists can finish building first. In place of
7338 b4_used_percent_define_variables and b4_used_percent_code_qualifiers,
7339 expect the lists b4_user_percent_define_variables and
7340 b4_user_percent_code_qualifiers.
7341 * data/c++.m4: Where setting default values for b4_parser_class_name,
7342 b4_location_type, b4_filename_type, b4_namespace, and
7343 b4_define_location_comparison, update their names to the
7344 b4_percent_define_ namespace.
7345 * data/glr.c: Don't use b4_check_percent_define_variables and
7346 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
7347 * data/glr.cc, data/lalr1.cc: Likewise, and use b4_get_percent_define.
7348 (b4_parser_class_name, b4_namespace): Define these using
7349 b4_get_percent_define for parser_class_name and namespace.
7350 * data/location.cc: Use b4_get_percent_define.
7351 * data/push.c: Don't use b4_check_percent_define_variables and
7352 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
7353 * data/yacc.c: Likewise, and don't call m4_exit in
7354 b4_use_push_for_pull_if or m4_wrap code will never execute.
7355 * src/muscle_tab.c, src/muscle_tab.h (muscle_grow_used_name_list):
7356 Rename to...
7357 (muscle_grow_user_name_list): ... this for consistency with the
7358 terminology used in bison.m4.
7359 * src/parse-gram.y (prologue_declaration): Prepend "percent_define_" to
7360 %define variable names, and rename muscle used_percent_define_variables
7361 to user_percent_define_variables.
7362 (grammar_declaration): Rename muscle used_percent_code_qualifiers to
7363 user_percent_code_qualifiers.
7364 (content): Remove.
7365 (content.opt): Replace content RHS with STRING RHS so %define "NAME"
7366 {CODE} form is no longer accepted.
7367 * tests/input.at (Reject bad %code qualifiers): Rename to...
7368 (Reject unused %code qualifiers): ... this, and update test output.
7369 (%define error): Update test output.
7370
7371 2007-01-07 Joel E. Denny <jdenny@ces.clemson.edu>
7372
7373 Check for unrecognized %define variables similar to checking for
7374 unrecognized %code qualifiers. Check for redefined %define variables.
7375 * data/bison.m4 (b4_check_for_unrecognized_names): New macro that
7376 generalizes...
7377 (b4_check_percent_code_qualifiers): ... this, which now wraps it.
7378 (b4_check_percent_define_variables): New, also wraps it.
7379 * data/glr.c: Unless glr.cc is wrapping glr.c, declare no valid %define
7380 variables using b4_check_percent_define_variables.
7381 * data/glr.cc, data/lalr1.cc: Declare the valid %define variables as
7382 all those exercised in the test suite and all those listed in the
7383 `Default values' section of c++.m4. Are there others?
7384 * data/push.c, data/yacc.c: Declare no valid %define variables.
7385 * src/muscle_tab.c, src/muscle_tab.h (muscle_find_const): New function,
7386 similar to muscle_find, but it works even when the muscle stores a
7387 const value.
7388 (muscle_grow_used_name_list): New function for constructing the used
7389 name list muscles that b4_check_for_unrecognized_names requires.
7390 * src/parse-gram.y (prologue_declaration): Warn if a variable is
7391 %define'd more than once. Define the b4_used_percent_define_variables
7392 muscle with muscle_grow_used_name_list.
7393 (grammar_declaration): Abbreviate %code code with
7394 muscle_grow_used_name_list.
7395 * tests/input.at (%define errors): New.
7396
7397 2007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
7398
7399 Provide warn_at, complain_at, and fatal_at function callbacks to the
7400 skeletons, and use this for %code qualifier complaints.
7401 * data/bison.m4 (b4_error_at): New, invoked by...
7402 (b4_warn_at, b4_complain_at, b4_fatal_at): ... these new macros to wrap
7403 the skeleton scanner's new @warn_at(...@), @complain_at(...@), and
7404 @fatal_at(...@) directives.
7405 (b4_check_percent_code_qualifiers): Rewrite to expect locations for
7406 qualifiers in b4_used_percent_code_qualifiers and to use
7407 b4_complain_at.
7408 * src/location.c, src/location.h (boundary_set_from_string): New global
7409 function.
7410 * src/muscle_tab.c, src/muscle_tab.h (muscle_boundary_grow): New global
7411 function.
7412 * src/parse-gram.y (grammar_declaration): Add locations for qualifiers
7413 to b4_used_percent_code_qualifiers.
7414 * src/scan-skel.l (fail_for_at_directive_too_few_args): New static
7415 function.
7416 (AT_DIRECTIVE_ARGC_MAX): Increase for boundary arguments.
7417 (lineno): Rename to...
7418 (out_lineno): ... this so I don't misunderstand it again.
7419 (SC_AT_DIRECTIVE_SKIP_WS): Don't increment out_lineno for newlines
7420 here; these newlines are in the input but not the output file.
7421 (SC_AT_DIRECTIVE_ARG): Likewise. Extract directive execution to...
7422 (at_directive_perform): ... this new static function, and add handling
7423 of new @warn_at(...@), @complain_at(...@), and @fatal_at(...@)
7424 directives.
7425 * tests/input.at (Reject bad %code qualifiers): Update test output with
7426 locations and extend.
7427
7428 * tests/output.at (Output file name: [, Output file name: ]): Remove
7429 bogus comment about these tests failing.
7430
7431 2007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
7432
7433 Clean up b4_check_percent_code_qualifiers a little.
7434 * data/bison.m4 (b4_check_percent_code_qualifiers): Expect qualifiers
7435 in b4_used_percent_code_qualifiers to be double-M4-quoted. Rewrite
7436 documentation and add examples.
7437 * src/parse-gram.y (grammar_declaration): Double-M4-quote those
7438 qualifiers here.
7439
7440 2007-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
7441
7442 Don't use m4_divert since it makes m4_divert_push and m4_divert_pop
7443 unreliable -- especially when they're hidden inside another macro.
7444 * data/bison.m4, data/c++-skel.m4, data/c++.m4, data/c-skel.m4,
7445 data/c.m4: Remove m4_divert(-1).
7446 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
7447 data/push.c, data/yacc.c: Likewise, and replace m4_divert(0) with
7448 m4_divert_push(0) and m4_divert_pop(0).
7449 * src/output.c (output_skeleton): Don't add an m4_divert_push(0) and
7450 an m4_wrap([m4_divert_pop(0)]) to the M4. Diversion -1, which is
7451 pushed and popped by m4sugar, should be first on the stack.
7452
7453 Provide warn, complain, and fatal function callbacks to the skeletons.
7454 This provides more flexibility than m4_fatal, improves the error
7455 message format, and captures messages for translation. Discussed
7456 starting at
7457 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00063.html>.
7458 * data/bison.m4 (b4_error): New, invoked by...
7459 (b4_warn, b4_complain, b4_fatal): ... these new macros to wrap the
7460 skeleton scanner's new @warn(...@), @complain(...@), and @fatal(...@)
7461 directives. Because these M4 macros might be called when the current
7462 diversion is -1 or 0, m4_divert_push and m4_divert_pop is used; thus
7463 the previous removal of uses of m4_divert, which caused trouble.
7464 (b4_check_percent_code_qualifiers): Use b4_complain instead of
7465 m4_fatal to report unrecognized %code qualifiers.
7466 * data/c++-skel.m4: Use b4_complain instead of m4_fatal to report C++
7467 push parser requests.
7468 * data/glr.c: Use b4_complain instead of m4_fatal to report
7469 non-deterministic push parser requests.
7470 Update @output usage to @output(...@) form.
7471 * data/glr.cc, data/lalr1.cc: Use b4_fatal instead of m4_fatal to
7472 report missing %defines. Update @output usage to @output(...@) form.
7473 * data/location.cc, data/push.c, data/yacc.c: Update @output usage to
7474 @output(...@) form.
7475 * src/main.c (main): Invoke skel_scanner_free.
7476 * src/scan-skel.h (skel_scanner_free): Prototype new function.
7477 * src/scan-skel.l (FLEX_NO_OBSTACK): Don't define; we now need the
7478 obstack_for_string from flex-scanner.h.
7479 (YY_DECL): Use to declare skel_lex static.
7480 (decode_at_digraphs): Remove; now handled in the new
7481 SC_AT_DIRECTIVE_ARG start condition.
7482 (fail_for_at_directive_too_many_args, fail_for_invalid_at): New static
7483 functions.
7484 (at_directive_name, AT_DIRECTIVE_ARGC_MAX, at_directive_argc,
7485 at_directive_argv): New static globals.
7486 (INITIAL): Use fail_for_invalid_at.
7487 Don't parse `@output file_name\n' or `@basename(...@)'. Instead,
7488 recognize the start of a generalized `@directive(...@)' form and
7489 start...
7490 (SC_AT_DIRECTIVE_ARG): ... this new start condition to parse the
7491 directive args (using the new obstack_for_string), to decode the
7492 contained @ diagraphs, and to perform the directive. It recognizes
7493 @basename(...@), @warn(...@), @complain(...@), @fatal(...@), and
7494 @output(...@).
7495 (SC_AT_DIRECTIVE_SKIP_WS): New start condition started by
7496 SC_AT_DIRECTIVE_ARG to skip whitespace after the argument delimiter,
7497 `@,'.
7498 (scan_skel): Initialize obstack_for_string on the first call.
7499 (skel_scanner_free): New function to free obstack_for_string.
7500 * tests/input.at (Reject bad %code qualifiers): Update test output.
7501
7502 2007-01-04 Joel E. Denny <jdenny@ces.clemson.edu>
7503
7504 Consolidate the 4 prologue alternative directives (%code, %requires,
7505 %provides, and %code-top) into a single %code directive with an
7506 optional qualifier field. Discussed at
7507 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00012.html>.
7508 * NEWS (2.3a+): Rewrite the existing entry for the prologue
7509 alternatives.
7510 * doc/bison.texinfo (Prologue Alternatives): Update.
7511 (Decl Summary): Update to %code "requires" and %code "provides".
7512 (Calc++ Parser): Update to %code "requires".
7513 (Table of Symbols): Remove entries for %requires, %provides, and
7514 %code-top. Rewrite %code entry, and add a %code "QUALIFIER" entry.
7515 * data/bison.m4 (b4_user_provides, b4_user_requires): Remove as these
7516 are replaced by b4_percent_code_provides and b4_percent_code_requires,
7517 which are skeleton-specific.
7518 (b4_check_percent_code_qualifiers): New. A skeleton can use this to
7519 declare what %code qualifiers it supports and to complain if any other
7520 qualifiers were used in the grammar.
7521 * data/glr.cc: Update to use b4_user_code([b4_percent_code_requires])
7522 and b4_user_code([b4_percent_code_provides]) in place of
7523 b4_user_requires and b4_user_provides.
7524 * data/glr.c, data/lalr1.cc, data/push.c, data/yacc.c: Likewise.
7525 Add b4_user_code([b4_percent_code_top]) and
7526 b4_user_code([b4_percent_code]).
7527 Invoke b4_check_percent_code_qualifiers.
7528 * src/parse-gram.y (PERCENT_CODE_TOP, PERCENT_PROVIDES,
7529 PERCENT_REQUIRES): Remove.
7530 (grammar_declaration): Remove RHS's for %code-top, %provides, and
7531 %requires. Rewrite the %code RHS as the unqualified form defining the
7532 muscle b4_percent_code. Add another RHS for the qualified %code form,
7533 which defines muscles of the form b4_percent_code_QUALIFIER and the
7534 b4_used_percent_code_qualifiers muscle.
7535 * src/scan-gram.l (PERCENT_CODE_TOP, PERCENT_PROVIDES,
7536 PERCENT_REQUIRES): Remove.
7537 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update to use
7538 %code "requires" and %code "provides".
7539 * tests/input.at (Reject bad %code qualifiers): New.
7540
7541 2007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
7542
7543 Use the new code_props interface for destructors and printers.
7544 * src/symtab.h (symbol, semantic_type): Remove destructor_location and
7545 printer_location members, and change the type of the destructor and
7546 printer members to code_props.
7547 (symbol_destructor_set, symbol_destructor_get, symbol_printer_set,
7548 symbol_printer_get, semantic_type_destructor_set,
7549 semantic_type_printer_set, default_tagged_destructor_set,
7550 default_tagless_destructor_set, default_tagged_printer_set,
7551 default_tagless_printer_set): Use code_props in arguments and return
7552 types in place of char const * and location.
7553 (symbol_destructor_location_get, symbol_printer_location_get): Remove
7554 since the locations are now contained in the return of
7555 symbol_destructor_get and symbol_printer_get.
7556 * src/output.c (symbol_destructors_output, symbol_printers_output):
7557 Replace with...
7558 (symbol_code_props_output): ... this to eliminate duplicate code.
7559 (output_skeleton): Update to use symbol_code_props_output.
7560 * src/reader.c (symbol_should_be_used): Update use of
7561 symbol_destructor_get.
7562 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
7563 Update uses of the various _destructor_set and _printer_set functions.
7564 * src/symtab.c: (default_tagged_destructor_location,
7565 default_tagless_destructor_location, default_tagged_printer_location,
7566 default_tagless_printer_location): Remove since we...
7567 (default_tagged_destructor, default_tagless_destructor,
7568 default_tagged_printer, default_tagless_printer): ... change the type
7569 of these to code_props.
7570 (symbol_new, semantic_type_new, symbol_destructor_set,
7571 semantic_type_destructor_set, symbol_destructor_get,
7572 symbol_printer_set, semantic_type_printer_set, symbol_printer_get,
7573 symbol_check_alias_consistency, default_tagged_destructor_set,
7574 default_tagless_destructor_set, default_tagged_printer_set,
7575 default_tagless_printer_set): Update.
7576 (symbol_destructor_location_get, symbol_printer_location_get): Remove.
7577 (SYMBOL_CODE_PRINT): New similar to SYMBOL_ATTR_PRINT but for
7578 code_props members.
7579 (symbol_print): Use SYMBOL_CODE_PRINT.
7580
7581 2007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
7582
7583 Use the new code_props interface for rule actions.
7584 * src/symlist.h (symbol_list): Replace action, action_location, and
7585 used members with a code_props action_props member.
7586 * src/reader.c (symbol_should_be_used, grammar_rule_check,
7587 grammar_midrule_action, grammar_current_rule_merge_set,
7588 grammar_current_rule_symbol_append, packgram): Update.
7589 * src/scan-code.h (translate_rule_action): Remove, no longer used.
7590 * src/scan-code.l (handle_action_dollar): Update.
7591 (translate_rule_action): Remove, no longer used.
7592 * src/symlist.c (symbol_list_sym_new, symbol_list_syms_print): Update.
7593
7594 2007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
7595
7596 Use the new code_props interface in parse-gram.y.
7597 * src/parse-gram.y (prologue_declaration, braceless, epilogue.opt):
7598 Update all uses of translate_* functions to use the new code_props
7599 interface and to use gram_scanner_last_string_free and
7600 code_scanner_last_string_free where possible.
7601 (grammar_declaration): symbol_list_destructor_set and
7602 symbol_list_printer_set now perform the translation, so don't do it
7603 here. Use gram_scanner_last_string_free where possible.
7604 * src/scan-code.h, src/scan-code.l (translate_symbol_action,
7605 translate_code): Remove, no longer used.
7606 * src/symlist.h, src/symlist.c (symbol_list_destructor_set,
7607 symbol_list_printer_set): Perform code translation here rather than
7608 depending on the caller to do so.
7609
7610 * src/symlist.h (struct symbol_list): Correct some documentation typos.
7611 * src/scan-gram.h (gram_last_string): Remove declaration.
7612 * src/scan-gram.l (last_string): Declare it static.
7613
7614 2007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
7615
7616 Encapsulate code properties and related functionality for the various
7617 destructors, printers, and actions into a code_props structure and
7618 interface. This patch merely implements code_props in scan-code.h and
7619 scan-code.l. Future patches will rewrite other modules to use it.
7620 Discussed starting at
7621 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00020.html>.
7622 * src/location.h (EMPTY_LOCATION_INIT): Define so that it's easier to
7623 consistently initialize const structs that have an empty location
7624 field.
7625 * src/location.c (empty_location): Initialize with EMPTY_LOCATION_INIT
7626 to ensure consistency.
7627 * src/scan-code.h (code_props): New structure.
7628 (code_props_none_init, CODE_PROPS_NONE_INIT, code_props_none): New
7629 function, macro, and const global variable for initializing a
7630 code_props with no code.
7631 (code_props_plain_init, code_props_symbol_action_init,
7632 code_props_rule_action_init, code_props_translate_code): The rest of
7633 the new code_props functional interface. Among other things, the init
7634 functions set the code_props kind field so that
7635 code_props_translate_code will know whether to behave like
7636 translate_symbol_action, translate_rule_action, or translate_code.
7637 These old translate functions must remain until all other modules are
7638 updated to use the new code_props interface.
7639 (code_scanner_last_string_free): New function similar to
7640 gram_scanner_last_string_free.
7641 (code_scanner_free): Add documentation.
7642 * src/scan-code.l: Implement the new interface.
7643 (code_lex): Make it static, add a code_props* argument, and remove the
7644 rule argument.
7645 (last_string): New static global similar to the one in scan-gram.l.
7646 (SC_RULE_ACTION): Update to use the code_props* argument to code_lex
7647 instead of rule.
7648 (SC_SYMBOL_ACTION): For $$, set the is_value_used member of the
7649 code_props since Bison may one day use this information for destructors
7650 and printers.
7651 (<*><<EOF>>): Use STRING_FINISH so that last_string is set.
7652 (handle_action_dollar): Use symbol_list_n_get and set used flag
7653 directly since symbol_list_n_used_set is removed.
7654 (translate_action): Add a code_props* argument and remove the rule,
7655 action, and location arguments. Pass the code_props* on to code_lex.
7656 (translate_rule_action, translate_symbol_action, translate_code):
7657 Rewrite as wrappers around the new code_props interface.
7658 * src/symlist.h, src/symlist.c (symbol_list_n_used_set): Remove since
7659 it would eventually need to break the encapsulation of code_props.
7660
7661 2007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
7662
7663 * etc/.cvsignore: New.
7664
7665 2007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
7666
7667 Add maintainer-push-check to run maintainer-check using push parsing in
7668 place of pull parsing where available.
7669 * Makefile.am (maintainer-push-check): New.
7670 * data/bison.m4 (b4_use_push_for_pull_if): New.
7671 * data/push.c: Redefine b4_push_if and b4_use_push_for_pull_if
7672 appropriately based on their existing values.
7673 (yypush_parse): Don't print push-parser-specific diagnostics if push
7674 parsing is being used in place of pull parsing.
7675 * data/yacc.c: If push parsing should replace pull parsing, redirect to
7676 push.c.
7677 * src/output.c (prepare): Check BISON_USE_PUSH_FOR_PULL environment
7678 variable, and insert b4_use_push_for_pull_flag into muscles.
7679 * tests/Makefile.am (maintainer-push-check): New.
7680
7681 2006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
7682
7683 * data/push.c (yypush_parse): Set yynew = 1 at the end of a parse
7684 (whether successful or failed) so that yypush_parse can be invoked
7685 again to start a new parse using the same yypstate.
7686 * tests/torture.at (AT_DATA_STACK_TORTURE): For push mode, extend to
7687 check multiple yypull_parse invocations on the same yypstate. For pull
7688 mode, extend to check multiple yyparse invocations.
7689 (Exploding the Stack Size with Alloca): Extend to try with
7690 %push-pull-parser.
7691 (Exploding the Stack Size with Malloc): Likewise.
7692
7693 * tests/calc.at (Simple LALR Calculator): Don't specify
7694 %skeleton "push.c" since %push-pull-parser implies that now.
7695 * tests/headers.at (export YYLTYPE): Don't check for the push
7696 declarations. Otherwise, this test case can't be used to see if push
7697 mode can truly emulate pull mode.
7698 * tests/input.at (Torturing the Scanner): Likewise.
7699 * tests/local.at (AT_YACC_OR_PUSH_IF, AT_PUSH_IF): Remove.
7700 (AT_YYERROR_SEES_LOC_IF): Rather than AT_YACC_OR_PUSH_IF, use
7701 AT_YACC_IF, which now includes the case of push mode since %skeleton
7702 need not be used for push mode. This will be more intuitive once
7703 push.c is renamed to yacc.c.
7704
7705 2006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
7706
7707 For push mode, convert yyparse from a macro to a function, invoke yylex
7708 instead of passing a yylexp argument to yypull_parse, and don't
7709 generate yypull_parse or yyparse unless %push-pull-parser is declared.
7710 Discussed starting at
7711 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00163.html>.
7712 * data/bison.m4 (b4_pull_if): New.
7713 * data/c.m4 (b4_identification): Define YYPULL similar to YYPUSH.
7714 * data/push.c: Improve M4 quoting a little.
7715 (b4_generate_macro_args, b4_parenthesize): Remove.
7716 (yyparse): If there's a b4_prefix, #define this to b4_prefix[parse]
7717 any time a pull parser is requested.
7718 Don't #define this as a wrapper around yypull_parse. Instead, when
7719 both push and pull are requested, make it a function that does that
7720 same thing.
7721 (yypull_parse): If there's a b4_prefix, #define this to
7722 b4_prefix[pull_parse] when both push and pull are requested.
7723 Don't define this as a function unless both push and pull are
7724 requested.
7725 Remove the yylexp argument and hard-code yylex invocation instead.
7726 * etc/bench.pl.in (bench_grammar): Use %push-pull-parser instead of
7727 %push-parser.
7728 * src/getargs.c (pull_parser): New global initialized to true.
7729 * getargs.h (pull_parser): extern it.
7730 * src/output.c (prepare): Insert pull_flag muscle.
7731 * src/parse-gram.y (PERCENT_PUSH_PULL_PARSER): New token.
7732 (prologue_declaration): Set both push_parser and pull_parser = true for
7733 %push-pull-parser. Set push_parser = true and pull_parser = false for
7734 %push-parser.
7735 * src/scan-gram.l: Don't accept %push_parser as an alternative to
7736 %push-parser since there's no backward-compatibility concern here.
7737 Scan %push-pull-parser.
7738 * tests/calc.at (Simple LALR(1) Calculator): Use %push-pull-parser
7739 instead of %push-parser.
7740 * tests/headers.at (export YYLTYPE): Make yylex static, and don't
7741 prototype it in the module that calls yyparse.
7742 * tests/input.at (Torturing the Scanner): Likewise.
7743 * tests/local.at (AT_PUSH_IF): Check for %push-pull-parser as well.
7744
7745 2006-12-26 Joel E. Denny <jdenny@ces.clemson.edu>
7746
7747 Update etc/bench.pl. Optimize push mode a little (the yyn change
7748 deserves most of the credit).
7749 * Makefile.am (SUBDIRS): Add etc subdirectory.
7750 * configure.ac (AC_CONFIG_FILES): Add etc/bench.pl and etc/Makefile.
7751 * data/push.c (b4_declare_parser_state_variables): Move yyn, yyresult,
7752 yytoken, yyval, and yyloc declarations to...
7753 (yyparse or yypush_parse): ... here to improve performance. For
7754 yypush_parse invocations after the first, be sure to assign yyn its old
7755 value again.
7756 (yypstate_new): Don't bother initializing the yyresult field since the
7757 initial value isn't used.
7758 (yyn, yyresult, yytoken, yyval, yyloc): For each NAME in this list,
7759 remove the #define that, in push mode, set it to yyps->NAME.
7760 * etc/Makefile.am: New.
7761 * etc/bench.pl: Remove and build it instead from...
7762 * etc/bench.pl.in: ... this new file. Use @abs_top_builddir@ to invoke
7763 "tests/bison" from the build directory by default rather than just
7764 invoking "bison" from $PATH.
7765 (calc_grammar): Update push parser code: don't declare yylval globally,
7766 don't define yyparse_wrapper, and don't #define yyparse.
7767 (bench_grammar): Update to check all working combinations of yacc.c,
7768 push.c, impure, pure, pull, and push.
7769
7770 2006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
7771
7772 For push mode, add pull wrappers around yypush_parse.
7773 * data/push.c: (b4_generate_macro_args, b4_parenthesize): New macros.
7774 (yypull_parse): New function wrapping yypush_parse.
7775 (yyparse): New #define wrapping yypull_parse.
7776 * tests/calc.at (_AT_DATA_CALC_Y): Call yyparse even when %push-parser
7777 is declared.
7778 * tests/headers.at (export YYLTYPE): Make yylex global. For push mode,
7779 prototype yylex in the module that calls yyparse, and don't prototype
7780 yyparse there. Otherwise, the yyparse expansion won't compile.
7781 * tests/input.at (Torturing the Scanner): Likewise.
7782
7783 2006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
7784
7785 Enable push parsers to operate in impure mode. Thus, %push-parser no
7786 longer implies %pure-parser. The point of this change is to move
7787 towards being able to test the push parser code by running the entire
7788 test suite as if %push-parser had been declared.
7789 * data/push.c (yypush_parse): For impure mode, remove the
7790 yypushed_char, yypushed_val, and yypushed_loc arguments.
7791 Instead, declare these as local variables initialized to the global
7792 yychar, yylval, and yylloc.
7793 For the first yypush_parse invocation only, restore the initial values
7794 of these global variables when it's time to read a token since they
7795 have been overwritten.
7796 * src/parse-gram.y (prologue_declaration): Don't set pure_parser for
7797 %push-parser.
7798 * tests/calc.at (Simple LALR(1) Calculator): Always declare
7799 %pure-parser along with %push-parser since this test case was designed
7800 for pure push parsers.
7801 * tests/local.at (AT_PURE_OR_PUSH_IF): Remove unused.
7802 (AT_YACC_OR_PUSH_IF): New.
7803 (AT_YYERROR_SEES_LOC_IF): Fix enough that the test suite passes, but
7804 add a note that it's still wrong for some cases (as it has been for a
7805 while).
7806 (AT_PURE_LEX_IF): Use AT_PURE_IF instead of AT_PURE_OR_PUSH_IF since
7807 %push-parser no longer implies %pure-parser.
7808
7809 2006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
7810
7811 Remove some unnecessary differences between the pull parser code and
7812 the push parser code. This patch enables yynerrs in push mode.
7813 * data/push.c: Reformat M4 a little.
7814 (b4_yyerror_range): Remove and convert all uses to just yyerror_range.
7815 (b4_declare_scanner_communication_variables): Don't omit yynerrs just
7816 because push mode is on. Instead, if pure mode is on, move yynerrs
7817 to...
7818 (b4_declare_parser_state_variables): ... here.
7819 (yynerrs, yyerror_range): For push mode, #define each NAME in this list
7820 to yyps->NAME so it can be used in yypush_parse.
7821 (yypush_parse): Don't omit uses of yynerrs in push mode.
7822
7823 2006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
7824
7825 Fix bug such that the first pushed token's value and location are
7826 sometimes overwritten (sometimes by %initial-action) before being used.
7827 * data/push.c (yypush_parse): Rename arguments yynchar, yynlval, and
7828 yynlloc to yypushed_char, yypushed_val, and yypushed_loc for clarity.
7829 For the first yypush_parse invocation, initialize yychar to YYEMPTY to
7830 more closely mimic the pull parser logic.
7831 Don't copy the pushed token to yychar, yylval, and yylloc until it's
7832 time to read a token, which is after any initialization of yylval and
7833 yylloc.
7834 (gottoken): Rename label to...
7835 (yyread_pushed_token): ... for clarity and to avoid infringing on the
7836 user namespace.
7837
7838 2006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
7839
7840 Rearrange initialization of the parser state variables so that the
7841 skeleton doesn't have to have a copy for pull mode and another for push
7842 mode. This patch also fixes at least a bug such that yylloc was not
7843 initialized (with b4_location_initial_line and
7844 b4_location_initial_column) upon calling yypush_parse. However, that
7845 initialization now overwrites the first token's location;
7846 %initial-action assigning @$ already did the same thing, and both bugs
7847 will be fixed in a later patch.
7848 * data/push.c (b4_yyssa): Remove and convert all uses to just yyssa.
7849 (b4_declare_parser_state_variables): Remove initialization of yytoken,
7850 yyss, yyvs, yyls, and yystacksize.
7851 (yypstate_new): Remove initialization of some yypstate fields: yystate,
7852 yyerrstatus, yytoken, yyss, yyvs, yyls, yystacksize, yyssp, yyvsp, and
7853 yylsp.
7854 (yyssa, yyvsa, yylsa): For push mode, #define each NAME in this list to
7855 yyps->NAME so it can be used in yypush_parse.
7856 (yyparse or yypush_parse): For yypush_parse, don't print the
7857 "Starting parse" diagnostic for invocations after the first.
7858 Add initialization of yytoken, yyss, yyvs, yyls, and yystacksize; for
7859 yypush_parse, only do it for the first invocation.
7860 Allow yystate, yyerrstatus, yyssp, yyvsp, yylsp, and yylloc
7861 initialization to occur in yypush_parse but only on the first
7862 invocation.
7863
7864 2006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
7865
7866 * data/push.c: Add CPP guards around push parser declarations in both
7867 the header and the code file.
7868 In the code file, move the push parser declarations to the same place
7869 they appear in the header file.
7870 Clean up the M4 some, especially the inconsistent underquoting in
7871 some b4_c_function_def and b4_c_function_decl uses.
7872
7873 2006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
7874
7875 Encapsulate the push parser state variables into an M4 macro so the
7876 push skeleton doesn't have to list them again for pull mode's yyparse.
7877 For push mode, remove yypush_parse's local equivalents of these
7878 variables to eliminate unnecessary copying between the two sets at
7879 run-time. This patch also fixes at least a bug related to multiple
7880 %initial-action invocations in push mode.
7881 * data/push.c (b4_declare_parser_variables): Rename to...
7882 (b4_declare_scanner_communication_variables): ... this for clarity and
7883 update both uses.
7884 (b4_declare_yyparse_variables): Remove and move its contents to the one
7885 spot where it was invoked.
7886 (b4_declare_parser_state_variables): New macro containing the parser
7887 state variables required by push mode.
7888 (struct yypstate): Replace all fields but yynew with
7889 b4_declare_parser_state_variables.
7890 (yystate, yyn, yyresult, yyerrstatus, yytoken, yyss, yyssp, yyvs,
7891 yyvsp, yyls, yylsp, yystacksize, yyval, yyloc): For push mode, #define
7892 each NAME in this list to yyps->NAME so it can be used in yypush_parse.
7893 (yyparse or yypush_parse): For yyparse in pull mode, replace local
7894 parser state variable declarations with
7895 b4_declare_parser_state_variables.
7896 Don't initialize parser state variables when calling yypush_parse since
7897 yypstate_new already does that.
7898 Invoke the user's initial action only upon the first yypush_parse
7899 invocation.
7900 Remove all code that copies between the local parser state variables
7901 and the yypstate.
7902
7903 2006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
7904
7905 * data/push.c (union yyalloc): Rename yyss, yyvs, and yyls fields to
7906 prevent a name collision in a future patch where these names will
7907 sometimes be #define'd.
7908 (YYSTACK_RELOCATE): Add an argument to select a union yyalloc field
7909 since it no longer has the same name as the existing argument.
7910 (yyparse or yypush_parse): Update all uses of YYSTACK_RELOCATE.
7911
7912 2006-12-19 Paolo Bonzini <bonzini@gnu.org>
7913 and Joel E. Denny <jdenny@ces.clemson.edu>
7914
7915 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
7916 that the argument is case-insensitive, and there's no `=' here.
7917 For the %skeleton entry, mention that %language is better.
7918 (Bison Options): Likewise for --language and --skeleton. Move the
7919 --skeleton entry so that the `Tuning the parser' section is sorted
7920 alphabetically on long options.
7921 (C++ Bison Interface): Don't use the word skeleton. Don't explain the
7922 %language directive in detail here; cross-reference the %language
7923 documentation instead.
7924 (Calc++ Parser): Use `%require "@value{VERSION}"' rather than
7925 `%require "2.3b"' so that the example is always up-to-date.
7926 (Table of Symbols): Add entries for %language and %skeleton.
7927 * examples/extexi (normalize): Instead of replacing every %require
7928 argument with the current Bison version, just substitute for
7929 `@value{VERSION}'. This guarantees that we're testing what actually
7930 appears in the documentation.
7931 * examples/calc++/Makefile.am ($(calc_extracted)): Use `$(VERSION)'
7932 rather than `@VERSION@'.
7933
7934 2006-12-18 Paul Eggert <eggert@cs.ucla.edu>
7935
7936 * NEWS: Reword the %language news a bit, and put it earlier.
7937
7938 * src/getargs.c (skeleton_arg): Last arg is now location const *.
7939 Rewrite to simplify the logic.
7940 (language_argmatch): Likewise.
7941 (program_name): We now own this var.
7942 * src/getargs.h (struct bison_language): Use char[] rather than
7943 const char *.
7944
7945 * doc/bison.texinfo (Decl Summary, Bison Options): Don't claim
7946 Java is supported.
7947 * src/complain.c (program_name): Remove decl; no longer needed.
7948 * src/main.c (program_name): Remove; now belongs to getargs.
7949
7950 2006-12-18 Paolo Bonzini <bonzini@gnu.org>
7951
7952 * NEWS: Document %language.
7953
7954 * data/Makefile.am (dist_pkgdata_DATA): Add c-skel.m4, c++-skel.m4.
7955
7956 * data/c-skel.m4, data/c++-skel.m4: New files.
7957 * data/glr.c: Complain on push parsers.
7958
7959 * doc/bison.texinfo (C++ Parser Interface): Prefer %language
7960 over %skeleton.
7961 (Decl Summary): Document %language and %skeleton.
7962 (Command line): Document -L.
7963
7964 * examples/extexi: Rewrite %require directive.
7965 * examples/calc++/Makefile.am: Pass VERSION to extexi.
7966
7967 * src/files.c (compute_exts_from_gc): Look in language structure
7968 for .y extension.
7969 (compute_file_name_parts): Check whether .tab should be added.
7970 * src/getargs.c (valid_languages, skeleton_prio, language_prio):
7971 (language, skeleton_arg, language_argmatch): New.
7972 (long_options): Add --language.
7973 (getargs): Use skeleton_arg, add -L/--language.
7974 * src/getargs.h: Include location.h.
7975 (struct bison_language, language, skeleton_arg, language_argmatch): New.
7976 * src/output.c (prepare): Pick default skeleton from struct language.
7977 Don't dispatch C skeletons here.
7978 * src/parse-gram.y (PERCENT_LANGUAGE): New.
7979 (prologue_declaration): Add "%language" rule, use skeleton_arg.
7980 * src/scan-gram.l ("%language"): New rule.
7981
7982 * tests/calc.at: Test %skeleton and %language.
7983 * tests/local.at (AT_SKEL_CC_IF): Look for %language.
7984 (AT_GLR_IF): Look for %skeleton "glr.cc".
7985 (AT_LALR1_CC_IF, AT_GLR_CC_IF): Rewrite.
7986 (AT_YACC_IF): Reject %language.
7987
7988 2006-12-18 Paul Eggert <eggert@cs.ucla.edu>
7989
7990 * src/symtab.h (struct semantic_type): Remove the tag 'semantic_type',
7991 since it wasn't used; only the typedef name 'semantic_type' is needed.
7992 Also, omit trailing white space.
7993
7994 * bootstrap: Sync from coreutils.
7995 (gnulib_extra_files): Add build-aux/announce.gen.
7996 (slurp): Adjust .gitignore files like .cvsignore files.
7997 * build-aux/announce-gen: Remove from CVS, since bootstrap
7998 now creates this.
7999
8000 2006-12-16 Joel E. Denny <jdenny@ces.clemson.edu>
8001
8002 Make %push-parser imply %pure-parser. This fixes several bugs; see
8003 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00148.html>.
8004 * src/parse-gram.y (prologue_declaration): For %push-parser, also set
8005 pure_parser = true.
8006 * data/push.c: Don't bother testing b4_push_if when deciding whether
8007 to expand b4_declare_parser_variables globally.
8008 (yypush_parse): Likewise in here.
8009
8010 * data/push.c (yypush_parse): Add b4_parse_param to arguments.
8011 (yy_reduce_print): Reformat M4 for readability.
8012
8013 2006-12-15 Bob Rossi <bob@brasko.net>
8014 and Joel Denny <jdenny@ces.clemson.edu>
8015
8016 * data/push.c (yypstate): Add typedef, and update all uses of
8017 struct yypstate to just yypstate.
8018 * tests/calc.at (_AT_DATA_CALC_Y): Update here as well.
8019
8020 2006-12-14 Bob Rossi <bob@brasko.net>
8021
8022 * data/push.c (yypush_parse): Declare prototype regardless of
8023 %locations option.
8024
8025 2006-12-14 Bob Rossi <bob@brasko.net>
8026
8027 * data/push.c (yyparse): Remove the prototype and the #define when in
8028 push-parser mode.
8029
8030 2006-12-13 Bob Rossi <bob@brasko.net>
8031
8032 * data/push.c (yypstate_init): Rename to...
8033 (yypstate_new): ... this and use b4_c_function_def.
8034 (yypstate_delete): New.
8035 (yypush_parse): Change parameters yynval and yynlloc to be const.
8036 * tests/calc.at (_AT_DATA_CALC_Y): Use new yypstate_new and
8037 yypstate_delete functions.
8038
8039 2006-12-13 Joel E. Denny <jdenny@ces.clemson.edu>
8040
8041 * configure.ac (AC_PREREQ): Require Autoconf 2.61 because of our
8042 strange test case titles. Reported by Bob Rossi.
8043
8044 2006-12-13 Paul Eggert <eggert@cs.ucla.edu>
8045
8046 * TODO: Add pointer to Sylvain Schmitz's work on static detection
8047 of potential ambiguities in GLR grammers.
8048
8049 2006-12-12 Joel E. Denny <jdenny@ces.clemson.edu>
8050
8051 * tests/testsuite.at (AT_CHECK): When checking if $1 starts with
8052 `bison ', use m4_index instead of m4_substr since chopping up a string
8053 containing M4-special characters causes problems here.
8054
8055 Fix a couple of bugs related to special characters in user-specified
8056 file names, and make it easier for skeletons to compute output file
8057 names with the same file name prefix as Bison-computed output file
8058 names.
8059 * data/glr.cc, data/push.c, data/yacc.c: In @output, use
8060 b4_parser_file_name and b4_spec_defines_file instead of
8061 @output_parser_name@ and @output_header_name@, which are now redundant.
8062 * data/glr.c, data/lalr1.cc: Likewise. Also, in header #include's, use
8063 b4_parser_file_name, b4_spec_defines_file, and the new
8064 @basename(FILENAME@) instead of @output_parser_name@ and
8065 @output_header_name@, which inappropriately escaped the file names as
8066 C string literals.
8067 * src/files.c (all_but_ext): Remove static qualifier.
8068 (compute_output_file_names): Move `free (all_but_ext)' to...
8069 (output_file_names_free): ... here since all_but_ext is needed later.
8070 * src/files.h (all_but_ext): Extern.
8071 * src/muscle_tab.h (MUSCLE_INSERT_STRING_RAW): New macro that does
8072 exactly what MUSCLE_INSERT_STRING used to do.
8073 (MUSCLE_INSERT_STRING): Use MUSCLE_OBSTACK_SGROW so that M4-special
8074 characters are escaped properly.
8075 * src/output.c (prepare): Define muscle file_name_all_but_ext as
8076 all_but_ext.
8077 For pkgdatadir muscle, maintain previous functionality by using
8078 MUSCLE_INSERT_STRING_RAW instead of MUSCLE_INSERT_STRING. The problem
8079 is that b4_pkgdatadir is used inside m4_include in the skeletons, so
8080 digraphs would never be expanded. Hopefully no one has M4-special
8081 characters in his Bison installation path.
8082 * src/scan-skel.l: Don't parse @output_header_name@ and
8083 @output_parser_name@ anymore since they're now redundant.
8084 In @output, use decode_at_digraphs.
8085 Parse a new @basename command that invokes last_component.
8086 (decode_at_digraphs): New.
8087 (BASE_QPUTS): Remove unused.
8088 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): New macro.
8089 (Output file name): New tests.
8090
8091 2006-12-09 Joel E. Denny <jdenny@ces.clemson.edu>
8092
8093 Warn about output files that are generated by the skeletons and that
8094 conflict with other output files.
8095 * data/glr.c: Don't generate the header file here when glr.cc does.
8096 * src/files.c (file_names, file_names_count): New static globals.
8097 (compute_output_file_names): Invoke output_file_name_check for files
8098 not generated by the skeletons and remove existing checks.
8099 (output_file_name_check): New function that warns about conflicting
8100 output file names.
8101 (output_file_names_free): Free file_names.
8102 * src/files.h (output_file_name_check): Declare.
8103 * src/scan-skel.l: Invoke output_file_name_check for files generated by
8104 the skeletons.
8105 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): New.
8106 (Conflicting output files): New tests.
8107
8108 2006-12-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8109
8110 * doc/bison.texinfo: Fix a couple of typos.
8111
8112 2006-12-08 Bob Rossi <bob@brasko.net>
8113
8114 * data/push.c: (yypvarsinit, yypvars, struct yypvars, yypushparse):
8115 Rename to...
8116 (yypstate_init, yypstate, struct yypstate, yypush_parse): ... these and
8117 update all uses.
8118 (b4_yyssa, b4_yyerror_range, yypstate_init): Rename pv to yyps.
8119 (yypush_parse): Rename yypvars argument to yyps and remove redundant
8120 local pv.
8121 (yypstate_init, yypush_parse): Declare in Bison-generated header file.
8122 * tests/calc.at (_AT_DATA_CALC_Y): Use newly named functions.
8123
8124 2006-12-07 Bob Rossi <bob@brasko.net>
8125 and Joel Denny <jdenny@ces.clemson.edu>
8126
8127 * data/push.c (yypvarsinit): Change return type from void* to struct
8128 yypvars*. No longer cast to void* on return.
8129 (struct yypvars): Remove yylen since it need not be remembered between
8130 yypushparse invocations.
8131 (yypushparse): Don't copy between yylen and pv->yylen.
8132
8133 2006-12-05 Bob Rossi <bob@brasko.net>
8134
8135 * data/push.c (yychar_set, yylval_set, yylloc_set): Delete.
8136 (yypushparse): Add yynchar, yynlval, yynlloc parameters.
8137 (b4_declare_parser_variables): Do not declare yynerrs for push mode.
8138 (struct yypvars): Remove b4_declare_parser_variables.
8139 (yypvarsinit): Remove init code for removed variables.
8140 (global scope): Do not declare b4_declare_parser_variables if
8141 push or pure mode.
8142 (yypushparse): Add b4_declare_parser_variables.
8143 Init new local variables, and remove init code for removed
8144 yypvars variables.
8145 (yyparse): Delete.
8146 * tests/calc.at (_AT_DATA_CALC_Y): Call yypushparse for push mode
8147 and yyparse for other modes.
8148 (AT_CHECK_CALC_LALR): Added '%skeleton "push.c"' for push tests.
8149 * tests/local.at (AT_PUSH_IF, AT_PURE_OR_PUSH_IF): Added.
8150 (AT_YYERROR_SEES_LOC_IF): push-parser makes this false.
8151 (AT_PURE_LEX_IF): True if pure or push parser.
8152
8153 2006-12-05 Joel E. Denny <jdenny@ces.clemson.edu>
8154
8155 Document Yacc prologue alternatives and default %destructor's and
8156 %printer's as experimental. Don't mention Java yet. Discussed at
8157 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00002.html>.
8158 * NEWS (2.3a+): Say they're experimental. Remove any mention of Java.
8159 (2.3a): Annotate this entry to say the old forms of these features were
8160 also experimental.
8161 * doc/bison.texinfo (Prologue Alternatives, Freeing Discarded Symbols,
8162 Table of Symbols): Say they're experimental. Comment out any mention
8163 of Java (we'll want this back eventually).
8164
8165 2006-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
8166
8167 Support a file name argument to %defines. Deprecate `=' in
8168 %file-prefix, %name-prefix, and %output. Discussed at
8169 <http://lists.gnu.org/archive/html/help-bison/2006-09/msg00001.html>.
8170 * NEWS (2.3a+): Mention.
8171 * doc/bison.texinfo (Decl Summary, Table of Symbols): Add entry for new
8172 form of %defines, and remove `=' from entries for %file-prefix,
8173 %name-prefix, and %output.
8174 * src/parse-gram.y (prologue_declaration): Implement.
8175 * tests/calc.at (Simple LALR Calculator, Simple GLR Calculator, Simple
8176 LALR1 C++ Calculator, Simple GLR C++ Calculator): Remove the `=' from
8177 all but one occurrence of %name-prefix.
8178 * tests/headers.at (export YYLTYPE): Remove the `=' from %name-prefix.
8179 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Likewise.
8180 * tests/output.at (AT_CHECK_OUTPUT): Remove the `=' from all but one
8181 occurrence of each of %file-prefix and %output. Add check for %defines
8182 with argument.
8183 * tests/reduce.at (Useless Terminals, Useless Nonterminals,
8184 Useless Rules, Reduced Automaton, Underivable Rules, Empty Language):
8185 Remove the `=' from %output.
8186
8187 2006-11-21 Joel E. Denny <jdenny@ces.clemson.edu>
8188
8189 Don't escape $ in test case titles since Autoconf 2.61 now does that
8190 correctly.
8191 * tests/actions.at (Default %printer and %destructor are not for error
8192 or $undefined): Here.
8193 (Default %printer and %destructor are not for $accept): Here.
8194 * tests/input.at (Invalid $n and @n): Here.
8195
8196 2006-11-20 Joel E. Denny <jdenny@ces.clemson.edu>
8197
8198 Rename <!> to <>. Discussed starting at
8199 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00039.html>.
8200 * NEWS (2.3a+): Update.
8201 * doc/bison.texinfo (Freeing Discarded Symbols, Table of Symbols):
8202 Update.
8203 * src/parse-gram.y (TYPE_TAG_NONE, generic_symlist_item): Implement.
8204 * src/scan-gram.l (INITIAL): Implement.
8205 * src/symlist.c (symbol_list_default_tagless_new): Update comment.
8206 * src/symlist.h (symbol_list, symbol_list_default_tagless_new): Update
8207 comment.
8208 * tests/actions.at (Default tagless %printer and %destructor,
8209 Default tagged and per-type %printer and %destructor,
8210 Default %printer and %destructor are not for error or $undefined,
8211 Default %printer and %destructor are not for $accept,
8212 Default %printer and %destructor for mid-rule values): Update.
8213 * tests/input.at (Default %printer and %destructor redeclared,
8214 Unused values with default %destructor): Update.
8215
8216 2006-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
8217
8218 Don't let %prec take a nonterminal.
8219 * src/reader.c (grammar_current_rule_prec_set): Make the %prec symbol a
8220 token.
8221 * tests/input.at (%prec takes a token): New test checking that %prec
8222 won't take a nonterminal.
8223
8224 2006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
8225
8226 * tests/testsuite.at (AT_CHECK): Don't miss an exit value of 0 because
8227 it was double-quoted.
8228 * src/Makefile.am (YACC): Use --warnings=all,error so that Bison's own
8229 grammar is maintained with Bison's highest standards.
8230 * src/getargs.c: Fix some typos in Doxygen comments.
8231
8232 2006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
8233
8234 Fix memory leaks in scanners generated by at least Flex 2.5.9 and
8235 later. Reported by Paul Eggert in
8236 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00014.html>.
8237 * src/flex-scanner.h (yylex_destroy): Define for Flex before 2.5.9.
8238 * src/scan-code.l (translate_action): Don't bother invoking
8239 yy_delete_buffer (YY_CURRENT_BUFFER) before creating the first buffer.
8240 (code_scanner_free): Instead of invoking
8241 yy_delete_buffer (YY_CURRENT_BUFFER) directly, invoke yylex_destroy,
8242 which frees more.
8243 * src/scan-gram.l (gram_scanner_free): Likewise.
8244 * src/scan-skel.l (scan_skel): Likewise.
8245
8246 2006-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
8247
8248 * src/files.c (tr): Change return type to void.
8249 * src/muscle_tab.c (muscle_insert): Free storage in case muscle_grow
8250 has been called previously for the same key.
8251 (muscle_find): Return storage instead of value so that
8252 --enable-gcc-warnings doesn't produce warnings that the return discards
8253 const. aver that the value and storage are the same since storage
8254 could potentially be NULL when value is not.
8255 * tests/testsuite.at (AT_CHECK): Treat an unspecified exit value the
8256 same as 0.
8257
8258 2006-11-08 Paul Eggert <eggert@cs.ucla.edu>
8259
8260 * bootstrap.conf (excluded_files): Exclude m4/codeset.m4 (undoing
8261 the earlier change today), m4/intl.m4, m4/intldir.m4. This gives
8262 us a slightly cleaner distribution, and also works.
8263 * m4/.cvsignore: Add inline.m4, wint_t.m4 to accommodate recent
8264 gnulib changes.
8265
8266 2006-11-08 Joel E. Denny <jdenny@ces.clemson.edu>
8267 and Paul Eggert <eggert@cs.ucla.edu>
8268
8269 Don't let Bison leak memory except when it complains.
8270 * src/files.h (parser_file_name, spec_verbose_file, spec_graph_file):
8271 (spec_defines_file, dir_prefix): Now char *, not const char *,
8272 since they are freed.
8273 * src/files.c: Likewise.
8274 (all_but_ext, all_but_tab_ext, src_extension, header_extension):
8275 Likewise.
8276 (tr): Now operates in-place. All uses changed.
8277 (compute_exts_from_gf, compute_exts_from_src): Don't leak temporary
8278 values.
8279 (compute_file_name_parts, compute_output_file_names): Don't store
8280 read-only data in variables that will be freed.
8281 (compute_output_file_names): Free all_but_ext, all_but_tab_ext,
8282 src_extension, and header_extension.
8283 (output_file_names_free): New public function to free
8284 spec_verbose_file, spec_graph_file, spec_defines_file,
8285 parser_file_name, and dir_prefix.
8286 * src/getargs.c (getargs): Don't store read-only data in variables that
8287 will be freed.
8288 * src/main.c (main): Invoke output_file_names_free, code_scanner_free
8289 (which previously existed but was unused), and quotearg_free.
8290 * src/muscle_tab.h (muscle_insert): value arg is now a `char const *'.
8291 * src/muscle_tab.c: Likewise.
8292 (muscle_entry): Make the value char const *,
8293 and add a new storage member that is char * and can be freed.
8294 (muscle_entry_free): New private function.
8295 (muscle_init): Use it instead of free.
8296 (muscle_insert, muscle_grow): Update and use new storage member.
8297 (muscle_code_grow): Free the string passed to muscle_grow
8298 since it's not needed anymore.
8299 * src/parse-gram.y (%union): Make `chars' member a `char const *', and
8300 add a new `char *code' member.
8301 ("{...}"): Declare semantic type as code.
8302 * src/scan-code.h (translate_rule_action):
8303 (translate_symbol_action, translate_code, translate_action): Return
8304 `char const *' rather than `char *' since external code should not free
8305 these strings.
8306 * src/scan-code.l: Likewise.
8307 * src/scan-gram.l (<SC_BRACED_CODE>): Use val->code for BRACED_CODE,
8308 which is "{...}" in the parser.
8309 * tests/Makefile.am (maintainer-check-valgrind): Set
8310 VALGRIND_OPTS='--leak-check=full --show-reacheable=yes' before invoking
8311 Valgrind.
8312 * tests/calc.at (_AT_DATA_CALC_Y): fclose the FILE* so Valgrind doesn't
8313 complain.
8314 * tests/testsuite.at (AT_CHECK): Redefine so that running Bison and
8315 expecting a non-zero exit status sets --leak-check=summary and
8316 --show-reachable=no for Valgrind. Bison unabashedly leaks memory in
8317 this case, and we don't want to hear about it.
8318
8319 2006-11-08 Paul Eggert <eggert@cs.ucla.edu>
8320
8321 * bootstrap (runtime-po/Makevars): Derive from po/Makevars
8322 instead of from the template, to simplify configuration a bit.
8323 * bootstrap.conf (excluded_files): Don't exclude m4/codeset.m4
8324 and m4/wint_t.m4, as they are needed with the latest gnulib.
8325
8326 2006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
8327
8328 Disable unset/unused mid-rule value warnings by default, and recognize
8329 --warnings=midrule-values to enable them. Discussed starting at
8330 <http://lists.gnu.org/archive/html/help-bison/2006-10/msg00030.html>.
8331 * NEWS (2.3a+): Mention.
8332 * src/getargs.c, src/getargs.h (warnings_args, warnings_types, enum
8333 warnings): Add entry for midrule-values subargument.
8334 * src/reader.c (symbol_should_be_used): Don't return true just because
8335 the value is a set/used mid-rule value unless
8336 --warnings=midrule-values was specified.
8337 * tests/input.at (Unused values, Unused values before symbol
8338 declarations): Run tests with and without --warnings=midrule-values.
8339
8340 * src/reader.c (check_and_convert_grammar): Use symbol_list_free rather
8341 than LIST_FREE directly.
8342
8343 2006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
8344
8345 Finish implementing --warnings=error, which should not be implied by
8346 --warnings=all (or by its synonyms -W and --warnings without
8347 subarguments).
8348 * src/complain.c (set_warning_issued): New function to report that
8349 warnings are being treated as errors and to record an error if so.
8350 Invoke...
8351 (warn_at, warn): ... here.
8352 * src/getargs.c (warnings_args, warnings_types): Reorder so that
8353 "error - warnings are errors" does not appear above "all - all of the
8354 above".
8355 (getargs): For -W and --warnings without subarguments, don't let
8356 FLAGS_ARGMATCH set warnings_error in warnings_flag.
8357 * src/getargs.h (enum warnings): Unset warnings_error in warnings_all.
8358
8359 2006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
8360
8361 * src/getargs.c (flags_argmatch): Don't cause segmentation fault for
8362 empty subargument list. For example: `bison --warnings= parser.y'.
8363
8364 2006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
8365
8366 * data/push.c, data/yacc.c: Make sure there's a newline at the end of
8367 the parser header file so that gcc doesn't warn.
8368
8369 2006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
8370
8371 Split the default %destructor/%printer into two kinds: <*> and <!>.
8372 Discussed starting at
8373 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00060.html>.
8374 * NEWS (2.3a+): Mention.
8375 * doc/bison.texinfo (Freeing Discarded Symbols): Document this and the
8376 previous change today related to mid-rules.
8377 (Table of Symbols): Remove %symbol-default and add <*> and <!>.
8378 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): Remove.
8379 (TYPE_TAG_ANY): Add as <*>.
8380 (TYPE_TAG_NONE): Add as <!>.
8381 (generic_symlist_item): Remove RHS for %symbol-default and add RHS's
8382 for <*> and <!>.
8383 * src/scan-gram.l (PERCENT_SYMBOL_DEFAULT): Remove.
8384 (TYPE_TAG_ANY, TYPE_TAG_NONE): Add.
8385 * src/symlist.c (symbol_list_default_new): Split into tagged and
8386 tagless versions.
8387 (symbol_list_destructor_set, symbol_list_printer_set): Split
8388 SYMLIST_DEFAULT case into SYMLIST_DEFAULT_TAGGED and
8389 SYMLIST_DEFAULT_TAGLESS.
8390 * src/symlist.h: Update symbol_list_default*_new prototypes.
8391 (symbol_list.content_type): Split enum value SYMLIST_DEFAULT into
8392 SYMLIST_DEFAULT_TAGGED and SYMLIST_DEFAULT_TAGLESS.
8393 * src/symtab.c (default_destructor, default_destructor_location,
8394 default_printer, default_printer_location): Split each into tagged and
8395 tagless versions.
8396 (symbol_destructor_get, symbol_destructor_location_get,
8397 symbol_printer_get, symbol_printer_location_get): Implement tagged
8398 default and tagless default cases.
8399 (default_destructor_set, default_printer_set): Split each into tagged
8400 and tagless versions.
8401 * src/symtab.h: Update prototypes.
8402 * tests/actions.at (Default %printer and %destructor): Rename to...
8403 (Default tagless %printer and %destructor): ... this, and extend.
8404 (Per-type %printer and %destructor): Rename to...
8405 (Default tagged and per-type %printer and %destructor): ... this, and
8406 extend.
8407 (Default %printer and %destructor for user-defined end token): Extend.
8408 (Default %printer and %destructor are not for error or $undefined):
8409 Update.
8410 (Default %printer and %destructor are not for $accept): Update.
8411 (Default %printer and %destructor for mid-rule values): Extend.
8412 * tests/input.at (Default %printer and %destructor redeclared): Extend.
8413 (Unused values with default %destructor): Extend.
8414
8415 2006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
8416
8417 Don't apply the default %destructor/%printer to an unreferenced midrule
8418 value. Mentioned at
8419 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00104.html>.
8420 * src/symtab.c (dummy_symbol_get): Name all dummy symbols initially
8421 like $@n instead of just @n so that the default %destructor/%printer
8422 logic doesn't see them as user-defined symbols.
8423 (symbol_is_dummy): Check for both forms of the name.
8424 * src/reader.c (packgram): Remove the `$' from each midrule symbol
8425 name for which the midrule value is referenced in any action.
8426 * tests/actions.at (Default %printer and %destructor for mid-rule
8427 values): New test.
8428 * tests/regression.at (Rule Line Numbers, Web2c Report): Update output
8429 for change to dummy symbol names.
8430
8431 2006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
8432
8433 Warn about unset midrule $$ if the corresponding $n is used.
8434 * src/reader.c (symbol_should_be_used): Check midrule parent rule for
8435 $n usage.
8436 (packgram): Before invoking grammar_rule_check on any rule, make sure
8437 all actions have already been scanned in order to set `used' flags.
8438 Otherwise, checking that a midrule's $$ is set will not always work
8439 properly because the midrule check must forward-reference the midrule's
8440 parent rule.
8441 * tests/input.at (AT_CHECK_UNUSED_VALUES): Extend to check the new
8442 warning.
8443
8444 2006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
8445
8446 More improvements to the documentation of the prologue alternatives:
8447 * NEWS (2.3a+): Mention the new `Prologue Alternatives' section in the
8448 Bison manual.
8449 * doc/bison.texinfo (Prologue Alternatives): Correct some errors. Add
8450 some text to clarify the relative importance of the new directives and
8451 to show how these directives may be viewed as code labels.
8452
8453 2006-10-16 Joel E. Denny <jdenny@ces.clemson.edu>
8454
8455 Similar to the recently removed %before-header, add %code-top as the
8456 alternative to the pre-prologue. Mentioned at
8457 <http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00063.html>.
8458 Also, let the prologue alternatives appear in the grammar section.
8459 * src/parse-gram.y (PERCENT_CODE_TOP): New token.
8460 (prologue_declaration): Move the existing prologue alternatives to...
8461 (grammar_declaration): ... here and add %code-top.
8462 * src/scan-gram.l (PERCENT_CODE_TOP): New token.
8463
8464 Clean up and extend documentation for the prologue alternatives.
8465 * NEWS (2.3a+): Describe prologue alternatives.
8466 * doc/bison.texinfo (Prologue): Move discussion of prologue
8467 alternatives to...
8468 (Prologue Alternatives): ... this new section, and extend it to discuss
8469 all 4 directives in detail.
8470 (Table of Symbols): Clean up discussion of prologue alternatives and
8471 add %code-top.
8472
8473 2006-10-16 Juan Manuel Guerrero <juan.guerrero@gmx.de>
8474
8475 DJGPP specific issues.
8476
8477 * djgpp/config.bat: config.hin has been moved to lib. Adjust
8478 config.bat accordingly.
8479 * djgpp/config.sed: Adjust config.sed for the use of autoconf 2.60.
8480 * djgpp/config.site: Likewise.
8481
8482 2006-10-16 Paolo Bonzini <bonzini@gnu.org>
8483
8484 Replace %*-header with %provides, %requires, %code. See discussion at
8485 http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00002.html
8486
8487 * data/bison.m4 (b4_user_requires, b4_user_provides): New.
8488 (b4_user_start_header): Remove.
8489 * data/glr.c: Use new macros instead of b4_*start_header
8490 and b4_*end_header.
8491 * data/glr.cc: Likewise.
8492 * data/lalr1.cc: Likewise.
8493 * data/push.c: Likewise.
8494 * data/yacc.c: Likewise.
8495
8496 * doc/bison.texinfo: Remove %before-header, rename
8497 %{start,end,after}-header to %requires, %provides, %code.
8498
8499 * src/parse-gram.y: Likewise (also rename token names accordingly).
8500 * src/scan-gram.l: Likewise.
8501 * tests/actions.at: Likewise.
8502
8503 2006-10-14 Paul Eggert <eggert@cs.ucla.edu>
8504
8505 * lib/Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS).
8506 Problem reported by Joel E. Denny.
8507
8508 2006-10-14 Jim Meyering <jim@meyering.net>
8509
8510 (Sync from coreutils.)
8511 Work also when the working directory (with e.g. coreutils sources)
8512 is version controlled with git, rather than CVS.
8513 * bootstrap (CVS_only_file): Test for the existence of README-cvs,
8514 rather than CVS.
8515 In messages and comments, say e.g., "checked-out sources",
8516 rather than "CVS sources".
8517 (version_controlled_file): New function. Work for git as well as
8518 for CVS. Don't use grep's -q option.
8519 (slurp): Call it here, in place of CVS-specific code.
8520
8521 2006-10-14 Joel E. Denny <jdenny@ces.clemson.edu>
8522
8523 Fix testsuite for ./configure --enable-gcc-warnings:
8524 * configure.ac (gcc-warnings): Move -Wall before -Wno-sign-compare.
8525 Otherwise, gcc 4.1.0 (at least) warns about sign comparisons in
8526 __AT_CHECK_PRINTER_AND_DESTRUCTOR in tests/actions.at.
8527 * test/input.at (Torturing the Scanner): #include <stdlib.h> for abort.
8528 * test/regression.at (Diagnostic that expects two alternatives):
8529 Likewise.
8530
8531 2006-10-12 Paul Eggert <eggert@cs.ucla.edu>
8532
8533 * bootstrap.conf (gnulib_modules): Add config-h.
8534 * djgpp/subpipe.c: Include <config.h> unconditionally; don't
8535 worry about HAVE_CONFIG_H.
8536 * lib/abitset.c: Likewise.
8537 * lib/bitset.c: Likewise.
8538 * lib/bitset_stats.c: Likewise.
8539 * lib/bitsetv-print.c: Likewise.
8540 * lib/bitsetv.c: Likewise.
8541 * lib/ebitset.c: Likewise.
8542 * lib/get-errno.c: Likewise.
8543 * lib/lbitset.c: Likewise.
8544 * lib/subpipe.c: Likewise.
8545 * lib/timevar.c: Likewise.
8546 * lib/vbitset.c: Likewise.
8547 * lib/bitset.c: Include "bitset.h" first, to test interface.
8548 * lib/bitset_stats.c: Include "bitset_stats.h" first.
8549 * lib/bitsetv-print.c: Include "bitsetv-print.h" first.
8550 * lib/bitsetv.c: Include "bitsetv.h" first.
8551 * lib/get-errno.c: Include "get-errno.h" first.
8552 * m4/.cvsignore: Add config-h.m4.
8553 * tests/actions.at (Default %printer and %destructor for ...):
8554 Adjust expected line numbers in output to reflect removal of #if
8555 HAVE_CONFIG_H lines.
8556 * tests/glr-regression.at (Missed %merge type warnings when ...):
8557 Likewise.
8558 * tests/regression.at (Braced code in declaration in rules section):
8559 Likewise.
8560 * tests/atlocal.in (CPPFLAGS): Don't define HAVE_CONFIG_H.
8561 * tests/local.at (AT_DATA_GRAMMAR_PROLOGUE):
8562 Include <config.h> unconditionally.
8563
8564 * bootstrap: Sync from coreutils, as follows:
8565
8566 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
8567
8568 * bootstrap (symlink_to_gnulib): Fix bug: the dot_dots shell
8569 variable was sometimes used without being initialized. This
8570 messed up the installation of the INSTALL file in some cases.
8571
8572 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
8573
8574 * bootstrap (usage, main program, symlink_to_gnulib): Add option
8575 --copy. Inspired by a suggestion from Bruno Haible.
8576
8577 2006-10-03 Jim Meyering <jim@meyering.net>
8578
8579 * bootstrap: Undo last change to this file, since now gnulib-tool
8580 sticks with the automake default in generating dependencies.
8581
8582 2006-10-12 Paul Eggert <eggert@cs.ucla.edu>
8583
8584 * configure.ac: Use AC_PROG_CC_STDC; this is more modern than
8585 the old AC_PROG_CC / AM_PROG_CC_STDC combination.
8586
8587 * doc/bison.1: Add copyright notice.
8588
8589 * data/glr.c: Don't include <stdarg.h>; not used.
8590
8591 * NEWS: The -g and --graph options now output graphs in Graphviz
8592 DOT format, not VCG format.
8593 * doc/bison.1: Likewise.
8594 * doc/bison.texinfo (Understanding, Bison Options): Likewise.
8595 * THANKS: Add Satya Kiran Popuri, who proposed the initial version
8596 of this change in
8597 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00158.html>.
8598 * TODO: Remove Graphviz entry.
8599 * src/Makefile.am (bison_SOURCES): Add graphviz.c and graphviz.h;
8600 remove vcg.c, vcg.h, vcg_defaults.h.
8601 * src/vcg.c, src/vcg.h, src/vcg_defaults.h: Remove.
8602 * src/graphviz.c, src/graphviz.h: New files.
8603 * src/files.c (compute_output_file_names): Output .dot, not .vcg.
8604 * src/files.h: Make comment more generic.
8605 * src/main.c (main): Likewise.
8606 * src/print_graph.h: Likewise.
8607 * src/getargs.c (usage): Make usage description more generic.
8608 * src/print_graph.c: Include graphviz.h rather than vcg.h.
8609 (static_graph, fgraph): Remove. All uses changed to pass
8610 arguments instead of sharing a static var.
8611 (print_core, print_actions, print_state, print_graph):
8612 Output graphviz format rather than VCG format.
8613 * tests/.cvsignore: Remove *.vcg; add *.dot.
8614 * tests/output.at: Expect *.dot files, not *.vcg files.
8615
8616 * data/Makefile.am (dist_pkgdata_DATA): Add bison.m4; this
8617 accommodates the 2006-10-08 change.
8618
8619 2006-10-11 Bob Rossi <bob@brasko.net>
8620
8621 * data/push.c (yypushparse, yypvarsinit, yypvars): Wrap in b4_push_if.
8622 (b4_yyssa, b4_yyerror_range): New macros.
8623 (struct yypvars): Remove yyssa_ptr and yyerror_range_ptr fields.
8624 (yypvarsinit): Remove init of removed fields.
8625 (yypushparse): Remove use of removed fields; use new macros instead.
8626
8627 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
8628
8629 * data/push.c (yypushparse): Fix memory leak if yymsg is malloced
8630 in a push parser. Reindent slightly to match yacc.c better.
8631
8632 2006-10-11 Bob Rossi <bob@brasko.net>
8633
8634 * data/push.c (struct yypvars): Remove yymsgbuf, yymsgbuf_ptr, yymsg,
8635 yymsg_alloc fields.
8636 (yypvarsinit, yypushparse): Remove init of removed fields.
8637 (yypushparse): Use yymsgbuf instead of yymsgbuf_ptr.
8638
8639 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
8640
8641 * THANKS: Add Paolo Bonzini and Bob Rossi.
8642
8643 2006-10-08 Paolo Bonzini <bonzini@gnu.org>
8644
8645 * data/c.m4 (b4_copyright, b4_epilogue, b4_location_initial_column,
8646 b4_location_initial_line, p4_parse_param, b4_ints_in, b4_flag_if,
8647 b4_define_flag_if and uses, b4_basename, b4_syncline, b4_user_code,
8648 b4_define_user_cde and uses): Remove.
8649 (b4_comment, b4_prefix, b4_sync_start): New.
8650 * data/bison.m4: New file, with most of the content removed from c.m4.
8651 * src/muscle_tab.h: Use "do {...} while(0)" throughout.
8652 * src/output.c (output_skeleton): Pass bison.m4.
8653 (prepare): Pass glr_flag and nondeterministic_flag. Pass prefix
8654 only if specified.
8655
8656 2006-10-05 Paul Eggert <eggert@cs.ucla.edu>
8657
8658 Fix test failure reported by Tom Lane in
8659 <http://lists.gnu.org/archive/html/bug-bison/2006-10/msg00000.html>
8660 and try to make such failures easier to catch in the future.
8661 * data/glr.c (YYTRANSLATE): Don't check for nonpositive arg;
8662 that's now the caller's responsibility.
8663 (yyprocessOneStack, yyrecoverSyntaxError, yyparse):
8664 Set yychar = YYEOF if it's negative.
8665 * tests/actions.at (yylex): Abort if asked to read past EOF.
8666 * tests/conflicts.at (yylex): Likewise.
8667 * tests/cxx-type.at (yylex): Likewise.
8668 * tests/glr-regression.at (yylex): Likewise.
8669 * tests/input.at (yylex): Likewise.
8670 * tests/regression.at (yylex): Likewise.
8671 * tests/torture.at (yylex): Likewise.
8672
8673 2006-10-01 Paul Eggert <eggert@cs.ucla.edu>
8674
8675 Fix problems with translating English-language diagnostics.
8676 * bootstrap: Fix bug introduced in recent bootstrap changes, with
8677 respect to bison-runtime pot generation. The YY_ stuff
8678 wasn't being captured.
8679 * bootstrap.conf (XGETTEXT_OPTIONS_RUNTIME): New var.
8680 * po/POTFILES.in: Add src/location.c, src/scan-code.l.
8681 * runtime-po/POTFILES.in: Add data/push.c.
8682
8683 2006-09-29 Paul Eggert <eggert@cs.ucla.edu>
8684
8685 Merge bootstrap changes from coreutils.
8686
8687 2006-09-28 Jim Meyering <jim@meyering.net>
8688
8689 Automatically generated dependencies are important even
8690 when all of the sources in a directory come from gnulib.
8691 * bootstrap (gnulib_tool): Remove the "no-dependencies" automake
8692 option that gnulib-tool adds to what becomes our lib/gnulib.mk.
8693
8694 2006-09-23 Jim Meyering <jim@meyering.net>
8695
8696 * bootstrap (gnulib_tool_options): Add "--local-dir gl".
8697
8698 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
8699
8700 * bootstrap: Add support for --force.
8701 (usage): New function. Describe usage less tersely.
8702 (CVS_only_file): New var.
8703
8704 2006-09-21 Paul Eggert <eggert@cs.ucla.edu>
8705
8706 * data/push.c (YYPUSH_MORE): Make it an enum instead.
8707 (yypushparse): Use YYPUSH_MORE instead of the mystery constant.
8708 Adjust white space and comments to match GNU style better.
8709
8710 2006-09-20 Bob Rossi <bob@brasko.net>
8711
8712 * data/push.c (yyresult_get): Remove function.
8713 (YYPUSH_MORE): Add #define.
8714 (yypushparse): Modify return value.
8715
8716 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
8717
8718 * stamp-h.in: Remove; no longer needed.
8719 * .cvsignore: Replace autom4te.cache and config.cache with *.cache.
8720 Remove config.h, config.hin, intl (no longer created).
8721 * lib/.cvsignore: Add config.h, config.hin, configmake.h, inttypes.h,
8722 stamp-h1.
8723
8724 Sync bootstrap from coreutils, as follows:
8725
8726 2006-09-18 Paul Eggert <eggert@cs.ucla.edu>
8727
8728 * bootstrap (symlink_to_gnulib): New function.
8729 (cp_mark_as_generated): Use it, to prefer symlinks-to-gnulib
8730 to copies-of-gnulib.
8731 (cp_mark_as_generated, slurp, gnulib_files):
8732 Avoid making a copy if it's the same as the old version.
8733 (gnulib_files): Add support for this variable (used by Bison).
8734
8735 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
8736
8737 * src/getargs.c (usage): Rework to use conventions similar to
8738 coreutils, to make translation a bit easier and the code a bit
8739 smaller. Problem reported by Tim Van Holder.
8740
8741 2006-09-15 Paul Eggert <eggert@cs.ucla.edu>
8742
8743 Use some of gnulib's new modules, taken from coreutils.
8744
8745 * bootstrap: Sync from coreutils, except add support for gnulib_files.
8746 * bootstrap.conf: New file.
8747 (gnulib_modules): Add configmake, inttypes, unistd.
8748 (XGETTEXT_OPTIONS): Add complain, complain_at,
8749 fatal, fatal_at, warn, warn_at, unexpected_end.
8750 * configure.ac (AC_CONFIG_HEADERS): config.h is now in lib, not here.
8751 (gl_USE_SYSTEM_EXTENSIONS): Remove; gl_EARLY now does this.
8752 (gl_EARLY): Add.
8753 (AM_STDBOOL_H): Remove; gl_INIT now dows this.
8754 (gl_INIT): Add
8755 (GNULIB_AUTOCONF_SNIPPET): Remove.
8756 (AM_GNU_GETTEXT): Add; require formatstring macros since that's
8757 the pickiest.
8758 * lib/.cvsignore: Add inttypes_.h.
8759 * lib/Makefile.am: Include gnulib.mk first so we can append to it.
8760 (AM_CFLAGS): Add WERROR_CFLAGS, to be more like coreutils.
8761 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES): Remove
8762 no-longer-necessary initializations.
8763 (lib_SOURCES): Remove, replacing by libbison_a_SOURCES.
8764 * lib/subpipe.c: Include <unistd.h> unconditionally, now that we
8765 use the unistd module.
8766 * src/system.h: Likewise.
8767 * m4/.cvsignore: Remove *_gl.m4, gnulib.m4, inttypes_h.m4, uintmax_t.m4,
8768 ulonglong.m4. Add gettext.m4, gnulib-cache.m4, gnulib-comp.m4,
8769 gnulib-tool.m4, inttypes-h.m4, inttypes-pri.m4, inttypes.m4.
8770 * src/Makefile.am (DEFS): Remove, since configmake does this for us.
8771 (AM_CPPFLAGS): Remove -I../lib, since Automake does that for us.
8772 * src/system.h: Include inttypes.h unconditionally, now that we
8773 use the inttypes module. Don't bother to include stdint.h, since
8774 inttypes.h now does that for us.
8775 (LOCALEDIR): Remove, now that we use the configmake module.
8776 * src/getargs.c: Include configmake.h.
8777 * src/main.c: Likewise.
8778 * src/output.c: Likewise.
8779 * tests/atlocal.in (CPPFLAGS): Include from $abs_top_builddir/lib,
8780 not from $abs_top_builddir, since config.h moved.
8781
8782
8783 Port to GCC 2.95. First two problems reported by Michael Deutschmann in
8784 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00018.html>.
8785
8786 * src/parse-gram.y (symbol_declaration): Don't put statements
8787 before declarations; it's not portable to C89.
8788 * src/scan-code.l (handle_action_at): Likewise.
8789
8790 * src/scan-code.l: Always initialize braces_level; the old code
8791 left it uninitialized and therefore had undefined behavior.
8792
8793 Don't attempt to redefine 'assert', since it runs afoul of
8794 systems where standard headers (mistakenly) include <assert.h>.
8795 Instead, define and use our own alternative, called 'aver'.
8796 * src/reader.c: Don't include assert.h, since we no longer
8797 use assert.
8798 * src/scan-code.l: Likewise.
8799 * src/system.h (assert): Remove, replacing with....
8800 (aver): New function, taking a bool arg. All uses changed.
8801 * src/tables.c (pack_vector): Ensure that aver arg is bool,
8802 not merely an integer.
8803
8804 2006-09-15 Bob Rossi <bob@brasko.net>
8805
8806 Add support for push parsing. Based on the original work of
8807 Odd Arild Olsen <oao@fibula.no>.
8808 * data/Makefile.am (dist_pkgdata_DATA): Add push.c.
8809 * data/c.m4 (YYPUSH): New.
8810 (b4_push_if): New macro. Use it instead of #ifdef YYPUSH.
8811 * data/push.c: New file.
8812 * src/getargs.c (push_parser): New var.
8813 * src/getargs.h (push_parser): New declaration.
8814 * src/output.c (prepare): Add macro insertion of `push_flag'.
8815 * src/parse-gram.y (PERCENT_PUSH_PARSER): New token.
8816 (prologue_declaration): Parse %push-parser.
8817 * src/scan-gram.l: Scan new PERCENT_PUSH_PARSER token.
8818 * tests/calc.at (_AT_CHECK_CALC_ERROR): Add "Return" and "Now" to
8819 list of removed lines from the traces observed.
8820 (AT_CHECK_CALC_LALR): Added push parser tests.
8821
8822 2006-09-13 Paul Eggert <eggert@cs.ucla.edu>
8823
8824 * NEWS: Version 2.3a.
8825 * configure.ac (AC_INIT): Likewise.
8826
8827 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Remove
8828 "#define YYSTYPE int" that caused "make maintainer-check" to fail
8829 due to header ordering dependencies. I don't know why the #define
8830 was there.
8831
8832 Fix glr.cc and lalr1.cc's use of YYDEBUG so that there's zero
8833 runtime cost when YYDEBUG is not defined, and so that some tests
8834 that used to fail now work. Problem and initial suggestion by
8835 Paolo Bonzini.
8836 * data/c++.m4 (b4_parse_param_cons): Omit leading ','.
8837 * data/glr.cc (b4_parser_class_name):
8838 Initialize yycdebug_ only if YYDEBUG. Also, initialize yydebug_.
8839 (debug_level, set_debug_level): Affect yydebug_, not ::yydebug.
8840 (yydebug_) [YYDEBUG]: New member.
8841 (yycdebug_): Now defined only if YYDEBUG.
8842 * data/lalr1.cc (yydebug_, yycdebug_): Now defined only if YYDEBUG.
8843 (YYCDEBUG) [!YYDEBUG]: Don't use yydebug_ and yycdebug_.
8844 (b4_parser_class_name): Initialize yydebug_ and yycdebug_ only
8845 if YYYDEBUG.
8846 (debug_stream, set_debug_stream, debug_level, set_debug_level):
8847 Define only if YYDEBUG.
8848 * tests/calc.at (_AT_DATA_CALC_Y) [!YYDEBUG]: Omit call to
8849 set_debug_level.
8850 * tests/regression.at (_AT_DATA_DANCER_Y) [!YYDEBUG]: Likewise.
8851 * tests/calc.at (AT_CHECK_CALC_GLR_CC): Uncomment calls to
8852 AT_CHECK_CALC_GLR_CC that are working now.
8853
8854 2006-09-12 Paul Eggert <eggert@cs.ucla.edu>
8855
8856 * data/glr.cc (YYERROR_VERBOSE, YYTOKEN_TABLE): Remove.
8857 We don't need them in glr.cc, and glr.c defines them.
8858 Defining YYERROR_VERBOSE to 0 here breaks glr.c, since glr.c
8859 assumes that defining it to anything is the same as defining
8860 it to 1. Problem reported by Paolo Bonzini.
8861
8862 2006-09-12 Paolo Bonzini <bonzini@gnu.org> (tiny change)
8863
8864 * data/c.m4 (b4_null, b4_case): Define.
8865 * src/output.c (prepare_symbols): Use b4_null.
8866 (user_actions_output): Use b4_case.
8867
8868 2006-09-11 Paul Eggert <eggert@cs.ucla.edu>
8869
8870 * data/glr.c (b4_shared_declarations): Put start-header first,
8871 before any #includes that we generate, so that feature-test
8872 macros work. Problem reported by Michael Deutschmann in
8873 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00004.html>.
8874 * data/lalr1.cc: Likewise.
8875 * doc/bison.texinfo (Prologue): Document that feature-test macros
8876 should be defined before any Bison declarations.
8877 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Put defns
8878 that depend on location.hh after, not before, Bison decls, since
8879 we now include location.hh after the first user prologue.
8880
8881 * doc/bison.texinfo (Calc++ Parser): Fix memory leak reported by
8882 Sander Brandenburg in
8883 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00002.html>.
8884 Also, fix minor white space and comment issues.
8885 (Prologue): Mention that it's better to define feature-test macros
8886 before Bison declarations. Problem reported by Michael Deutschmann.
8887
8888 * README-cvs: Fix typo: "&" should be "&&". Problem reported
8889 by Jim Meyering.
8890 * m4/.cvsignore: Add argmatch.m4. Remove obstack.m4, strerror_r.m4.
8891 This adjusts to recent gnulib changes.
8892
8893 2006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
8894
8895 Finish implementation of per-type %destructor/%printer. Discussed
8896 starting at
8897 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>
8898 and
8899 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>.
8900 * NEWS (2.3+): Add a description of this feature to the default
8901 %destructor/%printer description.
8902 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise.
8903 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
8904 Invoke semantic_type_destructor_set or semantic_type_printer_set when a
8905 list node contains a semantic type.
8906 * src/symtab.c, src/symtab.h: Extend with a table that associates
8907 semantic types with their %destructor's and %printer's.
8908 (semantic_type_from_uniqstr, semantic_type_get,
8909 semantic_type_destructor_set, semantic_type_printer_set): New functions
8910 composing the public interface of that table.
8911 (symbol_destructor_get, symbol_destructor_location_get,
8912 symbol_printer_get, symbol_printer_location_get): If there's no
8913 per-symbol %destructor/%printer, look up the per-type before trying
8914 the default.
8915 * tests/actions.at (Per-type %printer and %destructor): New test case.
8916 * tests/input.at (Default %printer and %destructor redeclared):
8917 Extend to check that multiple occurrences of %symbol-default in a
8918 single %destructor/%printer declaration is an error.
8919 (Per-type %printer and %destructor redeclared, Unused values with
8920 per-type %destructor): New test cases.
8921
8922 2006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
8923
8924 Require default %destructor/%printer to be declared using
8925 %symbol-default instead of an empty symbol list, and start working on
8926 new per-type %destructor/%printer. Discussed at
8927 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00007.html>.
8928 * NEWS (2.3+): Add %symbol-default to example.
8929 * bison.texinfo (Freeing Discarded Symbols): Likewise.
8930 (Table of Symbols): Add entry for %symbol-default.
8931 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): New token.
8932 (generic_symlist, generic_symlist_item): New nonterminals for creating
8933 a list in which each item is a symbol, semantic type, or
8934 %symbol-default.
8935 (grammar_declaration): Use generic_symlist in %destructor and %printer
8936 declarations instead of symbols.1 or an empty list.
8937 (symbol_declaration, precedence_declaration, symbols.1): Update actions
8938 for changes to symbol_list.
8939 * src/reader.c: Update for changes to symbol_list.
8940 * src/scan-code.l: Likewise.
8941 * src/scan-gram.l: Scan new PERCENT_SYMBOL_DEFAULT token.
8942 * src/symlist.c, src/symlist.h: Extend such that a list node may
8943 represent a semantic type or a %symbol-default in addition to just an
8944 ordinary symbol. Add switched functions for setting %destructor's and
8945 %printer's.
8946 * tests/actions.at, tests/input.at: Add %symbol-default to all default
8947 %destructor/%printer declarations.
8948
8949 2006-08-23 Joel E. Denny <jdenny@ces.clemson.edu>
8950
8951 Whether the default %destructor/%printer applies to a particular symbol
8952 isn't a question of whether the user *declares* that symbol (in %token,
8953 for example). It's a question of whether the user by any means
8954 *defines* the symbol at all (by simply using a char token, for
8955 example). $end is defined by Bison whereas any other token with token
8956 number 0 is defined by the user. The error token is always defined by
8957 Bison regardless of whether the user declares it with %token, but we
8958 may one day let the user define error as a nonterminal instead.
8959 * NEWS (2.3+): Say "user-defined" instead of "user-declared".
8960 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise, and document
8961 the meaning of "user-defined".
8962 * tests/actions.at (Default %printer and %destructor for user-declared
8963 end token): Rename to...
8964 (Default %printer and %destructor for user-defined end token): ...
8965 this.
8966
8967 * src/symtab.c (symbol_destructor_get, symbol_printer_get): In the
8968 computation of whether to apply the default, don't maintain a list of
8969 every Bison-defined symbol. Instead, just check for a first character
8970 of '$', which a user symbol cannot have, and check for the error token.
8971
8972 2006-08-21 Joel E. Denny <jdenny@ces.clemson.edu>
8973
8974 Don't apply the default %destructor or %printer to the error token,
8975 $undefined, or $accept. This change fits the general rule that the
8976 default %destructor and %printer are only for user-declared symbols,
8977 and it solves several difficulties that are described in the new test
8978 cases listed below.
8979 * src/symtab.c (symbol_destructor_get, symbol_printer_get): Implement.
8980 * tests/actions.at (Default %printer and %destructor are not for error
8981 or $undefined, Default %printer and %destructor are not for $accept):
8982 New test cases.
8983
8984 2006-08-19 Joel E. Denny <jdenny@ces.clemson.edu>
8985
8986 Allow %start after the first rule.
8987 * src/reader.c (grammar_current_rule_begin): Don't set the start symbol
8988 when parsing the first rule.
8989 (check_and_convert_grammar): Search for it here after all grammar
8990 declarations have been parsed. Skip midrules, which have dummy LHS
8991 nonterminals.
8992 * src/symtab.c (symbol_is_dummy): New function.
8993 * src/symtab.h (symbol_is_dummy): Declare it.
8994 * tests/input.at (%start after first rule): New test.
8995
8996 2006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
8997
8998 Redo some of the previous commit: add back the ability to use
8999 non-aliased/undeclared string literals since it might be useful to
9000 those declaring %token-table.
9001 * src/reader.c (check_and_convert_grammar): Undo changes in previous
9002 commit: don't worry about complaints from symbols_pack.
9003 * src/symtab.c (symbol_new, symbol_class_set,
9004 symbol_check_alias_consistency): Undo changes in previous commit: count
9005 each string literal as a new symbol and token, assign it a symbol
9006 number, and don't complain about non-aliased string literals.
9007 (symbols_pack): Since symbol_make_alias still does not decrement symbol
9008 and token counts but does still set aliased tokens to the same number,
9009 symbol_pack_processor now leaves empty slots in the symbols array.
9010 Remove those slots.
9011 * tests/regression.at (Undeclared string literal): Remove test case
9012 added in previous commit since non-aliased string literals are allowed
9013 again.
9014 (Characters Escapes, Web2c Actions): Undo changes in previous commit:
9015 remove unnecessary string literal declarations.
9016 * tests/sets.at (Firsts): Likewise.
9017
9018 2006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
9019
9020 Don't allow an undeclared string literal, but allow a string literal to
9021 be used before its declaration.
9022 * src/reader.c (check_and_convert_grammar): Don't invoke packgram if
9023 symbols_pack complained.
9024 * src/symtab.c (symbol_new): Don't count a string literal as a new
9025 symbol.
9026 (symbol_class_set): Don't count a string literal as a new token, and
9027 don't assign it a symbol number since symbol_make_alias does that.
9028 (symbol_make_alias): It's not necessary to decrement the symbol and
9029 token counts anymore. Don't assume that an alias declaration occurs
9030 before any uses of the identifier or string, and thus don't assert that
9031 one of them has the highest symbol number so far.
9032 (symbol_check_alias_consistency): Complain if there's a string literal
9033 that wasn't declared as an alias.
9034 (symbols_pack): Bail if symbol_check_alias_consistency failed since
9035 symbol_pack asserts that every token has been assigned a symbol number
9036 although undeclared string literals have not.
9037 * tests/regression.at (String alias declared after use, Undeclared
9038 string literal): New test cases.
9039 (Characters Escapes, Web2c Actions): Declare string literals as
9040 aliases.
9041 * tests/sets.at (Firsts): Likewise.
9042
9043 2006-08-14 Joel E. Denny <jdenny@ces.clemson.edu>
9044
9045 In the grammar scanner, STRING_FINISH unclosed constructs and return
9046 them to the parser in order to improve error messages.
9047 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER,
9048 SC_BRACED_CODE, SC_PROLOGUE): Implement.
9049 * tests/input.at (Unclosed constructs): New test case.
9050 * tests/regression.at (Invalid inputs): Update now that unclosed %{ is
9051 seen.
9052
9053 * src/scan-gram.h, src/scan-gram.l (gram_last_braced_code_loc): Remove
9054 unused global.
9055
9056 2006-08-13 Joel E. Denny <jdenny@ces.clemson.edu>
9057
9058 Handle string aliases for character tokens correctly.
9059 * src/symtab.c (symbol_user_token_number_set): If the token has an
9060 alias, check and set its alias's user token number instead of its own,
9061 which is set to indicate the alias. Previously, every occurrence of
9062 the character token in the grammar overwrote that alias indicator with
9063 the character code.
9064 * tests/input.at (String aliases for character tokens): New test.
9065
9066 2006-08-12 Joel E. Denny <jdenny@ces.clemson.edu>
9067
9068 * src/parse-gram.y: Add `%expect 0' so we don't overlook conflicts.
9069
9070 2006-08-11 Paul Eggert <eggert@cs.ucla.edu>
9071
9072 * bootstrap: Put in need-ngettext argument to AM_GNU_GETTEXT,
9073 to prevent failures when building on older platforms.
9074 Check for autopoint failure.
9075 Set XGETTEXT_OPTIONS to values that check for C format strings,
9076 so that translators are warned about them (this also helps
9077 prevent core dumps).
9078
9079 * lib/subpipe.c (create_subpipe): Use new gnulib pipe_safer
9080 function, since it simplifies our code a bit.
9081
9082 * configure.ac (AC_ARG_ENABLE): Use -Wextra -Wno-sign-compare
9083 rather than -W, so we don't get bogus warnings about sign comparisons.
9084 Add -Wpointer-arith, since that warning is useful (it reports code
9085 that does not conform to C89 and that some compilers reject).
9086 * data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c: Undo latest change,
9087 since it's no longer needed.
9088
9089 2006-08-10 Joel E. Denny <jdenny@ces.clemson.edu>
9090
9091 Clean up scanners a bit.
9092 * src/flex-scanner.h (FLEX_NO_OBSTACK): New macro that blocks obstack
9093 definitions so gcc won't warn when obstack_for_string is unused.
9094 * src/scan-code.l: config.h and system.h are already #include'd by
9095 scan-code-c.c, so get rid of them here.
9096 * src/scan-gram.l: Likewise.
9097 * src/scan-skel.l: Likewise, and use flex-scanner.h without obstack
9098 definitions rather than duplicating the rest of it.
9099 * src/scan-gram-c.c, scan-skel-c.c: #include "system.h".
9100
9101 2006-08-09 Joel E. Denny <jdenny@ces.clemson.edu>
9102
9103 Suppress signed/unsigned comparison warnings for yycheck.
9104 * data/c.m4 (b4_safest_int_type): New macro.
9105 * data/glr.c, data/lalr1.cc: Wherever you compare yycheck[i] against
9106 a signed int type, cast it to b4_safest_int_type first.
9107 * data/yacc.c: Likewise.
9108 (b4_safest_int_type): Overwrite the one from c.m4 since b4_int_type is
9109 also overwritten.
9110
9111 2006-08-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
9112
9113 * doc/bison.texinfo: Fix some typos.
9114
9115 2006-08-02 Paul Eggert <eggert@cs.ucla.edu>
9116
9117 * m4/.cvsignore: Add inttypes_h.m4,lib-ld.m4, lib-prefix.m4,
9118 po.m4, stdint_h.m4, uintmax_t.m4, ulonglong.m4, warning.m4.
9119
9120 * bootstrap (gnulib_tool): Stop using --assume-autoconf;
9121 the latest gnulib does this a different way.
9122 (get_translations): Sharuzzaman Ahmat Raslan reported that the ms
9123 translation was patched, so stop omitting it.
9124
9125 2006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
9126
9127 Enable declaration of default %printer/%destructor. Make the parser
9128 use these for all user-declared grammar symbols for which the user does
9129 not declare a specific %printer/%destructor. Thus, the parser uses it
9130 for token 0 if the user declares it but not if Bison generates it as
9131 $end. Discussed starting at
9132 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>,
9133 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>,
9134 and
9135 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>.
9136 * NEWS (2.3+): Mention.
9137 * doc/bison.texinfo (Actions in Mid-Rule): It's no longer impossible to
9138 declare a %destructor for a mid-rule's semantic value. It's just
9139 impossible to declare one specific to it.
9140 (Freeing Discarded Symbols): Mention that @$ can be used in %destructor
9141 code. Describe default %destructor form.
9142 * src/parse-gram.y (grammar_declaration): Parse default
9143 %printer/%destructor declarations.
9144 * src/output.c (symbol_destructors_output): Use symbol_destructor_get
9145 and symbol_destructor_location_get rather than accessing the destructor
9146 and destructor_location members of struct symbol.
9147 (symbol_printers_output): Likewise but for %printer's.
9148 * src/reader.c (symbol_should_be_used): Likewise but for %destructor's
9149 again.
9150 * src/symtab.c (default_destructor, default_destructor_location,
9151 default_printer, default_printer_location): New static global
9152 variables to record the default %destructor and %printer.
9153 (symbol_destructor_get, symbol_destructor_location_get,
9154 symbol_printer_get, symbol_printer_location_get): New functions to
9155 compute the appropriate %destructor and %printer for a symbol.
9156 (default_destructor_set, default_printer_set): New functions to set the
9157 default %destructor and %printer.
9158 * src/symtab.h: Prototype all those new functions.
9159 * tests/actions.at (Default %printer and %destructor): New test to
9160 check that the right %printer and %destructor are called, that they're
9161 not called for $end, and that $$ and @$ work correctly.
9162 (Default %printer and %destructor for user-declared end token): New
9163 test to check that the default %printer and %destructor are called for
9164 a user-declared end token.
9165 * tests/input.at (Default %printer and %destructor redeclared, Unused
9166 values with default %destructor): New tests to check related grammar
9167 warnings and errors.
9168
9169 2006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
9170
9171 Clean up handling of %destructor for the end token (token 0).
9172 Discussed starting at
9173 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>
9174 and
9175 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00013.html>.
9176
9177 Make the skeletons consistent in how they pop the end token and invoke
9178 its %destructor.
9179 * data/glr.c (yyrecoverSyntaxError, yyparse): Don't pop the start
9180 state, which has token number 0, since this would invoke the
9181 %destructor for the end token.
9182 * data/lalr1.cc (yy::parser::parse): Don't check for the final state
9183 until after shifting the end token, or else it won't be popped.
9184 * data/yacc.c (yyparse): Likewise.
9185
9186 * data/glr.c (yyparse): Clear the lookahead after shifting it even when
9187 it's the end token. Upon termination, destroy an unshifted lookahead
9188 even when it's the end token.
9189 * data/lalr1.cc (yy::parser::parse): Likewise.
9190 * data/yacc.c (yyparse): Likewise.
9191
9192 * src/reader.c (packgram): Don't check rule 0. This suppresses unused
9193 value warnings for the end token when the user gives the end token a
9194 %destructor.
9195
9196 * tests/actions.at (Printers and Destructors): Test all the above.
9197
9198 2006-07-24 Paul Eggert <eggert@cs.ucla.edu>
9199
9200 Update to latest gnulib and gettext versions.
9201 * bootstrap (gnulib-modules): Remove hard-locale, stdio-safer.
9202 Add fopen-safer.
9203 (gnulib_files): Add m4/warning.m4. Don't worry about files
9204 overwritten by autopoint.
9205 Replace gt_INTL_SUBDIR_CORE with an empty body in m4/gettext_gl.m4.
9206 Suppress "id", "ms", "tr" translations for now, since gettext 0.15
9207 rejects them.
9208 Don't use autoreconf; instead, invoke autopoint etc. by hand,
9209 so that we can remove the intl files at a better time.
9210 (intl_files_to_remove): Remove aclocal.m4, since it gets
9211 rebuilt anyway. Remove m4/inttypes_h.m4, m4/inttypes.m4,
9212 m4/isc-posix.m4, m4/lib-ld.m4, m4/lib-prefix.m4, m4/po.m4,
9213 m4/stdint_h.m4, m4/uintmax_t.m4, m4/ulonglong.m4.
9214 Add m4/inttypes-h.m4, m4/lock.m4, m4/visibility.m4.
9215 Remove datarootdir hack; no longer needed.
9216 * configure.ac: Use gl_WARNING_CFLAGS rather than BISON_WARNING.
9217 (AM_GNU_GETTEXT_VERSION): Bump from 0.12 to 0.15.
9218 * lib/.cvsignore: Remove hard-locale.c, hard-locale.h, strdup.c,
9219 strdup.h.
9220 * m4/.cvsignore: Remove hard-locale.m4, strdup.m4.
9221 * m4/warning.m4: Remove from CVS, since we now use gnulib's version.
9222
9223 2006-07-20 Paul Eggert <eggert@cs.ucla.edu>
9224
9225 * bootstrap: Adjust to today's change to gnulib-tool by invoking
9226 it with --assume-autoconf='latest-stable'.
9227
9228 2006-07-13 Joel E. Denny <jdenny@ces.clemson.edu>
9229
9230 * src/parse-gram.y (grammar_declaration): Don't confuse Doxygen (at
9231 least 1.4.7 and 1.4.4) by putting a #line between `typedef union
9232 YYSTYPE' and `{'.
9233 * src/muscle_tab.h (muscle_grow): Replace the header comments with
9234 those from muscle_tab.c since the old ones are misleading.
9235
9236 2006-07-13 Akim Demaille <akim@epita.fr>
9237
9238 Support %define "KEY" {VALUE}.
9239 * src/scan-code.h, src/scan-code.l (translate_action)
9240 (translate_rule_action, translate_symbol_action, translate_code):
9241 Return char *, not const char *.
9242 * src/parse-gram.y (declaration): Rename as...
9243 (prologue_declaration): this.
9244 (string_content): Remove this nonterminal, use STRING.
9245 (braceless, content, content.opt): New nonterminal.
9246 Use them.
9247 (%define): Now accept content.opt, i.e., accept also BRACED_CODE
9248 as value.
9249 * src/scan-gram.l (getargs.h): Don't include it.
9250
9251 2006-07-12 Paul Eggert <eggert@cs.ucla.edu>
9252
9253 * data/lalr1.cc (YYCDEBUG): Use 'if (yydebug_) (*yycdebug_)'
9254 rather than a for-loop that declares a local bool variable. This
9255 should work around a compatibility problem with a Cray x1e C++
9256 compiler reported by Hung Nguyen in
9257 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00022.html>.
9258 The for-loop was introduced in the 2004-11-17 change but I don't
9259 know why it was needed.
9260
9261 2006-07-12 Akim Demaille <akim@epita.fr>
9262
9263 * data/c.m4: Comment changes.
9264
9265 2006-07-10 Akim Demaille <akim@lrde.epita.fr>
9266
9267 * src/complain.c (error_message, ERROR_MESSAGE): New.
9268 To factor...
9269 (fatal_at, fatal, warn_at, warn, complain_at, complain): these.
9270 * src/complain.h, src/complain.c (warning_issued): Remove, unused.
9271
9272 2006-07-09 Paul Eggert <eggert@cs.ucla.edu>
9273
9274 * NEWS: Instead of %union, you can define and use your own union type
9275 YYSTYPE if your grammar contains at least one <type> tag.
9276 Your YYSTYPE need not be a macro; it can be a typedef.
9277 * doc/bison.texinfo (Value Type, Multiple Types, Location Type):
9278 (Union Decl, Decl Summary): Document this.
9279 * data/glr.c (YYSTYPE): Implement this.
9280 * data/glr.cc (YYSTYPE): Likewise.
9281 * data/lalr1.cc (YYSTYPE): Likewise.
9282 * data/yacc.c (YYSTYPE): Likewise.
9283 * src/output.c (prepare): Output tag_seen_flag.
9284 * src/parse-gram.y (declaration, grammar_declaration):
9285 Use 'union_seen' rather than 'typed' to determine whether
9286 %union has been seen, since grammars can now be typed without
9287 %union.
9288 (symbol_declaration, type.opt, symbol_def):
9289 Keep track of whether a tag has been seen.
9290 * src/reader.c (union_seen, tag_seen): New vars.
9291 (typed): remove.
9292 * src/reader.h (union_seen, tag_seen, typed): Likewise.
9293 * src/scan-code.l (untyped_var_seen): New variable.
9294 (handle_action_dollar): Adjust to above changes.
9295 (handle_action_dollar, handle_action_at):
9296 Improve overflow checking for outlandish numbers.
9297 * tests/input.at (AT_CHECK_UNUSED_VALUES): Redo test to
9298 avoid new diagnostics generated by above changes.
9299 * tests/regression.at (YYSTYPE typedef): Add test to check
9300 for type tags without %union.
9301
9302 * src/symlist.c (symbol_list_length): Return int, not unsigned
9303 int, since callers expect int. This may need to get revisited
9304 once we have proper integer overflow checking.
9305
9306 * src/scan-gram.h (gram_scanner_cursor): Remove decl, since this
9307 object is now static.
9308
9309 * src/getargs.c (flags_argmatch): Return void, not int,
9310 to pacify ./configure --enable-gcc-warnings.
9311
9312 * src/flex-scanner.h (STRING_FREE): Don't use FLEX_PREFIX (last_string)
9313 since last_string is already defined to FLEX_PREFIX (last_string).
9314
9315 2006-07-09 Akim Demaille <akim@lrde.epita.fr>
9316
9317 Implement --warnings/-W.
9318 * src/getargs.c (report_argmatch, trace_argmatch): Remove,
9319 replaced by...
9320 (flags_argmatch, FLAGS_ARGMATCH): this new function and macro.
9321 Adjust callers.
9322 * src/getargs.h, src/getargs.c (warnings, warnings_flags)
9323 (warnings_args, warnings_types): New.
9324 (getargs, short_options, long_options): Accept -W/--warnings.
9325 Sort the options by alphabetical order, upper case letter right
9326 before its lower case.
9327
9328 2006-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
9329
9330 Change %merge result type clash warnings to errors. Discussed at
9331 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00026.html>.
9332 * src/reader.c (record_merge_function_type): Use complain_at.
9333 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
9334 declared later): Update test case results.
9335
9336 2006-07-09 Akim Demaille <akim@lrde.epita.fr>
9337
9338 * src/getargs.h, src/getargs.c: Swap --report and --trace handling
9339 to be in alphabetical order.
9340 (trace_args): Spelling fixes.
9341
9342 2006-07-09 Paul Eggert <eggert@cs.ucla.edu>
9343
9344 * data/yacc.c (YYID, yy_stack_print): Prefix local vars with "yy"
9345 so they don't collide with user-defined macros.
9346 (yy_stack_print): Don't assume that yytype_int16 promotes to int;
9347 this was never guaranteed, and now that we're using gnulib stdint,
9348 which defines int_fast16_t to long int, the problem is exposed.
9349
9350 2006-07-08 Paul Eggert <eggert@cs.ucla.edu>
9351
9352 * data/c.m4 (b4_basename): Simplify a bit, since we don't
9353 need the full POSIX semantics (and weren't implementing them
9354 anyway).
9355
9356 Adjust to Autoconf 2.60 and today's gnulib.
9357 * bootstrap (gnulib_modules): Add stdint.
9358 Remove special case for m4/onceonly_2_57.m4, since gnulib-tool
9359 no longer copies it.
9360 (intl_files_to_remove): Remove m4/longlong.m4 and m4/wchar_t.m4,
9361 since stdint needs the former and wcwidth (which is now required
9362 by mbswidth) needs the latter.
9363 Append 'datarootdir = @datarootdir@' to po/Makefile.in.in, to
9364 work around a compatibility glitch between gettext 0.14.6 and
9365 Autoconf 2.60.
9366 * configure.ac (AC_PREREQ): Require Autoconf 2.60.
9367 Do not check for uintptr_t, since new stdint module does the right
9368 thing.
9369 * lib/.cvsignore: Remove alloca.c, alloca.h, alloca_.h.
9370 Add stdint.h, stdint_.h, wcwidth.h.
9371 * m4/.cvsignore: Remove alloca.m4, onceonly.m4.
9372 Add absolute-header.m4, double-slash-root.m4, longlong.m4,
9373 stdint.m4, wchar_t.m4, wcwidth.m4.
9374 * src/files.c: Include <dirname.h> and <stdio-safer.h> in the
9375 usual order for ../lib/*.h files.
9376 (file_name_split): Use last_component, not base_name, to adjust
9377 to gnulib changes.
9378 * src/parse-gram.h: Include <strverscmp.h> in the usual order
9379 for ../lib/*.h files.
9380 (YYTYPE_INT16, YYTYPE_INT8, YYTYPE_UINT16, YYTYPE_UINT8):
9381 Define unconditionally, since we now assume the stdint module.
9382 * src/scan-skel.l: Include <dirname.h>.
9383 (BASE_QPUTS): Use last_component, not base_name.
9384 * src/system.h: Include <unlocked-io.h> in the usual order
9385 for ../lib/*.h files. Include <stdint.h> unconditionally,
9386 since we now use the stdint module.
9387 (uintptr_t): Declare if UINTPTR_MAX is not defined, not
9388 HAVE_UINTPTR_T, since we now use the stdint module.
9389 (base_name): Remove decl, since files now include <dirname.h>
9390 to get the decl.
9391
9392 2006-07-08 Akim Demaille <akim@lrde.epita.fr>
9393
9394 * data/c.m4 (b4_location_initial_column, b4_location_initial_line):
9395 New, default to 1.
9396 * data/yacc.c, data/glr.c, data/location.cc: Use them.
9397 * NEWS, doc/bison.texinfo: The initial column and line are 1 by
9398 default.
9399 * tests/calc.at: Adjust.
9400
9401 2006-07-08 Akim Demaille <akim@lrde.epita.fr>
9402
9403 * data/c.m4 (b4_basename): New.
9404 (b4_syncline): Also output the location of its invocation (from
9405 the skeleton).
9406 (b4_user_action, b4_define_user_action, b4_user_actions)
9407 (b4_user_initial_action, b4_user_post_prologue, b4_user_start_header)
9408 (b4_user_stype): New.
9409 * data/yacc.c, data/glr.c, data/lalr1.cc, data/glr.cc: Use them.
9410
9411 2006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
9412
9413 In the grammar file, the first column is 1 not 0 on the first line as
9414 on every other line.
9415 * src/parse-gram.y (%initial-action): Initialize @$ correctly.
9416 * tests/input.at (Torturing the Scanner): Update output.
9417
9418 * src/scan-gram.l (scanner_cursor): Declare it static.
9419
9420 2006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
9421
9422 In warnings, say "previous declaration" rather than "first
9423 declaration".
9424 * src/symtab.c (redeclaration): Do that here.
9425 * src/reader.c (record_merge_function_type): In the case of a result
9426 type clash, report the previous declaration rather than the very first
9427 one in the grammar file.
9428 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
9429 declared later): Add a third declaration to check this behavior.
9430 * tests/input.at (Incompatible Aliases): Update output.
9431
9432 2006-06-27 Akim Demaille <akim@epita.fr>
9433
9434 * doc/Doxyfile.in: New.
9435 * doc/Makefile.am: Use it.
9436 * src/lalr.h, src/symtab.h: Initial doxygenation.
9437
9438 2006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
9439
9440 Don't miss %merge result type warnings just because the LHS types are
9441 declared after the %merge. This continues the effort of the previous
9442 patch.
9443 * src/reader.c (get_merge_function): Don't set the merger type yet.
9444 (record_merge_function_type): New function for setting the merger type
9445 and checking for clashes.
9446 (grammar_current_rule_merge_set): Set the location of the %merge for
9447 the current rule.
9448 (packgram): Invoke record_merge_function_type for each rule now that
9449 all symbol type declarations have been parsed.
9450 * src/reader.h (merger_list.type_declaration_location): New member
9451 storing the location of the first %merge from which the type for this
9452 merging function was derived.
9453 * src/symlist.h (symbol_list.merger_declaration_location): New member
9454 storing the location of a rule's %merge, if any.
9455 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
9456 declared later): New test to catch the error fixed by the above patch.
9457
9458 2006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
9459
9460 Get action warnings (grammar_rule_check) right even when symbol
9461 declarations appear after the rules. Discussed at
9462 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00108.html>
9463 and
9464 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00151.html>.
9465 Don't mistake the type of $$ in a midrule to be that of its parent
9466 rule's $$.
9467 * src/reader.c (grammar_current_rule_end): Don't invoke
9468 grammar_rule_check yet since not all symbol declarations may have been
9469 parsed yet.
9470 (grammar_midrule_action): Likewise.
9471 Don't record whether the midrule's $$ has been used yet since actions
9472 haven't been translated yet.
9473 Record the midrule's parent rule and its RHS index within the parent
9474 rule.
9475 (grammar_current_rule_action_append): Don't translate the action yet
9476 since not all symbol declarations may have been parsed yet and, thus,
9477 warnings about types for $$, $n, @$, and @n can't be reported yet.
9478 (packgram): Translate the action and invoke grammar_rule_check now that
9479 all symbol declarations have been parsed.
9480 * src/scan-code.l (handle_action_dollar): Now that this is invoked
9481 after parsing the entire grammar file, the symbol list here in the case
9482 of a midrule is actually the midrule's empty RHS, so reference its
9483 parent rule's RHS where necessary.
9484 On the other hand, now that you can already know it's a midrule, you
9485 aren't forced to think $$ has the same type as its parent rule's $$.
9486 (handle_action_at): In the case of a midrule, reference the parent rule
9487 where necessary.
9488 * src/symlist.c (symbol_list_new): Initialize new midrule-related
9489 members.
9490 (symbol_list_length): Now that this is invoked after all rules have
9491 been parsed, a NULL symbol (rather than a NULL symbol list node)
9492 terminates a rule. symbol_list_print already does this correctly.
9493 * src/symlist.h (symbol_list.midrule_parent_rule,
9494 symbol_list.midrule_parent_rhs_index): New members so that midrules can
9495 remember their relationships with their parents.
9496 * tests/input.at (Type Clashes): Extend to catch the midrule $$ error
9497 fixed by the above patch.
9498 (_AT_UNUSED_VALUES_DECLARATIONS, AT_CHECK_UNUSED_VALUES): New m4 macros
9499 implementing...
9500 (Unused values): ... this old test case and...
9501 (Unused values before symbol declarations): ... this new test case.
9502 This one is the same as `Unused values' except that all symbol
9503 declarations appear after the rules in order to catch the rest of the
9504 errors fixed by the above patch.
9505
9506 2006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
9507
9508 More cleanup.
9509 * src/reader.c (current_rule): Declare it static since it's no longer
9510 used outside this file.
9511 (grammar_current_rule_action_append): Remove redundant arguments from
9512 translate_rule_action invocation.
9513 * src/reader.h (current_rule): Remove this unused extern.
9514 * src/scan-code.h (translate_rule_action): Remove redundant arguments.
9515 * src/scan-code.l (translate_rule_action): Likewise.
9516
9517 2006-06-25 Joel E. Denny <jdenny@ces.clemson.edu>
9518
9519 Clean up yesterday's patch.
9520 * parse-gram.y (rhs): Move grammar_midrule_action invocation from here
9521 to...
9522 * src/reader.c (grammar_current_rule_action_append): ... here for
9523 consistency with grammar_current_rule_symbol_append.
9524 * tests/regression.at (Braced code in declaration in rules section):
9525 Make yyerror and yylex static as usual.
9526
9527 2006-06-24 Joel E. Denny <jdenny@ces.clemson.edu>
9528
9529 Fix bug that mistakes braced code in a declaration in the rules section
9530 to be a rule action. Mentioned at
9531 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00105.html>.
9532 * src/scan-gram.l: Move midrule action detection from the start of the
9533 scanning of any braced code to...
9534 * src/parse-gram.y (rhs): ... the parsing of braced code as a rule
9535 action. For readability, use $2 and @2 rather than the equivalent
9536 global variables.
9537 * tests/regression.at (Braced code in declaration in rules section):
9538 New test to catch the error fixed by the above patch.
9539
9540 Work on code readability some.
9541 * src/scan-code.l (current_rule): Get rid of this misleading and
9542 redundant declaration: it's actually extern'ed in reader.h.
9543 (YY_DECL, code_lex, handle_action_dollar, handle_action_at,
9544 translate_action): Add a rule argument and use it instead of the global
9545 current_rule.
9546 (translate_rule_action): This already receives current_rule through an
9547 argument, so pass it on to translate_action instead of assigning
9548 current_rule to current_rule.
9549 (translate_symbol_action, translate_code): Pass rule = NULL to
9550 translate_action.
9551
9552 2006-06-23 Joel E. Denny <jdenny@ces.clemson.edu>
9553
9554 Rename %before-definitions to %start-header and %after-definitions to
9555 %end-header. Don't use these declarations to separate pre-prologue
9556 blocks from post-prologue blocks. Add new order-independent
9557 declarations %before-header and %after-header as alternatives to the
9558 traditional Yacc pre-prologue and post-prologue blocks. Discussed at
9559 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00110.html>.
9560 * NEWS (2.3+): Update for these changes.
9561 * data/glr.c (b4_before_definitions): Update to...
9562 (b4_start_header): ... this.
9563 (b4_after_definitions): Update to...
9564 (b4_end_header): ... this.
9565 * data/glr.cc: Likewise.
9566 * data/lalr1.cc: Likewise.
9567 * data/yacc.c: Likewise.
9568 * doc/bison.texinfo (The prologue): Update names, and replace remaining
9569 prologue blocks with %*-header declarations.
9570 (Calc++ Parser): Likewise.
9571 (Decl Summary): Update names.
9572 (Table of Symbols): Update description.
9573 * src/parse-gram.y (PERCENT_AFTER_DEFINITIONS): Update to...
9574 (PERCENT_END_HEADER): ... this.
9575 (PERCENT_BEFORE_DEFINITIONS): Update to...
9576 (PERCENT_START_HEADER): ... this.
9577 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
9578 (declaration): Update token names and m4 macro names.
9579 When parsing %end-header and %start-header, invoke translate_code
9580 before muscle_code_grow, and no longer set global booleans to remember
9581 whether these declarations have been seen.
9582 Parse new %after-header and %before-header.
9583 * src/reader.c (before_definitions, after_definitions): Remove.
9584 (prologue_augment): Accept a new bool argument to specify whether to
9585 augment the pre-prologue or post-prologue.
9586 * src/reader.h (before_definitions, after_definitions): Remove these
9587 extern's.
9588 (prologue_augment): Add new bool argument.
9589 * src/scan-gram.l (PERCENT_AFTER_DEFINITIONS): Update to...
9590 (PERCENT_END_HEADER): ... this.
9591 (PERCENT_BEFORE_DEFINITIONS): Update to...
9592 (PERCENT_START_HEADER): ... this.
9593 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
9594 * tests/actions.at (Printers and Destructors): Update names.
9595
9596 2006-06-22 Joel E. Denny <jdenny@ces.clemson.edu>
9597
9598 Add comparison operators for C++ location classes. Discussed at
9599 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00092.html>.
9600 * data/c++.m4 (b4_define_location_comparison): New boolean %define
9601 declaration indicating whether filename_type has an operator==. If
9602 filename_type is `std::string', it defaults to `1', `0' otherwise.
9603 * data/location.cc: Iff b4_define_location_comparison is `1', add
9604 operator== and operator!= for class position and for class location.
9605
9606 Some minor fixes.
9607 * src/scan-action.l: Remove unused file.
9608 * src/symtab.c (symbol_printer_set): Use printer_location not
9609 destructor_location.
9610 * src/symtab.h (struct symbol): Replace incorrect source comment for
9611 printer members.
9612 * tests/input.at (Incompatible Aliases): Update output with correct
9613 printer location.
9614
9615 2006-06-20 Joel E. Denny <jdenny@ces.clemson.edu>
9616
9617 Don't put the pre-prologue in the header file. For the yacc.c code
9618 file and the glr.c header and code files, move the pre-prologue before
9619 the token definitions. Add new %before-definitions and
9620 %after-definitions to declare code that will go in both the header file
9621 and code file. Discussed at
9622 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00000.html>,
9623 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00016.html>,
9624 and
9625 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00055.html>.
9626 * NEWS (2.3+): Describe these changes.
9627 * data/glr.c (b4_pre_prologue): Move from within to before...
9628 (b4_shared_declarations): ... this.
9629 Add new b4_before_definitions before b4_token_enums.
9630 Add new b4_after_definitions at the end.
9631 * data/glr.cc (b4_pre_prologue): Replace with...
9632 (b4_before_definitions): ... this in the header file.
9633 (b4_after_definitions): New near the end of the header file.
9634 * data/lalr1.cc (b4_pre_prologue): Move from the header file to the
9635 code file right before including the header file.
9636 (b4_before_definitions): New in the previous position of
9637 b4_pre_prologue in the header file.
9638 (b4_after_definitions): New near the end of the header file.
9639 * data/yacc.c: Clean up some m4 quoting especially in the header file.
9640 (b4_token_enums_defines): In the code file, move to right before
9641 YYSTYPE for consistency with the header file.
9642 (b4_before_definitions): New right before b4_token_enums_defines in
9643 both the header and code file.
9644 (b4_after_definitions): New right after YYLTYPE and yylloc in both the
9645 header and code file.
9646 * doc/bison.texinfo (Prologue): Show use of %before-definitions instead
9647 of prologues for %union dependencies.
9648 (Decl Summary): In %defines description, mention the effect of
9649 %before-definitions and %after-definitions on the header file.
9650 (Calc++ Parser): Forward declare driver in a %before-definitions rather
9651 than in the pre-prologue so that make check succeeds.
9652 (Table of Symbols): Add entries for %before-definitions and
9653 %after-definitions.
9654 * src/parse-gram.y (PERCENT_BEFORE_DEFINITIONS): New token for
9655 %before-definitions.
9656 (PERCENT_AFTER_DEFINITIONS): New token for %after-definitions.
9657 (declaration): Parse those declarations and append to
9658 b4_before_definitions and b4_after_definitions, respectively.
9659 * src/reader.c (before_definitions, after_definitions): New bools to
9660 track whether those declarations have been seen.
9661 (prologue_augment): Add to the post-prologue if %union,
9662 %before-definitions, or %after-definitions has been seen.
9663 * src/reader.h (before_definitions, after_definitions): New extern's.
9664 * src/scan-gram.l: Scan the new declarations.
9665 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Place the second
9666 prologue block in a %before-definitions or a %after-definitions based
9667 on whether the %union is declared.
9668 * tests/regression.at (Early token definitions with --yacc, Early token
9669 definitions without --yacc): Move tests for token definitions into the
9670 post-prologue since token names are no longer defined in the
9671 pre-prologue.
9672
9673 2006-06-20 Akim Demaille <akim@epita.fr>
9674
9675 * src/symtab.h, src/symtab.c (symbol_from_uniqstr): New.
9676 (symbol_get): Use it.
9677 * src/parse-gram.y: Use it.
9678
9679 2006-06-19 Joel E. Denny <jdenny@ces.clemson.edu>
9680
9681 * src/scan-gram.l: Remove unused declaration of last_string_1 so the
9682 build succeeds when configured with --enable-gcc-warnings.
9683
9684 2006-06-19 Paul Eggert <eggert@cs.ucla.edu>
9685
9686 * src/parse-gram.y (char_name): New function.
9687 (CHAR, STRING, string_content): For %printer, properly escape.
9688 (ID): Prefer fputs to fprintf.
9689 (id): Reindent to be consistent with other rules.
9690 Properly quote char.
9691
9692 The Translation Project changed its way of publishing translations
9693 to maintainers. I haven't received any responses to my request
9694 for supporting the old way, or for documenting the new way. I
9695 have modified 'bootstrap' to use screen scraping
9696 (in this case, HTML scraping). This is unreliable and inelegant,
9697 but I don't see any better way. Yuck.
9698 * bootstrap (TP_URL, WGET_COMMAND): New vars.
9699 (get_translations): New function, which uses HTML scraping to
9700 deduce locations of latest translations.
9701 Use this function to grab both bison and bison-runtime .po files.
9702 Don't bother priming the pump for the runtime-po domain any more,
9703 as it's now translated better than bison is.
9704
9705 2006-06-19 Akim Demaille <akim@epita.fr>
9706
9707 * src/scan-gram.l: No longer "parse" things after `%union' until
9708 `{'. Rather, return a single "%union" token.
9709 No longer make symbols: return strings, and leave the conversion
9710 to symbols to the parser.
9711 (SC_PRE_CODE, token_type): Remove.
9712 * src/parse-gram.y (%union): New field `character'.
9713 Sort tokens.
9714 (CHAR): New token.
9715 (ID, ID_COLON): Now that the scanner no longer makes them
9716 identifiers, adjust all uses to invoke symbol_get.
9717 (id_colon): New, wraps the conversion from string to symbol.
9718 (%union): Accept a possible union_name.
9719 (symbol): Now can be a char.
9720 * data/c.m4 (b4_union_name): Leave a default value.
9721 * data/glr.c, data/yacc.c: Use it.
9722
9723 2006-06-11 Joel E. Denny <jdenny@ces.clemson.edu>
9724
9725 For associating token numbers with token names for "yacc.c", don't use
9726 #define statements unless `--yacc' is specified; always use enum
9727 yytokentype. Most important discussions start at:
9728 <http://lists.gnu.org/archive/html/bison-patches/2005-09/msg00053.html>,
9729 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00052.html>,
9730 and
9731 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00043.html>.
9732 * NEWS (2.3+): Mention.
9733 * data/c.m4 (b4_yacc_if): New.
9734 (b4_token_enums_defines): Use b4_yacc_if to decide whether to add the
9735 token #define's.
9736 * doc/bison.texinfo (Bison Options): Describe the effect of `--yacc'
9737 on token name definitions.
9738 * src/getargs.c (usage): Capitalize `Yacc' in English.
9739 * src/output.c (prepare): Define b4_yacc_flag.
9740 * tests/regression.at (Early token definitions): Test that tokens names
9741 are defined before the pre-prologue not just before the post-prologue.
9742 Remove this test case and copy to...
9743 (Early token definitions with --yacc): ... this to test #define's.
9744 (Early token definitions without --yacc): ... and this to test enums.
9745
9746 2006-06-11 Paul Eggert <eggert@cs.ucla.edu>
9747
9748 * NEWS: Reword the post-2.3 change to not be so optimistic about
9749 removing the old "look-ahead" spelling.
9750 Update previous look-ahead/lookahead change reports.
9751 * REFERENCES: look-ahead -> lookahead (since that's
9752 what he actually wrote).
9753 * doc/refcard.tex: look ahead -> lookahead,
9754 look-ahead -> lookahead
9755
9756 2006-06-09 Joel E. Denny <jdenny@ces.clemson.edu>
9757
9758 For consistency, use `lookahead' instead of `look-ahead' or
9759 `look_ahead'. Discussed starting at
9760 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00049.html>
9761 and then at
9762 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00017.html>.
9763 * NEWS: For the next release, note the change to `--report'.
9764 * TODO, doc/bison.1: Update English.
9765 * doc/bison.texinfo: Update English.
9766 (Understanding Your Parser, Bison Options): Document as
9767 `--report=lookahead' rather than `--report=look-ahead'.
9768 * src/conflicts.c: Update English in comments.
9769 (lookahead_set): Rename from look_ahead_set.
9770 (flush_reduce): Rename argument look_ahead_tokens to lookahead_tokens.
9771 (resolve_sr_conflict): Rename local look_ahead_tokens to
9772 lookahead_tokens, and update other uses.
9773 (flush_shift, set_conflicts, conflicts_solve, count_sr_conflicts,
9774 count_rr_conflicts, conflicts_free): Update uses.
9775 * src/getargs.c (report_args): Move "lookahead" before alternate
9776 spellings.
9777 (report_types): Update uses.
9778 (usage): For `--report' usage description, state `lookahead' spelling
9779 rather than `look-ahead'.
9780 * src/getargs.h (report.report_lookahead_tokens): Rename from
9781 report_look_ahead_tokens.
9782 * src/lalr.c: Update English in comments.
9783 (compute_lookahead_tokens): Rename from compute_look_ahead_tokens.
9784 (state_lookahead_tokens_count): Rename from
9785 state_look_ahead_tokens_count.
9786 Rename local n_look_ahead_tokens to n_lookahead_tokens.
9787 (lookahead_tokens_print): Rename from look_ahead_tokens_print.
9788 Rename local n_look_ahead_tokens to n_lookahead_tokens.
9789 Update other uses.
9790 Update English in output.
9791 (add_lookback_edge, initialize_LA, lalr, lalr_free): Update uses.
9792 * src/print.c: Update English in comments.
9793 (lookahead_set): Rename from look_ahead_set.
9794 (print_reduction): Rename argument lookahead_token from
9795 look_ahead_token.
9796 (print_core, state_default_rule, print_reductions, print_results):
9797 Update uses.
9798 * src/print_graph.c: Update English in comments.
9799 (print_core): Update uses.
9800 * src/state.c: Update English in comments.
9801 (reductions_new): Update uses.
9802 (state_rule_lookahead_tokens_print): Rename from
9803 state_rule_look_ahead_tokens_print, and update other uses.
9804 * src/state.h: Update English in comments.
9805 (reductions.lookahead_tokens): Rename from look_ahead_tokens.
9806 (state_rule_lookahead_tokens_print): Rename from
9807 state_rule_look_ahead_tokens_print.
9808 * src/tables.c: Update English in comments.
9809 (conflict_row, action_row): Update uses.
9810 * tests/glr-regression.at
9811 (Incorrect lookahead during deterministic GLR,
9812 Incorrect lookahead during nondeterministic GLR): Rename
9813 print_look_ahead to print_lookahead.
9814 * tests/torture.at: Update English in comments.
9815 (AT_DATA_LOOKAHEAD_TOKENS_GRAMMAR): Rename from
9816 AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR.
9817 (Many lookahead tokens): Update uses.
9818 * data/glr.c: Update English in comments.
9819 * lalr1.cc: Likewise.
9820 * yacc.c: Likewise.
9821 * src/conflicts.h: Likewise.
9822 * src/lalr.h: Likewise.
9823 * src/main.c: Likewise.
9824 * src/output.c: Likewise.
9825 * src/parse-gram.c: Likewise.
9826 * src/tables.h: Likewise.
9827 * tests/calc.at: Likewise.
9828
9829 2006-06-08 Joel E. Denny <jdenny@ces.clemson.edu>
9830
9831 * src/flex-scanner.h (yytext): Remove stray `*/' in #define.
9832
9833 2006-06-07 Paul Eggert <eggert@cs.ucla.edu>
9834
9835 * TODO: Add request from Nelson H. F. Beebe to be able to install
9836 Bison without installing the yacc script.
9837
9838 2006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
9839
9840 * src/flex-scanner.h: For the sake of Flex 2.5.4, don't #define yyleng
9841 and yytext if they're already #define'd.
9842 * src/flex-scanner.h, src/location.h: Move #include "system.h" to...
9843 * src/scan-code-c.c: ... here.
9844 * src/scan-code.l, src/scan-gram.l: ... and here. Also #include
9845 <config.h>.
9846
9847 2006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
9848
9849 Get Bison to build again when configured with --enable-gcc-warnings.
9850 * src/location.c, src/location.h, src/main.c, src/scan-code.l: Add some
9851 missing #include's.
9852 * src/scan-code.l (handle_action_dollar, handle_action_at): Rename
9853 loc argument as it shadows a global.
9854 * src/scan-gram.l: Remove stray comma that prevents boundary_set
9855 invocation.
9856
9857 * src/.cvsignore: Add scan-code.c.
9858
9859 2006-06-07 Akim Demaille <akim@epita.fr>
9860
9861 * src/scan-gram.l: Move the "add a trailing ; to actions" code
9862 to...
9863 * src/scan-code.l: here.
9864 * tests/input.at (Torturing the Scanner): Fix another location
9865 error.
9866
9867 2006-06-07 Akim Demaille <akim@epita.fr>
9868
9869 * src/Makefile.am (BUILT_SOURCES): Fix the trailing backslash.
9870
9871 2006-06-06 Akim Demaille <akim@epita.fr>
9872
9873 Extract the parsing of user actions from the grammar scanner.
9874 As a consequence, the relation between the grammar scanner and
9875 parser is much simpler. We can also split "composite tokens" back
9876 into simple tokens.
9877 * src/gram.h (ITEM_NUMBER_MAX, RULE_NUMBER_MAX): New.
9878 * src/scan-gram.l (add_column_width, adjust_location): Move to and
9879 rename as...
9880 * src/location.h, src/location.c (add_column_width)
9881 (location_compute): these.
9882 Fix the column count: the initial column is 0.
9883 (location_print): Be robust to ending column being 0.
9884 * src/location.h (boundary_set): New.
9885 * src/main.c: Adjust to scanner_free being renamed as
9886 gram_scanner_free.
9887 * src/output.c: Include scan-code.h.
9888 * src/parse-gram.y: Include scan-gram.h and scan-code.h.
9889 Use boundary_set.
9890 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_INITIAL_ACTION)
9891 (PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Remove the {...} part,
9892 which is now, again, a separate token.
9893 Adjust all dependencies.
9894 Whereever actions with $ and @ are used, use translate_code.
9895 (action): Remove this nonterminal which is now useless.
9896 * src/reader.c: Include assert.h, scan-gram.h and scan-code.h.
9897 (grammar_current_rule_action_append): Use translate_code.
9898 (packgram): Bound check ruleno, itemno, and rule_length.
9899 * src/reader.h (gram_in, gram__flex_debug, scanner_cursor)
9900 (last_string, last_braced_code_loc, max_left_semantic_context)
9901 (scanner_initialize, scanner_free, scanner_last_string_free)
9902 (gram_out, gram_lineno, YY_DECL_): Move to...
9903 * src/scan-gram.h: this new file.
9904 (YY_DECL): Rename as...
9905 (GRAM_DECL): this.
9906 * src/scan-code.h, src/scan-code.l, src/scan-code-c.c: New.
9907 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
9908 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
9909 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
9910 Move these declarations, and...
9911 (obstack_for_string, STRING_GROW, STRING_FINISH, STRING_FREE):
9912 these to...
9913 * src/flex-scanner.h: this new file.
9914 * src/scan-gram.l (rule_length, rule_length_overflow)
9915 (increment_rule_length): Remove.
9916 (last_braced_code_loc): Rename as...
9917 (gram_last_braced_code_loc): this.
9918 Adjust to the changes of the parser.
9919 Move all the handling of $ and @ into...
9920 * src/scan-code.l: here.
9921 * src/scan-gram.l (handle_dollar, handle_at): Remove.
9922 (handle_action_dollar, handle_action_at): Move to...
9923 * src/scan-code.l: here.
9924 * src/Makefile.am (bison_SOURCES): Add flex-scanner.h,
9925 scan-code.h, scan-code-c.c, scan-gram.h.
9926 (EXTRA_bison_SOURCES): Add scan-code.l.
9927 (BUILT_SOURCES): Add scan-code.c.
9928 (yacc): Be robust to white spaces.
9929
9930 * tests/conflicts.at, tests/input.at, tests/reduce.at,
9931 * tests/regression.at: Adjust the column numbers.
9932 * tests/regression.at: Adjust the error message.
9933
9934 2006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
9935
9936 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
9937 Use Akim's wording from
9938 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00056.html>.
9939
9940 2006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
9941
9942 Between Bison releases, manually append `+' to the previous Bison
9943 release number, and use that as a signal to automatically print the
9944 ChangeLog's CVS Id keyword from --version. Discussed starting at
9945 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00028.html>.
9946 * ChangeLog: Add Id header.
9947 * configure.ac (AC_INIT): Append `+' to `2.3'.
9948 * src/.cvsignore: Add revision.c.
9949 * src/Makefile.am (bison_SOURCES): Add revision.c and revision.h.
9950 (BUILT_SOURCES): Add revision.c.
9951 (revision.c): New target rule. This file defines a new global variable
9952 named revision. It initializes it with either the Id from ChangeLog
9953 or, if VERSION doesn't contain `+', with the empty string.
9954 * src/getargs.c (version): Print the value of revision.
9955 * src/revision.h: Extern revision.
9956
9957 2006-06-05 Paul Eggert <eggert@cs.ucla.edu>
9958
9959 * NEWS: Version 2.3.
9960 * configure.ac (AC_INIT): Likewise.
9961
9962 2006-05-30 Paul Eggert <eggert@cs.ucla.edu>
9963
9964 * data/glr.c (YYRECOVERING): Define to be a function-like macro
9965 with no arguments, not as an object-like macro. This is for
9966 compatibility with data/yacc.c. Problem reported by John P. Hartmann in
9967 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00059.html>.
9968 * doc/bison.texinfo (Action Features, Error Recovery, Table of Symbols):
9969 Document this.
9970
9971 2006-05-30 Joel E. Denny <jdenny@ces.clemson.edu>
9972
9973 * src/getargs.c (usage): Back out yesterday's modification of the
9974 --help output so that we don't have to wait for translation before
9975 releasing 2.3.
9976
9977 2006-05-29 Paul Eggert <eggert@cs.ucla.edu>
9978
9979 * doc/bison.texinfo (Introduction): Don't say "GLR grammar".
9980 Problem reported by Akim Demaille.
9981
9982 2006-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
9983
9984 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
9985
9986 2006-05-26 Paul Eggert <eggert@cs.ucla.edu>
9987
9988 * data/yacc.c (yy_reduce_print): Omit trailing white space in
9989 generated source code. Problem reported by Frans Englich in
9990 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00049.html>.
9991
9992 2006-05-22 Paul Eggert <eggert@cs.ucla.edu>
9993
9994 * Makefile.maint (gzip_rsyncable, GZIP_ENV): Compute within the
9995 shell, not within 'make', so that 'make' by an ordinary builder
9996 (using GNU make) does not worry about configuring gzip. This also
9997 works around a bug reported independently by Keith Thompson and by
9998 Georg Schwarz, whereby gzip 1.2.4 --help would output usage on
9999 stderr rather than stdout, messing up the build logs.
10000
10001 2006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
10002
10003 * data/yacc.c (yyparse): Wrap the final return from yyparse inside YYID
10004 to make sure that YYID will never be unused. This fixes a 'make
10005 maintainer-check' failure caused by the recent changes to the 'Trivial
10006 grammars' test case, which caused g++ 4.1.0 to complain that YYID was
10007 not used.
10008 * data/glr.c (yyparse): Wrap yyparse's return inside YYID just in case.
10009
10010 2006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
10011
10012 * data/glr.c (yyresolveLocations): Remove bogus YYASSERT that the
10013 state before an empty RHS is always resolved here. Only the location
10014 of that state is guaranteed to be resolved, and that's enough. This
10015 fixes the remaining bug reported by Derek M. Jones in
10016 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
10017 * tests/glr-regression.at (Uninitialized location when reporting
10018 ambiguity): Test the above case.
10019 Also, the embedded comments in this test case claim it checks the case
10020 of an empty RHS that has inherited the initial location. However, the
10021 corresponding LHS was already resolved, so yyresolveLocations didn't
10022 actually have reason to modify it. Fix this by forcing
10023 nondeterministic operation at the beginning of the parse.
10024
10025 2006-05-20 Paul Eggert <eggert@cs.ucla.edu>
10026
10027 * data/c.m4 (b4_yy_symbol_print_generate):
10028 (b4_yy_symbol_print_generate): Use 'YYSTYPE const' rather than
10029 'const YYSTYPE', and similarly for YYLTYPE. This fixes one
10030 of the bugs reported today by Derek M Jones in
10031 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
10032 * doc/bison.texinfo (Value Type): Document that YYSTYPE must be
10033 defined to be a type name without parens or brackets.
10034 (Location Type): Similarly for YYLTYPE.
10035 * tests/regression.at (Trivial grammars): Put in a test for this
10036 bug that will be caught by 'make maintainer-check' (though not,
10037 alas, by 'make check' unless your compiler is picky).
10038
10039 2006-05-19 Paul Eggert <eggert@cs.ucla.edu>
10040
10041 * NEWS: Version 2.2.
10042 * configure.ac (AC_INIT): Likewise.
10043
10044 2006-05-17 Joel E. Denny <jdenny@ces.clemson.edu>
10045
10046 * data/glr.c (yyreportTree): Make room in yystates for the state
10047 preceding the RHS. This fixes the segmentation fault reported by Derek
10048 M. Jones in
10049 <http://lists.gnu.org/archive/html/help-bison/2006-05/msg00035.html>.
10050 (yyreportTree, yypdumpstack): Subtract 1 from yyrule before printing
10051 to the user. Reported for yyreportTree by Derek M. Jones later in the
10052 same thread.
10053 * THANKS: Add Derek M. Jones.
10054 Update my email address.
10055 Fix typo in Steve Murphy's name.
10056
10057 2006-05-14 Paul Eggert <eggert@cs.ucla.edu>
10058
10059 * data/glr.c (yyreportSyntaxError): Fix off-by-one error in
10060 checking against YYLAST that caused the parser to miss a potential
10061 alternative in its diagnostic.
10062 Problem reported by Maria Jose Moron Fernandez in
10063 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00024.html>.
10064 * data/lalr1.cc (yysyntax_error_): Likewise.
10065 * data/yacc.c (yysyntax_error): Likewise.
10066 * tests/regression.at (_AT_DATA_DANCER_Y): Use static array for
10067 tokens, in case we run into an older C compiler.
10068 (_AT_DATA_EXPECT2_Y, AT_CHECK_EXPECT2): New macros.
10069 Use them to check for the off-by-one error fixed above.
10070
10071 * data/yacc.c (yytnamerr): Fix typo: local var should be of type
10072 YYSIZE_T, not size_t.
10073 * tests/regression.at (Trivial grammars): New test, to catch
10074 the error fixed by the above patch.
10075
10076 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
10077
10078 * doc/bison.texinfo (C++ Bison Interface): Clarify the naming
10079 scheme.
10080 Reported by Steve Murphy.
10081
10082 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
10083
10084 * data/glr.cc, data/lalr1.cc: Using %defines is mandatory.
10085 * data/glr.cc: b4_location_flag is now b4_locations_flag.
10086
10087 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
10088
10089 Implement --trace=m4.
10090 * src/getargs.c (trace_types, trace_args): Accept trace_m4.
10091 * src/output.c (output_skeleton): When set, pass -dV to m4.
10092
10093 Factor the handling of flags in m4.
10094 * src/output.c (prepare): Rename the muscle names debug, defines,
10095 error_verbose to debug_flag, defines_flag, error_verbose_flag.
10096 * data/c.m4: Adjust.
10097 (_b4_define_flag_if, b4_define_flag_if, b4_defines_if): New.
10098 Use b4_define_flag_if to define other b4_FLAG_if macros.
10099 (b4_location_if): As a consequence, rename as...
10100 (b4_locations_if): this, for consistency.
10101 Adjust all the skeletons.
10102
10103 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
10104
10105 * etc/bench.pm: Shorten bench names.
10106
10107 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
10108
10109 * src/output.h, src/output.c (error_verbose): Move to...
10110 * src/getargs.h, src/getargs.c: here.
10111 Sort the flags.
10112 Adjust dependencies.
10113
10114 2006-05-13 Paul Eggert <eggert@cs.ucla.edu>
10115
10116 * data/c.m4 (b4_copyright): Put the special exception for Bison
10117 skeletons here, so we don't have to put it in each skeleton. All
10118 uses changed. Suggested by Akim Demaille. Also, wrap the
10119 copyright notice, in case it is longer than 80 columns. Replace
10120 comma by newline after title.
10121
10122 2006-05-11 Paul Eggert <eggert@cs.ucla.edu>
10123
10124 * doc/bison.texinfo (Calc++ Scanner): The flex behavior is an
10125 incompatibility, not a bug. Mention that it wasn't fixed as of
10126 flex 2.5.33.
10127
10128 2006-05-11 Akim Demaille <akim@lrde.epita.fr>
10129
10130 * examples/extexi: Enforce the precedence of concatenation over
10131 >>.
10132 Reported by Tommy Nordgren.
10133
10134 2006-05-11 Akim Demaille <akim@lrde.epita.fr>
10135
10136 * data/lalr1.cc (yytranslate_): Rename token as t to avoid clashes
10137 with the member "token".
10138 Reported by Martin Nylin.
10139
10140 2006-05-08 Paul Eggert <eggert@cs.ucla.edu>
10141
10142 * data/glr.c: Switch to Bison 2.2 special-exception language in
10143 the copyright notice. Use more-regular format for titles and
10144 copyright notices.
10145 * data/glr.cc: Likewise.
10146 * data/location.cc: Likewise.
10147 * data/yacc.cc: Likewise.
10148 * doc/bison.texinfo (Conditions): Document this.
10149 * NEWS: likewise. Upgrade version to 2.2.
10150
10151 2006-04-27 Akim Demaille <akim@lrde.epita.fr>
10152
10153 * data/glr.cc: Remove dead code.
10154
10155 2006-04-25 Paul Eggert <eggert@cs.ucla.edu>
10156
10157 * bootstrap: Comment out the AM_CPPFLAGS line, since we don't use
10158 that variable and the line breaks the bootstrap. Problem reported
10159 by Juan M. Guerrero.
10160
10161 2006-04-24 Akim Demaille <akim@lrde.epita.fr>
10162
10163 * doc/bison.texinfo (Multiple start-symbols): New.
10164
10165 2006-04-24 Akim Demaille <akim@lrde.epita.fr>
10166
10167 * etc/README, etc/bench.pl: New.
10168
10169 2006-04-03 Akim Demaille <akim@lrde.epita.fr>
10170
10171 * src/scan-gram.l: Be robust to BRACED_CODE appearing before any
10172 rule.
10173 Reported by Mickael Labau.
10174 * tests/input.at (Torturing the Scanner): Test it.
10175
10176 2006-03-16 Paul Eggert <eggert@cs.ucla.edu>
10177
10178 * doc/bison.texinfo (Decl Summary): Don't mention yylloc twice.
10179 Problem reported by Bob Rossi.
10180
10181 2006-03-13 Paul Eggert <eggert@cs.ucla.edu>
10182
10183 * doc/bison.texinfo: Remove @shorttitlepage stuff; it wasn't used
10184 and didn't really work.
10185 For the index, use @ifnotinfo, not @iftex.
10186 Minor cleanups of spacing and terminology.
10187
10188 2006-03-12 Akim Demaille <akim@lrde.epita.fr>
10189
10190 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Fix the definition
10191 of AT_NAME_PREFIX when %name-prefix is not used.
10192
10193 2006-03-12 Akim Demaille <akim@lrde.epita.fr>
10194
10195 Apply --prefix to C++ skeletons too: they change the namespace.
10196 The test suite already exercize these cases.
10197 * data/c++.m4 (b4_namespace): New.
10198 * data/lalr1.cc, data/glr.cc, data/location.cc: Use it instead of `yy'.
10199 * data/lalr1.cc (yytnameerr_): Move its definition into the namespace.
10200 * data/yacc.c, data/glr.c: Remove a useless `[]'.
10201 * doc/bison.texinfo: Document it.
10202 (Option Cross Key): Use @multitable in all formats. It looks
10203 nicer, even in TeX outputs.
10204 (Rules): Use the same code whatever the output type is.
10205 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS)
10206 (_AT_BISON_OPTION_POPDEFS): Support AT_NAME_PREFIX.
10207 * tests/calc.at: Use it, instead of hard coding `yy'.
10208
10209 2006-03-10 Akim Demaille <akim@lrde.epita.fr>
10210
10211 * TODO: Remove dead items.
10212
10213 2006-03-10 Akim Demaille <akim@lrde.epita.fr>
10214
10215 * doc/FAQ: Remove, merged into...
10216 * doc/bison.texinfo (FAQ): this.
10217 * doc/Makefile.am (EXTRA_DIST): Adjust.
10218
10219 2006-03-10 Akim Demaille <akim@lrde.epita.fr>
10220
10221 * data/c.m4 (b4_token_enum): Always define the enum of tokens,
10222 even if empty.
10223 * data/lalrl1.cc, data/glr.cc (parser::token_type): New.
10224 * doc/bison.texinfo (Calc++ Scanner): Use it.
10225
10226 2006-03-09 Paul Eggert <eggert@cs.ucla.edu>
10227
10228 Fix two nits reported by twlevo, plus one more that I discovered.
10229
10230 * src/assoc.h (assoc_to_string): Give a name to the arg, as
10231 this is the usual Bison style.
10232 * src/location.h (location_print): Likewise.
10233
10234 * src/reader.h (token_name): Likewise.
10235
10236 2006-03-08 Paul Eggert <eggert@cs.ucla.edu>
10237
10238 Fix some nits reported by twlevo.
10239 * doc/FAQ: Remove ancient Y2K FAQ, replacing it with "secure"
10240 and "POSIX". Use more-modern syntax for URLs. Mention C++
10241 and ask for Java. Don't hardwire OS version numbers. Add
10242 copyright notice.
10243 * m4/.cvsignore: Add unistd_h.m4, for latest gnulib.
10244 * src/conflicts.c (solved_conflicts_obstack): Now static.
10245
10246 2006-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
10247
10248 * doc/bison.texinfo (Introduction): Mention GLR and C++ as on the web
10249 page. Say "you can use it" not "you may use it" as on the web page;
10250 we're describing capabilities not granting permission.
10251
10252 2006-03-06 Paul Eggert <eggert@cs.ucla.edu>
10253
10254 * data/glr.c (yyresolveLocations): Rename local variables to avoid
10255 shadowing warnings. Use usual patter for iterating through RHS.
10256 * tests/glr-regression.at
10257 (Uninitialized location when reporting ambiguity):
10258 Modify yylex so that it uses its argument, rather than trying
10259 to rely on ARGSUSED (which doesn't work for gcc with warnings).
10260 const char -> char const.
10261
10262 * tests/Makefile.am ($(srcdir)/package.m4, maintainer-check-valgrind):
10263 Don't use tabs inside commands; it messes up 'ps'.
10264 Problem reported by twlevo.
10265
10266 2006-03-06 Joel E. Denny <jdenny@ces.clemson.edu>
10267
10268 * tests/glr-regression.at (Uninitialized location when reporting
10269 ambiguity): New test case.
10270 * data/glr.c (yyresolveLocations): New function, which uses
10271 YYLLOC_DEFAULT.
10272 (yyresolveValue): Invoke yyresolveLocations before reporting an
10273 ambiguity.
10274 * doc/bison.texinfo (Default Action for Locations): Note
10275 YYLLOC_DEFAULT's usage for ambiguity locations.
10276 (GLR Semantic Actions): Cross-reference those notes.
10277
10278 2006-03-04 Joel E. Denny <jdenny@ces.clemson.edu>
10279
10280 * tests/glr-regression.at (Leaked semantic values when reporting
10281 ambiguity): Remove unnecessary union and type declarations.
10282 (Leaked lookahead after nondeterministic parse syntax error): New test
10283 case.
10284 * data/glr.c (yyparse): Check for zero stacks remaining before
10285 attempting to shift the lookahead so that you don't lose it.
10286
10287 2006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
10288
10289 Avoid memory leaks by not invoking longjmp in yyreportAmbiguity.
10290 * tests/glr-regression.at (Leaked semantic values when reporting
10291 ambiguity): New test case.
10292 * data/glr.c (yyreportAmbiguity): Invoke yyyerror directly and return
10293 yyabort rather than invoking yyFail, which invokes longjmp. Remove the
10294 now unnecessary yystackp parameter.
10295 (yyresolveValue): Return yyreportAmbiguity's result. Now the necessary
10296 destructors can be called.
10297
10298 * tests/glr-regression.at: Don't invoke bison with `-t' unnecessarily
10299 in existing testcases.
10300
10301 2006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
10302
10303 Don't leak semantic values for parent RHS when a user action cuts the
10304 parser, and clean up related code a bit.
10305 * tests/glr-regression.at (Leaked merged semantic value if user action
10306 cuts parse): Rename to...
10307 (Leaked semantic values if user action cuts parse): ... this. Add check
10308 for leaked parent RHS values.
10309 * data/glr.c (yydestroyGLRState): In debugging output, distinguish
10310 between an unresolved state (non-empty chain of semantic options) and
10311 an incomplete one (signaled by an empty chain).
10312 (yyresolveStates): Document the interface. Move all manipulation of a
10313 successfully or unsuccessfully resolved yyGLRState to...
10314 (yyresolveValue): ... here so that yyresolveValue always leaves a
10315 yyGLRState with consistent data and thus is easier to understand.
10316 Remove the yyvalp and yylocp parameters since they are always just
10317 taken from the yys parameter. When reporting a discarded merged value
10318 in debugging output, note that it is incompletely merged. Document the
10319 interface.
10320 (yyresolveAction): If resolving any of the RHS states fails, destroy
10321 them all rather than leaking them. Thus, as long as user actions are
10322 written to clean up the RHS correctly, yyresolveAction always cleans up
10323 the RHS of a semantic option. Document the interface.
10324
10325 2006-02-27 Paul Eggert <eggert@cs.ucla.edu>
10326
10327 * data/glr.c (yyexpandGLRStack): Catch an off-by-one error that
10328 led to a segmentation fault in GNU Pascal. Problem reported
10329 by Waldek Hebisch.
10330
10331 2006-02-21 Joel E. Denny <jdenny@ces.clemson.edu>
10332
10333 * doc/bison.texinfo (Mid-Rule Actions): Explain how to bury a
10334 mid-rule action inside a nonterminal symbol in order to declare a
10335 destructor for its semantic value.
10336
10337 2006-02-16 Paul Eggert <eggert@cs.ucla.edu>
10338
10339 * data/yacc.c [(! defined yyoverflow || YYERROR_VERBOSE) && !
10340 YYSTACK_USE_ALLOCA && ! defined YYSTACK_ALLOC && defined
10341 __cplusplus && ! defined _STDLIB_H && !
10342 ((defined YYMALLOC || defined malloc) && (defined YYFREE ||
10343 defined free))]: Include <stdlib.h> rather than rolling our own
10344 declarations of malloc and free, to avoid problems with
10345 incompatible declarations (using 'throw') C++'s stdlib.h. This
10346 should fix Debian bug 340012
10347 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=340012>,
10348 reported by Guillaume Melquiond.
10349
10350 2006-02-13 Paul Eggert <eggert@cs.ucla.edu>
10351
10352 * NEWS: Clarify symbols versus types in unused-value warnings.
10353
10354 * configure.ac (AC_INIT): Bump version number.
10355
10356 2006-02-13 Paul Eggert <eggert@cs.ucla.edu>
10357
10358 * NEWS: Version 2.1a.
10359 * tests/headers.at (AT_TEST_CPP_GUARD_H): Declare yyerror and yylex,
10360 since C99 requires this.
10361
10362 2006-02-11 Paul Eggert <eggert@cs.ucla.edu>
10363
10364 * m4/c-working.m4: New file.
10365 * configure.ac (BISON_TEST_FOR_WORKING_C_COMPILER): Use it.
10366
10367 2006-02-10 Paul Eggert <eggert@cs.ucla.edu>
10368
10369 * Makefile.maint: Merge from coreutils.
10370
10371 2006-02-09 Paul Eggert <eggert@cs.ucla.edu>
10372
10373 More portability fixes for problems summarized by Nelson H. F. Beebe.
10374
10375 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Catch a
10376 configuration screwup "./configure CC=/opt/SUNWspro/bin/c89
10377 CFLAGS="-xarch=generic64" CXX=/opt/SUNWspro/bin/CC
10378 LDFLAGS="-xarch=generic64" with Sun C 5.7 on Solaris 10; this
10379 messes up because C++ code is compiled in 32-bit mode but linked
10380 in 64-bit mode.
10381
10382 2006-02-08 Paul Eggert <eggert@cs.ucla.edu>
10383
10384 More portability fixes for problems summarized by Nelson H. F. Beebe.
10385
10386 * doc/bison.texinfo (Calc++ Scanner): Work around a bug in flex
10387 2.5.31. This resembles the 2005-10-10 patch to src/scan-skel.l.
10388
10389 * examples/calc++/Makefile.am (check_PROGRAMS): Renamed from
10390 nodist_PROGRAMS, since we don't need to actually compile the
10391 example if we're just doing a plain 'make'. This avoids bothering
10392 the installer unnecessarily about problems due to weird C++
10393 compilers.
10394
10395 2006-02-06 Paul Eggert <eggert@cs.ucla.edu>
10396
10397 More portability fixes for problems summarized by Nelson H. F. Beebe.
10398
10399 * tests/headers.at (AT_TEST_CPP_GUARD_H): Use #include <...> rather
10400 than #include "...", and compile with -I'.'. The old method was
10401 not portable, according to Posix and the C standard, and it does
10402 not work with Sun C 5.7, where previous #line directives affect
10403 the working directory used in later #include "..." directives.
10404
10405 2006-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
10406
10407 Various DJGGP specific issues in /djgpp
10408
10409 2006-02-02 Paul Eggert <eggert@cs.ucla.edu>
10410
10411 More portability fixes for problems summarized by Nelson H. F. Beebe.
10412
10413 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check that
10414 '#include <map>' works and that you can apply ++ to iterators.
10415
10416 2006-02-01 Paul Eggert <eggert@cs.ucla.edu>
10417
10418 Work around portability problems summarized by Nelson H. F. Beebe in
10419 <http://lists.gnu.org/archive/html/bug-bison/2005-09/msg00021.html>.
10420
10421 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
10422 that '#include <string>' works.
10423
10424 * data/lalr1.cc (yytranslate_): No longer inline, to work around a
10425 porting problem to g++ 3.4.3 on Darwin 7.9.0, where g++ complained
10426 "warning: sorry: semantics of inline function static data `const
10427 unsigned char translate_table[262]' are wrong (you'll wind up with
10428 multiple copies)".
10429
10430 * lib/bbitset.h (struct bitset_vtable): Rename members not, and,
10431 or, xor to not_, and_, or_, and xor_, respectively. This works
10432 around a bug in GCC 3.4.3 on Irix 6.5, which apparently has a
10433 random system header somewhere that includes the equivalent of
10434 <iso646.h>.
10435
10436 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that "$CC
10437 -E" works; it apparently doesn't work with PathScale EKO Compiler
10438 Suite Version 2.0.
10439
10440 2006-01-30 Joel E. Denny <jdenny@ces.clemson.edu>
10441
10442 During deterministic GLR operation, user actions should be able to
10443 influence the parse by changing yychar. To make this easier to fix and
10444 to make glr.c easier to evolve in general, don't maintain yytoken in
10445 parallel with yychar; just compute yytoken when needed.
10446 * tests/glr-regression.at (Incorrect lookahead during deterministic
10447 GLR): Check that setting yychar in a user action has the intended
10448 effect.
10449 * data/glr.c (yyGLRStack): Remove yytokenp member.
10450 (yyclearin): Don't set *yytokenp.
10451 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Examine
10452 yychar rather than *yytokenp to determine the current lookahead.
10453 Compute yytoken locally when needed.
10454 (yyparse): Likewise. Remove the local yytoken that yytokenp used to
10455 point to.
10456
10457 * doc/bison.texinfo (Bison Options): Remove stray sentence fragment
10458 after `--report' documentation.
10459
10460 2006-01-30 Paul Eggert <eggert@cs.ucla.edu>
10461
10462 * src/parse-gram.y (grammar_declaration): Location of printer
10463 symbol is @1, not list->location. Bug reported by twlevo.
10464 * tests/input.at (Incompatible Aliases): Adjust to above change.
10465
10466 2006-01-29 Paul Eggert <eggert@cs.ucla.edu>
10467
10468 * tests/input.at (AT_CHECK_UNUSED_VALUES): Remove. Instead, do
10469 all the test at once. This makes the output easier to read in the
10470 normal case.
10471
10472 Fix a longstanding bug uncovered by bro-0.9a9/src/parse.y, which I
10473 got from <http://bro-ids.org/download.html>. The bug is that
10474 when two actions appeared in succession, the second one was
10475 scanned before the first one was added to the grammar rule
10476 as a midrule action. Bison then output the incorrect warning
10477 "parse.y:905.17-906.36: warning: unused value: $3".
10478 * src/parse-gram.y (BRACED_CODE, action): These are no longer
10479 associated with a value.
10480 (rhs): Don't invoke grammar_current_rule_action_append.
10481 (action): Invoke it here instead.
10482 * src/reader.c (grammar_midrule_action): Now extern.
10483 (grammar_current_rule_action_append): Don't invoke
10484 grammar_midrule_action; that is now the scanner's job.
10485 * src/reader.h (last_string, last_braced_code_loc):
10486 (grammar_midrule_action): New decls.
10487 * src/scan-gram.l (last_string): Now extern, sigh.
10488 (last_braced_code_loc): New extern variable.
10489 (<INITIAL>"{"): Invoke grammar_midrule_action if the current
10490 rule already has an action.
10491 (<SC_BRACED_CODE>"}"): Set last_braced_code_loc before returning.
10492 * tests/input.at (AT_CHECK_UNUSED_VALUES):
10493 Add some tests to check that the above changes fixed the bug.
10494
10495 2006-01-27 Paul Eggert <eggert@cs.ucla.edu>
10496
10497 * src/reader.c (symbol_should_be_used): Renamed from symbol_typed_p.
10498 All used changed. Check whether the symbol has a destructor,
10499 not whether it is typed.
10500 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add a destructor, so
10501 that the values are still reported as unused. All line numbers
10502 adjusted.
10503
10504 2006-01-23 Paul Eggert <eggert@cs.ucla.edu>
10505
10506 Work around a bug in bro 0.8, which underparenthesizes its
10507 definition of YYLLOC_DEFAULT.
10508 * data/glr.c: Change all uses of YYLLOC_DEFAULT to parenthesize
10509 their arguments.
10510 * data/lalr1.cc: Likewise.
10511 * data/yacc.cc: Likewise.
10512
10513 2006-01-22 Paul Eggert <eggert@cs.ucla.edu>
10514
10515 Work around a bug in Pike 7.0, and give the Pike folks a
10516 better way to override the usual int widths.
10517 * data/yacc.c (b4_int_type): Use yytype_uint8, etc., so that the
10518 user can override the types.
10519 (short): #undef, to work around a bug in Pike 7.0.
10520 (yytype_uint8, yytype_int8, yytype_uint16, yytype_int16): New types.
10521 (union yyalloc.yyss): Use yytype_int16 rather than short.
10522 All uses changed.
10523 (yysigned_char): Remove.
10524 * src/parse-gram.y (YYTYPE_UINT8, YYTYPE_INT8, YYTYPE_UINT16):
10525 (YYTYPE_INT16): New macros, to test the new facility in yacc.c.
10526 * tests/regression.at (Web2c Actions): Adjust to above changes.
10527
10528 * src/reader.c (check_and_convert_grammar): New function.
10529 (reader): Close the input file even if something went wrong during
10530 parsing. Minor file descriptor leak reported by twlevo.
10531
10532 * src/assoc.c (assoc_to_string): Use a default: abort (); case
10533 to pacify gcc -Wswitch-default.
10534 * src/scan-gram.l (adjust_location): Use a default: break; case
10535 to pacify gcc -Wswitch-default.
10536 * src/scan-skel.h (skel_get_lineno, skel_get_in, skel_get_out):
10537 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
10538 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
10539 Move these decls to scan-skel.l, since they don't need to be
10540 visible elsewhere.
10541 * src/scan-skel.l: Accept the above decls.
10542 (skel_lex): New decl, to pacify GCC when unpatched flex 2.5.31
10543 is used.
10544
10545 2006-01-21 Paul Eggert <eggert@cs.ucla.edu>
10546
10547 * Makefile.cfg (local-checks-to-skip): Add changelog-check,
10548 since we don't want to insist on a version number at the start
10549 of the changelog every time.
10550 * Makefile.maint: Sync from coreutils a bit better.
10551 (sc_trailing_blank): Renamed from sc_trailing_space.
10552 All uses changed.
10553 (sc_no_if_have_config_h, sc_require_config_h):
10554 (sc_prohibit_assert_without_use): New rules.
10555 (sc_obsolete_symbols): Don't catch Makefile.maint itself.
10556 (sc_dd_max_sym_length): Fix leading spaces in rule.
10557 (sc_system_h_headers): Prefix with @.
10558 (sc_useless_cpp_parens, m4-check): Output line numbers.
10559 (changelog-check): Allow version only in head.
10560 * data/c.m4: Use "defined FOO" instead of "defined (FOO)", to
10561 satisfy new Makefile.maint rule.
10562 * data/glr.c: Likewise.
10563 * data/glr.cc: Likewise.
10564 * data/lalr1.cc: Likewise.
10565 * data/yacc.c: Likewise.
10566 * lib/ebitsetv.c: Likewise.
10567 * lib/lbitset.c: Likewise.
10568 * lib/subpipe.c: Likewise.
10569 * lib/timevar.c: Likewise.
10570 * src/system.h: Likewise.
10571 * data/yacc.c (YYSTYPE): Don't generate trailing spaces in output.
10572 * djgpp/Makefile.maint: Add copyright notice.
10573 * djgpp/README.in: Likewise.
10574 * djgpp/config.bat: Likewise.
10575 * djgpp/config.site: Likewise.
10576 * djgpp/config_h.sed: Likewise.
10577 * djgpp/djunpack.bat: Likewise.
10578 * djgpp/config.sed: Fix copyright notice to match standard format.
10579 * djgpp/subpipe.h: Likewise.
10580 * lib/bitsetv-print.c: Likewise.
10581 * lib/bitsetv.c: Likewise.
10582 * lib/subpipe.h: Likewise.
10583 * lib/timevar.c: Likewise.
10584 * lib/timevar.h: Likewise.
10585 * djgpp/subpipe.c: Use standard recipe for config.h.
10586 * lib/abitset.c: Likewise.
10587 * lib/bitset.c: Likewise.
10588 * lib/bitset_stats.c: Likewise.
10589 * lib/bitsetv-print.c: Likewise.
10590 * lib/bitsetv.c: Likewise.
10591 * lib/ebitsetv.c: Likewise.
10592 * lib/get-errno.c: Likewise.
10593 * lib/lbitset.c: Likewise.
10594 * lib/subpipe.c: Likewise.
10595 * lib/timevar.c: Likewise.
10596 * lib/vbitset.c: Likewise.
10597 * tests/local.at: Likewise.
10598 * src/scan-gram.l: Don't include verify.h, since system.h does
10599 that for us.
10600 * .x-sc_require_config_h: New file.
10601 * .x-sc_unmarked_diagnostics: New file.
10602
10603 2006-01-20 Paul Eggert <eggert@cs.ucla.edu>
10604
10605 Be a bit more systematic about using 'abort'.
10606 * lib/abitset.c (abitset_test): Remove ATTRIBUTE_UNUSED; not needed.
10607 * lib/bitset.c (bitset_bytes, bitset_init, bitset_op4_cmp):
10608 Put 'default: abort ();' before some other case, to satisfy older
10609 pedantic compilers.
10610 * lib/bitset_stats.c (bitset_stats_init): Likewise.
10611 * lib/ebitset.c (ebitset_elt_find, ebitset_op3_cmp): Likewise.
10612 * lib/lbitset.c (lbitset_elt_find, lbitset_op3_cmp): Likewise.
10613 * src/conflicts.c (resolve_sr_conflict): Likewise.
10614 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str):
10615 (get_decision_str, get_orientation_str, get_node_alignment_str):
10616 (get_arrow_mode_str, get_crossing_type_str, get_view_str):
10617 (get_linestyle_str, get_arrowstyle_str): Likewise.
10618 * src/conflicts.c (resolve_sr_conflict):
10619 Use a default case rather than one for the one remaining enum
10620 value, to catch invalid enum values as well.
10621 * src/lalr.c (set_goto_map, map_goto):
10622 Prefer "assert (FOO);" to "if (!FOO) abort ();".
10623 * src/nullable.c (nullable_compute, token_definitions_output):
10624 Likewise.
10625 * src/reader.c (packgram, reader): Likewise.
10626 * src/state.c (transitions_to, state_new, state_reduction_find):
10627 Likewise.
10628 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias):
10629 (symbol_pack): Likewise.
10630 * src/tables.c (conflict_row, pack_vector): Likewise.
10631 * src/scan-skel.l (QPUTS): Remove unnecessary parens.
10632 (BASE_QPUTS, "@output ".*\n): Remove unnecessary asserts.
10633 * src/system.h: Don't include <assert.h>.
10634 (assert): New macro.
10635
10636 * doc/bison.texinfo (Prologue, Rules, Actions, Union Decl, Action Decl):
10637 (Destructor Decl, Parser Function, Pure Calling):
10638 Describe rules for braces inside C code more carefully.
10639
10640 2006-01-19 Paul Eggert <eggert@cs.ucla.edu>
10641
10642 Fix some porting glitches found by Nelson H. F. Beebe.
10643 * lib/abitset.c (abitset_resize): Rewrite to avoid warnings from
10644 compilers that don't understand that abort () does not return.
10645 * src/state.c (transitions_to): Likewise.
10646 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
10647 that '#include <cstdlib>' works.
10648 * src/system.h (INT8_MIN, INT16_MIN, INT32_MIN, INT8_MAX):
10649 (INT16_MAX, UINT8_MAX, INT32_MAX, UINT16_MAX, UINT32_MAX):
10650 #undef if ! defined __STDC_VERSION__ || __STDC_VERSION__ < 199901,
10651 for the benefit of some pre-C99 compilers.
10652
10653 * bootstrap: Undo changes to gnulib files that autoreconf made.
10654
10655 Minor fixups to get 'make maintainer-check' to work.
10656 * configure.ac: Don't use -Wnested-externs, as it's incompatible
10657 with the new verify.h implementation.
10658 * data/c.m4 (b4_yy_symbol_print_generate): YYUSE (yyoutput).
10659 * data/glr.c (YYUSE): Depend on __GNUC__ as well.
10660 * data/yacc.c (YYUSE): Likewise.
10661 * data/lalr1.cc (yysyntax_error_): YYUSE (yystate).
10662 * lib/subpipe.c (end_of_output_subpipe): The args are unused.
10663 * src/parse-gram.y (declaration): Don't pass a string constant
10664 to a function that expects char *, since GCC might complain
10665 about the constant value.
10666 * src/reader.c (symbol_typed_p): Add parens to pacify GCC.
10667 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): #undef yylloc and yylval
10668 before #defining them.
10669 * tests/glr-regression.at
10670 (Incorrectly initialized location for empty right-hand side in GLR):
10671 In yyerror, use the msg arg.
10672 (Corrupted semantic options if user action cuts parse):
10673 (Incorrect lookahead during deterministic GLR):
10674 (Incorrect lookahead during nondeterministic GLR):
10675 Don't name a local var 'index'; it shadows string.h's 'index'.
10676
10677 2006-01-19 Akim Demaille <akim@epita.fr>
10678
10679 * tests/calc.at (_AT_DATA_CALC_Y): Initialize the whole initial
10680 location, not just parts of it.
10681
10682 2006-01-18 Paul Eggert <eggert@cs.ucla.edu>
10683
10684 * NEWS: Document the fact that multiple %unions are now allowed.
10685 * doc/bison.texinfo (Union Decl): Likewise.
10686 * TODO: This feature is now implemented, so remove it from
10687 the wishlist.
10688
10689 * Makefile.maint: Merge with coreutils Makefile.maint.
10690 (CVS_LIST): Use build-aux version if available.
10691 (VERSION_REGEXP): New macro.
10692 (syntax-check-rules): Add sc_no_if_have_config_h,
10693 sc_prohibit_assert_without_use, sc_require_config_h,
10694 sc_useless_cpp_parens.
10695 (sc_obsolete_symbols): Check for O_NDELAY.
10696 (sc_dd_max_sym_length): Track coreutils.
10697 (sc_unmarked_diagnostics): Look in all files, not just *.c.
10698 (sc_useless_cpp_parens): New rule.
10699 (news-date-check): Look for version or today's date.
10700 (changelog-check): Don't require version number near head.
10701 (copyright-check): Use current year instead of hardwiring 2005.
10702 (my-distcheck): Depend on $(release_archive_dir)/$(prev-tgz).
10703 (announcement): Add --gpg-key-ID.
10704
10705 * djgpp/config.sed: Add copyright notice, and replace "filesystem"
10706 with "file system".
10707
10708 Avoid undefined behavior that addressed just before the start of an
10709 array. Problem reported by twlevo.
10710 * src/reader.c (packgram): Prepend a new sentinel before ritem.
10711 * src/lalr.c (build_relations): Rely on new sentinel.
10712 * src/gram.c (gram_free): Adjust to new sentinel.
10713
10714 2006-01-12 Joel E. Denny <jdenny@ces.clemson.edu>
10715
10716 * data/glr.c (yyGLRStateSet): Rename yylookaheadStatuses to
10717 yylookaheadNeeds. All uses updated.
10718 (yysplitStack): Rename local yynewLookaheadStatuses to
10719 yynewLookaheadNeeds.
10720 * data/glr-regression.at (Incorrect lookahead during nondeterministic
10721 GLR): In comments, change `lookahead status' to `lookahead need'.
10722
10723 2006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
10724
10725 * data/glr.c (yysplitStack): A little stylistic rewrite.
10726
10727 2006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
10728
10729 * data/glr.c (yyaddDeferredAction): Flesh out the comment.
10730
10731 2006-01-11 Joel E. Denny <jdenny@ces.clemson.edu>
10732
10733 * doc/bison.texinfo: Fix some typos.
10734 (GLR Semantic Actions): New subsection discussing special
10735 considerations because GLR semantic actions might be deferred.
10736 (Actions): Mention look-ahead usage of yylval.
10737 (Actions and Locations): Mention look-ahead usage of yylloc.
10738 (Special Features for Use in Actions): Add YYEOF entry and mention it
10739 in the yychar entry.
10740 In the yychar entry, remove mention of the local yychar case (pure
10741 parser) since this is irrelevant information when writing semantic
10742 actions and since it's already discussed in `Table of Symbols' where
10743 yychar is otherwise described as an external variable.
10744 In the yychar entry, don't call it the `current' look-ahead since it
10745 isn't when semantic actions are deferred.
10746 In the yychar and yyclearin entries, add note about deferred semantic
10747 actions.
10748 Add yylloc and yylval entries discussing look-ahead usage.
10749 (Look-Ahead Tokens): When discussing yychar, don't call it the
10750 `current' look-ahead, and do mention yylval and yylloc.
10751 (Error Recovery): Cross-reference `Action Features' when mentioning
10752 yyclearin.
10753 (Table of Symbols): In the yychar entry, don't call it the `current'
10754 look-ahead.
10755 In the yylloc and yylval entries, mention look-ahead usage.
10756
10757 2006-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
10758
10759 * tests/glr-regression.at: Update copyright year to 2006.
10760
10761 2006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
10762
10763 * data/glr.c (yyGLRStateSet): Add yybool* yylookaheadStatuses member to
10764 use during nondeterministic operation to track which stacks have
10765 actually needed the current lookahead.
10766 (yyinitStateSet, yyfreeStateSet, yyremoveDeletes, yysplitStack):
10767 Allocate, deallocate, resize, and otherwise shuffle space for
10768 yylookaheadStatuses in parallel with yystates member of yyGLRStateSet.
10769 (yysplitStack, yyprocessOneStack, yyparse): Set lookahead status
10770 appropriately during nondeterministic operation.
10771 (yySemanticOption): Add int yyrawchar, YYSTYPE yyval, and YYLTYPE yyloc
10772 members to store the current lookahead to be used by the deferred
10773 user action.
10774 (yyaddDeferredAction): Add size_t yyk parameter specifying the stack
10775 from which the RHS is taken. Set the lookahead members of the new
10776 yySemanticOption according to the lookahead status for stack yyk.
10777 (yyglrShiftDefer, yyglrReduce): Pass yyk parameter on to
10778 yyaddDeferredAction.
10779 (yyresolveAction): Set yychar, yylval, and yylloc to the lookahead
10780 members of yySemanticOption before invoking yyuserAction, and then set
10781 them back to their current values afterward.
10782 (yyparse): Set yychar = YYEMPTY where yytoken = YYEMPTY.
10783 (yyreportAmbiguity): Add /*ARGSUSED*/ to pacify lint.
10784 * tests/glr-regression.at: Remove `.' from the ends of recent test case
10785 titles for consistency.
10786 (Leaked merged semantic value if user action cuts parse): In order to
10787 suppress lint warnings, use arguments in merge function, and assign
10788 char value < 128 in main.
10789 (Incorrect lookahead during deterministic GLR): New test case.
10790 (Incorrect lookahead during nondeterministic GLR): New test case.
10791
10792 2006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
10793
10794 * data/c.m4 (b4_yy_symbol_print_generate): In yy_symbol_print, accept
10795 !yyvaluep as signal that no semantic value is available to print.
10796 * data/glr.c (yydestroyGLRState): If state is not resolved, don't try
10797 to print a semantic value.
10798
10799 2006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
10800
10801 * tests/glr-regression.at: For consistency with my newer test cases,
10802 don't thank myself.
10803
10804 2006-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
10805
10806 * data/glr.c (yyresolveValue): When merging semantic options, if at
10807 least one user action succeeds but a later one cuts the parse, then
10808 destroy the semantic value before returning rather than leaking it.
10809 (yyresolveStates): If a user action cuts the parse and thus
10810 yyresolveValue fails, ignore the (unset) semantic value rather than
10811 corrupting the yyGLRState, and empty the semantic options list since
10812 the user actions should have called all necessary destructors.
10813 Simplify code with YYCHK.
10814 * tests/glr-regression.at (Corrupted semantic options if user action
10815 cuts parse): New test case.
10816 (Undesirable destructors if user action cuts parse): New test case.
10817 Before applying any of this patch, this test case never actually failed
10818 for me... but only because the corrupted semantic options usually
10819 masked this bug.
10820 (Leaked merged semantic value if user action cuts parse): New test
10821 case.
10822
10823 2006-01-05 Akim Demaille <akim@epita.fr>
10824
10825 * src/reader.c, src/symlist.h, src/symlist.c: s/mid_rule/midrule/.
10826
10827 2006-01-04 Paul Eggert <eggert@cs.ucla.edu>
10828
10829 * data/c.m4 (b4_c_modern): New macro, with a new provision for
10830 _MSC_VER. Problem reported by Cenzato Marco.
10831 (b4_c_function_def): Use it.
10832 * data/yacc.c (YYMODERN_C): Remove. All uses replaced by
10833 b4_c_modern.
10834 (yystrlen, yystpcpy, yyparse): Use b4_c_function... macros rather
10835 than rolling our own.
10836
10837 2006-01-04 Akim Demaille <akim@epita.fr>
10838
10839 Also warn about non-used mid-rule values.
10840 * src/symlist.h, src/symlist.c (symbol_list): Add a mid_rule
10841 member.
10842 (symbol_list_new): Adjust.
10843 * src/reader.c (symbol_typed_p): New.
10844 (grammar_rule_check): Use it.
10845 (grammar_midrule_action): Bind a mid-rule LHS to its rule.
10846 Check its rule.
10847 * tests/input.at (AT_CHECK_UNUSED_VALUES): New.
10848 Use it.
10849 * tests/actions.at (Exotic Dollars): Adjust.
10850
10851 2006-01-04 Akim Demaille <akim@epita.fr>
10852
10853 * src/reader.c (grammar_midrule_action): If $$ is set in a
10854 mid-rule, move the `used' bit to its lhs.
10855 * tests/input.at (Unused values): New.
10856 * tests/actions.at (Exotic Dollars): Adjust: exp is not typed.
10857
10858 2006-01-03 Paul Eggert <eggert@cs.ucla.edu>
10859
10860 * doc/bison.texinfo (Bison Options): Say more accurately what
10861 --yacc does.
10862 * src/parse-gram.y (rules_or_grammar_declaration): Don't complain
10863 about declarations in the grammar when in Yacc mode, as POSIX does
10864 not require a diagnostic when the grammar uses extensions.
10865
10866 * src/reduce.c (reduce_grammar): Remove unnecessary cast to bool.
10867
10868 Warn about dubious constructions like "%token T T".
10869 Reported by twlevo.
10870 * src/symtab.h (struct symbol.declared): New member.
10871 * src/symtab.c (symbol_new): Initialize it to false.
10872 (symbol_class_set): New arg DECLARING, specifying whether
10873 this is a declaration that we want to warn about, if there
10874 is more than one of them. All uses changed.
10875
10876 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c:
10877 Allow multiple %union directives, whose contents concatenate.
10878 * src/parse-gram.y (grammar_declaration): Likewise.
10879 Use muscle_code_grow, so that we don't need stype_line any more.
10880 All uses changed.
10881
10882 * src/muscle_tab.c (muscle_grow): Fix comment.
10883
10884 * ChangeLog, data/c.m4, data/glr.c, data/glr.cc, data/location.cc:
10885 * data/yacc.c, src/getargs.c, src/output.c, tests/cxx-type.at:
10886 Update copyright year to 2006.
10887
10888 2006-01-03 Akim Demaille <akim@epita.fr>
10889
10890 Have glr.cc pass (some of) the calc.at tests.
10891 * data/glr.cc (b4_parse_param_orig): New.
10892 (b4_parse_param): Improve its definition, and bound it more
10893 clearly in the skeleton.
10894 (b4_epilogue): Append, instead of prepending, in order to keep
10895 #line consistency.
10896 Simplify the generation of auxiliary functions: locations and
10897 purity are mandated.
10898 (b4_global_tokens_and_yystype): Honor it.
10899 * data/location.cc (c++.m4): Don't include it.
10900 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Define AT_GLR_CC_IF
10901 and AT_SKEL_CC_IF.
10902 * tests/calc.at (AT_CHECK_CALC): Rely on AT_SKEL_CC_IF instead of
10903 AT_LALR1_CC_IF.
10904 Be sure to initialize the first position's filename.
10905 (AT_CHECK_CALC_LALR1_CC): Add %location and %defines, they are
10906 mandated anyway.
10907 (AT_CHECK_CALC_GLR_CC): New.
10908 Use it to exercise glr.cc as a lalr1.cc drop-in replacement.
10909
10910 2006-01-02 Akim Demaille <akim@epita.fr>
10911
10912 * src/output.c (output_skeleton): Don't hard wire the inclusion of
10913 c.m4.
10914 * data/c++.m4, data/glr.c, data/yacc.c: Include c.m4.
10915 * data/glr.cc: Do not include stack.hh.
10916
10917 2006-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
10918
10919 * data/glr.c: Reformat whitespace with tabs.
10920 (b4_lpure_formals): Remove this unused m4 macro.
10921 * tests/cxx-type.at: Reformat whitespace with tabs.
10922 (_AT_TEST_GLR_CXXTYPES): In union Node, rename node_info to nodeInfo
10923 since it's a member. Rename type to isNterm for clarity.
10924
10925 2005-12-29 Akim <akim@sulaco.local>
10926
10927 Let glr.cc catch up with symbol_value_print.
10928 * data/glr.cc (b4_yysymprint_generate): Replace by...
10929 (b4_yy_symbol_print_generate): this.
10930 (yy_symbol_print, yy_symbol_value_print): Declare them.
10931
10932 2005-12-28 Paul Eggert <eggert@cs.ucla.edu>
10933
10934 * src/location.h (boundary): Note that a line or column equal
10935 to INT_MAX indicates an overflow.
10936 * src/scan-gram.l: Include verify.h. Don't include get-errno.h.
10937 (rule_length_overflow, increment_rule_length, add_column_width):
10938 New functions.
10939 (<INITIAL>{id}, <SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'"):
10940 (<SC_BRACED_CODE>"}"):
10941 Use increment_rule_length rather than incrementing it by hand.
10942 (adjust_location, handle_syncline): Diagnose overflow.
10943 (handle_action_dollar, handle_action_at):
10944 Fix bug with monstrosities like $-2147483648.
10945 Remove now-unnecessary checks.
10946 (scan_integer): Verify assumptions and remove now-unnecessary checks.
10947 (convert_ucn_to_byte): Verify assumptions.
10948 (handle_syncline): New arg LOC. All callers changed.
10949 Don't store through a value derived from char const * pointer.
10950
10951 * src/reader.c (grammar_rule_check): Rewrite slightly to avoid
10952 GCC warnings.
10953
10954 2005-12-27 Paul Eggert <eggert@cs.ucla.edu>
10955
10956 * src/reader.c (grammar_midrule_action, grammar_symbol_append):
10957 Remove unnecessary forward static decls.
10958
10959 2005-12-27 Akim Demaille <akim@epita.fr>
10960
10961 * src/reader.c (grammar_current_rule_check): Also check that $$
10962 is used.
10963 Take the rule to check as argument, hence rename as...
10964 (grammar_rule_check): this.
10965 * src/reader.h, src/reader.c (grammar_rule_begin, grammar_rule_end):
10966 Rename as...
10967 (grammar_rule_begin, grammar_rule_end): these, for consistency.
10968 (grammar_midrule_action, grammar_symbol_append): Now static.
10969 * tests/torture.at (input): Don't rely on the default action
10970 being always performed.
10971 * tests/calc.at: "Set" $$ even when the action is "cut" with
10972 YYERROR or other.
10973 * tests/actions.at (Exotic Dollars): Instead of using unused
10974 values, check that the warning is issued.
10975
10976 2005-12-22 Paul Eggert <eggert@cs.ucla.edu>
10977
10978 * NEWS: Improve wording for unused-value warnings.
10979
10980 2005-12-22 Akim Demaille <akim@epita.fr>
10981
10982 * data/lalr1.cc, data/yacc.c, data/glr.c, data/c.m4
10983 (b4_yysymprint_generate): Rename as...
10984 (b4_yy_symbol_print_generate): this.
10985 Generate yy_symbol_print instead of yysymprint.
10986 Generate also yy_symbol_value_print, and use it.
10987
10988 2005-12-22 Akim Demaille <akim@epita.fr>
10989
10990 * NEWS: Warn about unused values.
10991 * src/symlist.h, src/symlist.c (symbol_list, symbol_list_new): Add
10992 a `used' member.
10993 (symbol_list_n_get, symbol_list_n_used_set): New.
10994 (symbol_list_n_type_name_get): Use symbol_list_n_get.
10995 * src/scan-gram.l (handle_action_dollar): Flag used symbols.
10996 * src/reader.c (grammar_current_rule_check): Check that values are
10997 used.
10998 * src/symtab.c (symbol_print): Accept 0.
10999 * tests/existing.at: Remove the type information.
11000 Empty the actions.
11001 Remove useless actions (beware of mid-rule actions: perl -000
11002 -pi -e 's/\s*\{\}(?=[\n\s]*[|;])//g').
11003 * tests/actions.at (Exotic Dollars): Use unused values.
11004 * tests/calc.at: Likewise.
11005 * tests/glr-regression.at (No users destructors if stack 0 deleted):
11006 Likewise.
11007
11008 * src/gram.c (rule_useful_p, rule_never_reduced_p): Use
11009 rule_useful_p.
11010
11011 2005-12-21 Paul Eggert <eggert@cs.ucla.edu>
11012
11013 Undo 2005-12-01 tentative license wording change. The wording is
11014 still being reviewed by the lawyers, and we don't want to wait for
11015 them before publishing a test release. For now, revert to the
11016 previous wording.
11017 * NEWS: Undo 2005-12-01 change.
11018 * data/glr.c: Revert to previous license wording.
11019 * data/glr.cc: Likewise.
11020 * data/lalr1.cc: Likewise.
11021 * data/location.cc: Likewise.
11022 * data/yacc.c: Likewise.
11023
11024 * NEWS: Reword %destructor vs YYABORT etc.
11025 * data/glr.c: Use American spacing, for consistency.
11026 * data/glr.cc: Likewise.
11027 * data/lalr1.cc: Likewise.
11028 * data/yacc.c: Likewise.
11029 * data/yacc.c: Reformat comments slightly.
11030 * doc/bison.texinfo: Replace "non-" with "non" when that makes sense,
11031 for consistency. Fix some spelling errors and reword recently-included
11032 text slightly.
11033 * tests/cxx-type.at: Cast results of malloc, for C++.
11034
11035 2005-12-21 Joel E. Denny <address@hidden>
11036
11037 * tests/cxx-type.at: Construct a tree, count the parents of shared
11038 nodes, and free each node once and only once. Previously, the memory
11039 for semantic values was leaked instead.
11040
11041 2005-12-21 Joel E. Denny <address@hidden>
11042
11043 * data/glr.c (struct yyGLRStack): If pure, add yyval and yyloc members.
11044 (yylval, yylloc): If pure, #define to yystackp->yyval and
11045 yystackp->yyloc similar to yychar and yynerrs.
11046 (yyparse): If pure, remove local yylval and yylloc. Add local
11047 yystackp to accommodate pure definitions of yylval and yylloc.
11048 (b4_lex_param, b4_lyyerror_args, b4_lpure_args): If pure, change
11049 yylvalp and yyllocp to &yylval and &yylloc.
11050 (nerrs, char, lval, lloc): If pure, add #define's for b4_prefix[]
11051 namespace. Previously, nerrs and char were missing, but lval and lloc
11052 weren't necessary.
11053 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Remove
11054 yylvalp and yyllocp parameters since, if pure, these are now always
11055 accessible through yystackp. If not pure, they are still accessible
11056 globally.
11057 * data/glr.c, data/yacc.c (YYLLOC_DEFAULT): Change `if (N)' to
11058 `if (YYID (N))' to pacify lint.
11059
11060 2005-12-21 Akim Demaille <akim@epita.fr>
11061
11062 YYACCEPT, YYERROR, and YYABORT, as user actions, should not
11063 destroy the RHS symbols of a rule.
11064 * data/yacc.c (yylen): Initialize to 0.
11065 Keep its value to the number of items to possibly shift.
11066 In particular, a regular successful parse that ends on YYFINAL by
11067 a (internal) YYACCEPT must not have yylen != 0.
11068 (yyerrorlab, yyreturn): Pop the RHS.
11069 Reorder a bit to emphasize the `shifting' bits of code.
11070 (YYPOPSTACK): Now accept a number of items to pop.
11071 * data/lalr1.cc: Likewise.
11072 * data/glr.c: Formatting changes.
11073 Use goto instead of fall through.
11074 * doc/bison.texinfo (Destructor Decl): Complete.
11075
11076 2005-12-20 Juan Manuel Guerrero <juan.guerrero@gmx.de>
11077
11078 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
11079 * djgpp/Makefile.maint: Fix PACKAGE variable computation.
11080 * djgpp/config.bat: Replace every occurence of the file name
11081 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
11082 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
11083 * djgpp/config.sed: Replace every occurence of the file name
11084 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
11085 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
11086 * djgpp/djunpack.bat: DJGPP specific file.
11087 * djgpp/fnchange.lst: DJGPP specific file.
11088 * djgpp/README.in: Add new information about how to unpack the bison
11089 source on MSDOS and other systems which have 8.3 file name restrictions
11090 using djunpack.bat and fnchange.lst.
11091
11092 2005-12-12 Paul Eggert <eggert@cs.ucla.edu>
11093
11094 * bootstrap (build_cvs_prefix): Remove; unused.
11095 (CVS_PREFIX): Adjust to yesterday's Savannah reorganization
11096 when getting gnulib.
11097
11098 2005-12-12 "Joel E. Denny" <jdenny@ces.clemson.edu>
11099
11100 * data/glr.c: Reorder typedef declarations for structs to match order
11101 of struct declarations.
11102 Rename yystack everywhere to yystackp except in yyparse where it's not
11103 a pointer.
11104 (yyglrShift): Change parameter YYSTYPE yysval to YYSTYPE* yyvalp for
11105 consistency.
11106 (yyis_table_ninf): Change 0 to YYID (0) to pacify lint.
11107 (yyreportSyntaxError): Add /*ARGSUSED*/ to pacify lint.
11108 (yyparse): Change while (yytrue) to while ( YYID (yytrue)) to pacify
11109 lint.
11110
11111 2005-12-09 Paul Eggert <eggert@cs.ucla.edu>
11112
11113 * tests/sets.at (Accept): Fix typos in regular expression used to
11114 sed out the final state number.
11115
11116 Work around portability problem on Solaris 10: flex-generated
11117 files include <stdio.h> before <config.h>, which messes up
11118 because the latter defines __EXTENSIONS__. Address the problem
11119 by creating two new little files that include <config.h> first,
11120 then include the flex-generated files. Rewrite everyone else
11121 to include <config.h> first, as well.
11122 * lib/timevar.c: Always include "config.h".
11123 * src/Makefile.am (bison_SOURCES): Replace scan-gram.l with
11124 scan-gram-c.c, and scan-skel.l with scan-skel-c.c.
11125 (EXTRA_bison_SOURCES): New macro.
11126 * src/scan-gram-c.c, src/scan-skel-c.c: New files.
11127 * src/system.h: Don't include config.h.
11128 * src/LR0.c: Include <config.h> first.
11129 * src/assoc.c: Likewise.
11130 * src/closure.c: Likewise.
11131 * src/complain.c: Likewise.
11132 * src/conflicts.c: Likewise.
11133 * src/derives.c: Likewise.
11134 * src/files.c: Likewise.
11135 * src/getargs.c: Likewise.
11136 * src/gram.c: Likewise.
11137 * src/lalr.c: Likewise.
11138 * src/location.c: Likewise.
11139 * src/main.c: Likewise.
11140 * src/muscle_tab.c: Likewise.
11141 * src/nullable.c: Likewise.
11142 * src/output.c: Likewise.
11143 * src/parse-gram.y: Likewise.
11144 * src/print.c: Likewise.
11145 * src/print_graph.c: Likewise.
11146 * src/reader.c: Likewise.
11147 * src/reduce.c: Likewise.
11148 * src/relation.c: Likewise.
11149 * src/state.c: Likewise.
11150 * src/symlist.c: Likewise.
11151 * src/symtab.c: Likewise.
11152 * src/tables.c: Likewise.
11153 * src/uniqstr.c: Likewise.
11154 * src/vcg.c: Likewise.
11155
11156 * src/parse-gram.y: Fix minor problems uncovered by lint.
11157 (current_lhs, current_lhs_location): Now static.
11158 (current_assoc): Remove unused variable.
11159
11160 Cleanups so that Bison-generated parsers have less lint.
11161 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate):
11162 Prepend /*ARGSUSED*/, for lint's sake.
11163 * data/glr.c (YYUSE): Properly parenthesize, and use an alternate
11164 definition if 'lint' is defined.
11165 (YYID): New macro (or function, if lint).
11166 All uses of /*CONSTCOND*/0 replaced by YYID(0).
11167 * data/yacc.c: Likewise.
11168 * data/glr.c (yyuserAction, yyuserMerge, yy_reduce_print):
11169 (yyrecoverSyntaxError): Prepend /*ARGSUSED*/.
11170 * data/glr.cc (YYLLOC_DEFAULT): Omit /*CONSTCOND*/ since this code
11171 is C++ only.
11172 * data/lalr1.cc (YYUSE): Just use a cast, since this code is C++ only.
11173 * data/yacc.c (YYSTACK_FREE) [defined YYSTACK_ALLOC]:
11174 Use YYID(0) rather than 0, for lint.
11175 (yystrlen): Rewrite to avoid lint warning about ptrdiff_t overflow.
11176 (yysyntax_error): Rewrite to avoid lint warnings about parenthesization.
11177
11178 2005-12-07 Paul Eggert <eggert@cs.ucla.edu>
11179
11180 * tests/glr-regression.at
11181 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
11182 Close memory leak reported by twlevo.
11183
11184 2005-12-06 "Joel E. Denny" <jdenny@ces.clemson.edu>
11185
11186 * data/glr.c (yyprocessOneStack, yyparse): Synchronize the shift for
11187 all stacks.
11188 (yyparse): Iterate another stack in order to call user destructors.
11189 * tests/glr-regression.at (No users destructors if stack 0 deleted):
11190 New test case.
11191 (Duplicated user destructor for lookahead): This test now is expected
11192 to succeed.
11193
11194 2005-12-01 Paul Eggert <eggert@cs.ucla.edu>
11195
11196 * NEWS: Document the following change.
11197 * data/yacc.c: Say "parser skeleton" rather than "file", since
11198 it's no longer just a file.
11199 * data/glr.c: Grant a special exception for C GLR parsers, that
11200 reads like the already-existing exception for C LALR(1) parsers.
11201 * data/glr.cc: Likewise.
11202 * data/lalr1.cc: Likewise.
11203 * data/location.cc: Likewise.
11204 * data/yacc.c: Reword the "written by" statement to clarify that
11205 it was the parser skeleton, not the entire output file.
11206 * data/glr.c: Written by Paul Hilfinger.
11207 * data/glr.cc: Written by Akim Demaille.
11208 * data/lalr1.cc: Likewise.
11209
11210 2005-11-18 Paul Eggert <eggert@cs.ucla.edu>
11211
11212 * data/yacc.c (yy_reduce_print, YY_REDUCE_PRINT):
11213 Fix typos in previous change that broke 'make check'.
11214 YY_REDUCE_PRINT cannot be a pseudo-varargs macro; that isn't
11215 supported in C.
11216 * tests/calc.at (_AT_CHECK_CALC,_AT_CHECK_CALC_ERROR):
11217 Don't check NUM-STDERR-LINES, since the output format is fluctuating.
11218 We can revert this once things settle down.
11219
11220 * src/conflicts.c (conflicts_print): Don't print file name twice
11221 when %expect fails because there were no conflicts.
11222 * doc/bison.texinfo (Expect Decl): Tighten up wording in previous
11223 change.
11224 * tests/conflicts.at (%expect not enough, %expect too much):
11225 (%expect with reduce conflicts): Adjust to new behavior.
11226
11227 2005-11-18 Akim Demaille <akim@epita.fr>
11228
11229 * src/conflicts.c (conflicts_print): Unsatisfied %expectation are
11230 errors.
11231 * NEWS: Document this.
11232 * doc/bison.texinfo (Expect Decl): Likewise.
11233
11234 2005-11-16 Akim Demaille <akim@epita.fr>
11235
11236 Generalize the display of semantic values and locations in traces.
11237 * data/glr.c (yy_reduce_print): Fix indices (again).
11238 * data/c++.m4 (b4_rhs_value, b4_rhs_location): Don't expect
11239 literal integers.
11240 * data/lalr1.cc (yyreduce_print): Rename as...
11241 (yy_reduce_print): this.
11242 Display values and locations.
11243 * data/yacc.c (yy_reduce_print): Likewise.
11244 (YY_REDUCE_PRINT): Adjust to pass the required arguments.
11245 (yysymprint): Move higher to be visible from yy_reduce_print).
11246 (yyparse): Adjust.
11247 * tests/calc.at: Adjust the expected length of the traces.
11248
11249 2005-11-14 Akim Demaille <akim@epita.fr>
11250
11251 * data/glr.c (yy_reduce_print): The loop was quite wrong: type are
11252 from 1 to N, while values and location start at 0.
11253 (b4_rhs_location, b4_rhs_value): Add parens around $1 and $2.
11254
11255 2005-11-14 Akim Demaille <akim@epita.fr>
11256
11257 * data/glr.c (yy_reduce_print): Fix the $ number.
11258
11259 2005-11-14 Akim Demaille <akim@epita.fr>
11260
11261 "Use" parse parameters.
11262 * data/c.m4 (b4_parse_param_for, b4_parse_param_use): New.
11263 * data/glr.c, data/glr.cc: Use them.
11264 * data/glr.c (YYUSE): Have a C++ definition that supports
11265 non-pointer types.
11266
11267 2005-11-14 Akim Demaille <akim@epita.fr>
11268
11269 * data/glr.c (yyexpandGLRStack): Declare only if defined.
11270
11271 2005-11-14 Akim Demaille <akim@epita.fr>
11272
11273 * data/glr.cc: New.
11274 * data/m4sugar/m4sugar.m4 (m4_prepend): New.
11275
11276 2005-11-12 Akim Demaille <akim@epita.fr>
11277
11278 Let position and location be PODs.
11279 * data/location.cc (position::initialize, location::initialize): New.
11280 (position::position, location::location): Define only if
11281 b4_location_constructors is defined.
11282 * data/lalr1.cc (b4_location_constructors): Define it for backward
11283 compatibility.
11284 * doc/bison.texinfo (Initial Action Decl): Use initialize.
11285
11286 2005-11-12 Akim Demaille <akim@epita.fr>
11287
11288 * data/lalr1.cc: Move the body of the ctor and dtor into the
11289 parser file (instead of the header).
11290 Wrap the implementations in a "namespace yy".
11291
11292 2005-11-12 Akim Demaille <akim@epita.fr>
11293
11294 Have glr.c include its header file when created.
11295 * data/glr.c (b4_shared_declarations): New.
11296 Output them verbatim in the parser if !%defines, otherwise
11297 output then in the header file, and include it instead.
11298
11299 2005-11-11 Akim Demaille <akim@epita.fr>
11300
11301 * data/glr.c: Comment changes.
11302
11303 2005-11-11 Akim Demaille <akim@epita.fr>
11304
11305 When yydebug, report semantic and location values for reductions.
11306 * data/glr.c (yy_reduce_print): Report the semantic values and the
11307 locations.
11308 (YY_REDUCE_PRINT): Adjust.
11309 (yyglrReduce): Use them.
11310 (b4_rhs_value, b4_rhs_location): Remove m4_eval invocations.
11311 * data/c.m4 (b4_yysymprint_generate): Specify the const arguments.
11312 * tests/calc.at (_AT_CHECK_CALC_ERROR): Remove the reduction
11313 traces.
11314
11315 2005-11-10 Akim Demaille <akim@epita.fr>
11316
11317 * data/glr.c (yynewGLRStackItem, YY_RESERVE_GLRSTACK): New.
11318 (yyaddDeferredAction, yyglrShift, yyglrShiftDefer): Use them.
11319 (yyexpandGLRStack, YYRELOC): Define only when YYSTACKEXPANDABLE.
11320
11321 2005-11-09 Albert Chin-A-Young <china@thewrittenword.com>
11322
11323 * m4/cxx.m4, examples/Makefile.am: Don't build
11324 examples/calc++ if no C++ compiler is available. (trivial change)
11325
11326 2005-11-09 Akim Demaille <akim@epita.fr>
11327
11328 * src/scan-skel.l: Use a couple of asserts.
11329
11330 2005-11-03 Akim Demaille <akim@epita.fr>
11331
11332 In some (weird) cases, the final state number is incorrect.
11333 Reported by Alexandre Duret-Lutz.
11334 * src/LR0.c (state_list_append): Remove the computation of
11335 final_state.
11336 (save_reductions): Do it here.
11337 (get_state): Alpha conversion.
11338 (generate_states): Use a for loop.
11339 * src/gram.h (item_number_is_rule_number)
11340 (item_number_is_symbol_number): New.
11341 * src/state.c: Use assert.
11342 * src/system.h: Include assert.h.
11343 * tests/sets.at (Accept): New.
11344
11345 2005-10-30 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
11346
11347 * data/glr.c (yyfill): Adjust comment.
11348 (yyresolveAction): Initialize default location properly
11349 for empty right-hand sides.
11350 (yydoAction): Ditto.
11351 Add comment explaining apparently dead code.
11352 * tests/glr-regression.at
11353 (Incorrectly initialized location for empty right-hand side in GLR):
11354 New test.
11355
11356 2005-10-30 Paul Eggert <eggert@cs.ucla.edu>
11357
11358 * bootstrap (cleanup_gnulib): New function. Use it to clean up
11359 gnulib when interrupted. This fixes some race conditions and
11360 works around some portability problems (one noted by Paul
11361 Hilfinger).
11362
11363 2005-10-22 Akim <akim@epita.fr>
11364
11365 * Makefile.cfg: Adjust to config -> build-aux.
11366 Reported by twledo.
11367
11368 2005-10-21 Akim Demaille <akim@epita.fr>
11369
11370 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Pass
11371 the %parse-params.
11372 * data/glr.c (YY_SYMBOL_PRINT, yydestroyGLRState): Adjust.
11373 * data/yacc.c (b4_Pure_if): Rename as...
11374 (b4_yacc_pure_if): this.
11375 (YY_SYMBOL_PRINT, yyparse): Adjust.
11376 * doc/bison.texinfo: Formatting changes.
11377
11378 2005-10-21 Akim Demaille <akim@epita.fr>
11379
11380 Finish the transition config -> build-aux.
11381 * configure.ac, Makefile.am: Use build-aux.
11382 * config/prev-version, config/announce-gen, config/Makefile.am:
11383 Move to...
11384 * build-aux/prev-version, build-aux/announce-gen,
11385 * build-aux/Makefile.am: here.
11386
11387 2005-10-14 Akim Demaille <akim@epita.fr>
11388
11389 * examples/calc++/test: Use set -x only when VERBOSE.
11390
11391 2005-10-13 Paul Eggert <eggert@cs.ucla.edu>
11392
11393 * NEWS: Bison now warns if it finds a stray `$' or `@' in an action.
11394 * src/scan-gram.l (<SC_BRACED_CODE>[$@]): Implement this.
11395
11396 2005-10-13 Akim Demaille <akim@epita.fr>
11397
11398 * src/scan-skel.l: Output the base name parts of the parser and
11399 header file names.
11400 * tests/output.at (AT_CHECK_OUTPUT): Support subdirectories, and
11401 additional checks.
11402 Use this to exercise C++ outputs in subdirs.
11403 Reported by Oleg Smolsky.
11404
11405 2005-10-12 Paul Eggert <eggert@cs.ucla.edu>
11406
11407 * data/c.m4 (b4_c_function_def): Look at __C99_FUNC__, not at
11408 __STDC_VERSION__, as IBM cc 7.0 doesn't define the latter either.
11409 Problem reported by John P. Hartmann.
11410 * data/yacc.c (YYMODERN_C): Likewise. Don't define if the user has
11411 already defined it.
11412
11413 2005-10-12 Akim Demaille <akim@epita.fr>
11414
11415 * src/parse-gram.y (version_check): Exit 63 to please missing
11416 (stands for "version mismatch).
11417 * tests/input.at, doc/bison.texinfo: Adjust.
11418
11419 2005-10-10 Paul Eggert <eggert@cs.ucla.edu>
11420
11421 Work around portability problems with Visual Age C compiler
11422 (xlc and xlC_r) reported by John P. Hartmann.
11423 * data/location.cc (initial_column, initial_line): Remove.
11424 All uses replaced by 0 and 1.
11425 * src/scan-gram.l (gram_wrap): Redefine to avoid bug in flex 2.5.31
11426 that xlc complains about.
11427 * src/scan-skel.l (skel_wrap): Likewise.
11428 * data/c.m4 (b4_c_function_def): Look at __STDC_VERSION__ as well
11429 as __STDC__.
11430 * data/yacc.c (YYMODERN_C): New macro, which also looks at
11431 __STDC_VERSION__. Use it everywhere instead of looking at
11432 __STDC__ and __cplusplus.
11433
11434 2005-10-10 Akim Demaille <akim@epita.fr>
11435
11436 * examples/calc++/test: Be quiet unless VERBOSE.
11437
11438 2005-10-05 Paul Eggert <eggert@cs.ucla.edu>
11439
11440 * data/c.m4 (yydestruct, yysymprint):
11441 Use YYUSE instead of casting to void.
11442 * data/glr.c (YYUSE): New macro.
11443 (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
11444 Use it instead of rolling our own.
11445 (YYLLOC_DEFAULT, YYCHK, YYDPRINTF, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
11446 (YYCHK1):
11447 Use /*CONSTCOND*/ to suppress lint warnings.
11448 * data/lalr1.cc (YYLLOC_DEFAULT, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
11449 (YY_STACK_PRINT): Use 'false' not '0'.
11450 (YYUSE): New macro.
11451 (yysymprint_, yydestruct_): Use it instead of rolling our own.
11452 * data/yacc.c (YYUSE): New macro.
11453 (YYCOPY, YYSTACK_RELOCATE, YYBACKUP, YYLLOC_DEFAULT):
11454 (YYDPRINTF, YY_SYMBOL_PRINT, YY_STACK_PRINT, YY_REDUCE_PRINT):
11455 (yyerrorlab): Use /*CONSTCOND*/ to suppress lint warnings.
11456
11457
11458 * data/m4sugar/m4sugar.m4 (_m4_map): New macro.
11459 (m4_map, m4_map_sep): Use it. Handle the empty list correctly.
11460
11461 2005-10-04 Paul Eggert <eggert@cs.ucla.edu>
11462
11463 Undo the parts of the unlocked-I/O change that substituted
11464 putc or puts for printf. This might hurt performance a bit,
11465 but some people prefer the printf style.
11466 * data/c.m4 (yysymprint): Prefer printf to puts and putc.
11467 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): Remove.
11468 All uses replaced by YYFPRINTF and YYDPRINTF.
11469 * data/yacc.c: Likewise.
11470 * lib/bitset.c (bitset_print): Likewise.
11471 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer printf to
11472 putc and puts.
11473 * lib/lbitset.c (debug_lbitset): Likewise.
11474 * src/closure.c (print_firsts, print_fderives): Likewise.
11475 * src/gram.c (grammar_dump): Likewise.
11476 * src/lalr.c (look_ahead_tokens_print): Likewise.
11477 * src/output.c (escaped_output): Likewise.
11478 (user_actions_output): Break apart two printfs.
11479 * src/parse-gram.y (%printer): Prefer printf to putc and puts.
11480 * src/reduce.c (reduce_print): Likewise.
11481 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
11482 * src/system.h: Include unlocked-io.h rathe than stdio.h.
11483
11484 * data/glr.c (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
11485 Use assignments rather than casts-to-void to suppress
11486 unused-variable warnings. This pacifies 'lint'.
11487 * data/lalr1.cc (yysymprint_, yydestruct_): Use a call to suppress
11488 unused-variable warnings.
11489
11490 2005-10-03 Juan Manuel Guerrero <juan.guerrero@gmx.de>
11491
11492 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
11493
11494 2005-10-02 Paul Eggert <eggert@cs.ucla.edu>
11495
11496 Use unlocked I/O for a minor performance improvement on hosts like
11497 GNU/Linux and Solaris that support unlocked I/O. The basic idea
11498 is to use the gnlib unlocked-io module, and to prefer putc and
11499 puts to printf when either will work (since the latter doesn't
11500 come in an unlocked flavor).
11501 * bootstrap (gnulib_modules): Add unlocked-io.
11502 * data/c.m4 (yysymprint): Prefer puts and putc to printf.
11503 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): New macros.
11504 Prefer them to YYFPRINTF and YYDPRINTF if either will do,
11505 and similarly for puts and putc and printf.
11506 * data/yacc.c: Likewise.
11507 * lib/bitset.c (bitset_print): Likewise.
11508 * lib/bitset.h [USE_UNLOCKED_IO]: Include unlocked-io.h.
11509 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer putc and puts
11510 to printf.
11511 * lib/lbitset.c (debug_lbitset): Likewise.
11512 * src/closure.c (print_firsts, print_fderives): Likewise.
11513 * src/gram.c (grammar_dump): Likewise.
11514 * src/lalr.c (look_ahead_tokens_print): Likewise.
11515 * src/output.c (escaped_output): Likewise.
11516 (user_actions_output): Coalesce two printfs.
11517 * src/parse-gram.y (%printer): Prefer putc and puts to printf.
11518 * src/reduce.c (reduce_print): Likewise.
11519 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
11520 * src/system.h: Include unlocked-io.h rather than stdio.h.
11521
11522 * data/lalr1.cc: Don't put an unmatched ' in a dnl comment, as
11523 this confuses xgettext.
11524
11525 2005-10-02 Akim Demaille <akim@epita.fr>
11526
11527 * bootstrap (gnulib_modules): Add strverscmp.
11528 * lib/.cvsignore: Add strverscmp.c, strverscmp.h.
11529 * m4/.cvsignore: Add strverscmp.m4.
11530 * src/parse-gram.y (%require): New token, new rule.
11531 (version_check): New.
11532 * src/scan-gram.l (%require): Adjust.
11533 * tests/input.at (AT_REQUIRE): New.
11534 Use it.
11535 * doc/bison.texinfo (Require Decl): New.
11536 (Calc++ Parser): Use %require.
11537
11538 2005-10-02 Akim Demaille <akim@epita.fr>
11539
11540 * data/location.cc: New.
11541
11542 2005-10-02 Paul Eggert <eggert@cs.ucla.edu>,
11543 Akim Demaille <akim@epita.fr>
11544
11545 Make sure -odir/foo.cc creates dir/location.hh etc.
11546 * src/files.h (spec_outfile, parser_file_name, spec_name_prefix)
11547 (spec_file_prefix, spec_verbose_file, spec_graph_file)
11548 (spec_defines_file): Now const.
11549 (dir_prefix): New.
11550 (short_base_name): Remove.
11551 * src/files.c: Adjust.
11552 (dirname.h): Include.
11553 (base_name): Don't prototype it.
11554 (finput): Remove, duplicates gram_in.
11555 (full_base_name, short_base_name): Replace by...
11556 (all_but_ext, all_but_tab_ext): these.
11557 (compute_base_names): Rename as...
11558 (compute_file_name_parts): this.
11559 Update to compute the new variables, including dir_prefix.
11560 Adjust dependencies.
11561 * src/output.c (prepare): Output them.
11562 * src/reader.c: Adjust to use gram_in, not finput.
11563 * src/scan-skel.l (@dir_prefix@): New.
11564
11565 2005-10-02 Juan Manuel Guerrero <juan.guerrero@gmx.de>
11566
11567 * lib/subpipe.c: New function end_of_output_subpipe() added
11568 to allow support for non-posix systems. This is a no-op function
11569 for posix systems.
11570
11571 * lib/subpipe.h: New function end_of_output_subpipe() added
11572 to allow support for non-posix systems. This is a no-op function
11573 for posix systems.
11574
11575 * src/output.c (output_skeleton): Use end_of_output_subpipe() to
11576 handle the lack of pipe/fork functionality on non-posix systems.
11577
11578 * djgpp/Makefile.maint: DJGPP specific file.
11579
11580 * djgpp/README.in: DJGPP specific file.
11581
11582 * djgpp/config.bat: DJGPP specific configuration file.
11583
11584 * djgpp/config.sed: DJGPP specific configuration file.
11585
11586 * djgpp/config.site: DJGPP specific configuration file.
11587
11588 * djgpp/config_h.sed: DJGPP specific configuration file.
11589
11590 * djgpp/subpipe.c: DJGPP specific replacement file for lib/subpipe.c.
11591
11592 * djgpp/subpipe.h: DJGPP specific replacement file for lib/subpipe.h.
11593
11594 2005-10-02 Akim Demaille <akim@epita.fr>
11595
11596 * data/location.cc: New, extract from...
11597 * data/lalr1.cc: here.
11598 (location.hh): Include it after the user prologue, in case the
11599 filename type is defined by the user.
11600 Forward declation location and position before the pre-prologue.
11601 (yyresult_): Rename as...
11602 (yyresult): this, it's a local variable, not an attribute.
11603 * data/Makefile.am (dist_pkgdata_DATA): Adjust.
11604
11605 2005-10-01 Akim Demaille <akim@epita.fr>
11606
11607 * examples/extexi: Restore the #line generation.
11608
11609 2005-09-30 Akim Demaille <akim@epita.fr>,
11610 Alexandre Duret-Lutz <adl@gnu.org>
11611
11612 Move the token type and YYSTYPE in the parser class.
11613 * data/lalr1.cc (stack.hh, location.hh): Include earlier.
11614 (parser::token): New, from the moved free definition of tokens.
11615 (parser::semantic_value): Now a full definition instead of an
11616 indirection to YYSTYPE.
11617 (b4_post_prologue): No longer included in the header file, but
11618 in the implementation file.
11619 * doc/bison.texi (C+ Language Interface): Update.
11620 * src/parse-gram.y: Support unary %define.
11621 * tests/actions.at: Define global_tokens_and_yystype for backward
11622 compatibility until we update the tests.
11623 * tests/calc.at: Idem.
11624 (first_line, first_column, last_line, last_column): Define for lalr1.cc
11625 to simplify the code.
11626
11627 2005-09-29 Paul Eggert <eggert@cs.ucla.edu>
11628
11629 Port to SunOS 4.1.4, which lacks strtoul and strerror.
11630 Ah, the good old days! Problem reported by Peter Klein.
11631 * bootstrap (gnulib_modules): Add strerror, strtoul.
11632 * lib/.cvsignore: Add strerror.c, strtol.c, strtoul.c
11633 * m4/.cvsignore: Add strerror.m4, strtol.m4, strtoul.m4.
11634
11635 2005-09-29 Akim Demaille <akim@epita.fr>
11636
11637 * data/c.m4 (b4_error_verbose_if): New.
11638 * data/lalr1.cc: Use it.
11639 (YYERROR_VERBOSE_IF): Remove.
11640 (yyn_, yylen_, yystate_, yynerrs_, yyerrstatus_): Remove as
11641 parser members, replaced by...
11642 (yyn, yylen, yystate, yynerss, yyerrstatus): these parser::parse
11643 local variables.
11644 (yysyntax_error_): Takes the state number as argument.
11645 (yyreduce_print_): Use the argument yyrule, not the former
11646 attribute yyn_.
11647
11648 2005-09-26 Paul Eggert <eggert@cs.ucla.edu>
11649
11650 * bootstrap (gnulib_modules): Add verify.
11651 * lib/.cvsignore: Add verify.h.
11652 * src/getargs.c: Use ARGMATCH_VERIFY rather than verify.
11653 * src/system.h (verify): Remove.
11654 Include verify.h instead.
11655 * src/tables.c (tables_generate): Use new API for 'verify'.
11656
11657 2005-09-21 Paul Eggert <eggert@cs.ucla.edu>
11658
11659 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Do not use
11660 local variables whose names begin with 'yy'.
11661 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
11662 Trivial changes from Joel E. Denny.
11663
11664 * bootstrap (gnulib_modules): Remove alloca. Bison doesn't need
11665 it itself.
11666 * src/main.c (main) [C_ALLOCA]: Don't flush alloca'ed memory; we
11667 don't use alloca any more.
11668
11669 * data/yacc.c [YYSTACK_USE_ALLOCA && !defined __GNUC__ && ! defined
11670 __BUILTIN_VA_ARG_INCR && ! defined _AIX && ! defined _MSC_VER &&
11671 defined _ALLOCA_H]: Don't include <stdlib.h>; not needed in this case.
11672 * tests/torture.at (Exploding the Stack Size with Alloca): Adjust
11673 to match yacc.c, to test more hosts.
11674
11675 2005-09-20 Paul Eggert <eggert@cs.ucla.edu>
11676
11677 * data/yacc.c (YYSIZE_T): Reindent to make it clearer. This
11678 doesn't affect behavior.
11679 (YYSTACK_ALLOC) [YYSTACK_USE_ALLOCA]: Improve support for
11680 Solaris, AIX, MSC.
11681 (_STDLIB_H): Renamed from YYINCLUDED_STDLIB_H. All uses changed.
11682 This works a bit better with glibc, if user code has already included
11683 stdlib.h.
11684 * doc/bison.texinfo (Bison Parser): Document that users can't
11685 arbitrarily use malloc and free for other purposes. Document
11686 that <alloca.h> and <malloc.h> might be included.
11687 (Table of Symbols): Under YYSTACK_USE_ALLOCA, Don't claim that the
11688 user must declare alloca.
11689
11690 * HACKING (release): Forwarn the Translation Project about
11691 stable releses.
11692
11693 2005-09-20 Akim Demaille <akim@epita.fr>
11694
11695 * data/glr.c: Use b4_token_enums, not b4_token_enums_defines.
11696
11697 2005-09-19 Paul Eggert <eggert@cs.ucla.edu>
11698
11699 * data/yacc.c (YYSIZE_MAXIMUM): New macro.
11700 (YYSTACK_ALLOC_MAXIMUM): Use it.
11701 (yysyntax_error): New function.
11702 (yyparse) [YYERROR_VERBOSE]: Don't leak memory indefinitely if
11703 multiple syntax errors are reported, and alloca is being used.
11704 Instead, reallocate buffers twice as big each time, so that
11705 we waste at most half the allocated memory. Start with a small
11706 (128-byte) buffer that will suffice in most cases anyway.
11707 Use yysyntax_error to do most of the work.
11708
11709 * doc/bison.texinfo (Error Reporting, Table of Symbols):
11710 yynerrs is the number of errors reported, not the number of
11711 errors encountered.
11712
11713 * tests/glr-regression.at (Duplicated user destructor for lookahead):
11714 Mark it as expected to fail.
11715 Cast result of malloc; problem reported by twlevo@xs4all.nl.
11716 * tests/actions.at, tests/calc.at, tests/glr-regression.at:
11717 Don't start user-code symbols with "yy", to avoid name space problems.
11718
11719 2005-09-19 Akim Demaille <akim@epita.fr>
11720
11721 Remove the traits, failed experiment.
11722 It never proved useful, and anyway because of the current
11723 definition, it was not possible to have several specialization of
11724 this traits, making it useless.
11725 * data/lalr1.cc (yy:traits): Remove.
11726 Inline its definitions in the parser class.
11727
11728 2005-09-19 Akim Demaille <akim@epita.fr>
11729
11730 * tests/atlocal.in (LIBS): Pass INTLLIBS to address failures on at
11731 least Mac OSX with a /usr/local install of gettext.
11732
11733 2005-09-19 Akim Demaille <akim@epita.fr>
11734
11735 * data/lalr1.cc (yyparse): Rename yylooka and yyilooka as yychar
11736 and yytoken for similarity with the other skeletons.
11737
11738 2005-09-19 Akim Demaille <akim@epita.fr>
11739
11740 * NEWS, configure.ac: update version number to 2.1a.
11741
11742 2005-09-16 Paul Eggert <eggert@cs.ucla.edu>
11743
11744 * NEWS: Version 2.1.
11745
11746 * NEWS: Remove notice of yytname change, since it was never in an
11747 official release.
11748 * data/glr.c (yydestroyGLRState): Rename local var to avoid shadowing
11749 diagnostic.
11750 * src/output.c (prepare): Likewise.
11751 * data/lalr1.cc (YYERROR_VERBOSE_IF): New macro.
11752 (yysyntax_error_): Use it to avoid GCC warning when YYERROR_VERBOSE
11753 is not defined. This is an awful hack, but it's enough for now.
11754 All callers changed.
11755 * tests/glr-regression-at (make_value): Args are const pointers now,
11756 to avoid GCC warning.
11757 (Duplicated user destructor for lookahead): New test. Currently
11758 skipped. It fails on my host but I'm not sure it'll always fail.
11759
11760 2005-09-16 Akim Demaille <akim@epita.fr>
11761
11762 * src/symtab.h (struct symbol): Declare the printer and destructor
11763 as const, to avoid accidental calls to free.
11764 (symbol_destructor_set, symbol_printer_set): Adjust.
11765 * src/symtab.c: Adjust.
11766
11767 2005-09-16 Akim Demaille <akim@epita.fr>
11768
11769 * data/c.m4 (b4_token_enums): New.
11770 (b4_token_defines): Rename as...
11771 (b4_token_enums_defines): this.
11772 (b4_token_defines): New, output only the #defines.
11773 * data/yacc.c, data/glr.c: Adjust.
11774 * data/lalr1.cc: Use b4_token_enums instead of b4_token_enums_defines.
11775 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Define
11776 as default values.
11777
11778 2005-09-16 Akim Demaille <akim@epita.fr>
11779
11780 * data/lalr1.cc (yylex_): Remove, inline its code.
11781 (yyreport_syntax_error_): Remove, replaced by...
11782 (yysyntax_error_): this which returns a string and leaves to the
11783 caller the call to the users' error function.
11784 (yylooka_, yyilooka_, yylval, yylloc, yyerror_range_, yyval, yyloc):
11785 Move from members of the parser object...
11786 (yylooka, yyilooka, yylval, yylloc, yyerror_range, yyval, yyloc):
11787 to local variables of the parse function.
11788
11789 2005-09-16 Akim Demaille <akim@epita.fr>
11790
11791 * doc/bison.texinfo (Calc++ Parser): Don't promote defining YYEOF
11792 since it's in Bison's name space.
11793
11794 2005-09-15 Paul Eggert <eggert@cs.ucla.edu>
11795
11796 * data/glr.c (yyresolveValue): Add default case to pacify
11797 gcc -Wswitch-default. Problem reported by twlevo@xs4all.nl.
11798
11799 * NEWS: Document when yyparse started to return 2.
11800 * doc/bison.texinfo (Parser Function): Document when yyparse
11801 returns 2.
11802
11803 * data/lalr1.cc: Revert part of previous change, as it's incompatible.
11804 (b4_filename_type): Renamed back from b4_file_name_type. All uses
11805 changed.
11806 (class position): file_name -> filename (reverting). All uses changed.
11807
11808 2005-09-14 Paul Eggert <eggert@cs.ucla.edu>
11809
11810 * examples/calc++/Makefile.am ($(calc_sources_generated)): Don't
11811 do anything if $@ exists. This reverts part of the 2005-07-07
11812 patch.
11813
11814 2005-09-11 Paul Eggert <eggert@cs.ucla.edu>
11815
11816 * Makefile.am (EXTRA_DIST): Do not distribute REFERENCES; it
11817 contains obsolete information and isn't worth distributing as a
11818 separate file anyway.
11819 * data/glr.c [defined YYSETJMP]: Don't include <setjmp.h>.
11820 (YYJMP_BUF, YYSETJMP, YYLONGJMP) [!defined YYSETJMP]: New macros.
11821 All uses of jmp_buf, setjmp, longjmp changed to use these instead.
11822 (yyparse): Abort if user code uses longjmp to throw an unexpected
11823 value.
11824
11825 2005-09-09 Paul Eggert <eggert@cs.ucla.edu>
11826
11827 * data/c.m4 (b4_identification): Define YYBISON_VERSION.
11828 Suggested by twlevo@xs4all.nl.
11829
11830 * data/glr.c (YYCHK1): Do not assume YYE is in range.
11831 This avoids a diagnostic from gcc -Wswitch-enum.
11832 Problem reported by twlevo@xs4all.nl.
11833
11834 * doc/bison.texinfo: Don't use "filename", as per GNU coding
11835 standards. Use "file name" or "file" or "name", depending on
11836 the context.
11837 (Invocation): The output of "bison hack/foo.y" goes to foo.tab.c,
11838 not to hack/foo.tab.c.
11839 (Calc++ Top Level): 2nd arg of main is not const.
11840 * data/glr.c: b4_filename -> b4_file_name.
11841 * data/lalr1.cc: Likewise. Also, b4_filename_type -> b4_file_name_type.
11842 All uses changed.
11843 (class position): filename -> file_name. All uses changed.
11844 * data/yacc.c: b4_filename -> b4_file_name.
11845 * lib/bitset.h: filename -> file_name in local vars.
11846 * lib/bitset_stats.c: Likewise.
11847 * src/files.c: Likewise.
11848 * src/scan-skel.l ("@output ".*\n): Likewise.
11849 * src/files.c (file_name_split): Renamed from filename_split.
11850 * src/muscle_tab.c (muscle_init): Output b4_file_name, not b4_filename.
11851
11852 2005-09-08 Paul Eggert <eggert@cs.ucla.edu>
11853
11854 * lib/.cvsignore: Add pipe-safer.c, stdio--.h, unistd--.h,
11855 to accommodate latest gnulib.
11856
11857 * tests/glr-regression.at (Duplicate representation of merged trees):
11858 Add casts to pacify g++. Problem reported by twlevo@xs4all.nl.
11859
11860 * bootstrap: Add comment as to why the AM_LANGINFO_CODESET hack is
11861 needed.
11862
11863 2005-08-26 Paul Eggert <eggert@cs.ucla.edu>
11864
11865 * data/glr.c (yydestroyGLRState): Renamed from yydestroyStackItem.
11866 All uses changed. Invoke user destructor after an error during a
11867 split parse (trivial change from Joel E. Denny).
11868
11869 * tests/glr-regression.at
11870 (User destructor after an error during a split parse): New test case.
11871 Problem reported by Joel E. Denny in:
11872 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00029.html
11873
11874 2005-08-25 Paul Eggert <eggert@cs.ucla.edu>
11875
11876 * README-cvs: Give URLs for recommended tools.
11877 Mention Gzip version problem, and bootstrapping issues.
11878 Remove troubleshooting section, as it's somewhat obsolete.
11879
11880 * bootstrap (no_cache): New var, to accommodate different wget
11881 variants. Use it instead of '-C off'. Problem reported by
11882 twlevo@xs4all.nl.
11883
11884 * data/glr.c (yydestroyStackItem): New function.
11885 (yyrecoverSyntaxError, yyreturn): Use it to improve quality of
11886 debugging information. Problem reported by Joel E. Denny.
11887
11888 2005-08-25 Akim Demaille <akim@epita.fr>
11889
11890 * tests/local.at (AT_COMPILE_CXX): Pass $LINKS too.
11891
11892 2005-08-24 Paul Eggert <eggert@cs.ucla.edu>
11893
11894 * data/glr.c (yyrecoverSyntaxError, yyreturn):
11895 Don't invoke destructor on unresolved entries.
11896 * tests/glr-regression.at
11897 (User destructor for unresolved GLR semantic value): New test case.
11898 Problem reported by Joel E. Denny in:
11899 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00016.html
11900
11901 2005-08-21 Paul Eggert <eggert@cs.ucla.edu>
11902
11903 * lib/.cvsignore: Remove realloc.c, strncasecmp.c, xstrdup.c.
11904 Add strnlen.c.
11905 * m4/.cvsignore: Remove codeset.m4, gettext.m4, lib-ld.m4,
11906 lib-prefix.m4, po.m4.
11907
11908 * data/glr.c (yyreturn): Use "Cleanup:" rather than "Error:"
11909 in yydestruct diagnostic, since it might not be an error.
11910 Problem reported by Joel Denny near end of
11911 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
11912 * data/lalr1.cc (yyerturn): Likewise.
11913 * data/yacc.c (yyreturn): Likewise.
11914 * tests/calc.at (_AT_CHECK_CALC_ERROR): Adjust to the above change.
11915
11916 * src/files.c: Remove obsolete FIXME comment.
11917
11918 * data/glr.c (YY_SYMBOL_PRINT): Append a newline, for consistency
11919 with the other templates, and to fix bogus run-on messages such
11920 as the one reported at the end of
11921 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
11922 All callers changed to avoid the newline.
11923 (yyprocessOneStack): Output two lines rather than one, to accommodate
11924 the above change. This changes the debug output format slightly.
11925
11926 * data/glr.c (yyresolveValue): Fix redundant parse tree problem
11927 reported by Joel E. Denny in
11928 <http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00004.html>
11929 (trivial change).
11930 * tests/glr-regression.at (Duplicate representation of merged trees):
11931 New test, from Joel E. Denny in:
11932 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00013.html>.
11933 * THANKS: Add Joel E. Denny.
11934
11935 * configure.ac (AC_INIT): Bump to 2.0c.
11936
11937 2005-07-24 Paul Eggert <eggert@cs.ucla.edu>
11938
11939 * NEWS: Version 2.0b.
11940
11941 * Makefile.am (SUBDIRS): Put examples before tests, so that
11942 "make check" doesn't finish with "All 1 tests passed".
11943
11944 * tests/regression.at (Token definitions): Don't rely on
11945 AT_PARSER_CHECK for data that contains backslashes. It currently
11946 uses 'echo', and 'echo' isn't portable if its argument contains
11947 backslashes. Problem found on OpenBSD 3.4. Also, do not assume
11948 that the byte '\0xff' is not printable in the C locale; it is,
11949 under OpenBSD 3.4 (!). Luckily, '\0x80' through '\0x9e' are
11950 not printable, so use '\0x81' to test.
11951
11952 * data/glr.c (YYOPTIONAL_LOC): Define even if it's not a recent
11953 version of GCC, since the macro is used with non-GCC compilers.
11954
11955 Fix core dump reported by Pablo De Napoli in
11956 <http://lists.gnu.org/archive/html/bug-bison/2005-07/msg00053.html>.
11957 * tests/regression.at (Invalid inputs with {}): New test.
11958 * src/parse-gram.y (token_name): Translate type before using
11959 it as an index.
11960
11961 * data/glr.c (ATTRIBUTE_UNUSED): Remove, since it infringes on
11962 the user's name space. All uses changed to __attribute__
11963 ((__unused__)).
11964 (yyFail, yyMemoryExhausted, yyreportAmbiguity):
11965 Add __attribute__ ((__noreturn__)).
11966
11967 * etc/clcommit: Remove. We weren't using it, and it failed
11968 "make maintainer-distcheck".
11969 * Makefile.maint: Merge from coreutils.
11970 (CVS_LIST, CVS_LIST_EXCEPT): New macros.
11971 (syntax-check-rules): Change list of rules as described below.
11972 (sc_cast_of_alloca_return_value, sc_dd_max_sym_length):
11973 (sc_file_system, sc_obsolete_symbols, sc_prohibit_atoi_atof):
11974 (sc_prohibit_jm_in_m4, sc_root_tests, sc_tight_scope):
11975 (sc_trailing_space): New rules.
11976 (sc_xalloc_h_in_src): Remove.
11977 (sc_cast_of_argument_to_free, sc_cast_of_x_alloc_return_value):
11978 (sc_space_tab, sc_error_exit_success, sc_changelog):
11979 (sc_system_h_headers, sc_sun_os_names, sc_unmarked_diagnostics):
11980 (makefile-check, po-check, author_mark_check):
11981 (makefile_path_separator_check, copyright-check):
11982 Use grep -n, to make it easier to find violations.
11983 Use CVS_LIST and CVS_LIST_EXCEPT.
11984 (header_regexp, h_re): Remove.
11985 (dd_c): New macro.
11986 (sc_dd_max_sym_length, .re-list, news-date-check): New rules.
11987 (my-distcheck): Use more-modern GCC flags.
11988 (signatures, %.asc): Remove.
11989 (rel-files, announcement): Remove signatures.
11990 Restore old updating code, even though we don't use it, so
11991 that we're the same as coreutils.
11992 (alpha, beta, major): Depend on news-date-check.
11993 Make the upload commands.
11994
11995 * data/c.m4, data/lalr1.cc, data/yacc.c: Normalize white space.
11996 * lib/abitset.h, lib/bbitset.h, lib/bitset.h: Likewise.
11997 * lib/bitset_stats.c, lib/ebitset.h, lib/lbitset.c: Likewise.
11998 * lib/libitset.h, lib/timevar.c, lib/vbitset.h: Likewise.
11999 * src/Makefile.am, src/gram.c, src/muscle_tab.h: Likewise.
12000 * src/parse-gram.y, src/system.h, src/tables.c, src/vcg.c: Likewise.
12001 * src/vcg_defaults.h, tests/cxx-type.at, tests/existing.at: Likewise.
12002 * tests/sets.at: Likewise.
12003
12004 * data/m4sugar/m4sugar.m4: Sync from Autoconf, except that
12005 we comment out the Autoconf version number.
12006 * doc/bison.texinfo (Calc++ Scanner): Don't use atoi, as
12007 it's error-prone and "make maintainer-distcheck" rejects it.
12008
12009 * lib/subpipe.c: Include <fcntl.h> without checking for HAVE_FCNTL_H.
12010 Indent calls to "error" to pacify "make maintainer-distcheck",
12011 when the calls are not intended to be translated.
12012 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't check for fcntl.h.
12013
12014 * src/Makefile.am (DEFS): Use +=, to pacify
12015 "make maintainer-distcheck".
12016 (bison_SOURCES): Add scan-skel.h.
12017 (sc_tight_scope): New rule, from coreutils.
12018
12019 * src/files.c (src_extension, header_extension):
12020 Now static, not extern.
12021 * src/getargs.c (short_options): Likewise.
12022 * src/muscle_tab.c (muscle_table): Likewise.
12023 * src/parse-gram.y (current_class, current_type, current_prec):
12024 Likewise.
12025 * src/reader.c (grammar_end, previous_rule_end): Likewise.
12026 * src/getargs.h: Redo comments to pacify "make maintainer-distcheck".
12027 * src/main.c (main): Cast bindtextdomain and textdomain calls to
12028 void, to avoid warning when NLS is disabled.
12029 * src/output.c: Include scan-skel.h.
12030 (scan_skel): Remove decl, since scan-skel.h does this.
12031 (output_skeleton):
12032 Indent calls to "error" to pacify "make maintainer-distcheck".
12033 * src/print_graph.c: Don't include <obstack.h>, as system.h does this.
12034 * src/reader.h (gram_end, gram_lineno): New decls to pacify
12035 "make maintainer-distcheck".
12036 * src/scan-skel.l (skel_lex, skel_get_lineno, skel_get_in):
12037 (skel_get_out, skel_get_leng, skel_get_text, skel_set_lineno):
12038 (skel_set_in, skel_set_out, skel_get_debug, skel_set_debug):
12039 (skel_lex_destroy, scan_skel): Move these decls to...
12040 * src/scan-skel.h: New file.
12041 * src/uniqstr.c (uniqstr_assert):
12042 Indent calls to "error" to pacify "make maintainer-distcheck".
12043
12044 * tests/Makefile.am ($(srcdir)/package.m4): Use $(VAR),
12045 not @VAR@.
12046
12047 * tests/torture.at: Revamp to avoid misuse of atoi that
12048 "make maintainer-distcheck" complained about.
12049
12050 * examples/extexi (message): Don't print a message more than once,
12051 and omit line-number decoration that makes Emacs compile think
12052 that informative messages are worth worrying about.
12053
12054 2005-07-22 Paul Eggert <eggert@cs.ucla.edu>
12055
12056 * configure.ac: Update version number.
12057
12058 * Makefile.am (SUBDIRS): Add examples; somehow this got removed
12059 accidentally.
12060 * examples/calc++/calc++-parser.yy: Remove from CVS, as it's
12061 autogenerated by the maintainer.
12062 * examples/calc++/.cvsignore: Add *.yy.
12063
12064 * lib/bitset.c (bitset_alloc): Don't cast xcalloc result.
12065 * lib/bitset_stats.c (bitset_stats_init): Likewise.
12066 * lib/bitsetv.c (bitsetv_alloc): Likewise.
12067
12068 * po/POTFILES.in: Add lib/xalloc-die.c; remove lib/xmalloc.c.
12069
12070 * src/relation.c (relation_transpose): Rewrite to avoid bogus complaint
12071 from maintainer-distcheck about casting the argument of 'free'.
12072
12073 * NEWS: Mention recent yytname changes.
12074 * THANKS: Add Anthony Heading, twlevo@xs4all.nl.
12075
12076 * bootstrap: For translations that have not yet been upgraded to
12077 the new runtime-po domain, prime the pump by extracting the
12078 relevant strings from the obsolete translations. This code can be
12079 removed once the bison-runtime domain has been translated by each
12080 team.
12081
12082 * src/scan-gram.l (<SC_PRE_CODE>.): Don't double-quote token names,
12083 now that token names are already quoted.
12084
12085 Fix problem reported by Anthony Heading.
12086 * data/glr.c (YYTOKEN_TABLE): New macro.
12087 (yytname): Define if YYTOKEN_TABLE.
12088 * data/yacc.c (YYTOKEN_TABLE, yytname): Likewise.
12089 * data/lalr1.cc (YYTOKEN_TABLE, yytname_): Likewise.
12090 (YYERROR_VERBOSE): Define the same way the other skeletons do.
12091 * src/output.c (prepare_symbols): Output token_table_flag.
12092
12093 2005-07-21 Paul Eggert <eggert@cs.ucla.edu>
12094
12095 * data/glr.c (yyinitGLRStack, yyreturn): Don't call malloc
12096 again if the first call fails.
12097
12098 * data/glr.c (yytnamerr): New function.
12099 (yyreportSyntaxError): Use it to dequote most string literals.
12100 * data/lalr1.c (yytname_): Renamed from yyname_, for compatibility
12101 with other skeletons. All uses changed.
12102 (yytnameerr_): New function.
12103 (yyreport_syntax_error): Use it to dequote most string literals.
12104 * data/yacc.c (yytnamerr): New function.
12105 (yyerrlab): Use it to decode most string literals.
12106 * doc/bison.texinfo (Decl Summary, Calling Convention):
12107 Clarify quoting convention of yytname.
12108 * src/output.c (prepare_symbols): Quote all names. This undoes
12109 the 2005-04-17 change, which is now accomplished (mostly) via
12110 changes in the parsers as described above.
12111 * tests/regression.at (Token definitions, Web2c Actions):
12112 Undo most 2005-04-17 change here, too.
12113
12114 2005-07-20 Paul Eggert <eggert@cs.ucla.edu>
12115
12116 Fix more problems reported by twlevo@xs4all.nl.
12117 * tests/cxx-type.at: Don't pipe output of ./types through sed to
12118 remove trailing spaces. This loses the exit status of ./types,
12119 and isn't needed since ./types shouldn't be emitting trailing
12120 spaces.
12121 * data/glr.c (yyreturn): Don't pop stack if yyinitStateSet failed,
12122 as the stack isn't valid in that case.
12123
12124 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
12125 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
12126 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
12127 Add declarations to pacify "gcc -Wmissing-prototypes" when flex 2.5.31
12128 is used.
12129 * src/scan-skel.l (skel_get_lineno, skel_get_in, skel_get_out):
12130 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
12131 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
12132 Likewise.
12133
12134 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Work even with
12135 overly-picky compilers that reject 'char *foo = "bar";'.
12136
12137 * src/symtab.c (SYMBOL_ATTR_PRINT, symbol_print): Direct output
12138 to FILE * parameter, not to stderr. This fixes a typo introduced
12139 in the 2005-07-12 change.
12140
12141 * lib/subpipe.c (create_subpipe): Rewrite slightly to avoid
12142 warnings from GCC 4.
12143
12144 * data/glr.c (yyexpandGLRStack, yyaddDeferredAction, yyexpandGLRStack):
12145 (yyglrShiftDefer, yysplitStack):
12146 Remove unused parameters b4_pure_formals. All uses changed.
12147 (yyglrShift): Remove unused parameters b4_user_formals.
12148 All uses changed.
12149 (yyglrReduce): Removed unused parameter yylocp. All uses changed.
12150
12151 2005-07-18 Paul Eggert <eggert@cs.ucla.edu>
12152
12153 Destructor cleanups and regularization among the three skeletons.
12154 * NEWS: Document the behavior changes.
12155 * data/glr.c (yyrecoverSyntaxError): Don't bother to pop the
12156 stack before failing, as the cleanup code will do it for us now.
12157 * data/lalr1.cc (yyerrlab): Likewise.
12158 * data/glr.c (yyparse): Pop everything off the stack before
12159 freeing it, so that destructors get called properly.
12160 * data/lalr1.cc (yyreturn): Likewise.
12161 * data/yacc.c (yyreturn): Pop and destroy the start symbol, too.
12162 This is more consistent.
12163 * doc/bison.texinfo (Destructor Decl): Mention more reasons
12164 why destructors might be called. 1.875 -> 2.1.
12165 (Destructor Decl, Decl Summary, Table of Symbols):
12166 Some English-language cleanups for %destructor.
12167 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
12168 Add output line for destructor of start symbol.
12169 * tests/calc.at (AT_CHECK_CALC): Add one to line counts,
12170 because of that same extra output line.
12171
12172 * NEWS: Document minor wording changes in diagnostics of
12173 Bison-generated parsers.
12174 * data/glr.c (yyMemoryExhausted): Renamed from yyStackOverflow.
12175 Remove unused formals. All uses changed.
12176 (yyreportAmbiguity): "ambiguity detected" -> "syntax is ambiguous".
12177 (yyparse): Rename yyoverflowlab to yyexhaustedlab.
12178 * data/yacc.c (yyparse): "parser stack overflow" -> "memory exhausted".
12179 Rename yyoverflowab to yyexhaustedlab.
12180 When memory exhaustion occurs during syntax-error reporting,
12181 report it separately rather than in a single diagnostic; this
12182 eases translation.
12183 * doc/bison.texinfo (Memory Management): Renamed from Stack Overflow.
12184 (Memory Exhausted): Renamed from Parser Stack Overflow.
12185 Revamp wording slightly to prefer "memory exhaustion".
12186 * tests/actions.at: "parser stack overflow" -> "memory exhausted".
12187
12188 * data/c.m4 (b4_yysymprint_generate): Use YYFPRINTF, not fprintf.
12189
12190 Add i18n support to the GLR skeleton. Partially fix the C++
12191 skeleton; a C++ expert needs to finish this. Remove debugging
12192 msgids; there's little point to having them translated, since they
12193 can be understood only by someone who can read the
12194 (English-language) source code.
12195
12196 Generate runtime-po/bison-runtime.pot automatically, so that we
12197 don't have to worry about garbage getting in that file. We'll
12198 make sure after the next official release that old msgids don't
12199 get lost. See
12200 <http://lists.gnu.org/archive/html/bison-patches/2005-07/msg00119.html>.
12201
12202 * runtime-po/Makefile.in.in, runtime-po/bison-runtime.pot: Remove.
12203 Now auto-generated.
12204 * PACKAGING: Don't claim that Gawk, GCC, Perl use this method yet.
12205 Fix typos in explanations of the runtime file.
12206 * bootstrap: Change gettext keyword from YYI18N to YY_.
12207 Use standard Makefile.in.in in runtime-po, since we'll arrange
12208 for backward-compatible bison-runtime.po files in a different way.
12209 * data/glr.c (YY_): New macro, from yacc.c.
12210 (yyuserAction, yyreportAmbiguity, yyreportSyntaxError, yyparse):
12211 Translate messages intended for users.
12212 (yyreportSyntaxError): Change "virtual memory" to "memory" to match
12213 the wording in the other skeletons. We don't know that the memory
12214 is virtual.
12215 * data/lalr1.cc (YY_): Renamed from _. All uses changed.
12216 Use same method that yacc.c uses.
12217 Don't translate debugging messages.
12218 (yy::yyreport_syntax_error): Put in a FIXME for the i18n stuff;
12219 it doesn't work (yet), and requires C++ expertise to fix.
12220 * data/yacc.c (YY_): Renamed from YY18N. All uses changed.
12221 Move defn to a more logical place, to be consistent with other
12222 skeletons.
12223 Don't translate debugging messages.
12224 Don't assume line numbers fit in unsigned int; use unsigned long fmts.
12225 * doc/bison.texinfo: Mention <libintl.h>. Change glibc cross reference
12226 to gettext cross reference. Add indexing terms. Mention YYENABLE_NLS.
12227 * runtime-po/POTFILES.in: Add data/glr.c, data/lalr1.cc.
12228
12229 Fix yyerror / yylex test glitches noted by twlevo@xs4all.nl.
12230 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Have yyerror return
12231 void, not int.
12232 * tests/glr-regression.at (Badly Collapsed GLR States):
12233 Likewise.
12234 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
12235 yylex should return 0 at EOF rather than aborting.
12236
12237 Improve tests for stack overflow in GLR parser.
12238 Problem reported by twlevo@xs4all.nl.
12239 * data/glr.c (struct yyGLRStack): Remove yyerrflag member.
12240 All uses removed.
12241 (yyStackOverflow): Just longjmp, but with value 2 so that caller
12242 can handle the problem.
12243 (YYCHK1): Use goto (a la yacc.c) rather than setting a flag.
12244 (yyparse): New local variable yyresult to record the result.
12245 Use result of setjmp to set it, rather than storing itinto
12246 struct.
12247 (yyDone): Remove label.
12248 (yyacceptlab, yyabortlab, yyoverflowlab, yyreturn): New labels,
12249 to mimic yacc.c. Do not discard lookahead if it's EOF (possible
12250 if YYABORT is used).
12251 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Exit with
12252 yyparse status; put status > 1 into diagnostic.
12253 Check that status==2 works.
12254 * tests/calc.at, tests/cxx-type.at, tests/glr-regression.at:
12255 Use exit status 3 for failure to open (which shouldn't happen).
12256
12257 2005-07-17 Paul Eggert <eggert@cs.ucla.edu>
12258
12259 * tests/conflicts.at (%nonassoc and eof): Don't exit with status
12260 1 on syntax error; just let yyparse do its thing.
12261 * tests/glr-regression.at (Badly Collapsed GLR States): Likewise.
12262 * tests/torture.at (AT_DATA_STACK_TORTURE): Likewise.
12263 (Exploding the Stack Size with Alloca):
12264 (Exploding the Stack Size with Malloc):
12265 Expect exit status 2, not 1, since the parser is supposed to blow
12266 its stack. Problem reported by twlevo@xs4all.nl.
12267
12268 * data/glr.c (yyparse): Don't assume that the initial calls
12269 to YYMALLOC succeed; in that case, yyparse incorrectly returned 0.
12270 Print a stack-overflow message and fail instead.
12271 Initialize the line-number information before creating the stack,
12272 so that the stack-overflow message can report line zero safely.
12273
12274 2005-07-14 Paul Eggert <eggert@cs.ucla.edu>
12275
12276 Fix problems reported by twlevo@xs4all.nl.
12277 * data/glr.c (YYSTACKEXPANDABLE): Don't define if already defined.
12278 (yyuserMerge): Provide a default case if b4_mergers is empty.
12279 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Define YYSTACKEXPANDABLE.
12280 * tests/glr-regression.at
12281 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
12282 Add casts to pacify C++ compilers.
12283 * tests/glr-regression.at (Improper merging of GLR delayed action
12284 sets): Declare yylex before using it.
12285 * tests/Makefile.am (maintainer-check-g++): Fix a stray
12286 $(GXX) that escaped the renaming of GXX to CXX. Remove bogus
12287 test for valgrind; valgrind is independent of g++.
12288 (maintainer-check-posix): Add _POSIX2_VERSION=200112, to check
12289 for compatibility with POSIX 1003.1-2001 (if running coreutils).
12290 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Port to stricter C++.
12291 Use a destructor, so that we can expand the stack. Change
12292 YYSTYPE to char * so that we can free it. Cast result of malloc.
12293
12294 2005-07-13 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
12295
12296 * data/glr.c (yyuserAction): Fix uninitialized variable that caused
12297 a valgrind failure. Problem reported by twlevo@xs4all.nl.
12298
12299 2005-07-13 Paul Eggert <eggert@cs.ucla.edu>
12300
12301 * PACKAGING: New file, suggested by Bruno Haible and taken from
12302 similar wording in gettext's PACKAGING file.
12303 * NEWS: Mention PACKAGING.
12304 * Makefile.am (EXTRA_DIST): Add PACKAGING.
12305
12306 2005-07-12 Paul Eggert <eggert@cs.ucla.edu>
12307
12308 * NEWS: Document recent i18n improvements.
12309 * bootstrap: Get runtime translations into runtime-po.
12310 Create runtime-po files automatically, if possible.
12311 * configure.ac: Invoke BISON_I18N, so that we eat our own dog food.
12312 * data/yacc.c: Rewrite inclusion of <libintl.h> so that ENABLE_NLS
12313 does not infringe on the user's name space.
12314 (YYENABLE_NLS): Renamed from ENABLE_BISON_NLS.
12315 * doc/bison.texinfo (Internationalization): Revamp the English
12316 and Texinfo syntax a bit, to try to make it clearer.
12317 (Bison Options, Option Cross Key): Mention --print-localedir.
12318 * m4/bison-i18n.m4 (BISON_I18N): Rename ENABLE_BISON_NLS to
12319 YYENABLE_NLS. Quote a bit more.
12320 * runtime-po/.cvsignore: New file.
12321 * runtime-po/Makefile.in.in (mostlyclean): Remove *.old.pot.
12322 * runtime-po/Rules-quot: Remove; now created by bootstrap.
12323 * runtime-po/quot.sed: Likewise.
12324 * runtime-po/boldquot.sed: Likewise.
12325 * runtime-po/en@quot.header: Likewise.
12326 * runtime-po/en@boldquot.header: Likewise.
12327 * runtime-po/insert-header.sin: Likewise.
12328 * runtime-po/remove-potcdate.sin: Likewise.
12329 * runtime-po/Makevars: Likewise.
12330 * runtime-po/LINGUAS: Likewise.
12331 * runtime-po/de.po: Likewise; we will rely on the translation project
12332 to maintain this, so "bootstrap" should get it.
12333 * src/getarg.c (PRINT_LOCALEDIR_OPTION): Let the C compiler determine
12334 its value.
12335 * src/main.c (main): Bind the bison-runtime domain, too.
12336
12337 2005-07-12 Bruno Haible <bruno@clisp.org>
12338
12339 * data/yacc.c: Include <libintl.h> when NLS is enabled.
12340 (YYI18N): Renamed from _. Use dgettext when NLS is enabled.
12341 * po/POTFILES.in: Remove autogenerated file src/parse-gram.c.
12342 * runtime-po: New directory.
12343 * runtime-po/Makefile.in.in: New file, copied from po/, with modified
12344 $(DOMAIN).pot-update rule, so that old messages are never dropped.
12345 * runtime-po/Rules-quot: New file, copied from po/.
12346 * runtime-po/quot.sed: Likewise.
12347 * runtime-po/boldquot.sed: Likewise.
12348 * runtime-po/en@quot.header: Likewise.
12349 * runtime-po/en@boldquot.header: Likewise.
12350 * runtime-po/insert-header.sin: Likewise.
12351 * runtime-po/remove-potcdate.sin: Likewise.
12352 * runtime-po/Makevars: New file.
12353 * runtime-po/POTFILES.in: New file.
12354 * runtime-po/LINGUAS: New file.
12355 * runtime-po/bison-runtime.pot: New file.
12356 * runtime-po/de.po: New file.
12357 * m4/bison.m4: New file.
12358 * Makefile.am (SUBDIRS): Add runtime-po.
12359 (aclocaldir, aclocal_DATA): New variables.
12360 * configure.ac: Add AC_CONFIG_FILES of runtime-po/Makefile.in.
12361 Define aclocaldir.
12362 * src/getargs.c (usage): Document --print-localedir option.
12363 (PRINT_LOCALEDIR_OPTION): New enum item.
12364 (long_options): Add --print-localedir option.
12365 (getargs): Handle --print-localedir option.
12366 * doc/bison.texinfo (Bison Parser): Remove paragraph about _().
12367 (Internationalization): New section.
12368
12369 2005-07-12 Akim Demaille <akim@epita.fr>
12370
12371 * src/symtab.h, src/symtab.c (symbol_print): Swap the arguments,
12372 for consistency with the rest of the code.
12373 * src/symlist.h, src/symlist.c (symbol_list_print): Ditto.
12374 Add separators.
12375
12376 2005-07-12 Akim Demaille <akim@epita.fr>
12377
12378 * src/parse-gram.y: Use %printer instead of YYPRINT.
12379
12380 2005-07-12 Akim Demaille <akim@epita.fr>
12381
12382 * src/symtab.h, src/symtab.c (symbol_print): New.
12383 * src/symlist.h, src/symlist.c (symbol_list_print): New.
12384 * src/symlist.c (symbol_list_n_type_name_get): Report the culprit.
12385
12386 2005-07-12 Akim Demaille <akim@epita.fr>
12387
12388 * data/glr.c (b4_syncline): Fix (swap) the definitions of
12389 b4_at_dollar and b4_dollar_dollar.
12390
12391 2005-07-11 Paul Eggert <eggert@cs.ucla.edu>
12392
12393 * doc/bison.texinfo (Mystery Conflicts): Add reference to DeRemer
12394 and Pennello's paper.
12395
12396 2005-07-09 Paul Eggert <eggert@cs.ucla.edu>
12397
12398 * data/yacc.c (yyparse): Undo previous patch. Instead,
12399 set yylsp[0] and yyvsp[0] only if the initial action
12400 sets yylloc and yylval, respectively.
12401
12402 * data/yacc.c (yyparse): In the initial action, set
12403 yylsp[0] and yyvsp[0] rather than yylloc and yylval.
12404 This avoids the use of undefined variables if the initial
12405 action does not set yylloc and/or yylval.
12406
12407 2005-07-07 Paul Eggert <eggert@cs.ucla.edu>
12408
12409 * examples/calc++/calc++-driver.cc, examples/calc++/calc++-driver.hh:
12410 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc:
12411 Remove from CVS. These files are automatically generated.
12412 * examples/extexi: Clarify that this file is now part of Bison,
12413 not GNU M4, and that it works with any POSIX-compatible Awk.
12414 * examples/calc++/Makefile.am (run_extexi): Remove; not used.
12415 ($(calc_extracted)): Renamed from $(calc_sources_extracted),
12416 so that we also get calc++-parser.yy. Geneate it.
12417 Use $(AWK), not gawk, since any conforming Awk will do.
12418 Put comment before action, since older 'make' can't handle comment
12419 in action.
12420 $(BUILT_SOURCES): List all built sources, not just some of them.
12421 $(MAINTAINERCLEANFILES): Remove *.stamp, and all built sources.
12422 $($(srcdir)/calc++-parser.stamp): Work even if POSIXLY_CORRECT.
12423 $($(calc_sources_generated)): Remove unnecessary test for existence
12424 of target. (This had a shell syntax error anyway; a stray "x".)
12425 (calc_extracted): List $(srcdir)/calc++-parser.yy, not
12426 calc++-parser.yy.
12427 * examples/.cvsignore, examples/calc++/.cvsignore: New files.
12428
12429 * bootstrap (gnulib_modules): Add gettext, now that it's no longer
12430 implied by the other modules.
12431
12432 2005-07-06 Akim Demaille <akim@epita.fr>
12433
12434 Bind examples/calc++ to the package.
12435 * examples/calc++/Makefile: Remove, replaced by...
12436 * examples/calc++/Makefile.am: ... this new file.
12437 * examples/calc++/test: Remove input.
12438 * examples/calc++/compile: Remove.
12439 * examples/Makefile.am: New.
12440 * configure.ac, Makefile.am: Adjust.
12441 * doc/Makefile.am (clean-local): New, for more recent texi2dvis.
12442
12443 2005-07-05 Paul Eggert <eggert@cs.ucla.edu>
12444
12445 * data/glr.c (yyFail): Drastically simplify; since the format argument
12446 never had any % directives, we can simply pass it to yyerror.
12447 (yyparse): Use "t a; a=b;" rather than "t a = b;" when a will
12448 be modified later, as that is the usual style in glr.c.
12449 Problems reported by Paul Hilfinger.
12450
12451 Rewrite GLR parser to catch more buffer overrun, storage exhaustion,
12452 and size overflow errors.
12453 * data/glr.c: Include <stdio.h> etc. after user prolog, not before,
12454 in case the user prolog sets feature-test macros like _GNU_SOURCE.
12455 (YYSIZEMAX): New macro.
12456 (yystpcpy): New function, taken from yacc.c.
12457 (struct yyGLRStack.yyspaceLeft): Now size_t, not int.
12458 (yyinitGLRStack, yyfreeGLRstack): Remove unnecessary forward decls,
12459 so that we don't have to maintain their signatures.
12460 (yyFail): Check for buffer overflow, by using vsnprintf rather
12461 than vsprintf. Allocate a bigger buffer if possible.
12462 Report an error if buffer allocation fails.
12463 (yyStackOverflow): New function.
12464 (yyinitStateSet, yyinitGLRStack): Return a boolean indicating whether
12465 the initialization was successful. It might fail if storage was
12466 exhausted.
12467 (yyexpandGLRStack): Add more checks for storage allocation failure.
12468 Use yyStackOverflow to report failures.
12469 (yymarkStackDeleted, yyglrShift, yyglrShiftDefer, yydoAction):
12470 (yysplitStack, yyprocessOneStack, yyparse, yypstack):
12471 Don't assume stack number fits in int.
12472 (yysplitStack): Check for storage allocation failure.
12473 (yysplitStack, yyprocessOneStack): Add pure_formals, so that we
12474 can print diagnostics on storage allocation failure. All callers
12475 changed.
12476 (yyresolveValue): Use yybool for boolean.
12477 (yyreportSyntaxError): Check for size-calculation overflow.
12478 This code is taken from yacc.c.
12479 (yyparse): Check for storage allocation errors when allocating
12480 the initial stack.
12481
12482 2005-07-05 Akim Demaille <akim@epita.fr>
12483
12484 Extract calc++ from the documentation.
12485 * doc/bison.texinfo (Calc++): Add the extraction marks.
12486 * examples/extexi: New, from the aborted GNU Programming 2E.
12487 Separate the different paragraph of a file with empty lines.
12488 * examples/Makefile: Use it to extract the whole calc++ example.
12489
12490 2005-06-24 Akim Demaille <akim@epita.fr>
12491
12492 * doc/bison.texinfo (C++ Parser Interface): Use defcv to define
12493 class typedefs.
12494
12495 2005-06-22 Akim Demaille <akim@epita.fr>
12496
12497 * doc/bison.texinfo (C++ Language Interface): First stab.
12498 (C++ Parsers): Remove.
12499
12500 2005-06-22 Akim Demaille <akim@epita.fr>
12501
12502 * data/lalr1.cc (yylex_): Honor %lex-param.
12503
12504 2005-06-22 Akim Demaille <akim@epita.fr>
12505
12506 Start a set of simple examples.
12507 * examples/calc++/Makefile, examples/calc++/calc++-driver.cc,
12508 * examples/calc++/calc++-driver.hh,
12509 * examples/calc++/calc++-parser.yy,
12510 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc,
12511 * examples/calc++/compile, examples/calc++/test: New.
12512
12513 2005-06-09 Paul Eggert <eggert@cs.ucla.edu>
12514
12515 * data/yacc.c (malloc, free) [defined __cplusplus]: Wrap inside
12516 extern "C" {}. This fixes a problem reported by Paul Hilfinger,
12517 which stems from the 2005-05-27 patch.
12518
12519 2005-06-06 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
12520
12521 * data/glr.c: Modify treatment of unused parameters to permit use
12522 of g++ (which doesn't allow __attribute__ ((unused)) for parameters).
12523
12524 2005-05-30 Paul Eggert <eggert@cs.ucla.edu>
12525
12526 Fix infringement on user name space reported by Janos Zoltan Szabo.
12527 * data/yacc.c (yyparse): strlen -> yystrlen.
12528
12529 2005-05-30 Akim Demaille <akim@epita.fr>
12530
12531 * data/lalr1.cc (_): New.
12532 Translate the various messages.
12533
12534 2005-05-27 Paul Eggert <eggert@cs.ucla.edu>
12535
12536 Fix infringement on user name space reported by Bruno Haible.
12537 * data/yacc.c (YYSIZE_T): Define first, so that later decls can use it.
12538 Prefer GCC's __SIZE_TYPE__ if available, so that we don't infringe on
12539 the user's name space.
12540 (alloca): Include <stdlib.h> to get it, if it's not built in.
12541 (YYMALLOC, YYFREE): Define only if needed.
12542 (malloc, free): Declare, but only if needed, as this infringes on
12543 the user name space.
12544
12545 2005-05-25 Paul Eggert <eggert@cs.ucla.edu>
12546
12547 Fix BeOS, FreeBSD, MacOS porting problems reported by Bruno Haible.
12548 * lib/bitset.c (bitset_print): Don't assume size_t can be printed
12549 with %d format.
12550 * lib/ebitset.c (min, max): Undef before defining.
12551 * lib/vbitset.c (min, max): Likewise.
12552 * lib/subpipe.c (create_subpipe): Save local variables in case
12553 vfork clobbers them.
12554
12555 2005-05-24 Bruno Haible <bruno@clisp.org>
12556
12557 * tests/synclines.at (AT_SYNCLINES_COMPILE): Add support for the
12558 error message syntax used by gcc-4.0.
12559
12560 2005-05-23 Paul Eggert <eggert@cs.ucla.edu>
12561
12562 * README: Mention m4 1.4.3. Remove obsolete advice about
12563 Sun Forte Developer 6 update 2, VMS, and MS-DOS.
12564
12565 * bootstrap: Remove workaround for problem I encountered with
12566 gettext 0.14.1; it seems to be fixed now.
12567
12568 2005-05-22 Paul Eggert <eggert@cs.ucla.edu>
12569
12570 * NEWS: Version 2.0a.
12571
12572 * src/files.c: Include "stdio-safer.h"; this fixes a typo in
12573 the previous change.
12574
12575 Various maintainer cleanups.
12576 * .cvsignore: Add a.exe, a.out, b.out,, conf[0-9]*, confdefs*,
12577 conftest*, for benefit of CVS commands run at the same time as
12578 "configure". Add build-aux, since "bootstrap" now creates it and
12579 its subfiles.
12580 * Makefile.cfg (move_if_change): Remove.
12581 * Makefile.maint: Remove the update stuff; we now use "bootstrap".
12582 (ftp-gnu, www-gnu, move_if_change, local_updates, update):
12583 (po_repo, do-po-update, po-update, wget_files, get-targets):
12584 (config.guess-url_prefix, config.sub-url_prefix):
12585 (ansi2knr.c-url_prefix, texinfo.tex-url_prefix):
12586 (standards.texi-url_prefix, make-stds.texi-url_prefix, taget, url):
12587 ($(get-targets), cvs-files, automake_repo, wget-update, cvs-update):
12588 Remove.
12589 * configure.ac (AC_CONFIG_AUX_DIR): Change from config to build-aux;
12590 this is now the recommended name.
12591 * config/.cvsignore: Remove config.guess, config.rpath, config.sub,
12592 depcomp, install-sh, mdate-sh, missing, mkinstalldirs, texinfo.tex,
12593 ylwrap. These files now go into build-aux.
12594 * config/move-if-change: Remove.
12595 * config/prev-version.txt: Bump from 1.75 to 2.0.
12596
12597 * bootstrap: Add stdio-safer, unistd-safer modules.
12598 Remove m4/glibc2.m4 (introduced by latest gnulib, but
12599 we don't need it).
12600 * lib/.cvsignore: Add dup-safer.c, fd-safer.c,
12601 fopen-safer.c, stdio-safer.h, unistd-safer.h.
12602 * lib/subpipe.c: Include "unistd-safer.h".
12603 (create_subpipe): Make sure all the newly-created
12604 file descriptors are > 2, so that diagnostics don't
12605 get sent down them (which might cause Bison to hang, in theory).
12606 * m4/.cvsignore: Add stdio-safer.m4, unistd-safer.m4.
12607 * src/files.c (xfopen): Use fopen_safer, not fopen.
12608
12609 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Port
12610 yesterday's yacc.c fix.
12611
12612 2005-05-21 Paul Eggert <eggert@cs.ucla.edu>
12613
12614 * data/glr.c, data/lalr1.cc: Update copyright date.
12615
12616 Fix a destructor bug reported by Wolfgang Spraul in
12617 <http://lists.gnu.org/archive/html/bug-bison/2005-05/msg00042.html>.
12618 * data/yacc.c (yyabortlab): Don't call destructor, and
12619 don't set yychar to EMPTY.
12620 (yyoverflowlab): Don't call destructor.
12621 (yyreturn): Call destructor, if yychar is neither YYEOF nor YYEMPTY.
12622 * tests/calc.at (AT_CHECK_CALC): Expect one fewer output lines,
12623 since we no longer output the message "discarding lookahead token
12624 end of input ()".
12625
12626 2005-05-20 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
12627
12628 * data/glr.c (YY_SYMBOL_PRINT): Don't print newline at end to
12629 fix a small glitch in debugging output.
12630 (yyprocessOneStack, yyrecoverSyntaxError, yyparse): Print newline
12631 after YY_SYMBOL_PRINT where needed.
12632
12633 (struct yyGLRState): Add some comments.
12634 (struct yySemanticOption): Add some comments.
12635 (union yyGLRStackItem): Add comment.
12636
12637 (yymergeOptionSets): Correct this to properly perform the union,
12638 avoiding infinite reported by Michael Rosien.
12639 Update comment.
12640
12641 * tests/glr-regression.at: Add test for GLR merging error reported
12642 by M. Rosien.
12643
12644 2005-05-13 Paul Eggert <eggert@cs.ucla.edu>
12645
12646 * COPYING, ChangeLog, GNUmakefile, HACKING, Makefile.am,
12647 Makefile.cfg, Makefile.maint, NEWS, README, README-alpha,
12648 README-cvs, TODO, bootstrap, configure.ac, data/Makefile.am,
12649 data/README, data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c,
12650 data/m4sugar/m4sugar.m4, doc/Makefile.am, doc/bison.texinfo,
12651 doc/fdl.texi, doc/gpl.texi, doc/refcard.tex, lib/Makefile.am,
12652 lib/abitset.c, lib/abitset.h, lib/bbitset.h, lib/bitset.c,
12653 lib/bitset.h, lib/bitset_stats.c, lib/bitset_stats.h,
12654 lib/bitsetv-print.c, lib/bitsetv-print.h, lib/bitsetv.c,
12655 lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/get-errno.c,
12656 lib/get-errno.h, lib/lbitset.c, lib/lbitset.h, lib/libiberty.h,
12657 lib/main.c, lib/subpipe.c, lib/subpipe.h, lib/timevar.c,
12658 lib/timevar.def, lib/timevar.h, lib/vbitset.c, lib/vbitset.h,
12659 lib/yyerror.c, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4, m4/timevar.m4,
12660 m4/warning.m4, src/LR0.c, src/LR0.h, src/Makefile.am, src/assoc.c,
12661 src/assoc.h, src/closure.c, src/closure.h, src/complain.c,
12662 src/complain.h, src/conflicts.c, src/conflicts.h, src/derives.c,
12663 src/derives.h, src/files.c, src/files.h, src/getargs.c,
12664 src/getargs.h, src/gram.c, src/gram.h, src/lalr.c, src/lalr.h,
12665 src/location.c, src/location.h, src/main.c, src/muscle_tab.c,
12666 src/muscle_tab.h, src/nullable.c, src/nullable.h, src/output.c,
12667 src/output.h, src/parse-gram.c, src/parse-gram.h,
12668 src/parse-gram.y, src/print.c, src/print.h, src/print_graph.c,
12669 src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c,
12670 src/reduce.h, src/relation.c, src/relation.h, src/scan-gram.l,
12671 src/scan-skel.l, src/state.c, src/state.h, src/symlist.c,
12672 src/symlist.h, src/symtab.c, src/symtab.h, src/system.h,
12673 src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h,
12674 src/vcg.c, src/vcg.h, src/vcg_defaults.h, tests/Makefile.am,
12675 tests/actions.at, tests/c++.at, tests/calc.at, tests/conflicts.at,
12676 tests/cxx-type.at, tests/existing.at, tests/glr-regression.at,
12677 tests/headers.at, tests/input.at, tests/local.at, tests/output.at,
12678 tests/reduce.at, tests/regression.at, tests/sets.at,
12679 tests/synclines.at, tests/testsuite.at, tests/torture.at:
12680 Update FSF postal mail address.
12681
12682 2005-05-11 Paul Eggert <eggert@cs.ucla.edu>
12683
12684 * tests/local.at (AT_COMPILE_CXX): Treat LDFLAGS like AT_COMPILE does.
12685 Problem reported by Ralf Menzel.
12686
12687 2005-05-01 Paul Eggert <eggert@cs.ucla.edu>
12688
12689 * tests/actions.at: Test that stack overflow invokes destructors.
12690 From Marcus Holland-Moritz.
12691 * data/yacc.c (yyerrlab): Move the code that destroys the stack
12692 from here....
12693 (yyreturn): to here. That way, destructors are called properly
12694 even if the stack overflows, or the user calls YYACCEPT or
12695 YYABORT. Stack-overflow problem reported by Marcus Holland-Moritz.
12696 (yyoverflowlab): Destroy the lookahead.
12697
12698 2005-04-24 Paul Eggert <eggert@cs.ucla.edu>
12699
12700 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): Add more-descriptive comment.
12701
12702 2005-04-17 Paul Eggert <eggert@cs.ucla.edu>
12703
12704 * NEWS: Bison-generated C parsers no longer quote literal strings
12705 associated with tokens.
12706 * src/output.c (prepare_symbols): Don't escape strings,
12707 since users don't want to see C escapes.
12708 * tests/calc.at (AT_CHECK_CALC): Adjust to lack of quotes
12709 in diagnostics.
12710 * tests/input.at (Torturing the Scanner): Likewise.
12711 * tests/regression.at (Token definitions, Web2c Actions): Likewise.
12712
12713 2005-04-16 Paul Eggert <eggert@cs.ucla.edu>
12714
12715 * tests/torture.at (AT_INCREASE_DATA_SIZE): Skip the test if
12716 the data size is known to be too small and we can't increase it.
12717 This works around an HP-UX 11.00 glitch reported by Andrew Benham.
12718
12719 2005-04-15 Paul Eggert <eggert@cs.ucla.edu>
12720
12721 * src/parse-gram.y: Include quotearg.h.
12722 (string_as_id): Quote $1 before using it as a key, since the
12723 lexer no longer quotes it for us.
12724 (string_content): Don't strip quotes, since lexer no longer
12725 quotes it for us.
12726 * src/scan-gram.l: Include quotearg.h.
12727 ("\""): Omit quote.
12728 ("'"<SC_ESCAPED_CHARACTER>): Quote symbol before using it as
12729 a key, since the rest of the lexer doesn't quote it.
12730 * src/symtab.c (symbol_get): Don't quote symbol; caller does it now.
12731 * tests/regression.at (Token definitions): Check for backslashes
12732 in token strings.
12733
12734 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): New macro.
12735 (YYSIZE_T): Define to unsigned long int when using an older compiler.
12736 (yyparse): Revamp code to generate long syntax error message, to
12737 make it easier to translate, and to avoid problems with arithmetic
12738 overflow. Change "virtual memory" to "memory" in diagnostic, since
12739 we don't know whether the memory is virtual.
12740
12741 2005-04-13 Paul Eggert <eggert@cs.ucla.edu>
12742
12743 * NEWS: Bison-generated C parsers now use the _ macro to
12744 translate strings.
12745 * data/yacc.c (_) [!defined _]: New macro.
12746 All English strings wrapped inside this macro.
12747 * doc/bison.texinfo (Bison Parser): Document _.
12748 * po/POTFILES.in: Include src/parse-gram.c, since it now
12749 includes translateable strings that parse-gram.y doesn't.
12750
12751 2005-04-12 Paul Eggert <eggert@cs.ucla.edu>
12752
12753 * src/symtab.c (symbol_make_alias): Call symbol_type_set,
12754 reverting the 2004-10-11 change to this function.
12755 (symbol_check_alias_consistency): Don't call symbol_type_set
12756 if the type name is already correct.
12757 * tests/input.at (Typed symbol aliases): New test, from Tim Van Holder.
12758
12759 2005-03-25 Paul Eggert <eggert@cs.ucla.edu>
12760
12761 * tests/regression.at (Token definitions): Don't use a token named
12762 c, as that generates a "#define c ..." that runs afoul of buggy
12763 stdlib.h that uses the identifier c as a member of struct
12764 drand48_data. Problem reported by Horst Wente.
12765
12766 2005-03-21 Paul Eggert <eggert@cs.ucla.edu>
12767
12768 * bootstrap: Change translation URL from
12769 http://www2.iro.umontreal.ca/~gnutra/po/maint/bison/ to
12770 http://www.iro.umontreal.ca/translation/maint/bison/ to avoid
12771 redirection glitches. Problem reported by twlevo@xs4all.nl.
12772
12773 2005-03-20 Paul Eggert <eggert@cs.ucla.edu>
12774
12775 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Don't put options
12776 after operands; POSIX says this isn't portable for the c99 command.
12777
12778 2005-03-18 Paul Eggert <eggert@cs.ucla.edu>
12779
12780 * tests/glr-regression.at (glr-regr2a.y): Try to dump core
12781 immediately if a data overrun has occurred; this may help us track
12782 down what may be a spurious failure on MacOS.
12783
12784 2005-03-17 Paul Eggert <eggert@cs.ucla.edu>
12785
12786 Respond to problems reported by twlevo@xs4all.nl.
12787
12788 * bootstrap: Use "trap - 0" rather than the unportable "trap 0".
12789
12790 * src/vcg.h: Comment fix.
12791 * src/vcg_defaults.h: Parenthesize macro bodies to make them safe.
12792 (G_CMAX): Change to -1 instead of INT_MAX.
12793
12794 * data/yacc.c (yyparse): Omit spaces before #line.
12795
12796 2005-03-15 Paul Eggert <eggert@cs.ucla.edu>
12797
12798 * src/tables.c (state_number_to_vector_number): Put it inside an
12799 "#if 0", since it's not currently used. Problem reported by
12800 Roland McGrath.
12801
12802 2005-03-06 Paul Eggert <eggert@cs.ucla.edu>
12803
12804 * src/output.c (escaped_output): Renamed from
12805 escaped_file_name_output, since we now use it for symbol tags as
12806 well. All uses changed.
12807 (symbol_destructors_output, symbol_printers_output):
12808 Escape symbol tags too.
12809 Problem reported by Matyas Forstner in
12810 <http://lists.gnu.org/archive/html/bug-bison/2005-03/msg00009.html>.
12811
12812 * src/muscle_tab.c (muscle_code_grow): Don't quote numbers; it's
12813 not needed.
12814 * src/output.c (user_actions_output, token_definitions_output,
12815 symbol_destructors_output, symbol_printers_output): Likewise.
12816 * src/reader.c (prologue_augment): Likewise.
12817 * src/scan-gram.l (handle_action_dollar, handle_action_at): Likewise.
12818
12819 * src/vcg.c (output_edge): Don't quote linestyle arg.
12820 Problem reported by twlevo@xs4all.nl.
12821
12822 2005-02-28 Paul Eggert <eggert@cs.ucla.edu>
12823
12824 * doc/bison.texinfo (Semantic Tokens): Fix scoping problem in
12825 example, reported by Derek M Jones. Also, make the example even
12826 more outrageous, to better illustrate how bad the problem is.
12827
12828 2005-02-24 Paul Eggert <eggert@cs.ucla.edu>
12829
12830 * doc/bison.texinfo (Mfcalc Symtab): Correct the prototype for
12831 putsym. Typo reported by Sebastian Piping.
12832
12833 2005-02-23 Paul Eggert <eggert@cs.ucla.edu>
12834
12835 * doc/bison.texinfo (Language and Grammar): some -> same
12836 (Epilogue): int he -> in the
12837 Typos reported by Sebastian Piping via Justin Pence.
12838
12839 2005-02-07 Paul Eggert <eggert@cs.ucla.edu>
12840
12841 * tests/glr-regression.at (Improper handling of embedded actions
12842 and dollar(-N) in GLR parsers): Renamed from "Improper handling of
12843 embedded actions and $-N in GLR parsers", work around an Autoconf bug
12844 with dollar signs in test names.
12845 * tests/input.at (Invalid dollar-n): Renamed from "Invalid \$n",
12846 for a similar reason.
12847
12848 2005-01-28 Paul Eggert <eggert@cs.ucla.edu>
12849
12850 * src/vcg.c (output_graph): G_VIEW -> normal_view in case someone
12851 wants to redefine G_VIEW.
12852
12853 2005-01-27 Paul Eggert <eggert@cs.ucla.edu>
12854
12855 * src/vcg.c (get_view_str): Remove case for normal_view.
12856 Problem reported by twlevo@xs4all.nl.
12857
12858 2005-01-24 Paul Eggert <eggert@cs.ucla.edu>
12859
12860 * configure.ac (O0CFLAGS, O0CXXFLAGS): Fix quoting bug.
12861 Problem reported by twlevo@xs4all.nl.
12862
12863 * doc/bison.texinfo: Change @dircategory from "GNU programming
12864 tools" to "Software development". Requested by Richard Stallman
12865 via Karl Berry.
12866
12867 2005-01-23 Paul Eggert <eggert@cs.ucla.edu>
12868
12869 * tests/c++.at (AT_CHECK_DOXYGEN): Don't use options after operands.
12870 Problem reported by twlevo@xs4all.nl.
12871
12872 2005-01-21 Paul Eggert <eggert@cs.ucla.edu>
12873
12874 * data/yacc.c (YYCOPY, yystpcpy, yyparse): Remove "register"
12875 keyword; it's not needed with modern compilers, and it doesn't
12876 affect correctness with older compilers. Suggested by
12877 twlevo@xs4all.nl.
12878
12879 2005-01-17 Paul Eggert <eggert@cs.ucla.edu>
12880
12881 * data/glr.c (yyuserAction): Add "default: break;" case to pacify
12882 gcc -Wswitch-default.
12883 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
12884 * data/yacc.c (yyparse): Likewise.
12885
12886 2005-01-12 Paul Eggert <eggert@cs.ucla.edu>
12887
12888 * src/system.h (OUTPUT_EXT, TAB_EXT): Define only if not defined
12889 already. Let config.h define any nonstandard values.
12890
12891 2005-01-10 Paul Eggert <eggert@cs.ucla.edu>
12892
12893 * tests/calc.at (_AT_DATA_CALC_Y): Use alarm (100), not alarm (10),
12894 for the benefit of slower hosts. Problem reported by
12895 Nelson H. F. Beebe.
12896
12897 2005-01-07 Paul Eggert <eggert@cs.ucla.edu>
12898
12899 * data/yacc.c (yyparse): Pacify non-GCC compilers about yyerrorlab
12900 being defined and not used.
12901 * data/lalr1.cc (yyparse): Likewise.
12902 Use "if (false)" rather than "if (0)".
12903
12904 2005-01-05 Paul Eggert <eggert@cs.ucla.edu>
12905
12906 * TODO: Mention that we should allow NUL bytes in tokens.
12907
12908 2005-01-02 Paul Eggert <eggert@cs.ucla.edu>
12909
12910 * src/scan-skel.l (<<EOF>>): Don't close standard output.
12911 Problem reported by Hans Aberg.
12912
12913 2005-01-01 Paul Eggert <eggert@cs.ucla.edu>
12914
12915 * src/getargs.c (version): Happy new year; update overall
12916 program copyright date from 2004 to 2005.
12917
12918 * src/scan-skel.l ("@output ".*\n): Don't close standard output.
12919 Problem reported by Hans Aberg.
12920 * tests/output.at (AT_CHECK_OUTPUT): New arg SHELLIO.
12921 (Output file names.): Add a test for the case when standard output
12922 is closed.
12923
12924 2004-12-26 Paul Eggert <eggert@cs.ucla.edu>
12925
12926 * doc/bison.texinfo (@copying): Update FDL version number to 1.2,
12927 to fix an oversight in the Bison 2.0 manual.
12928
12929 2004-12-25 Paul Eggert <eggert@cs.ucla.edu>
12930
12931 * NEWS: Version 2.0. Reformat the existing news items since
12932 1.875, so that related items are grouped together.
12933 * configure.ac (AC_INIT): Bump version to 2.0.
12934 * src/parse-gram.c, src/parse-gram.h: Regenerate with 2.0.
12935
12936 * tests/torture.at (Exploding the Stack Size with Alloca): Set
12937 YYSTACK_USE_ALLOCA to 1 if __GNUC__ or alloca are defined;
12938 otherwise, we're not testing alloca. Unfortunately there's no
12939 simple way to consult HAVE_ALLOCA here.
12940
12941 * data/lalr1.cc (yydestruct_): Pacify unused variable warning
12942 for yymsg, too.
12943
12944 * src/LR0.c (new_itemsets): Use memset rather than zeroing by
12945 hand. This avoids a warning about comparing int to size_t when
12946 GCC warnings are enabled.
12947
12948 2004-12-22 Paul Eggert <eggert@cs.ucla.edu>
12949
12950 * NEWS: Bison-generated parsers no longer default to using the
12951 alloca function (when available) to extend the parser stack, due
12952 to widespread problems in unchecked stack-overflow detection.
12953 * data/glr.c (YYMAXDEPTH): Remove undef when zero. It's the user's
12954 responsibility to set it to a positive value. This lets the user
12955 specify a value that is not a preprocessor constant.
12956 * data/yacc.c (YYMAXDEPTH): Likewise.
12957 (YYSTACK_ALLOC): Define only if YYSTACK_USE_ALLOCA is nonzero.
12958 * doc/bison.texinfo (Stack Overflow): YYMAXDEPTH no longer needs
12959 to be a compile-time constant. However, explain the constraints on it.
12960 Also, explain the constraints on YYINITDEPTH.
12961 (Table of Symbols): Explain that alloca is no longer the default.
12962 Explain the user's responsibility if they define YYSTACK_USE_ALLOCA
12963 to 1.
12964
12965 * doc/bison.texinfo (Location Default Action): Mention that n must
12966 be zero when k is zero. Suggested by Frank Heckenbach.
12967
12968 2004-12-22 Akim Demaille <akim@epita.fr>
12969
12970 * data/lalr1.cc (parser::token_number_type, parser::rhs_number_type)
12971 (parser::state_type, parser::semantic_type, parser::location_type):
12972 Private, not public.
12973 (parser::parse): Return ints, not bool.
12974 Returning a bool introduces a problem: 0 corresponds to false, and
12975 it seems weird to return false on success. Returning true changes
12976 the conventions for yyparse.
12977 Alternatively we could return void and send an exception.
12978 There is no clear consensus (yet?).
12979 (state_stack, semantic_stack, location_stack): Rename as...
12980 (state_stack_type, semantic_stack_type, location_stack_type): these.
12981 Private, not public.
12982 * tests/c++.at: New.
12983 * tests/testsuite.at, tests/Makefile.am: Adjust.
12984
12985 2004-12-21 Akim Demaille <akim@epita.fr>
12986
12987 * data/lalr1.cc (parser::parse): Return a bool instead of an int.
12988
12989 2004-12-21 Akim Demaille <akim@epita.fr>
12990
12991 Don't impose std::string for filenames.
12992
12993 * data/lalr1.cc (b4_filename_type): New.
12994 (position::filename): Use it.
12995 (parser.hh): Move the inclusion of stack.hh and location.hh below
12996 the user code, so that needed headers for the filename type can be
12997 included first.
12998 Forward declare them before the user code.
12999 * tests/Makefile.am (check-local, installcheck-local): Pass
13000 TESTSUITEFLAGS to the TESTSUITE.
13001
13002 2004-12-20 Akim Demaille <akim@epita.fr>
13003
13004 Use more STL like names: my_class instead of MyClass.
13005
13006 * data/lalr1.cc (LocationStack, LocationType, RhsNumberType)
13007 (SemanticStack, SemanticType, StateStack, StateType)
13008 (TokenNumberType, Stack, Slice, Traits, Parser::location)
13009 (Parser::value): Rename as...
13010 (location_stack, location_type, rhs_number_type, semantic_stack)
13011 (semantic_type, state_stack, state_type, token_number_type, stack)
13012 (slice, traits, parser::yylloc, parser::yylval): these.
13013
13014 * tests/calc.at, tests/regression.at, tests/actions.at: Adjust.
13015
13016 2004-12-19 Paul Eggert <eggert@cs.ucla.edu>
13017
13018 * data/glr.c (YYLLOC_DEFAULT): Use GNU spacing conventions.
13019 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
13020
13021 2004-12-17 Paul Eggert <eggert@cs.ucla.edu>
13022
13023 Remove uses of 'short int' and 'unsigned short int'. This raises
13024 some arbitrary limits. It uses more memory but nowadays that's
13025 not much of an issue.
13026
13027 This change does not affect the generated parsers; that's a different
13028 task, as some users will want to conserve memory there.
13029
13030 Ideally we should use size_t to represent all object counts, and
13031 something like ptrdiff_t to represent signed differences of object
13032 counts; but that will require more code-cleanup than I have the
13033 time to do right now.
13034
13035 * src/LR0.c (allocate_itemsets, new_itemsets, save_reductions):
13036 Use size_t, not int or short int, to count objects.
13037 * src/closure.c (nritemset, closure): Likewise.
13038 * src/closure.h (nritemset, closure): Likewise.
13039 * src/nullable.c (nullable_compute): Likewise.
13040 * src/print.c (print_core): Likewise.
13041 * src/print_graph.c (print_core): Likewise.
13042 * src/state.c (state_compare, state_hash): Likewise.
13043 * src/state.h (struct state): Likewise.
13044 * src/tables.c (default_goto, goto_actions): Likewise.
13045
13046 * src/gram.h (rule_number, rule): Use int, not short int.
13047 * src/output.c (prepare_rules): Likewise.
13048 * src/state.h (state_number, STATE_NUMBER_MAXIMUM, transitions,
13049 errs, reductions): Likewise.
13050 * src/symtab.h (symbol_number, SYMBOL_NUMBER_MAXIMUM, struct symbol):
13051 Likewise.
13052 * src/tables.c (vector_number, tally, action_number,
13053 ACTION_NUMBER_MINIMUM): Likewise.
13054 * src/output.c (muscle_insert_short_int_table): Remove.
13055
13056 2004-12-17 Akim Demaille <akim@epita.fr>
13057
13058 * data/lalr1.cc: Extensive Doxygenation.
13059 (error_): Rename as...
13060 (error): this, since it is visible to the user.
13061 Adjust callers.
13062 (Parser::message): Now an automatic variable from...
13063 (Parser::yyreport_syntax_error_): here.
13064 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust to
13065 Parser::error.
13066 * tests/input.at: Escape $.
13067
13068 2004-12-16 Paul Eggert <eggert@cs.ucla.edu>
13069
13070 * data/glr.c (b4_lhs_value, b4_rhs_value, b4_rhs-location):
13071 Parenthesize rhs to avoid obscure problems with mistakes like
13072 "foo$$bar = foo$1bar;". Problem reported by twlevo at xs4all.
13073 * data/lalr1.cc (b4_lhs_value, b4_rhs_value, b4_lhs_location,
13074 b4_rhs_location): Likewise.
13075 * data/yacc.c (b4_lhs_value, b4_rhs_value, b4_lhs_location,
13076 b4_rhs_location): Likewise.
13077
13078 2004-12-16 Akim Demaille <akim@epita.fr>
13079
13080 * data/lalr1.cc (yyreport_syntax_error_): Catch up with glr.c and
13081 yacc.c: be sure to stay within yycheck_.
13082 * tests/actions.at: Re-enable C++ tests.
13083
13084 2004-12-16 Akim Demaille <akim@epita.fr>
13085
13086 * src/print_graph.c (print_graph): Remove layoutalgorithm uses for
13087 real.
13088
13089 2004-12-16 Akim Demaille <akim@epita.fr>
13090
13091 Use #define to handle the %name-prefix.
13092
13093 * data/glr.c, data/yacc.c: Comment changes.
13094 * data/lalr1.cc (yylex): Use #define to select the name of yylex,
13095 so that one can refer to yylex in the parser file, and have it
13096 renamed, as is the case with other skeletons.
13097
13098 2004-12-16 Akim Demaille <akim@epita.fr>
13099
13100 Move lalr1.cc internals into yy*.
13101
13102 * data/lalr1.cc (semantic_stack_, location_stack_, state_stack_)
13103 (semantic_stack_, location_stack_, pact_, pact_ninf_, defact_)
13104 (pgoto_, defgoto_, table_, table_ninf_, check_, stos_, r1_, r2_)
13105 (name_, rhs_, prhs_, rline_, token_number_, eof_, last_, nnts_)
13106 (empty_, final_, terror_, errcode_, ntokens_)
13107 (user_token_number_max_, undef_token_, n_, len_, state_, nerrs_)
13108 (looka_, ilooka_, error_range_, nerrs_):
13109 Rename as...
13110 (yysemantic_stack_, yylocation_stack_, yystate_stack_)
13111 (yysemantic_stack_, yylocation_stack_, yypact_, yypact_ninf_)
13112 (yydefact_, yypgoto_, yydefgoto_, yytable_, yytable_ninf_)
13113 (yycheck_, yystos_, yyr1_, yyr2_, yyname_, yyrhs_, yyprhs_)
13114 (yyrline_, yytoken_number_, yyeof_, yylast_, yynnts_, yyempty_)
13115 (yyfinal_, yyterror_, yyerrcode_, yyntokens_)
13116 (yyuser_token_number_max_, yyundef_token_, yyn_, yylen_, yystate_)
13117 (yynerrs_, yylooka_, yyilooka_, yyerror_range_, yynerrs_):
13118 these.
13119
13120 2004-12-15 Paul Eggert <eggert@cs.ucla.edu>
13121
13122 Fix some problems reported by twlevo at xs4all.
13123 * src/symtab.c (symbol_new): Report an error if the input grammar
13124 contains too many symbols. This is better than calling abort() later.
13125 * src/vcg.h (enum layoutalgorithm): Remove. All uses removed.
13126 (struct node, struct graph):
13127 Rename member expand to stretch. All uses changed.
13128 (struct graph): Remove member layoutalgorithm. All uses removed.
13129 * src/vcg.c (get_layoutalgorithm_str): Remove. All uses removed.
13130 * src/vcg_defaults.h (G_STRETCH): Renamed from G_EXPAND.
13131 All uses changed.
13132 (N_STRETCH): Rename from N_EXPAND. All uses changed.
13133
13134 2004-12-15 Akim Demaille <akim@epita.fr>
13135
13136 * data/lalr1.cc: Normalize /** \brief ... */ to ///.
13137 Add more Doxygen comments.
13138 (symprint_, stack_print_, reduce_print_, destruct_, pop)
13139 (report_syntax_error_, translate_): Rename as...
13140 (yysymprint_, yystack_print_, yyreduce_print_, yydestruct_)
13141 (yypop_, yyreport_syntax_error_, yytranslate_): this.
13142
13143 2004-12-15 Akim Demaille <akim@epita.fr>
13144
13145 * data/lalr1.cc (lex_): Rename as...
13146 (yylex_): this.
13147 Move the trace here.
13148 Take the %name-prefix into account.
13149 Reported by Alexandre Duret-Lutz.
13150
13151 2004-12-15 Akim Demaille <akim@epita.fr>
13152
13153 Simplify the C++ parser constructor.
13154
13155 * data/lalr1.cc (debug_): Rename as...
13156 (yydebug_): so that the parser's internals are always in the yy*
13157 pseudo namespace.
13158 Adjust uses.
13159 (b4_parse_param_decl): Remove the leading comma as it is now only
13160 called as unique argument list.
13161 (Parser::Parser): Remove the constructor accepting a location and
13162 an initial debugging level.
13163 Remove from the other ctor the argument for the debugging level.
13164 (debug_level_type, debug_level, set_debug_level): New.
13165
13166 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust
13167 constructor calls.
13168
13169 2004-12-15 Akim Demaille <akim@epita.fr>
13170
13171 Remove b4_root related material: failure experiment
13172 (which goal was to allow to derive from a class).
13173
13174 * data/lalr1.cc (b4_root, b4_param, b4_constructor): Remove
13175 definitions and uses.
13176
13177 2004-12-14 Paul Eggert <eggert@cs.ucla.edu>
13178
13179 * data/glr.c (struct yyGLRStack): yyerror_range now has 3 items,
13180 not 2, since it's not portable to subtract 1 from the start of an
13181 array. The new item 0 is never set or used. All uses changed.
13182
13183 (yyrecoverSyntaxError): Use YYLLOC_DEFAULT instead of assuming
13184 the default definition of YYLLOC_DEFAULT. Problem reported
13185 by Frank Heckenbach.
13186
13187 2004-12-12 Paul Eggert <eggert@cs.ucla.edu>
13188
13189 * data/glr.c (YYRHSLOC): Don't have two definitions, one for
13190 the normal case and one for the error case. Just use the
13191 first one uniformly. Problem reported by Frank Heckenbach.
13192 (YYLLOC_DEFAULT): Use the conventions of yacc.c, so we can
13193 use exactly the same macro in both places.
13194 (yyerror_range): Now of type yyGLRStackItem, not YYLTYPE,
13195 so that the normal-case YYRHSLOC works for the error case too.
13196 All uses changed.
13197 * data/yacc.c (YYRHSLOC): New macro, taken from glr.c.
13198 (YYLLOC_DEFAULT): Use the same macro as glr.c.
13199 * doc/bison.texinfo (Location Default Action): Don't claim that
13200 we have an array of locations. Use the same macro for both glr
13201 and lalr parsers. Mention YYRHSLOC. Mention what happens when
13202 the index is 0.
13203
13204 2004-12-10 Paul Eggert <eggert@cs.ucla.edu>
13205
13206 * HACKING: Update email addresses to send announcements to.
13207
13208 * configure.ac (AC_INIT): Bump version to 1.875f.
13209
13210 2004-12-10 Paul Eggert <eggert@cs.ucla.edu>
13211
13212 * NEWS: Version 1.875e.
13213 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875e.
13214
13215 * src/scan-skel.l: Include "complain.h", for "fatal".
13216
13217 * src/relation.h (relation_print, relation_digraph):
13218 Relation sizes are of type relation_node, not size_t (this is
13219 merely a doc fix, since the two types are equivalent).
13220 (relation_transpose): Relation sizes are of type relation_node,
13221 not int.
13222 * src/relation.c: Likewise.
13223 (top, infinity): Now of type relation_node, not int.
13224 (traverse, relation_transpose): Use relation_node, not int.
13225
13226 * data/glr.c (yyuserAction, yyrecoverSyntaxError): Mark args
13227 with ATTRIBUTE_UNUSED if they're not used, to avoid GCC warning.
13228 (yyparse): Remove unused local introduced in 2004-10-25 patch.
13229
13230 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): New arg
13231 specifying whether the test should be skipped. Use it tp
13232 specify that the [%defines %skeleton "lalr1.cc"] tests currently
13233 fail on some hosts, and should be skipped.
13234
13235 2004-12-08 Paul Eggert <eggert@cs.ucla.edu>
13236
13237 * src/system.h (CALLOC, MALLOC, REALLOC): Remove. All callers
13238 changed to use xcalloc, xnmalloc, xnrealloc, respectively,
13239 unless otherwise specified below.
13240
13241 * src/LR0.c (allocate_itemsets): Use xnmalloc, not xcalloc,
13242 to allocate kernel_base, kernel_items, kernel_size, since
13243 they needn't be initialized to 0.
13244 (allocate_storgae): Likewise, for shiftset, redset, shift_symbol.
13245 * src/closure.c (new_closure): Likewise, for itemset.
13246 * src/derives.c (derives_compute): Likewise, for delts, derives, q.
13247 * src/lalr.c (set_goto_map): Likewise, for temp_map.
13248 (initialize_F): Likewise, for reads, edge, reads[i], includes[i].
13249 (build_relations): Likewise for edge, states1, includes.
13250 * src/nullable.c (nullable_compute): Likewise, for squeue, relts.
13251 * src/reader.c (packgram): Likewise, for ritem, rules.
13252 * src/reduce.c (nonterminals_reduce): Likewise for nontermmap.
13253 * src/relation.c (relation_digraph): Likewise for VERTICES.
13254 (relation_transpose): Likewise for new_R, end_R.
13255 * src/symtab.c (symbols_token_translations_init): Likewise for
13256 token_translations.
13257 * src/tables.c (save_row): Likewise for froms, tos, conflict_tos.
13258 (token_actions): Likewise for yydefact, actrow, conflrow,
13259 conflict_list.
13260 (save_column): Likewise for froms[symno], tos[symno].
13261 (goto_actions): Likewise for state_count.
13262 (pack_table): Likewise for base, pos, check.
13263 (tables_generate): Likewise for width.
13264
13265 * src/LR0.c (set_states): Don't reuse kernel_size and kernel_base
13266 for initial core. Just have a separate core, so we needn't worry
13267 about whether kernel_size and kernel_base are initialized.
13268
13269 * src/LR0.c (shift_symbol, redset, shiftset, kernel_base,
13270 kernel_size, kernel_items): Remove unnecessary initialization.
13271 * src/conflicts.c (conflicts): Likewise.
13272 * src/derives.c (derives): Likewise.
13273 * src/muscle_tablc (muscle_insert): Likewise.
13274 * src/relation.c (relation_digraph): Likewise.
13275 * src/tables.c (froms, tos, conflict_tos, tally, width, actrow, order,
13276 conflrow, conflict_table, conflict_list, table, check):
13277 Likewise.
13278
13279 * src/closure.c (new_closure): Arg is of type unsigned int, not int.
13280 This is because all callers pass unsigned int.
13281 * src/closure.h (new_closure): Likewise.
13282
13283 * src/lalr.c (initialize_F): Initialize reads[i] in all cases.
13284 (build_relations): Initialize includes[i] in all cases.
13285 * src/reader.c (packgram): Always initialize rules[ruleno].prec
13286 and rules[ruleno].precsym. Initialize members in order.
13287 * src/relation.c (relation_transpose): Always initialize new_R[i]
13288 and end_R[i].
13289 * src/table.c (conflict_row): Initialize 0 at end of conflict_list.
13290
13291 * src/output.c (prepare_actions): Pass 0 instead of conflict_list[0];
13292 conflict_list[0] was always 0, but now it isn't initialized.
13293
13294 * src/table.c (table_grow): When conflict_table grew, the grown
13295 area wasn't cleared. Fix this.
13296
13297 * lib/.cvsignore: Add strdup.c, strdup.h.
13298 * m4/.cvsignore: Add strdup.m4.
13299
13300 2004-12-07 Paul Eggert <eggert@cs.ucla.edu>
13301
13302 * src/lalr.h (GOTO_NUMBER_MAXIMUM): New macro.
13303 * src/lalr.c (set_goto_map): Don't allow ngotos to equal
13304 GOTO_NUMBER_MAXIMUM, since we occasionally compute
13305 ngotos + 1 without checking for overflow.
13306 (build_relations): Use END_NODE, not -1, to denote end of edges.
13307 * src/lalr.c (set_goto_map, map_goto, initialize_F, add_loopback_edge,
13308 build_relations): Use goto_number, not int, for goto numbers.
13309 * src/tables.c (save_column, default_goto): Likewise.
13310
13311 2004-11-23 Akim Demaille <akim@epita.fr>
13312
13313 * data/lalr1.cc (YYSTYPE): Define it as is done for C, instead
13314 of #defining from yystype.
13315 Don't typedef yystype, C++ does not need it.
13316 This lets it possible to forward declare it as union.
13317
13318 2004-11-23 Paul Eggert <eggert@cs.ucla.edu>
13319
13320 * bootstrap (gnulib_modules): Add extensions.
13321 Problem reported by Jim Meyering.
13322
13323 2004-11-22 Paul Eggert <eggert@cs.ucla.edu>
13324
13325 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c,
13326 src/lalr.c, src/nullable.c, src/relation.c, src/scan-skel.l,
13327 src/system.h, src/tables.c: XFREE -> free, to accommodate
13328 recent change to gnulib xalloc.h.
13329 Problem reported by Jim Meyering.
13330
13331 2004-11-17 Akim Demaille <akim@epita.fr>
13332
13333 * data/lalr1.cc (symprint_): Use cdebug_ to avoid warnings.
13334
13335 2004-11-17 Akim Demaille <akim@epita.fr>,
13336 Alexandre Duret-Lutz <adl@gnu.org>
13337
13338 * data/lalr1.cc (Parser::yycdebug_): New, a pointer, to allow
13339 changes.
13340 (YYCDEBUG): Adjust.
13341 Use it instead of cdebug_.
13342 (Parser::debug_stream, Parser::set_debug_stream): New.
13343 (Parser::symprint_): Define cdebug_ for temporary backward
13344 compatibility.
13345 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use
13346 debug_stream ().
13347
13348 2004-11-17 Akim Demaille <akim@epita.fr>
13349
13350 * data/lalr1.cc (Parser:print_): Remove, use %printer instead.
13351 * tests/regression.at (_AT_DATA_DANCER_Y): Adjust.
13352 * tests/calc.at (_AT_DATA_CALC_Y): Ditto.
13353 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
13354
13355 2004-10-27 Paul Eggert <eggert@cs.ucla.edu>
13356
13357 * data/glr.c (yyloc_default): Remove; not used.
13358 Problem reported by Frank Heckenbach.
13359
13360 2004-10-25 Akim Demaille <akim@epita.fr>
13361
13362 * data/glr.c (YYRHSLOC): Move its definition next to its uses.
13363 Introduce another definition to address simple location arrays.
13364 (yyGLRStack): New member: yyerror_range.
13365 (yyrecoverSyntaxError, yyparse): Update it.
13366 (yyrecoverSyntaxError): Use it when shifting the error token to
13367 have an accurate range, equivalent to the one computed by both
13368 yacc.c and lalr1.cc.
13369 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Change its yylex so
13370 that column numbers start at column 0, as per GNU Coding
13371 Standards, the others tests, and the doc.
13372 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT_WITH_LOC):
13373 Adjust to the above change (first column is 0).
13374 And adjust the location of the "<error>", now covering the whole
13375 line.
13376
13377 2004-10-22 Akim Demaille <akim@epita.fr>
13378 and Paul Eggert <eggert@cs.ucla.edu>
13379
13380 Remove some arbitrary limits on goto numbers and relations.
13381 * src/lalr.c (goto_map, ngotos, from_state, to_state): Omit
13382 initial values, since they're never used.
13383 (set_goto_map): ngotos is now unsigned, so test for overflow
13384 by seeing whether it wraps around to zero.
13385 * src/lalr.h (goto_number): Now size_t, not short int.
13386 (GOTO_NUMBER_MAXIMUM): Remove.
13387 * src/relation.c (relation_print, traverse, relation_transpose):
13388 Check for END_NODE rather than looking at sign.
13389 * src/relation.h (END_NODE): New macro.
13390 (relation_node): Now size_t, not short int.
13391
13392 2004-10-22 Paul Eggert <eggert@cs.ucla.edu>
13393
13394 * doc/bison.texinfo (Language and Grammar): In example, "int" is a
13395 keyword, not an identifier. Problem reported by Baron Schwartz in
13396 <http://lists.gnu.org/archive/html/bug-bison/2004-10/msg00017.html>.
13397
13398 2004-10-11 Akim Demaille <akim@epita.fr>
13399
13400 * src/symtab.c (symbol_check_alias_consistency): Also check
13401 type names, destructors, and printers.
13402 Reported by Alexandre Duret-Lutz.
13403 Recode the handling of associativity and precedence in terms
13404 of symbol_precedence_set.
13405 Accept no redeclaration at all, not even equal to the previous
13406 value.
13407 (redeclaration): New.
13408 Use it to factor redeclaration complaints.
13409 (symbol_make_alias): Don't set the type of the alias, let
13410 symbol_check_alias_consistency do it as for other features.
13411 * src/symtab.h (symbol): Add new member prec_location, and
13412 type_location.
13413 * src/symtab.c (symbol_precedence_set, symbol_type_set): Set them.
13414 * tests/input.at (Incompatible Aliases): New.
13415
13416 2004-10-09 Paul Eggert <eggert@cs.ucla.edu>
13417
13418 .cvsignore fixes to accommodate gnulib changes,
13419 and the practice of naming build directories "_build".
13420 * .cvsignore: Add "_*". Sort.
13421 * lib/.cvsignore: Add getopt_.h, xalloc-die.c.
13422 * m4/.cvsignore: Add "*_gl.m4".
13423
13424 2004-10-06 Akim Demaille <akim@epita.fr>
13425
13426 * src/parse-gram.y (add_param): Fix the truncation of trailing
13427 spaces.
13428
13429 2004-10-05 Akim Demaille <akim@epita.fr>
13430
13431 In Bison 1.875's yacc.c, YYLLOC_DEFAULT was called regardless
13432 whether the reducion was empty or not. This leaves room to
13433 improve the use of YYLLOC_DEFAULT in such a case.
13434 lalr1.cc is still experimental, so changing this is acceptable.
13435 And finally, there are probably not many users who changed the
13436 handling of locations in GLR, so changing is admissible too.
13437
13438 * data/glr.c, data/lalr1.cc, data/yacc.c (YYLLOC_DEFAULT): On an
13439 empty reduction, set @$ to an empty location ending the previously
13440 stacked symbol.
13441 Adjust uses to make sure the code is triggered on empty
13442 reductions.
13443 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust the
13444 expected output: empty reductions have empty locations.
13445
13446 2004-09-29 Akim Demaille <akim@epita.fr>
13447
13448 * data/lalr1.cc: Move towards a more standard C++ coding style
13449 for templates: Class < T > -> Class<T>.
13450
13451 2004-09-29 Akim Demaille <akim@epita.fr>
13452
13453 * data/lalr1.cc: Reinstall the former ctor, for sake of
13454 compatibility, but warn it will be removed.
13455 Move towards a more standard C++ coding style (i.e., type *var ->
13456 type* var).
13457
13458 2004-09-27 Paul Eggert <eggert@cs.ucla.edu>
13459
13460 * src/parse-gram.y (add_param): Rewrite to avoid strchr,
13461 since it's less likely to work if NULs are involved in the future.
13462
13463 2004-09-27 Akim Demaille <akim@epita.fr>
13464
13465 * data/yacc.c (YY_LOCATION_PRINT): Fix its default declaration.
13466
13467 2004-09-27 Akim Demaille <akim@epita.fr>
13468
13469 * data/lalr1.cc (b4_parse_param_decl_1): New.
13470 (b4_parse_param_decl): Use it to have different names between attribute
13471 and argument names.
13472 (b4_cc_constructor_call): Likewise.
13473
13474 2004-09-24 Akim Demaille <akim@epita.fr>
13475
13476 * src/parse-gram.y (add_param): Strip the leading and trailing
13477 blanks from a formal argument declaration.
13478 (YY_LOCATION_PRINT): New.
13479
13480 2004-09-24 Akim Demaille <akim@epita.fr>
13481
13482 * data/c.m4 (b4_yysymprint_generate): Move the YYINPUT invocation
13483 after the location.
13484
13485 2004-09-24 Akim Demaille <akim@epita.fr>
13486
13487 * doc/bison.texinfo (Table of Symbols): Sort.
13488
13489 2004-09-21 Akim Demaille <akim@epita.fr>
13490
13491 * data/yacc.c, data/glr.c (b4_at_dollar, b4_dollar_dollar): Remove
13492 the useless parentheses.
13493 Suggested by Paul Eggert.
13494
13495 2004-09-20 Akim Demaille <akim@epita.fr>
13496
13497 Let the initial-action act on the look-ahead, and use it for the
13498 "initial push" (corresponding to an hypothetical beginning-of-file).
13499 And let lalr1.cc honor %initial-action.
13500
13501 * doc/bison.texinfo (Initial Action Decl): Clarify, and add an
13502 example.
13503 * data/lalr1.cc (Parser::initlocation_): Remove, bad experiment.
13504 (Parser::Parser): Remove the ctor that used to initialize it.
13505 (Parser::parse): Like in the other skeletons, issue the "starting
13506 parse" message before any action.
13507 Honor %initial-action.
13508 Initialize the stacks with the lookahead.
13509 * data/yacc.c: Let $$ and @$ in %initial-action designate the
13510 look-ahead.
13511 Push them in the stacks.
13512 * tests/actions.at, tests/calc.at: Adjust the C++ ctor invocations.
13513
13514 2004-09-20 Akim Demaille <akim@epita.fr>
13515
13516 * doc/bison.texinfo (Initial Action Decl): New.
13517
13518 2004-09-20 Akim Demaille <akim@epita.fr>
13519
13520 * data/yacc.c (YY_LOCATION_PRINT): Use YYLTYPE_IS_TRIVIAL as a
13521 clearer criterion to define it.
13522 (parse): Initialize the initial location when YYLTYPE_IS_TRIVIAL.
13523 When reducing on an empty RHS, use the latest stacked location as
13524 location.
13525 yylloc is not always available.
13526 * data/glr.c: Likewise.
13527 Also, honor initial-actions.
13528
13529 2004-09-20 Akim Demaille <akim@epita.fr>
13530
13531 * data/yacc.c (YY_LOCATION_PRINT): New.
13532 Define when we know YYLTYPE's structure, i.e., when the default
13533 YYLLOC_DEFAULT is used.
13534 * data/c.m4 (b4_yysymprint_generate): Use it.
13535 * data/lalr1.cc (YYLLOC_DEFAULT): Stop relying on the initial
13536 value of the result.
13537 (error_start_): Replace with...
13538 (error_range_): this location array.
13539 This allows to replace code relying on the implementation of
13540 locations by portable code.
13541 * data/yacc.c (yylerrsp): Replace with...
13542 (yyerror_range): this.
13543 Every time a token is popped, update yyerror_range[0], to have an
13544 accurate location for the error token.
13545 * data/glr.c (YY_LOCATION_PRINT): New.
13546 (yyprocessOneStack): Fix an invocation of YY_SYMBOL_PRINT:
13547 deference a pointer.
13548 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): No longer
13549 report the location in %printers.
13550
13551 * src/scan-skel.l: Instead of abort, report error messages to ease
13552 understanding skeleton scanning failures.
13553
13554 2004-09-16 Akim Demaille <akim@epita.fr>
13555
13556 * data/lalr1.cc (Stack::Iterator, Stack::ConstIterator): Rename as...
13557 (iterator, const_iterator): these, to be more in the C++ spirit.
13558 Also, return reverse iterators so that when displaying the stack
13559 we display its bottom first.
13560 (Parser::stack_print_, Parser::reduce_print_): Match the messages
13561 from yacc.c.
13562 We should probably use vector here though.
13563
13564 2004-09-16 Akim Demaille <akim@epita.fr>
13565
13566 Have more complete shift traces.
13567
13568 * data/yacc.c, data/lalr1.c, data/glr.c: Use YY_SYMBOL_PRINT
13569 to report Shifts instead of ad hoc YYDPRINTF invocations,
13570 including for the error token.
13571 * data/lalr1.cc (symprint_): Output the location.
13572 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): In C++, don't
13573 output the location within the %printer.
13574 Activate GLR tests, at least to make sure they compile properly.
13575 They still don't pass though.
13576 * tests/calc.at: Adjust expect verbose output, since now "Entering
13577 state..." is on a different line than the "Shifting" message.
13578
13579 2004-09-08 Akim Demaille <akim@epita.fr>
13580
13581 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Move the
13582 Bison directive from the Bison file to the invocation of this
13583 macro, so that these directives are passed to
13584 AT_BISON_OPTION_PUSHDEFS to get correct help macros.
13585 Use these helping macros (e.g., AT_LOC, AT_VAL and so forth).
13586 Move the AT_SETUP/AT_CLEANUP outside, to report as test title
13587 the extra Bison directives instead of the whole series.
13588 Change the grammar so that there are recoverable errors, and
13589 unrecoverable errors. Now we can have the parser give up before
13590 consuming the whole input. As a result we now can observe that
13591 the lookahead is freed when needed.
13592 Change the parser source to parse argv[1] instead of a hard coded
13593 string.
13594 Simplify yylex, and give a value and location to EOF.
13595 Simplify some invocations of AT_CHECK_PRINTER_AND_DESTRUCTOR that
13596 passed directives already coded in the file.
13597 Add some tests to check the location of "error".
13598 For some tests, the C++ parser is correct, and not yacc.c.
13599 For other tests, they provide different, but unsatisfying, values,
13600 so keep the C++ value so that at least one parser is "correct"
13601 according to the test suite.
13602 (Actions after errors): Remove, this is subsumed by the
13603 AT_CHECK_PRINTER_AND_DESTRUCTOR series.
13604
13605 2004-09-06 Akim Demaille <akim@epita.fr>
13606
13607 * data/lalr1.cc: Adjust the indentation of the labels.
13608 (Parser::pop): New.
13609 Use it.
13610
13611 2004-09-06 Akim Demaille <akim@epita.fr>
13612
13613 * data/yacc.cc, data/glr.cc (yydestruct): Accept an additional
13614 argument, an informative message.
13615 Call YY_SYMBOL_PRINT.
13616 Adjust all callers: integrate the associated YY_SYMBOL_PRINT.
13617 * data/lalr1.cc (destruct_): Likewise.
13618 In addition, no longer depend on b4_yysymprint_generate and
13619 b4_yydestruct_generate to generate these functions, do it "by
13620 hand".
13621
13622 2004-09-03 Akim Demaille <akim@epita.fr>
13623
13624 * data/glr.c, data/lalr1.cc, data/yacc.c: When YYABORT was
13625 invoked, yydestruct the lookahead.
13626 * tests/calc.at (Calculator $1): Update the expected lengths of
13627 traces: there is an added line for the discarded lookahead.
13628 * doc/bison.texinfo (Destructor Decl): Some rewording.
13629 Define "discarded" symbols.
13630
13631 2004-09-02 Akim Demaille <akim@epita.fr>
13632
13633 * data/lalr1.cc (translate_, destruct_): No reason to be static.
13634
13635 2004-09-02 Akim Demaille <akim@epita.fr>
13636
13637 * data/glr.c, yacc.c (YYDSYMPRINT): Remove, not used.
13638 (YYDSYMPRINTF): Rename as...
13639 (YY_SYMBOL_PRINT): this.
13640 * data/lalr1.cc (YY_SYMBOL_PRINT): New, modeled after the previous
13641 two.
13642 Use it instead of direct symprint_ calls.
13643 (yybackup): Tweak the "Now at end of input" case to match yacc.c's
13644 one.
13645
13646 2004-09-02 Akim Demaille <akim@epita.fr>
13647
13648 * data/lalr1.cc (b4_yysymprint_generate): New.
13649 (symprint_): New member function, defined when YYDEBUG.
13650 Use it consistently instead of token/nterm debugging output by
13651 hand.
13652 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust
13653 %printer calls to use cdebug_ when using lalr1.cc.
13654
13655 2004-08-30 Florian Krohm <florian@edamail.fishkill.ibm.com>
13656
13657 * data/glr.c: Guard the declarations of yypstack and yypdumpstack
13658 with #ifdef YYDEBUG.
13659
13660 2004-08-26 Akim Demaille <akim@epita.fr>
13661
13662 * doc/bison.texinfo (Implementing Loops): Rename as...
13663 (Implementing Gotos/Loops): this.
13664
13665 2004-08-13 Paul Eggert <eggert@cs.ucla.edu>
13666
13667 Adjust to latest gnulib.
13668 * bootstrap (gnulib_modules): Add xalloc-die.
13669 Set LC_ALL=C so that file names sort consistently.
13670 Prefer the gnulib copies of gettext.m4, glibc21.m4,
13671 inttypes_h.m4, lib-ld.m4, lib-prefix.m4, po.m4, stdint_h.m4,
13672 uintmax_t.m4, ulonglong.m4.
13673 (intl_files_to_remove): Add gettext.m4, lib-ld.m4, lib-prefix.m4,
13674 po.m4 since we are now using _gl.m4 instead.
13675
13676 2004-08-10 Florian Krohm <florian@edamail.fishkill.ibm.com>
13677
13678 * src/scan-action.l: Remove. Scanning of semantic actions is
13679 handled in scan-gram.l.
13680
13681 2004-08-07 Florian Krohm <florian@edamail.fishkill.ibm.com>
13682
13683 * src/scan-gram.l (handle_syncline): Use uniqstr_new not xstrdup.
13684
13685 * src/location.h (struct): The file member is a uniqstr.
13686 (equal_boundaries): Use UNIQSTR_EQ for comparison.
13687
13688 2004-07-22 Paul Eggert <eggert@cs.ucla.edu>
13689
13690 Fix bug with non-%union parsers that have printers or destructors,
13691 which led to a Bison core dump. Reported by Peter Fales in
13692 <http://lists.gnu.org/archive/html/bug-bison/2004-07/msg00014.html>.
13693
13694 * data/c.m4 (b4_symbol_actions): Don't assume %union was used.
13695 * data/lalr1.cc (yystype) [defined YYSTYPE]: Define to YYSTYPE,
13696 not to our own type.
13697 * src/output.c (symbol_destructors_output, symbol_printers_output):
13698 Don't assume %union.
13699 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR,
13700 AT_CHECK_PRINTER_AND_DESTRUCTOR): New argument
13701 UNION-FLAG. All callers changed.
13702 (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't assume %union.
13703 Use type char, not unsigned int, when declaring an array of char;
13704 this lets us remove a cast.
13705 (Printers and Destructors): Add non-%union test cases.
13706
13707 2004-06-21 Paul Eggert <eggert@cs.ucla.edu>
13708
13709 * doc/bison.texinfo: Minor editorial changes, mostly to the new
13710 GLR writeups. E.g., avoid frenchspacing and the future tense,
13711 change "lookahead" to "look-ahead", and change "wrt" to "with
13712 respect to".
13713
13714 2004-06-21 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
13715
13716 * doc/bison.texinfo (Merging GLR Parses, Compiler Requirements):
13717 New sections, split off from the GLR Parsers section. Put the new
13718 Simple GLR Parser near the start of the GLR section, for clarity.
13719 Rewrite connective text.
13720
13721 2004-06-21 Frank Heckenbach <frank@g-n-u.de>
13722
13723 * doc/bison.texinfo (Simple GLR Parsers): New section.
13724
13725 2004-06-21 Paul Eggert <eggert@cs.ucla.edu>
13726
13727 * NEWS, TODO, doc/bison.texinfo:
13728 Use "look-ahead" instead of "lookahead", to be consistent.
13729 * REFERENCES: Fix incorrect reference to DeRemer and Pennello,
13730 while we're fixing "look-ahead".
13731 * src/conflicts.c (shift_set): Renamed from shiftset.
13732 (look_ahead_set): Renamed from lookaheadset.
13733 * src/print.c: Likewise.
13734 * src/getargs.c (report_args): Add "look-ahead" as the new canonical
13735 name for "lookahead".
13736 (report_types, usage): Likewise.
13737 * src/getargs.h (report_look_ahead_tokens): Renamed from
13738 report_lookaheads.
13739 * src/lalr.c (compute_look_ahead_tokens): Renamed from
13740 compute_lookaheads.
13741 (state_look_ahead_tokens_count): Renamed from state_lookaheads_count.
13742 (look_ahead_tokens_print): Renamed from lookaheads_print.
13743 * src/state.c (state_rule_look_ahead_tokens_print): Renamed from
13744 state_rule_lookaheads_print.
13745 * src/state.h: Likewise.
13746 (reductions.look_ahead_tokens): Renamed from lookaheads.
13747 * tests/torture.at (AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR): Renamed from
13748 AT_DATA_LOOKAHEADS_GRAMMAR.
13749
13750 2004-06-03 Paul Eggert <eggert@cs.ucla.edu>
13751
13752 * README: Update location of patched M4 distribution.
13753
13754 2004-05-30 Albert Chin-A-Young <china@thewrittenword.com>
13755
13756 Don't assume the C++ compiler takes the same arguments as the C compiler
13757 (trivial change).
13758 * configure.ac (O0CXXFLAGS): New var.
13759 * tests/atlocal.in (CXXFLAGS): Use it.
13760
13761 2004-05-29 Paul Eggert <eggert@cs.ucla.edu>
13762
13763 Fix some "make check" problems with C++ reported by
13764 Albert Chin-A-Young for Tru64 C++ in this thread:
13765 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00049.html
13766
13767 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check for std::cerr.
13768 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
13769 Output to a .cc file for C++, not to a .c file.
13770 * tests/calc.at (AT_CHECK_CALC): Likewise.
13771 * tests/regression.at (AT_CHECK_DANCER): Likewise.
13772 * tests/local.at (AT_COMPILE_CXX): Default to OUTPUT.cc, not OUTPUT.c.
13773
13774 2004-05-28 Albert Chin-A-Young <china@thewrittenword.com>
13775
13776 * tests/calc.at, tests/actions.at: Workaround for SGI
13777 C++ compiler. (trivial change)
13778
13779 2004-05-27 Paul Eggert <eggert@cs.ucla.edu>
13780
13781 Spent a few hours checking out which prerequisite versions the
13782 current sources actually require. I went all the way back to
13783 Gettext 0.10.40, Automake 1.4, and Autoconf 2.57 and investigated
13784 a seemingly endless set of combinations of versions more recent
13785 than that. The bottom line is that the current sources require
13786 fairly recent versions of the build tools, and it'll be some work
13787 to change this.
13788 * configure.ac (AC_PREREQ): Increase from 2.58 to 2.59.
13789 (AM_INIT_AUTOMAKE): Increase from 1.7 to 1.8.
13790 (AM_GNU_GETTEXT_VERSION): Increase from 0.11.5 to 0.12.
13791 Add comments explaining why those particular versions are
13792 currently needed.
13793
13794 * src/parse-gram.y (lloc_default): Rewrite to avoid compiler bug
13795 in SGI MIPSpro 7.4.1m. Problem reported by Albert Chin-A-Young in
13796 <http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00037.html>.
13797
13798 * configure.ac (AC_PREREQ): Bump to 2.58, since 2.57 doesn't work
13799 (it fails with a Autoconf-without-aclocal-m4 diagnostic).
13800
13801 2004-05-26 Paul Eggert <eggert@cs.ucla.edu>
13802
13803 * configure.ac (AM_GNU_GETTEXT_VERSION): Lower it from 0.14.1 to
13804 0.11.5. Suggested by Bruno Haible.
13805 * bootstrap: Remove gettext version checking.
13806
13807 * doc/bison.texinfo (Decl Summary): Also mention that %union
13808 can depend on prerequisite types. Problem reported by Tim
13809 Van Holder.
13810
13811 2004-05-25 Paul Eggert <eggert@cs.ucla.edu>
13812
13813 * README: Mention GNU m4 1.4 bugs and Akim's patched version.
13814 * README-alpha: Don't tell people not to package this.
13815
13816 * bootstrap: Don't assume $(...) works; use `...` instead.
13817 Problem reported by Paul Hilfinger. Also, diagnose non-GNU
13818 gettext better.
13819
13820 * doc/bison.texinfo (Decl Summary, Bison Options): Clarify what's
13821 put into the -d output file, and mention what to do if YYSTYPE is
13822 defined as a macro.
13823
13824 2004-05-24 Paul Eggert <eggert@cs.ucla.edu>
13825
13826 Undo change made earlier today: it caused autopoint to not bring
13827 in ABOUT-NLS. Ouch. Instead, substitute our own diagnostic for
13828 autopoint's.
13829
13830 * bootstrap: Check that gettext version matches what's in
13831 configure.ac. Warn users to ignore robots.txt ERROR 404.
13832 * bootstrap: Undo today's earlier change (logged below).
13833 * configure.ac (AM_GNU_GETTEXT_VERSION): Likewise.
13834
13835 The gettext version checking is causing more trouble than it's
13836 curing; remove it. Problem reported by Paul Hilfinger.
13837
13838 * bootstrap: Issue a warning that one can expect a message
13839 'AM_GNU_GETTEXT is used, but not AM_GNU_GETTEXT_VERSION'.
13840 * configure.ac (AM_GNU_GETTEXT_VERSION): Remove.
13841
13842 2004-05-23 Paul Eggert <eggert@cs.ucla.edu>
13843
13844 Ensure that the C++ compiler used for testing actually works on a
13845 simple test program; if not, skip the C++-related tests. Problem
13846 reported by Vin Shelton in:
13847 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00026.html
13848
13849 * m4/cxx.m4: New file.
13850 * configure.ac (BISON_TEST_FOR_WORKING_CXX_COMPILER): Add.
13851 * tests/atlocal.in (BISON_CXX_WORKS): Add.
13852 * tests/local.at (AT_COMPILE_CXX): Use it.
13853
13854 2004-05-21 Paul Eggert <eggert@cs.ucla.edu>
13855
13856 * data/glr.c (yylloc): Output this macro even if locations are not
13857 being generated, as the GLR parser needs it even in that case.
13858 Problem reported by Troy A. Johnson
13859 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=195946>.
13860
13861 * configure.ac (AC_INIT): Update to 1.875e.
13862
13863 2004-05-21 Paul Eggert <eggert@cs.ucla.edu>
13864
13865 * NEWS: Version 1.875d.
13866 * configure.ac (AC_INIT): Likewise.
13867 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875d.
13868
13869 * configure.ac (--enable-gcc-warnings): Do not enable -Wshadow,
13870 -Wmissing-prototypes, or -Wstrict-prototypes for C++. The current
13871 lalr1.cc runs afoul of the first, and the last two are no longer
13872 supported by GCC 3.4.0.
13873 * README: Mention GNU m4 1.4 or later; mention m4 patches.
13874 * HACKING: Use ./bootstrap, not "make update" to import foreign files.
13875
13876 2004-05-06 Paul Eggert <eggert@cs.ucla.edu>
13877
13878 * src/muscle_tab.c (hash_muscle): Accept and return size_t, not
13879 unsigned int, for compatibility with latest gnulib hash module.
13880 * src/state.c (state_hash, state_hasher): Likewise.
13881 * src/symtab.c (hash_symbol, hash_symbol_hasher): Likewise.
13882 * src/uniqstr.c (hash_uniqstr): Likewise.
13883
13884 2004-05-03 Paul Eggert <eggert@cs.ucla.edu>
13885
13886 * NEWS: Unescaped newlines are no longer allowed in char & strings.
13887
13888 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER,
13889 SC_CHARACTER,SC_STRING>): Reject unescaped newlines in
13890 character and string literals.
13891 (unexpected_end): New function.
13892 (unexpected_eof): Use it.
13893 (unexpected_newline): New function.
13894 (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>): Coalesce duplicate
13895 actions.
13896
13897 * NEWS: Document %expect-rr.
13898
13899 * bootstrap (--gnulib-srcdir=*, --cvs-user=*):
13900 Fix typo by replacing $1 with $option.
13901 Remove more 'intl'-related files.
13902 Don't DEFUN AM_INTL_SUBDIR twice.
13903
13904 * lib/.cvsignore: Add strndup.h. Remove memchr.c, memcmp.c,
13905 memrchr.c, strcasecmp.c, strchr.c, strrchr.c, strspn.c, strtol.c,
13906 strtoul.c.
13907 * m4/.cvsignore: Add exitfail.m4, extensions.m4, gnulib.m4,
13908 hard-locale.m4, mbstate_t.m4, strerror_r.m4, strndup.m4,
13909 xstrndup.m4. Remove glibc21.m4, intdiv0.m4, inttypes-pri.m4,
13910 inttypes.m4, inttypes_h.m4, isc-posix.m4, lcmessage.m4,
13911 stdint_h.m4, uintmax_t.m4, ulonglong.m4.
13912 * src/.cvsignore: Add *.output.
13913
13914 * src/parse-gram.y: Put copyright notice inside %{ %} so it
13915 gets copied to the output file.
13916
13917 2004-04-28 Paul Eggert <eggert@twinsun.com>
13918
13919 Get files from the gnulib and po repositories, instead of relying
13920 on them being in our CVS. Upgrade to latest versions of gnulib
13921 and Automake.
13922
13923 * Makefile.am (SUBDIRS): Remove m4; Automake now does m4.
13924 * bootstrap: Bootstrap from gnulib and po repositories.
13925 Much of this code was stolen from GNU diff and GNU tar's bootstrap.
13926 * README-cvs: Document these changes. Remove version numbers from
13927 mentions of build tools, since they change so often. Mention Flex.
13928
13929 * configure.ac (AC_CONFIG_MACRO_DIR): Add, with m4 as arg.
13930 (gl_USE_SYSTEM_EXTENSIONS): Add.
13931 (AC_GNU_SOURCE, AC_AIX, AC_MINIX):
13932 Remove; no longer needed, as gl_USE_SYSTEM_EXTENSIONS
13933 does this for us.
13934 (AC_ISC_POSIX): Remove; we no longer support this
13935 ancient OS, as it gets in the way of latest Autoconf & gnulib.
13936 (AC_HEADER_STDC): Remove: we now assume C89 or better.
13937 (AC_CHECK_HEADERS_ONCE): Use instead of AC_CHECK_HEADERS.
13938 Do not check for C89 headers, except for locale.h which is used
13939 by the Yacc library and must port to K&R hosts.
13940 (AC_CHECK_FUNCS_ONCE): Use instead of AC_CHECK_FUNCS.
13941 Do not check for C89 functions, except for setlocale which is
13942 used by the Yacc library.
13943 (AC_CHECK_DECLS, AC_REPLACE_FUNCS): Remove; no longer needed.
13944 (gl_DIRNAME, gl_ERROR, gl_FUNC_ALLOCA, gl_FUNC_MEMCHR,
13945 gl_FUNC_MEMRCHR, gl_FUNC_STPCPY, gl_FUNC_STRNLEN, gl_FUNC_STRTOL,
13946 gl_GETOPT, gl_HASH, gl_MBSWIDTH, gl_OBSTACK, gl_QUOTE,
13947 gl_QUOTEARG, gl_XALLOC, jm_FUNC_GLIBC_UNLOCKED_IO, jm_FUNC_MALLOC,
13948 AM_GNU_GETTEXT): Remove; now done by:
13949 (GNULIB_AUTOCONF_SNIPPET): Add. "bootstrap" builds this for us.
13950 (AC_CONFIG_FILES): Remove m4/Makefile, as Automake now does this
13951 for us.
13952
13953 * lib/Makefile.am: Include gnulib.mk, built for us by "bootstrap".
13954 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES):
13955 Define to empty, as gnulib.mk will do the rest for us.
13956 ($(libbison_a_OBJECTS), stdbool.h): Remove, as gnulib.mk does this
13957 for us.
13958 (libbison_a_SOURCES): Define to $(lib_SOURCES) now.
13959 (lib_SOURCES): New symbol, containing only the non-gnulib libs.
13960
13961 * src/files.c: Include gnulib's xstrndup.h.
13962
13963 * src/system.h (MALLOC): Use xnmalloc, for better overflow checking.
13964 (REALLOC): Use xnrealloc, for likewise.
13965 (xstrndup, stpcpy): Remove decls, as gnulib does this for us now.
13966 (strnlen, memrchr): Remove decls; functions no longer used.
13967 Include <stpcpy.h>.
13968
13969 * config/depcomp, config/install-sh, lib/alloca.c, lib/argmatch.c,
13970 lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
13971 lib/error.c, lib/error.h, lib/getopt.c, lib/getopt.h,
13972 lib/getopt1.c, lib/gettext.h, lib/hash.c, lib/hash.h,
13973 lib/malloc.c, lib/mbswidth.c, lib/mbswidth.h, lib/memchr.c,
13974 lib/memcmp.c, lib/memrchr.c, lib/obstack.c, lib/obstack.h,
13975 lib/quote.c, lib/quote.h, lib/quotearg.c, lib/quotearg.h,
13976 lib/realloc.c, lib/stdbool_.h, lib/stpcpy.c, lib/strcasecmp.c,
13977 lib/strchr.c, lib/strncasecmp.c, lib/strnlen.c, lib/strrchr.c,
13978 lib/strspn.c, lib/strtol.c, lib/strtoul.c, lib/unlocked-io.h,
13979 lib/xalloc.h, lib/xmalloc.c, lib/xstrdup.c, lib/xstrndup.c,
13980 m4/Makefile.am, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
13981 m4/error.m4, m4/getopt.m4, m4/hash.m4, m4/malloc.m4,
13982 m4/mbrtowc.m4, m4/mbswidth.m4, m4/memchr.m4, m4/memcmp.m4,
13983 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/prereq.m4,
13984 m4/quote.m4, m4/quotearg.m4, m4/realloc.m4, m4/stdbool.m4,
13985 m4/stpcpy.m4, m4/strnlen.m4, m4/strtol.m4, m4/strtoul.m4,
13986 m4/unlocked-io.m4, m4/xalloc.m4, po/LINGUAS, po/Makefile.in.in,
13987 po/Makevars, po/da.po, po/de.po, po/es.po, po/et.po, po/fr.po,
13988 po/hr.po, po/id.po, po/it.po, po/ja.po, po/ms.po, po/nl.po,
13989 po/pt_BR.po, po/ro.po, po/ru.po, po/sv.po, po/tr.po:
13990 Remove, as these files are now generated automatically
13991 by bootstrap or automake.
13992
13993 * po/ChangeLog: Remove: all but one entry was a duplicate
13994 of this file, and I moved that 2000-11-02 entry here.
13995
13996 * config/.cvsignore: Add Makefile, depcomp, install-sh.
13997 * lib/.cvsignore: Add alloca.c, alloca.h, alloca_.h, argmatch.c,
13998 argmatch.h, basename.c, dirname.c, dirname.h, error.c, error.h,
13999 exit.h, exitfail.c, exitfail.h, getopt.c, getopt.h, getopt1.c,
14000 getopt_int.h, gettext.h, gnulib.mk, hard-locale.c, hard-locale.h,
14001 hash.c, hash.h, malloc.c, mbswidth.c, mbswidth.h, memchr.c,
14002 memcmp.c, memrchr.c, obstack.c, obstack.h, quote.c, quote.h,
14003 quotearg.c, quotearg.h, realloc.c, stdbool_.h, stpcpy.c, stpcpy.h,
14004 strcasecmp.c, strchr.c, stripslash.c, strncasecmp.c, strndup.c,
14005 strnlen.c, strrchr.c, strspn.c, strtol.c, strtoul.c,
14006 unlocked-io.h, xalloc.h, xmalloc.c, xstrdup.c, xstrndup.c,
14007 xstrndup.h.
14008 * m4/.cvsignore: Remove Makefile, Makefile.in. Add alloca.m4,
14009 dirname.m4, dos.m4, error.m4, getopt.m4, hash.m4, mbrtowc.m4,
14010 mbswidth.m4, obstack.m4, onceonly.m4, quote.m4, quotearg.m4,
14011 stdbool.m4, stpcpy.m4, strnlen.m4, unlocked-io.m4, xalloc.m4.
14012 * po/.cvsignore: Add *.po, LINGUAS, Makefile.in.in, Makevars.
14013 * src/.cvsignore: Remove *_.c.
14014
14015
14016 * Makefile.maint (GZIP_ENV): Don't use --rsyncable if gzip doesn't
14017 support it. (The latest stable gzip doesn't.)
14018
14019 2004-04-27 Paul Eggert <eggert@twinsun.com>
14020
14021 * data/lalr1.cc (Parser::stos_) [! YYDEBUG]: Define even in this
14022 case, as stos_ is now used by destructors due to the 2004-02-09
14023 change.
14024
14025 Remove more K&R C support.
14026 * lib/libiberty.y (PARAMS): Remove. All uses removed.
14027 * lib/subpipe.c (errno): Remove decl.
14028 Include <stdlib.h> unconditionally.
14029 (EXIT_FAILURE): Remove macro.
14030 * src/complain.c (vfprintf, strerror): Remove.
14031 * src/system.h: Include limits.h, stdlib.h, string.h, locale.h
14032 unconditionally.
14033 (EXIT_FAILURE, EXIT_SUCCESS, setlocale): Remove defns.
14034 Use latest Autoconf recommendations for including inttypes.h, stdint.h.
14035 (strchr, strspn, memchr): Remove decls.
14036 * tests/calc.at (_AT_DATA_CALC_Y): Include stdlib.h, string.h
14037 unconditionally. Do not declare perror.
14038 * tests/conflicts.at (%nonassoc and eof): Include stdlib.h
14039 unconditionally.
14040
14041 * src/complain.c (_): Remove useless defn, as system.h defines this.
14042
14043 * lib/bitset.h (__INT_TO_PTR): Remove; workaround no longer needed
14044 with latest obstack.h.
14045 * lib/ebitset.c (ebitset_elt_alloc): Don't bother to cast args
14046 to procedure types, as obstack.h now does that for us.
14047 * lib/lbitset.c (lbitset_elt_alloc): Likewise.
14048
14049 * lib/subpipe.h [HAVE_SYS_TYPES_H]: Include <sys/types.h>,
14050 so that this include file can stand alone.
14051 * lib/subpipe.c: Do not include <sys/types.h>, as subpipe.h
14052 does this now. Include subpipe.h first after config.h, to
14053 test whether it can stand alone.
14054
14055 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't
14056 declare yyerror when using lalr.cc, as GCC 3.4.0 warns about the
14057 unused declaration.
14058
14059 * tests/synclines.at (%union synch line): Put a dummy member in
14060 the union, because empty unions aren't allowed in C. Caught
14061 by GCC 3.4.0.
14062
14063 2004-04-13 Jim Meyering <jim@meyering.net>
14064
14065 * src/conflicts.c (conflicts_print): Correct format string typo:
14066 use `%%' to produce literal `%'. (trivial change)
14067
14068 2004-03-30 Paul Eggert <eggert@twinsun.com>
14069
14070 * src/getargs.c (version): Update copyright year to 2004.
14071
14072 * data/c.m4 (b4_int_type): Use 'short int' rather than
14073 'short', and similarly for 'long', 'unsigned', etc.
14074 * data/glr.c (YYTRANSLATE, yyconfl, yySymbol, yyItemNum,
14075 yygetLRActions, yyprocessOneStack, yyrecoverSyntaxError,
14076 yy_yypstack, yydumpstack): Likewise.
14077 * data/lalr1.cc (user_token_number_max_, user_token_number_max_,
14078 translate_, seq_, [], pop, Slice, range_, operator+, operator+=):
14079 Likewise.
14080 * data/yacc.c (b4_int_type, yyss, YYSTACK_BYTES, yysigned_char,
14081 yy_stack_print, yyparse): Likewise.
14082 * doc/bison.texinfo (Prologue, Multiple Types): Likewise.
14083 * lib/bbitset.h (bitset_word, BITSET_WORD_BITS): Likewise.
14084 * lib/bitset.c (bitset_print): Likewise.
14085 * lib/bitset_stats.c (bitste_log_histogram_print): Likewise.
14086 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
14087 * lib/bitsetv.c (bitsetv_dump): Likewise.
14088 * lib/ebitset.c (EBITSET_ELT_BITS, ebitset_elt_alloc): Likewise.
14089 * lib/lbitset.c (LBITSET_ELT_BITS, lbitset_elt_alloc, debug_lbitset):
14090 Likewise.
14091 * src/LR0.c (allocate_itemsets): Likewise.
14092 * src/gram.h (rule_number, rule): Likewise.
14093 * src/lalr.h (goto_number): Likewise.
14094 * src/nullable.c (nullable_compute): Likewise.
14095 * src/output.c (prepare_rules): Likewise.
14096 * src/relation.c (relation_print, relation_digraph): Likewise.
14097 * src/relation.h (relation_node): Likewise.
14098 * src/state.h (state_number, transitions, errs, reductions,
14099 struct state): Likewise.
14100 * src/symtab.h (symbol_number, struct symbol): Likewise.
14101 * src/tables.c (vector_number, tally, action_number,
14102 default_goto, goto_actions): Likewise.
14103 * tests/existing.at (GNU Cim Grammar): Likewise.
14104 * tests/regression.at (Web2c Actions): Likewise.
14105
14106 * src/output.c (muscle_insert_short_int_table): Renamed from
14107 muscle_insert_short_table. All uses changed.
14108
14109 2004-03-25 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
14110
14111 * src/parse-gram.y: Define PERCENT_EXPECT_RR.
14112 (declaration): Replace expected_conflicts with expected_sr_conflicts.
14113 Add %expect-rr rule.
14114
14115 * src/scan-gram.l: Recognize %expect-rr.
14116
14117 * src/conflicts.h (expected_sr_conflicts): Rename from
14118 expected_conflicts.
14119 (expected_rr_conflicts): Declare.
14120
14121 * src/conflicts.c (expected_sr_conflicts): Rename from
14122 expected_conflicts.
14123 (expected_rr_conflicts): Define.
14124 (conflicts_print): Check r/r conflicts against expected_rr_conflicts
14125 for GLR parsers.
14126 Use expected_sr_conflicts in place of expected_conflicts.
14127 Warn if expected_rr_conflicts used in non-GLR parser.
14128
14129 * doc/bison.texinfo: Add documentation for %expect-rr.
14130
14131 2004-03-08 Paul Eggert <eggert@gnu.org>
14132
14133 Add support for hex token numbers. Suggested by Odd Arild Olsen in
14134 <http://lists.gnu.org/archive/html/bison-patches/2004-03/msg00000.html>.
14135
14136 * NEWS: Document hexadecimal tokens, no NUL bytes, %destructor
14137 in lalr1.cc.
14138 * doc/bison.texinfo (Token Decl): Add hexadecimal token numbers.
14139 * src/scan-gram.l (scan_integer): New function.
14140 ({int}): Use it.
14141 (0[xX][0-9abcdefABCDEF]+): New pattern, to support hex numbers.
14142 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>, \\x[0-9abcdefABCDEF]+,
14143 handle_action_dollar, handle_action_at, convert_ucn_to_byte):
14144 Say "long int", not "long", for uniformity with GNU style.
14145
14146 2004-02-25 Paul Eggert <eggert@twinsun.com>
14147
14148 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Ignore stdout from
14149 compilers. This fixes a problem with Intel's C++ compiler being
14150 chatty, reported by Guido Trentalancia in
14151 <http://lists.gnu.org/archive/html/bug-bison/2004-02/msg00030.html>.
14152
14153 2004-02-09 Alexandre Duret-Lutz <adl@gnu.org>
14154
14155 Support %destructor and merge error locations in lalr1.cc.
14156
14157 * data/lalr1.cc (b4_cxx_destruct_def): New macro.
14158 (Parser::stos_): Define unconditionally.
14159 (Parser::destruct_): New method. Generate its body with
14160 b4_yydestruct_generate.
14161 (Parser::error_start_): New attribute.
14162 (Parser::parse) <yyerrlab, yyerrlab1>: Call destruct_ on erroneous
14163 token which are discarded.
14164 (Parser::parse) <yyerrlab, yyerrorlab, yyerrlab1>: Update
14165 error_start_ when erroneous token are discarded.
14166 (Parser::parse) <yyerrlab1>: Compute the location of the error
14167 token so that it covers all the discarded tokens.
14168 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust so
14169 it can be called with `%skeleton "lalr1.cc"', and do that.
14170
14171 2004-02-02 Paul Eggert <eggert@twinsun.com>
14172
14173 * src/Makefile.am (AM_CPPFLAGS): New macro. It mentions
14174 $(top_srcdir)/lib and ../lib. This fixes a bug reported
14175 by Paul Hilfinger; the old INCLUDES value didn't mention ../lib.
14176 There's no need to mention top_builddir since Automake does that
14177 for us.
14178 (INCLUDES): Remove, as Automake says it's obsolescent.
14179 Contents migrated into AM_CPPFLAGS as described above.
14180 * lib/Makefile.am (INCLUDES): Remove; obsolescent.
14181
14182 2004-01-14 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
14183
14184 * data/glr.c (yytokenName): Bullet-proof against YYEMPTY token.
14185 (yyreportSyntaxError): Handle case where lookahead token is
14186 YYEMPTY.
14187
14188 2004-01-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14189
14190 * data/glr.c: Put casts on uses of YYREALLOC and YYMALLOC so that
14191 resulting parsers are compilable with C++.
14192
14193 2003-12-23 Paul Eggert <eggert@twinsun.com>
14194
14195 * config/depcomp, config/install-sh: Sync with Automake 1.8.
14196 * src/output.c (output_skeleton): Rename local var.
14197 * tests/input.at (Torturing the Scanner): Don't use \x0 or \0 in
14198 Bison tokens, as this runs afoul of the 2003-10-07 change that
14199 disallowed NUL bytes in character constants or string literals.
14200
14201 * tests/local.at: Require Autoconf 2.59's Autotest.
14202 * tests/testsuite.at: Don't include local.at, since we now assume
14203 Autoconf 2.59 or later. Autoconf 2.59 had some problems with
14204 including it.
14205 * tests/Makefile.am ($(TESTSUITE)): Remove warning about ignoring
14206 multiple inclusion warnings.
14207
14208 2003-12-02 Akim Demaille <akim@epita.fr>
14209
14210 * doc/bison.texinfo (How Can I Reset the Parser): More about start
14211 conditions.
14212 From Bruno Haible.
14213
14214 2003-11-18 Alexandre Duret-Lutz <adl@gnu.org>
14215
14216 * doc/bison.texinfo (Bison Options): Escape `@' in `$@'.
14217
14218 2003-10-07 Paul Eggert <eggert@twinsun.com>
14219
14220 * tests/Makefile.am (clean-local): Don't run 'testsuite --clean'
14221 if testsuite doesn't exist.
14222
14223 * doc/bison.texinfo (Symbols): NUL bytes are not allowed in string
14224 literals, unfortunately.
14225 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
14226 Complain about NUL bytes in character constants or string literals.
14227
14228 2003-10-05 Paul Eggert <eggert@twinsun.com>
14229
14230 * NEWS: Don't document %no-default-prec, as it's still
14231 too experimental.
14232 * doc/bison.texinfo: Document %no-default-prec only if
14233 the defaultprec flag is set. Normally it's not.
14234
14235 2003-10-04 Paul Eggert <eggert@twinsun.com>
14236
14237 * data/glr.c (b4_rhs_value, b4_rhs_location): Yield a
14238 non-modifiable lvalue, instead of a modifiable one.
14239 * doc/bison.texinfo (Actions): Document that $$ can
14240 be assigned to. Do not claim that $$ and $N are
14241 array element references: user code should not rely on this.
14242
14243 2003-10-01 Paul Eggert <eggert@twinsun.com>
14244
14245 * src/parse-gram.h (PERCENT_NO_DEFAULT_PREC): New token.
14246 (grammar_declaration): Use it.
14247 * src/scan-gram.l: New token %no-default-prec.
14248 * tests/conflicts.at: Revamp tests to use %no-default-prec.
14249 * NEWS, doc/bison.texinfo: Document the above.
14250
14251 2003-10-01 Akim Demaille <akim@epita.fr>
14252
14253 VCG no longer supports long_straight_phase.
14254
14255 * src/vcg.c, src/vcg.h: Remove the handling of long_straight_phase.
14256 * src/print_graph.c (print_graph): Adjust.
14257
14258 2003-09-30 Frank Heckenbach <frank@g-n-u.de>
14259 and Paul Eggert <eggert@twinsun.com>
14260
14261 * doc/bison.texinfo (Decl Summary, Contextual Precedence,
14262 Table of Symbols): Document %default-prec.
14263 * src/parse-gram.y (PERCENT_DEFAULT_PREC): New token.
14264 (grammar_declaration): Set default_prec on %default-prec.
14265 * src/scan-gram.l (%default-prec): New token.
14266 * src/reader.h (default_prec): New flag.
14267 * src/reader.c: Likewise.
14268 (packgram): Handle it.
14269 * tests/conflicts.at (%default-prec without %prec,
14270 %default-prec with %prec, %default-prec 1): New tests.
14271
14272 2003-09-30 Paul Eggert <eggert@twinsun.com>
14273
14274 * tests/testsuite.at: Include local.at, not input.at, fixing
14275 a typo in the 2003-08-25 patch.
14276
14277 2003-08-27 Akim Demaille <akim@epita.fr>
14278
14279 * data/lalr1.cc (yyparse) [__GNUC__]: "Use" yyerrorlab to pacify
14280 GCC warnings.
14281
14282 2003-08-26 Akim Demaille <akim@epita.fr>
14283
14284 * config/announce-gen (print_changelog_deltas): Neutralize "<#" as
14285 "<\#" to avoid magic from Gnus when posting parts of this script.
14286
14287 2003-08-26 Akim Demaille <akim@epita.fr>
14288
14289 * data/lalr1.cc (Parser::report_syntax_error_): New, extracted from
14290 (Parser::parse): here.
14291 Adjust: nerrs and errstatus is now replaced by...
14292 (Parser::nerrs_, Parser::errstatus_): New.
14293
14294 2003-08-25 Akim Demaille <akim@epita.fr>
14295
14296 * config/announce-gen, Makefile.cfg: New.
14297 * Makefile.am: Adjust.
14298 * GNUmakefile, Makefile.maint: Update from CVS Autoconf, but
14299 keeping local WGET and WGETFLAGS modifications from Paul Eggert.
14300
14301 2003-08-25 Akim Demaille <akim@epita.fr>
14302
14303 When reducing initial empty rules, Bison parser read an initial
14304 location that is not defined. This results in garbage, and that
14305 affects Bison's own parser. Therefore we need (i) to extend Bison
14306 to support a means to initialize this location, and (ii) to use
14307 this CVS Bison to fix CVS Bison's parser.
14308
14309 * src/reader.h, reader.c (epilogue_augment): Remove, replace
14310 with...
14311 * src/muscle_tab.h, src/muscle_tab.c (muscle_code_grow): this.
14312 * src/parse-gram.y: Adjust.
14313 (%initial-action): New.
14314 (%error-verbose): Since we require CVS Bison, there is no reason
14315 not to use it.
14316 * src/scan-gram.l: Adjust.
14317 * src/Makefile.am (YACC): New, to make sure we use our own parser.
14318 * data/yacc.c (yyparse): Use b4_initial_action.
14319
14320 2003-08-25 Akim Demaille <akim@epita.fr>
14321
14322 * doc/bison.texinfo: Don't promote stdout for error messages.
14323
14324 2003-08-25 Akim Demaille <akim@epita.fr>
14325
14326 * data/lalr1.cc (Parser::reduce_print_): Remove unused yyi.
14327 From Alexandre Duret-Lutz.
14328
14329 2003-08-25 Akim Demaille <akim@epita.fr>
14330
14331 Version 1.875c.
14332
14333 2003-08-25 Akim Demaille <akim@epita.fr>
14334
14335 * data/lalr1.cc (Parser::stack_print_, YY_STACK_PRINT): New.
14336 Use them.
14337
14338 2003-08-25 Akim Demaille <akim@epita.fr>
14339
14340 * data/lalr1.cc (Parser::reduce_print_): New.
14341 Use it.
14342
14343 2003-08-25 Akim Demaille <akim@epita.fr>
14344
14345 Have lalr1.cc catch with Paul Eggert's patch to fix the infinite
14346 error recovery loops. This patch is based on
14347 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00000.html>.
14348 Also, augment the similarity between lalr1.cc and yacc.c.
14349 Note: the locations of error recovery rules are not correct yet.
14350
14351 * data/lalr1.cc: Comment changes to augment the similarity between
14352 lalr1.cc and yacc.c.
14353 (YYERROR): Goto to yyerrorlab, not yyerrlab1.
14354 (yyerrlab1): Remove, but where it used to be (now the bottom part of
14355 yyerrlab), when hitting EOF, pop the whole stack here instead of
14356 merely falling thru the default error handling mechanism.
14357 (yyerrorlab): New label, with the old contents of YYERROR,
14358 plus the following change: pop the stack of rhs corresponding
14359 to the production that invoked YYERROR. That is how Yacc
14360 behaves (required by POSIX).
14361 * tests/calc.at (AT_CHECK_CALC_LALR1_CC): No longer expected to
14362 fail.
14363
14364 2003-08-25 Akim Demaille <akim@epita.fr>
14365
14366 Tune local.at so that people can "autom4te -l autotest calc.at -o
14367 calc" for instance, to extract a sub test suite.
14368
14369 * tests/testsuite.at: Move the initialization, Autotest version
14370 requirement, and AT_TESTED invocation into...
14371 * tests/local.at: here.
14372 * tests/testsuite.at: Include it for compatibility with Autoconf
14373 2.57.
14374 * tests/Makefile.am ($(TESTSUITE)): Report that the warning should
14375 be ignore.
14376
14377 2003-08-04 Paul Eggert <eggert@twinsun.com>
14378
14379 Rework code slightly to avoid gcc -Wtraditional warnings.
14380 * data/glr.c (yyuserMerge): Return void, not YYSTYPE.
14381 The returned value is now stored in *YY0. All callers changed.
14382 * src/output.c (merge_output): Adjust to the above change.
14383
14384 2003-07-26 Paul Eggert <eggert@twinsun.com>
14385
14386 * data/glr.c (YYASSERT): New macro.
14387 (yyfillin, yydoAction, yyglrReduce, yysplitStack,
14388 yyresolveStates, yyprocessOneStack):
14389 Use `YYASSERT (FOO);' rather than `if (! (FOO)) abort ();'.
14390 Derived from a suggestion by Frank Heckenbach.
14391
14392 2003-07-25 Paul Eggert <eggert@twinsun.com>
14393
14394 * data/glr.c (yyglrReduce): Don't use C89 string concatenation,
14395 for portability to K&R C (after ansi2knr, presumably). See
14396 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>
14397 by Frank Heckenbach, though I have omitted the structure-initialization
14398 part of his glr-knr.diff patch since I recall that the Portable
14399 C Compiler didn't require that change.
14400
14401 Let the user specify how to allocate and free memory.
14402 Derived from a suggestion by Frank Heckenbach in
14403 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>.
14404 * data/glr.c (YYFREE, YYMALLOC, YYREALLOC): New macros.
14405 All uses of free, malloc, realloc changed to use these macros,
14406 and unnecessary casts removed.
14407 * data/yacc.c (YYFREE, YYMALLOC): Likewise.
14408
14409 2003-07-06 Matthias Mann <MatthiasMann@gmx.de>
14410
14411 * data/lalr1.cc (operator<<(std::ostream&, const Position&)):
14412 use s.empty() rather than s == "" to test for empty string; see
14413 <http://lists.gnu.org/archive/html/bison-patches/2003-07/msg00003.html>
14414 (trivial change)
14415
14416 2003-06-25 Akim Demaille <akim@epita.fr>
14417
14418 * config/depcomp, config/install-sh: Update from masters.
14419
14420 2003-06-20 Paul Eggert <eggert@twinsun.com>
14421
14422 * data/glr.c (YYLLOC_DEFAULT): Parenthesize arguments as needed,
14423 and return properly parenthesized result.
14424 * data/lalar1.cc (YYLLOC_DEFAULT): Likewise.
14425 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
14426 Remove unnecessary parentheses from uses.
14427 * doc/bison.texinfo (Location Default Action): Describe the
14428 conventions for parentheses.
14429
14430 2003-06-19 Paul Eggert <eggert@twinsun.com>
14431
14432 * data/glr.c (yyremoveDeletes, yy_reduce_print, yyglrReduce,
14433 yyreportTree): Do not assume that size_t is the same width as int,
14434 when printing sizes. Print sizes using an unsigned format.
14435 Problem reported by Frank Heckenbach in
14436 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00035.html>.
14437
14438 Port to Forte Developer 7 C compiler.
14439 * data/glr.c (struct YYLTYPE): If locations are not being used,
14440 declare a single dummy member, as empty structs do not conform
14441 to the C standard.
14442 (YYERROR, YYBACKUP): Do not use "do { ...; return foo; } while (0)";
14443 the Forte Developer 7 C compiler complains that end-of-loop
14444 code is not reached.
14445
14446 2003-06-17 Paul Eggert <eggert@twinsun.com>
14447
14448 * lib/libiberty.h (PARAMS): Spell argument as Args, not as X, to
14449 avoid warnings from picky compilers about redefinition of PARAMS.
14450
14451 2003-06-17 Paul Eggert <eggert@twinsun.com>
14452
14453 Version 1.875b.
14454
14455 * NEWS: Document 1.875b.
14456
14457 * lib/bbitset.h: Do not include config.h; that's the includer's job.
14458 Do not include <sys/types.h>; shouldn't be needed on a C89 host.
14459 * lib/bitset.h (bitset_compatible_p): Indent as per GNU standard.
14460 Don't use 'index' in comments, as it's a builtin fn on some hosts.
14461 * lib/bitset_stats.c: Include gettext.h unconditionally, as
14462 per recent gettext manual's suggestion.
14463 * lib/ebitset.c (ebitset_resize, ebitset_unused_clear):
14464 Use prototypes, not old-style definitions.
14465 * lib/lbitset.c (lbitset_unused_clear): Likewise.
14466 * lib/vbitset.c (vbitset_resize, vbitset_ones, vbitset_zero,
14467 vbitset_empty_p, vbitset_copy1, vbitset_not, vbitset_equal_p,
14468 vbitset_subset_p, vbitset_disjoint_p, vbitset_and, vbitset_and_cmp,
14469 vbitset_andn, vbitset_andn_cmp, vbitset_or, vbitset_or_cmp,
14470 vbitset_xor, vbitset_xor_cmp, vbitset_and_or, vbitset_and_or_cmp,
14471 vbitset_andn_or, vbitset_andn_or_cmp, vbitset_or_and,
14472 vbitset_or_and_cmp, vbitset_copy): Likewise.
14473
14474 * lib/libiberty.h: Do not include config.h; that's the includer's job.
14475 Do not include <stdlib.h>.
14476 (PARAMS): Define unconditionally for C89.
14477 (ATTRIBUTE_NORETURN): Remove.
14478 (ATTRIBUTE_UNUSED): Define unconditionally.
14479
14480 Upgrade to 2003-06-08 libbitset, submitted by Michael Hayes in:
14481 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00005.html>
14482 * lib/Makefile.am (bitsets_sources): Add vbitset.c, vbitset.h.
14483 * lib/vbitset.c, lib/vbitset.h: New files.
14484 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
14485 lib/bitset_stats.c, lib/ebitset.c, lib/lbitset.c: Import
14486 from libbitset.
14487
14488 * doc/bison.texinfo (How Can I Reset the Parser): Renamed from
14489 `How Can I Reset @code{yyparse}', since texinfo does not allow
14490 arbitrary @ in node names.
14491
14492 * m4/Makefile.am (EXTRA_DIST): Add the following files, which
14493 shouldn't be needed according to the gettext 0.12.1 documentation
14494 but which seem to be needed anyway: codeset.m4 glibc21.m4
14495 intdiv0.m4 inttypes-pri.m4 inttypes.m4 inttypes_h.m4 isc-posix.m4
14496 lcmessage.m4 nls.m4 po.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4.
14497 * po/Makefile.in.in: Upgrade to gettext 0.12.1 version.
14498
14499 * lib/.cvsignore: Add stdbool.h.
14500 * m4/.cvsignore: Add nls.m4, po.m4.
14501
14502 Upgrade to CVS gnulib.
14503 * stdbool_.h: File renamed from stdbool.h.in.
14504 * configure.ac (AM_STDBOOL_H): Invoke this instead of
14505 AC_HEADER_STDBOOL.
14506 (AM_GNU_GETTEXT): Put brackets around args, as latest manual suggests.
14507 (AM_GNU_GETTEXT_VERSION): Update to 0.12.1.
14508 * lib/Makefile.am (EXTRA_DIST): Add stdbool_.h.
14509 (MOSTLYCLEANFILES): New var.
14510 ($(libbison_a_OBJECTS)): Depend on $(STDBOOL_H).
14511 (stdbool.h): New rule.
14512 * lib/dirname.c, lib/dirname.h, lib/hash.c, lib/hash.h,
14513 lib/malloc.c, lib/obstack.h, lib/quote.c, lib/realloc.c,
14514 lib/strcasecmp.c, lib/xalloc.h, m4/alloca.m4, m4/onceonly.m4,
14515 m4/quote.m4: Upgrade to today's gnulib.
14516
14517 * tests/calc.at (AT_CHECK_CALC): New option EXPECTED-TO-FAIL.
14518 (AT_CHECK_CALC_LALR1_CC): Use it, since the C++ LALR parser fails
14519 the tests right now.
14520 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Ensure yylex and
14521 yyerror are declared before use; C99 requires this.
14522
14523 2003-06-09 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14524
14525 * data/glr.c (YYERROR): Update definition to reset yyerrState to 0
14526 first.
14527 (yyrecoverSyntaxError): Correct the logic for setting and testing
14528 yyerrState.
14529 Correct comment on handling EOF.
14530 Allow states with only a default reduction, rather than failing
14531 (I can't quite reconstruct why these were not allowed before).
14532
14533 Fixes to avoid problem that $-N rules in GLR parsers can cause
14534 buffer overruns, corrupting state.
14535
14536 * src/output.c (prepare_rules): Output max_left_semantic_context
14537 definition.
14538 * src/reader.h (max_left_semantic_context): New variable declaration.
14539 * src/scan-gram.l (max_left_semantic_context): Define.
14540 (handle_action_dollar): Update max_left_semantic_context.
14541 * data/glr.c (YYMAXLEFT): New definition.
14542 (yydoAction): Increase size of yyrhsVals by YYMAXLEFT.
14543 (yyresolveAction): Ditto.
14544
14545 Fixes to problems with location handling in GLR parsers reported by
14546 Frank Heckenbach (2003/06/05).
14547
14548 * data/glr.c (YYLTYPE): Make trivial if locations not used.
14549 (YYRHSLOC): Add parentheses, and define only if locations used.
14550 (YYLLOC_DEFAULT): Add parentheses, and give trivial definition if
14551 locations not used.
14552 (yyuserAction): Use YYLLOC_DEFAULT to set *yylocp.
14553 (yydoAction): Remove redundant initialization of *yyvalp and *yylocp.
14554
14555 * tests/cxx-type.at: Exercise location information; update tests
14556 to differentiate output with and without locations.
14557 Remove forward declarations of yylex and yyerror---caused errors
14558 because default YYLTYPE not yet defined.
14559 Change semantic actions to compute strings, rather than printing
14560 them directly (to test proper passing of semantics values). Change
14561 output to prefix notation and update test data and expected results.
14562 (yylex): Track locations.
14563 (stmtMerge): Return value rather than printing, and include arguments
14564 in value.
14565
14566 2003-06-03 Paul Eggert <eggert@twinsun.com>
14567
14568 Avoid warnings generated by GCC 2.95.4 when Bison is
14569 configured with --enable-gcc-warnings.
14570 * data/lalr1.cc (yy::]b4_parser_class_name[::parse,
14571 yy::]b4_parser_class_name[::translate_,
14572 yy::Stack::operator[] (unsigned),
14573 yy::Stack::operator[] (unsigned) const,
14574 yy::Slice::operator[] (unsigned),
14575 yy::Slice::operator[] (unsigned) const):
14576 Rename local vars to avoid warnings.
14577 * tests/glr-regression.at (Improper handling of embedded actions
14578 and $-N in GLR parsers): Remove unused local variable from yylex.
14579 * tests/regression.at (_AT_DATA_DANCER_Y): Declare yylex to take
14580 (void) as arg when not pure, since we now assume C89 when building
14581 Bison. Pacify GCC by using parameter.
14582
14583 2003-06-02 Paul Eggert <eggert@twinsun.com>
14584
14585 * data/lalr1.cc (yy::Position::lines, yy::Position::columns,
14586 yy::Location::lines, yy::Location::columns): Rename arguments
14587 to avoid shadowing; this removes a warning generated by GCC 3.3.
14588
14589 2003-06-01 Paul Eggert <eggert@twinsun.com>
14590
14591 Don't pass C-only warning optins (e.g., -Wmissing-declarations)
14592 to g++, as GCC 3.3 complains if you do it.
14593 * configure.ac (WARNING_CXXFLAGS): New subst. Set it to
14594 everything that WARNING_CFLAGS has, except omit warnings
14595 not suitable for C++.
14596 (AC_PROG_CXX): Use this instead of AC_CHECK_PROGS([CXX], [g++]).
14597 * tests/atlocal.in (CXXFLAGS): New var.
14598 * tests/local.at (AT_COMPILE_CXX): Use it instead of CFLAGS.
14599
14600 Fix a GLR parser bug I reported in February; see
14601 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00008.html>.
14602 The problem was that GLR parsers did not conform to the C standard,
14603 because actions like { $1 = $2 + $3; } expanded to expressions
14604 that invoked YYFILL in separate subexpressions, and YYFILL assigned
14605 to a local variable. The C standard says that expressions
14606 like (var = f ()) + (var = f ()) have undefined behavior.
14607 Another problem was that GCC sometimes issues warnings that
14608 yyfill and its parameters are unused.
14609
14610 * data/glr.c (yyfillin): Renamed from the old yyfill. Mark
14611 as possibly unused.
14612 (yyfill): New function.
14613 (YYFILL): Use it.
14614 (yyuserAction): Change type of yynormal to bool, so that it matches
14615 the new yyfill signature. Mark it as possibly unused.
14616
14617
14618 Follow up on a bug I reported in February, where a Bison-generated
14619 parser can loop. Provide a test case and a fix for yacc.c. I
14620 don't have a fix for lalr1.cc or for glr.c, unfortunately.
14621 The original bug report is in:
14622 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00044.html>
14623
14624 * data/yacc.c (YYERROR): Now just 'goto yyerrorlab', since the
14625 macro's size was becoming unwieldy.
14626 (yyerrlab): Do not discard an empty lookahead symbol, as this
14627 might destroy garbage.
14628 (yyerrorlab): New label, with the old contents of YYERROR,
14629 plus the following change: pop the stack of rhs corresponding
14630 to the production that invoked YYERROR. That is how Yacc
14631 behaves, and POSIX requires this behavior.
14632 (yyerrlab1): Use YYPOPSTACK instead of its definiens.
14633 * tests/calc.at (_AT_DATA_CALC_Y): Include unistd.h if available.
14634 Define 'alarm' to do nothing if unistd.h is not available.
14635 Add a new rule "exp: '-' error;" to test the above change to
14636 data/yacc.c. Use 'alarm' to abort any test taking longer than
14637 10 seconds, as it's probably looping.
14638 (AT_CHECK_CALC): Test recovery from error in new grammar rule.
14639 Also, the new yacc.c generates two fewer diagnostics for an
14640 existing test.
14641
14642 2003-05-24 Paul Eggert <eggert@twinsun.com>
14643
14644 * data/glr.c (YYSTACKEXPANDABLE): Do not evaluate
14645 YYSTYPE_IS_TRIVIAL or YYSTYPE_IS_TRIVIAL unless they are defined.
14646 This fixes a problem reported by John Bowman when the Compaq/HP
14647 Alpha cxx compiler happy (e.g. using cxx -D__USE_STD_IOSTREAM
14648 -ansi -Wall -gall).
14649 * data/yacc.c (union yyalloc): Likewise.
14650 (YYCOPY): Do not evaluate __GNUC__ unless it is defined.
14651
14652 Switch from 'int' to 'bool' where that makes sense.
14653
14654 * lib/abitset.c (abitset_test, abitset_empty_p, abitset_equal_p,
14655 abitset_subset_p, abitset_disjoint_p, abitset_and_cmp,
14656 abitset_andn_cmp, abitset_or_cmp, abitset_xor_cmp, abitset_and_or,
14657 abitset_and_or_cmp, abitset_andn_or_cmp, abitset_or_and_cmp):
14658 Return or accept bool, not int. All callers changed.
14659 * lib/bbitset.h: (bitset_toggle_, bitset_copy_, bitset_and_or_cmp_,
14660 bitset_andn_or_cmp_, bitset_or_and_cmp_): Likewise.
14661 * lib/bitset.c (bitset_only_set_p, bitset_print, bitset_toggle_,
14662 bitset_copy_, bitset_op4_cmp, bitset_and_or_cmp_, bitset_andn_or_cmp_,
14663 bitset_or_and_cmp_): Likewise.
14664 * lib/bitset.h (bitset_test, bitset_only_set_p): Likewise.
14665 * lib/bitset_stats.c (bitset_stats_print, bitset_stats_toggle,
14666 bitset_stats_test, bitset_stats_empty_p, bitset_stats_disjoint_p,
14667 bitset_stats_equal_p, bitset_stats_subset_p, bitset_stats_and_cmp,
14668 bitset_stats_andn_cmp, bitset_stats_or_cmp, bitset_stats_xor_cmp,
14669 bitset_stats_and_or_cmp, bitset_stats_andn_or_cmp,
14670 bitset_stats_or_and_cmp): Likewise.
14671 * lib/ebitset.c (ebitset_elt_zero_p, ebitset_equal_p, ebitset_copy_cmp,
14672 ebitset_test, ebitset_empty_p, ebitset_subset_p, ebitset_disjoint_p,
14673 ebitset_op3_cmp, ebitset_and_cmp, ebitset_andn_cmp, ebitset_or_cmp,
14674 ebitset_xor_cmp): Likewise.
14675 * lib/lbitset.c (lbitset_elt_zero_p, lbitset_equal_p, lbitset_copy_cmp,
14676 lbitset_test, lbitset_empty_p, lbitset_subset_p, lbitset_disjoint_p,
14677 lbitset_op3_cmp, lbitset_and_cmp, lbitset_andn_cmp, lbitset_or_cmp,
14678 lbitset_xor_cmp): Likewise.
14679 * lib/bbitset.h: Include <stdbool.h>.
14680 (struct bitset_vtable): The following members now return bool, not
14681 int: toggle, test, empty_p, disjoint_p, equal_p, subset_p,
14682 and_cmp, andn_cmp, or_cmp, xor_cmp, and_or_cmp, andn_or_cmp,
14683 or_and_cmp).
14684 * src/conflicts.c (count_rr_conflicts): Likewise.
14685 * lib/bitset_stats.h (bitset_stats_enabled): Now bool, not int.
14686 All uses changed.
14687 * lib/ebitset.c (ebitset_obstack_init): Likewise.
14688 * lib/lbitset.c (lbitset_obstack_init): Likewise.
14689 * src/getargs.c (debug_flag, defines_flag, locations_flag,
14690 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
14691 graph_flag): Likewise.
14692 * src/getargs.h (debug_flag, defines_flag, locations_flag,
14693 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
14694 graph_flag): Likewise.
14695 * src/output.c (error_verbose): Likewise.
14696 * src/output.h (error_verbose): Likewise.
14697 * src/reader.c (start_flag, typed): Likewise.
14698 * src/reader.h (typed): Likewise.
14699 * src/getargs.c (LOCATIONS_OPTION): New constant.
14700 (long_options, getargs): Use it.
14701 * src/lalr.c (build_relations): Use bool, not int.
14702 * src/nullable.c (nullable_compute): Likewise.
14703 * src/print.c (print_reductions): Likewise.
14704 * src/tables.c (action_row, pack_vector): Likewise.
14705 * src/muscle_tab.h (MUSCLE_INSERT_BOOL): New macro.
14706 * src/output.c (prepare): Use it.
14707 * src/output.c (token_definitions_output,
14708 symbol_destructors_output, symbol_destructors_output): Use string,
14709 not boolean integer, to keep track of whether to output separator.
14710 * src/print_graph.c (print_core): Likewise.
14711 * src/state.c (state_rule_lookaheads_print): Likewise.
14712
14713 * config/install-sh: Sync from automake 1.7.5.
14714
14715 2003-05-14 Paul Eggert <eggert@twinsun.com>
14716
14717 * src/parse-gram.y (rules_or_grammar_declaration): Require a
14718 semicolon after a grammar declaration, in the interest of possible
14719 future changes to the Bison input language.
14720 Do not allow a stray semicolon at the start of the grammar.
14721 (rhses.1): Allow one or more semicolons after any rule, including
14722 just before "|" as required by POSIX.
14723 * tests/input.at (Torturing the Scanner): Add tests for ";|" in a
14724 grammar.
14725
14726 2003-05-14 Alexandre Duret-Lutz <adl@gnu.org>
14727
14728 %parse-param support for lalr1.cc.
14729
14730 * data/lalr1.cc (b4_parse_param_decl, b4_parse_param_cons,
14731 b4_cc_constructor_calls, b4_cc_constructor_call,
14732 b4_parse_param_vars, b4_cc_var_decls, b4_cc_var_decl): New m4
14733 definitions.
14734 (yy::b4_parser_class_name::b4_parser_class_name): Take extra
14735 parse-param arguments.
14736 (yy::b4_parser_class_name): Declare instance variables to
14737 hold parse-param arguments.
14738 * tests/calc.at: s/value/semantic_value/ because value clashes
14739 with a member of yy::b4_parser_class_name. Adjust C++ code
14740 to handle %parse-param. Enable %parse-param test in C++.
14741
14742 2003-05-12 Paul Eggert <eggert@twinsun.com>
14743
14744 * doc/bison.texinfo (How Can I Reset @code{yyparse}): Reword the
14745 English a bit. Fix fclose typo. Change "const char" to "char
14746 const", and use ANSI C rather than K&R for "main". Suggest
14747 YY_FLUSH_BUFFER over yyrestart (as that is what Flex recommends)
14748 and suggest yy_switch_to_buffer.
14749
14750 2003-05-05 Paul Eggert <eggert@twinsun.com>
14751
14752 * lib/bitset.h (__INT_TO_PTR): Define to a value that presumes
14753 C89. This avoids a diagnostic on compilers that define __STDC__
14754 to 0, fixing a problem with Tru64 cc reported by Martin Mokrejs in
14755 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
14756
14757 2003-05-03 Paul Eggert <eggert@twinsun.com>
14758
14759 * lib/bitset.h (BITSET_FOR_EACH, BITSET_FOR_EACH_REVERSE):
14760 Do not overrun array bounds.
14761 This should fix a bug reported today by Olatunji Oluwabukunmi in
14762 <http://lists.gnu.org/archive/html/bug-bison/2003-05/msg00004.html>.
14763
14764 2003-04-29 Akim Demaille <akim@epita.fr>
14765
14766 * src/gram.h, src/gram.c (pure_parser, glr_parser): Move to...
14767 * src/getargs.c, src/getargs.h: here, as bool, not int.
14768 (nondeterministic_parser): New.
14769 * src/parse-gram.y, src/scan-gram.l: Support
14770 %nondeterministic-parser.
14771 * src/output.c (prepare): Use nondeterministic_parser instead
14772 of glr_parser where appropriate.
14773 * src/tables.c (conflict_row, action_row, save_row)
14774 (token_actions, token_actions, pack_vector): Ditto.
14775
14776 2003-04-29 Akim Demaille <akim@epita.fr>
14777
14778 * doc/bison.texinfo (C++ Parsers, Implementing Loops): New.
14779
14780 2003-04-29 Akim Demaille <akim@epita.fr>
14781
14782 * tests/calc.at: Also test yacc.c and glr.c (but not lalr1.cc yet)
14783 with %pure-parser and %locations to exercise the patch from Yakov
14784 Markovitch below.
14785
14786 2003-04-28 Tim Van Holder <tim.van.holder@pandora.be>
14787
14788 * data/yacc.c: (b4_lex_param): Corrected for the case where
14789 %lex-param is provided and %pure-parser isn't.
14790
14791 2003-04-27 Paul Eggert <eggert@twinsun.com>
14792
14793 Avoid gcc -Wundef warnings reported by Gerald Pfeifer in
14794 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00044.html>.
14795 * data/yacc.c (YYSTACK_ALLOC): Don't evaluate YYSTACK_USE_ALLOCA
14796 if it is not defined.
14797 (YYMAXDEPTH): Don't evaluate YYMAXDEPTH if it is not defined.
14798
14799 2003-04-26 Paul Eggert <eggert@twinsun.com>
14800
14801 * data/lalr1.cc (yy::Parser::pact_ninf_, yy::Parser::table_ninf_):
14802 Declare to be of type suitable for the ninf value itself, not of
14803 type suitable for the corresponding table, since the latter might
14804 be unsigned but the ninf value might be negative. This fixes a
14805 bug reported by Alexandre Duret-Lutz in
14806 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00017.html>.
14807
14808 * configure.ac (AC_FUNC_ERROR_AT_LINE): Remove, since gl_ERROR
14809 invokes it. We shouldn't invoke it twice because it will attempt
14810 to put error.o in the archive twice. This fixes a glitch reported
14811 by Martin Mokrejs in
14812 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
14813
14814 2003-04-21 Paul Eggert <eggert@twinsun.com>
14815
14816 * m4/error.m4: Update from Bruno Haible's 2003-04-14 patch
14817 to gnulib.
14818
14819 2003-04-21 Yakov Markovitch <Markovitch@iso.ru>
14820
14821 * data/glr.c (yyexpandGLRStack) [!YYSTACKEXPANDABLE]:
14822 Fix obvious typo that results in uncompilable GLR parsers
14823 when both %pure-parser and %locations are used. (trivial change)
14824
14825 2003-04-17 Paul Eggert <eggert@twinsun.com>
14826
14827 * src/scan-gram.l: Add %option nounput, since we no longer use unput.
14828 (unexpected_eof): Renamed from unexpected_end_of_file, for brevity.
14829 Do not insert the expected token via unput, as this runs afoul
14830 of a POSIX-compatibility bug in flex 2.5.31.
14831 All uses changed to BEGIN the parent state,
14832 since we no longer insert the expected token via unput.
14833 * tests/regression.at (Invalid inputs): Remove cascaded diagnostic
14834 that is no longer emitted after the above change.
14835
14836 * src/conflicts.c (set_conflicts): Resolve all conflicts, not just
14837 the first one. This change is from Paul Hilfinger, and it fixes
14838 regression reported by Werner Lemberg in
14839 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
14840
14841 (resolve_sr_conflict): Don't invoke state_errs_set
14842 unless one or more tokens have been explicitly made errors.
14843 Otherwise, the above change causes Bison to abort.
14844
14845 * tests/existing.at (GNU pic Grammar): New test case, taken from
14846 Lemberg's email.
14847
14848 2003-03-31 Akim Demaille <akim@epita.fr>
14849
14850 * doc/Makefile.am (AM_MAKEINFOFLAGS): Don't split the info file.
14851
14852 2003-03-31 Akim Demaille <akim@epita.fr>
14853
14854 * src/output.c (prepare_symbols): Avoid trailing spaces in the
14855 output.
14856
14857 2003-03-31 Akim Demaille <akim@epita.fr>
14858
14859 * doc/bison.texinfo (Strings are Destroyed): s/losses/loses/.
14860 From Paul Hilfinger.
14861
14862 2003-03-29 Akim Demaille <akim@epita.fr>
14863
14864 * m4/error.m4: Do not put under dynamic conditions some code which
14865 expansion is under static control.
14866
14867 2003-03-29 Akim Demaille <akim@epita.fr>
14868
14869 * doc/bison.texinfo (How Can I Reset @code{yyparse}): New.
14870
14871 2003-03-29 Akim Demaille <akim@epita.fr>
14872
14873 * doc/bison.texinfo (Strings are Destroyed): New.
14874
14875 2003-03-13 Paul Eggert <eggert@twinsun.com>
14876
14877 * .cvsignore: Add configure.lineno.
14878 * src/.cvsignore: Add yacc.
14879 * tests/.cvsignore: Add testsuite.log.
14880 * doc/fdl.texi: Sync with latest FSF version.
14881
14882 2003-03-12 Paul Eggert <eggert@twinsun.com>
14883
14884 * scan-gram.l (YY_USER_INIT): Initialize code_start, too.
14885 (<INITIAL><<EOF>>, <SC_PRE_CODE><<EOF>>): Set *loc to the scanner
14886 cursor, instead of leaving it undefined. This fixes a bug
14887 reported by Tim Van Holder in
14888 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00023.html>.
14889 * tests/input.at (Torturing the Scanner): Test the scanner on
14890 an empty input file, which was Tim Van Holder's test case.
14891
14892 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): When checking whether
14893 <sys/resource.h> can be included, include sys/time.h and
14894 sys/times.h first, if available. This works around the SunOS
14895 4.1.4 porting bug reported by Bruce Becker in
14896 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00018.html>.
14897
14898 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't
14899 AC_CHECK_HEADERS([sys/wait.h]), as this interferes with
14900 AC_HEADER_SYS_WAIT.
14901
14902 Merge changes from gnulib. This was prompted because the CVS
14903 snapshot didn't build on Solaris 7 due to strnlen problems.
14904
14905 These changes need to be merged back into gnulib:
14906 * lib/hash.c: Include <stdbool.h> unconditionally.
14907 * m4/onceonly.m4 (m4_quote): New macro.
14908 (AC_CHECK_HEADERS_ONCE, AC_CHECK_FUNCS_ONCE, AC_CHECK_DECLS_ONCE):
14909 Quote AC_FOREACH variable-expansions properly.
14910 The 2003-01-03 obstack.h change also needs merging.
14911 {end of changes requiring merging}
14912
14913 * lib/stdbool.h.in, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
14914 m4/getopt.m4, m4/hash.m4, m4/malloc.m4, m4/memchr.m4,
14915 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/quote.m4,
14916 m4/quotearg.m4, m4/realloc.m4, m4/stpcpy.m4, m4/strnlen.m4,
14917 m4/strtol.m4, m4/strtoul.m4, m4/unlocked-io.m4, m4/xalloc.m4:
14918 New files, imported from gnulib.
14919 * m4/Makefile.am (EXTRA_DIST): Add the new m4/*.m4 files mentioned
14920 above.
14921
14922 * lib/mbswidth.c, m4/error.m4, m4/mbrtowc.m4, m4/mbswidth.m4,
14923 m4/memcmp.m4, m4/prereq.m4, m4/stdbool.m4: Update to current
14924 gnulib sources.
14925
14926 * configure.ac (gl_DIRNAME, gl_GETOPT, gl_HASH, gl_QUOTE, gl_XALLOC):
14927 Add.
14928 (gl_ERROR): New, replacing jm_PREREQ_ERROR.
14929 (gl_FUNC_ALLOCA): New, replacing AC_FUNC_ALLOCA.
14930 (gl_FUNC_STPCPY): New, replacing AC_REPLACE_FUNCS(stpcpy).
14931 (gl_FUNC_STRNLEN): New, replacing AC_FUNC_STRNLEN.
14932 (gl_MBSWIDTH): New, replacing jm_PREREQ_MBSWIDTH.
14933 (gl_OBSTACK): New, replacing AC_FUNC_OBSTACK.
14934 (gl_QUOTEARG): New, replacing jm_PREREQ_QUOTEARG.
14935 (jm_FUNC_GLIBC_UNLOCKED_IO, gl_FUNC_STPCPY, gl_FUNC_STRTOL): New.
14936 (jm_FUNC_MALLOC): New, replacing AC_FUNC_MALLOC.
14937 (jm_FUNC_REALLOC): New, replacing AC_FUNC_REALLOC.
14938 (jm_PREREQ_ARGMATCH): Remove.
14939 (AC_REPLACE_FUNCS): Remove memchr, memrchr, stpcpy, strtol, strtoul.
14940 * lib/Makefile.am (libbison_a_SOURCES): Add argmatch.c, argmatch.h.
14941
14942 * src/system.h: Include <stdbool.h> unconditionally.
14943
14944 * lib/bbitset.h: Include <limits.h> unconditionally. We have been
14945 assuming at least C89 in the bitset code for some time now.
14946
14947 2003-03-03 Akim Demaille <akim@epita.fr>
14948
14949 * ro.po: New.
14950
14951 2003-03-02 Akim Demaille <akim@epita.fr>
14952
14953 * doc/bison.texinfo (Table of Symbols): Reactivate the
14954 documentation for %lex-param, and %parse-param.
14955
14956 2003-03-02 Akim Demaille <akim@epita.fr>
14957
14958 * data/yacc.c, data/glr.c, data/lal1.cc: Use similar code to
14959 generate verbose error messages.
14960 Use the number of tokens as an upper bound in yytname, as it
14961 cannot be a non terminal.
14962
14963 2003-03-02 Akim Demaille <akim@epita.fr>
14964
14965 * tests/regression.at (_AT_DATA_DANCER_Y): Fix the expected error
14966 message.
14967
14968 2003-03-02 Akim Demaille <akim@epita.fr>
14969
14970 * tests/regression.at (_AT_DATA_DANCER_Y, AT_CHECK_DANCER): New.
14971 Use them to exercise yycheck overrun.
14972 Based on Andrew Suffield's grammar.
14973
14974 2003-03-02 Akim Demaille <akim@epita.fr>
14975
14976 Create tests/local.at for Bison generic testing macros.
14977
14978 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Move to...
14979 * tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS):
14980 This new file.
14981 * tests/calc.at (AT_CHECK_CALC): Adjust.
14982 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR)
14983 (AT_COMPILE, AT_COMPILE_CXX, AT_PARSER_CHECK): Move to...
14984 * tests/local.at: here.
14985 (AT_COMPILE_CXX): Tags the tests using it as c++.
14986 Ignore the test if CXX is not functional.
14987
14988 2003-03-01 Paul Eggert <eggert@twinsun.com>
14989
14990 * src/scan-gram.l (code_start): Initialize it to scanner_cursor,
14991 not loc->end, since loc->end might contain garbage and this leads
14992 to undefined behavior on some platforms.
14993 (id_loc, token_start): Use (IF_LINTed) initial values that do not
14994 depend on *loc, so that the reader doesn't give the the false
14995 impression that *loc is initialized.
14996 (<INITIAL>"%%"): Do not bother setting code_start, since its value
14997 does not survive the return.
14998
14999 2003-03-01 Akim Demaille <akim@epita.fr>
15000
15001 * src/scan-gram.l (code_start): Always initialize it when entering
15002 into yylex, as SC_EPILOGUE is activated *before* the corresponding
15003 yylex invocation. An alternative would be making it static, but
15004 then it starts with the second %%'s beginning, instead of its end.
15005
15006 2003-02-28 Paul Eggert <eggert@twinsun.com>
15007
15008 * lib/mbswidth.c: Include <wchar.h> before "mbswidth.h", to work
15009 around a UnixWare 7.1.1 porting bug reported by John Hughes in
15010 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00030.html>.
15011
15012 2003-02-26 Paul Eggert <eggert@twinsun.com>
15013
15014 * README: Mention compiler bug in Sun Forte Developer 6 update 2.
15015 Remove Sequent/Pyramid discussion (nobody uses them any more).
15016 Merge VMS and MS-DOS discussion; these ports may well be dead
15017 but let's keep mentioning them for now. Put <> around email
15018 addresses. Add copyright notice.
15019
15020 2003-02-24 Paul Eggert <eggert@twinsun.com>
15021
15022 * data/glr.c (yy_reduce_print): yylineno -> yylno,
15023 to avoid collision with flex use of yylineno.
15024 Problem reported by Bruce Lilly in
15025 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00016.html>.
15026 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
15027 * data/yacc.c (yy_reduce_print): Likewise.
15028
15029 * config/depcomp: Sync with Automake 1.7.3.
15030
15031 2003-02-21 Akim Demaille <akim@epita.fr>
15032
15033 * data/lalr1.cc: Use temporary variables instead of casts to
15034 change integer types.
15035 Suggested by Paul Eggert.
15036
15037 2003-02-21 Akim Demaille <akim@epita.fr>
15038
15039 * doc/bison.texinfo: Use "location" consistently to refer to @n,
15040 to avoid confusions with lalr1.cc's notion of Position.
15041 Suggested by Paul Eggert.
15042
15043 2003-02-20 Akim Demaille <akim@epita.fr>
15044
15045 * data/lalr1.cc (position.hh): Make sure "columns" never pushes
15046 before initial_columns.
15047 (location.hh): Use consistent variable names when defining the
15048 operator<<.
15049 Use "last" so that we subtract from Positions, not from unsigned.
15050
15051 2003-02-20 Akim Demaille <akim@epita.fr>
15052
15053 * data/lalr1.cc (position.hh): New subfile, including the extended
15054 and Doxygen'ed documentation of class Position.
15055 (location.hh): Use it.
15056 Document a` la Doxygen.
15057 With the help of Benoit Perrot.
15058
15059 2003-02-20 Akim Demaille <akim@epita.fr>
15060
15061 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Define
15062 AT_YACC_IF.
15063 Redefine AT_YYERROR_SEES_LOC_IF using it.
15064 (_AT_DATA_CALC_Y): Don't declare yyerror when lalr1.cc, as it is
15065 not defined.
15066 Don't use the location in yy::Parser::error_ and
15067 yy::Parser::print_ when not %locations.
15068 Activate more lalr1.cc tests.
15069
15070 2003-02-19 Akim Demaille <akim@epita.fr>
15071
15072 * data/lalr1.cc: When displaying a line number, be sure to make it
15073 an int.
15074
15075 2003-02-19 Akim Demaille <akim@epita.fr>
15076
15077 * data/lalr1.cc (b4_stack_depth_init, yy::Parser::initdepth_):
15078 Remove, useless.
15079 (YYABORT, YYACCEPT, YYERROR): New.
15080 * tests/calc.at: Renable the lalr1.cc test.
15081
15082 2003-02-19 Akim Demaille <akim@epita.fr>
15083
15084 * tests/calc.at (AT_CHECK_CALC): Check different scenarios of
15085 error recovery, mixing with/without pops and discarding of the
15086 lookahead.
15087 Exercise YYERROR.
15088 Disable the lalr1.cc tests as currently it doesn't support YYERROR.
15089
15090 2003-02-17 Paul Eggert <eggert@twinsun.com>
15091
15092 * tests/atlocal.in (LDFLAGS, LIBS): New vars.
15093 * tests/testsuite.at (AT_COMPILE): Use them.
15094 This fixes the testsuite problem reported by Robert Lentz in
15095 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00011.html>.
15096
15097 2003-02-12 Paul Eggert <eggert@twinsun.com>
15098
15099 * data/yacc.c (yyerrlab) [YYERROR_VERBOSE]:
15100 Avoid subscript error in yycheck. Bug reported by Andrew Suffield in
15101 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00003.html>.
15102 * data/glr.c (yyreportSyntaxError) [YYERROR_VERBOSE]: Likewise.
15103 Check for malloc failure, for consistency with yacc.c.
15104 (yytname_size): Remove, for consistency with yacc.c.
15105
15106 The bug still remains in data/lalr1.cc, as I didn't have time
15107 to fix it there.
15108
15109 2003-02-06 Akim Demaille <akim@epita.fr>
15110
15111 * configure.ac (GXX): Rename as...
15112 (CXX): this, to keep the original Autoconf semantics.
15113 Require 2.57.
15114 * data/lalr1.cc: Fix b4_copyright invocations.
15115 If YYDEBUG is not defined, don't depend upon name_ being defined.
15116 (location.hh): Include string and iostream.
15117 (Position::filename): New member.
15118 (Position::Position ()): New.
15119 (operator<< (Position)): New.
15120 (operator- (Position, int)): New.
15121 (Location::first, Location::last): Rename as...
15122 (Location::begin, Location::end): these, to mock the conventional
15123 iterator names.
15124 (operator<< (Location)): New.
15125 * tests/atlocal.in (CXX): New.
15126 * tests/testsuite.at (AT_COMPILE_CXX): New.
15127 * tests/calc.at (_AT_DATA_CALC_Y): Adjust yyerror to report the
15128 locations in a more synthetic way.
15129 (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF is positive if
15130 lalr1.cc is used.
15131 Adjust the C locations to match those from Emacs: first column is
15132 column 0.
15133 Change all the expected results.
15134 Conform to the GCS: simplify the locations when applicable.
15135 (LOC, VAL, YYLLOC_FORMAL, YYLLOC_ARG, USE_YYLLOC, LEX_FORMALS)
15136 (LEX_ARGS, USE_LEX_ARGS, LEX_PRE_FORMALS, LEX_PRE_ARGS): Replace
15137 these CPP macros with the m4 macros new defined by...
15138 (AT_CHECK_PUSHDEFS): this, i.e.:
15139 (AT_LALR1_CC_IF, AT_PURE_LEX_IF, AT_LOC, AT_VAL, AT_LEX_FORMALS)
15140 (AT_LEX_ARGS, AT_USE_LEX_ARGS, AT_LEX_PRE_FORMALS, AT_LEX_PRE_ARGS)
15141 New macros.
15142 (AT_CHECK_POPDEFS): Undefine them.
15143 (AT_CHECK_CALC_LALR1_CC): New.
15144 Use it for the first lalr1.cc test.
15145
15146 2003-02-04 Akim Demaille <akim@epita.fr>
15147
15148 * data/lalr1.cc (YYLLOC_DEFAULT): Fix its definition: be based on
15149 Location as is defined.
15150
15151 2003-02-04 Akim Demaille <akim@epita.fr>
15152
15153 * data/lalr1.cc: If YYDEBUG is not defined, don't depend upon
15154 name_ being defined.
15155
15156 2003-02-03 Paul Eggert <eggert@twinsun.com>
15157
15158 * src/gram.h (start_symbol): Remove unused decl.
15159
15160 Use more-consistent naming conventions for local vars.
15161
15162 * src/derives.c (derives_compute): Change type of local var from
15163 int to rule_number.
15164 * src/gram.c (grammar_rules_partial_print): Likewise.
15165 * src/print.c (print_core): Likewise.
15166 * src/reduce.c (reduce_grammar_tables): Likewise.
15167
15168 * src/gram.c (grammar_dump): Change name of item_number *
15169 local var from r to rp.
15170 * src/nullable.c (nullable_compute): Likewise.
15171
15172 * src/gram.h (ISTOKEN, ISVAR): Use i, not s, for int var.
15173
15174 * src/gram.h (symbol_number_as_item_number): Use sym, not s,
15175 for symbol or symbol_number var.
15176 * src/reader.c (grammar_start_symbol_set): Likewise.
15177 * src/reader.h (grammar_start_symbol_set, grammar_symbol_append):
15178 Likewise.
15179 * src/state.c (transitions_to): Likewise.
15180 * src/state.h: Likewise.
15181 * src/tables.c (symbol_number_to_vector_number): Likewise.
15182
15183 * src/muscle_tab.h (MUSCLE_OBSTACK_SGROW): Use p, not s, for
15184 char * var.
15185
15186 * src/parse-gram.y (lloc_default): Use loc, not r, for YYLTYPE
15187 var.
15188
15189 * src/scan-gram.l (no_cr_read): Use bytes_read, not s, for size
15190 var.
15191
15192 * src/system.h (xstrndup, strchr, strspn, strnlen, memchr, memrchr):
15193 Use str, not s, for char * var. Use ch, not c, for character var.
15194 Use size for size var.
15195
15196 * src/uniqstr.c (uniqstr_new, uniqstr_assert): Use str, not s, for
15197 char * var.
15198 (uniqstr_print, uniqst_print_processor): Use ustr, not s, for
15199 uniqstr var.
15200 * src/uniqstr.h: Likewise.
15201
15202 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
15203 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
15204 get_node_alignment_str, get_arrow_mode_str, get_crossing_type_str,
15205 get_view_str, get_linestyle_str, get_arrowstyle_str): Rename
15206 param to have same name as that of enum, so that we don't use
15207 "s" to stand for a non-state.
15208
15209 2003-02-02 Akim Demaille <akim@epita.fr>
15210
15211 * src/scan-skel.l: Scan more than one inert character per yylex
15212 invocation.
15213
15214 2003-02-01 Paul Eggert <eggert@twinsun.com>
15215
15216 Version 1.875a.
15217
15218 * po/LINGUAS: Add ms.
15219
15220 2003-01-30 Akim Demaille <akim@epita.fr>
15221
15222 * doc/Makefile.am (CLEANFILES): Add bison.fns for distcheck.
15223
15224 2003-01-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15225
15226 * tests/cxx-type.at: Correct apparent typo in Bison input: $$ instead
15227 of $1.
15228
15229 Changes in response to error report by S. Eken: GLR mode does not
15230 handle negative $ indices or $ indices in embedded rules correctly.
15231 See <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00076.html>.
15232
15233 * data/glr.c (b4_rhs_value): Change to use YYFILL macro.
15234 (b4_rhs_location): Ditto.
15235 (yyfill): New function to copy from stack tree into array
15236 incrementally.
15237 (yyuserAction): Modify to allow incremental move of semantic values
15238 to rhs array when in GLR mode.
15239 Define YYFILL to use in user-defined actions to fill semantic array
15240 as needed.
15241 Remove dummy use of yystack, as there is now a guaranteed use.
15242 (yydoAction): Modify to allow incremental move of semantic values
15243 to rhs array when in GLR mode.
15244 (yyresolveAction): Ditto.
15245 (yyglrShiftDefer): Update comment.
15246 (yyresolveStates): Use X == NULL for pointers, not !X.
15247 (yyglrReduce): Ditto.
15248 (yydoAction): Ditto
15249
15250 * tests/glr-regr1.at: Rename to ...
15251 * tests/glr-regression.at: Add new regression test for the problems
15252 described above (adapted from S. Eken).
15253 Update copyright notice.
15254 * tests/testsuite.at: Rename glr-regr1.at to glr-regression.at.
15255 * tests/Makefile.am: Ditto.
15256
15257 2003-01-28 Paul Eggert <eggert@twinsun.com>
15258
15259 * data/lalr1.cc: Do not use @output_header_name@ unless
15260 b4_defines_flag is set. This fixes two bugs reported by
15261 Tim Van Holder in
15262 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00071.html>
15263 and <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00073.html>.
15264
15265 2003-01-21 Paul Eggert <eggert@twinsun.com>
15266
15267 * data/yacc.c (YYERROR): Move code from yyerrlab1 to here, so that
15268 we don't need to worry about yyerrlab1 being reported as an
15269 "unused label" by non-GCC C compilers. The downside is that if
15270 locations are used then a couple of statements are duplicated each
15271 time YYERROR is invoked, but the upside is that the warnings
15272 should vanish.
15273 (yyerrlab1): Move code to YERROR.
15274 (yyerrlab2): Remove. Change uses back to yyerrlab1.
15275 This reverts some of the 2002-12-27 change.
15276
15277 2003-01-17 Paul Eggert <eggert@twinsun.com>
15278
15279 * src/output.c (symbol_printers_output): Fix typo that led
15280 to core dump. Problem reported by Antonio Rus in
15281 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00058.html>.
15282
15283 2003-01-13 Akim Demaille <akim@epita.fr>,
15284 Quoc Peyrot <chojin@lrde.epita.fr>,
15285 Robert Anisko <anisko_r@lrde.epita.fr>
15286
15287 * data/lalr1.cc (parse::yyerrlab1): When popping the stack, stop
15288 when the stacks contain one element, as the loop would otherwise
15289 free the last state, and then use the top state (the one we just
15290 popped). This means that the initial elements will not be freed
15291 explicitly, as is the case in yacc.c; it is not a problem, as
15292 these elements have fake values.
15293
15294 2003-01-11 Paul Eggert <eggert@twinsun.com>
15295
15296 * NEWS: %expect-violations are now just warnings, reverting
15297 to Bison 1.30 and 1.75 behavior. This fixes the GCC 3.2
15298 bootstrapping problem reported by Matthias Klose; see
15299 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00053.html>.
15300 * src/conflicts.c (conflicts_print): Likewise.
15301 * tests/conflicts.at (%expect not enough, %expect too much,
15302 %expect with reduce conflicts): Likewise.
15303 * doc/bison.texinfo (Expect Decl): Document this. Also mention
15304 that the warning is enabled if the number of conflicts changes
15305 (not necessarily increases).
15306
15307 * src/getargs.c (version): Update copyright year.
15308
15309 2003-01-09 Akim Demaille <akim@epita.fr>
15310
15311 * src/Makefile.am, lib/Makefile.am: Use $(VAR) instead of @VAR@.
15312
15313 2003-01-08 Paul Eggert <eggert@twinsun.com>
15314
15315 * Makefile.maint (WGETFLAGS):
15316 New macro, containing "-C off" to disable proxy caches.
15317 All uses of $(WGET) changed to $(WGET) $(WGETFLAGS).
15318 (rel-check): Use $(WGET) instead of wget.
15319
15320 2003-01-06 Paul Eggert <eggert@twinsun.com>
15321
15322 * doc/bison.texinfo (Generalized LR Parsing): Add a reference to
15323 the GLR paper of Scott, Johnstone and Hussain.
15324
15325 2003-01-04 Paul Eggert <eggert@twinsun.com>
15326
15327 * configure.ac (AC_ARG_ENABLE): Add --disable-yacc.
15328 (YACC_SCRIPT, YACC_LIBRARY): New vars to AC_SUBST.
15329 * lib/Makefile.am (lib_LIBRARIES): liby.a -> @YACC_LIBRARY@.
15330 (EXTRA_LIBRARIES): New var, for liby.a.
15331 * src/Makefile.am (bin_SCRIPTS): yacc -> @YACC_SCRIPT@.
15332 (EXTRA_SCRIPTS): New var, for yacc.
15333
15334 * data/yacc.c (yyerrlab1): Omit attribute if __cplusplus is defined,
15335 since GNU C++ (as of 3.2.1) does not allow attributes on labels.
15336 Problem reported by Nelson H. F. Beebe.
15337
15338 2003-01-03 Paul Eggert <eggert@twinsun.com>
15339
15340 * lib/obstack.h (__INT_TO_PTR) [__STDC__]: Cast result to
15341 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
15342 when compiling Bison 1.875's `bitset bset = obstack_alloc
15343 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
15344
15345 * src/scan-skel.l (QPUTS): Omit redundant `;' from macro definition.
15346 ([^@\n]): Renamed from [^@\n]+ so that the token buffer does not
15347 grow to a huge size with typical invocation.
15348
15349 * lib/hash.c (_Bool, bool, false, true, __bool_true_false_are_defined):
15350 Use the pattern recommended by Autoconf 2.57, except also protect
15351 against double-definition.
15352 * src/system.h: Likewise.
15353 Portability issues reported by Nelson H. F. Beebe.
15354
15355 * data/glr.c (yybool): Renamed from bool, to avoid collisions in C.
15356 All uses changed. Provide a definition in both C and C++.
15357 (yytrue, yyfalse): Define even if defined (__cplusplus).
15358
15359 * lib/bitset_stats.c (bitset_stats_list): Remove unused var.
15360 Reported by Nelson H. F. Beebe.
15361
15362 * src/scan-skel.l ("@oline@"): Output lineno+1, not lineno.
15363
15364 2003-01-02 Paul Eggert <eggert@twinsun.com>
15365
15366 * data/yacc.c (yyerrlab1): Append `;' after attribute, to
15367 pacify the buggy "smart preprocessor" in MacOS 10.2.3.
15368 Bug reported by Nelson H. F. Beebe.
15369
15370 2003-01-01 Paul Eggert <eggert@twinsun.com>
15371
15372 * Version 1.875.
15373
15374 2002-12-30 Paul Eggert <eggert@twinsun.com>
15375
15376 * src/scan-gram.l (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>","):
15377 Moved here from...
15378 (<INITIAL>","): Here. This causes stray "," to be treated
15379 more uniformly.
15380
15381 * src/scan-gram.l (<SC_BRACED_CODE>"}"): Output ";" before the
15382 last brace in braced code when not in Yacc mode, for compatibility
15383 with Bison 1.35. This resurrects the 2001-12-15 patch to
15384 src/reader.c.
15385
15386 * src/reader.h (YYDECL): Use YYSTYPE, not its deprecated alias
15387 yystype. This follows up the 2002-12-24 YYSTYPE bug fix.
15388
15389 2002-12-28 Paul Eggert <eggert@twinsun.com>
15390
15391 * src/symtab.c (symbol_make_alias): Set type of SYMVAL to be
15392 that of SYM's type. This fixes Debian bug 168069, reported by
15393 Thomas Olsson.
15394
15395 2002-12-28 Paul Eggert <eggert@twinsun.com>
15396
15397 Version 1.75f.
15398
15399 Switch back to the Yacc style of conflict reports, undoing some
15400 of the 2002-07-30 change.
15401 * doc/bison.texinfo (Understanding): Use Yacc style for
15402 conflict reports. Also, use new way of locating rules.
15403 * src/conflicts.c (conflict_report):
15404 Renamed from conflict_report_yacc, removing the old
15405 'conflict_report'. Translate the entire conflict report at once,
15406 so that we don't assume that "," has the same interpretation in
15407 all languages.
15408 (conflicts_output): Use Yacc-style conflict report for each state,
15409 instead of our more-complicated style.
15410 (conflicts_print): Use Yacc-style conflict report, except print
15411 the input file name when not emulating Yacc.
15412 * tests/conflicts.at (Unresolved SR Conflicts, Defaulted
15413 Conflicted Reduction, %expect not enough, %expect too much,
15414 %expect with reduce conflicts): Switch to Yacc-style conflict reports.
15415 * tests/existing.at (GNU Cim Grammar): Likewise.
15416 * tests/glr-regr1.at (Badly Collapsed GLR States): Likewise.
15417
15418 * src/complain.c (warn_at, warn, complain_at, complain, fatal_at,
15419 fatal): Don't invoke fflush; it's not needed and it might even be
15420 harmful for stdout, as stdout might not be open.
15421 * src/reduce.c (reduce_print): Likewise.
15422
15423 2002-12-27 Paul Eggert <eggert@twinsun.com>
15424
15425 Fix a bug where error locations were not being recorded correctly.
15426 This problem was originally reported by Paul Hilfinger in
15427 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00086.html>.
15428
15429 * data/yacc.c (yyparse): New local var yylerrsp, to record the
15430 top of the location stack's error locations.
15431 (yyerrlab): Set it. When discarding a token, push its location
15432 onto yylerrsp so that we don't lose track of the error's end.
15433 (yyerrlab1): Now is only the target of YYERROR, so that we can
15434 properly record the location of the action that failed. For GCC
15435 2.93 and later, insert an __attribute__ ((__unused__)) to avoid
15436 GCC warning about yyerrlab1 being unused if YYERROR is unused.
15437 (yyerrlab2): New label, which yyerrlab now falls through to.
15438 Compute the error's location by applying YYLLOC_DEFAULT to
15439 the locations of all the symbols that went into the error.
15440 * doc/bison.texinfo (Location Default Action): Mention that
15441 YYLLOC_DEFAULT is also invoked for syntax errors.
15442 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
15443 Error locations include the locations of all the tokens that were
15444 discarded, not just the last token.
15445
15446 2002-12-26 Paul Eggert <eggert@twinsun.com>
15447
15448 * src/files.c: Include quote.h.
15449 (compute_output_file_names): Warn if we detect conflicting
15450 outputs to the same file. This should catch the misunderstanding
15451 exemplified by Debian Bug 165349, reported by Bruce Stephens..
15452
15453 * src/conflicts.c (conflicts_print): If the user specifies
15454 "%expect N", report an error if there are any reduce/reduce
15455 conflicts. This is what the manual says should happen.
15456 This fixes Debian bug 130890, reported by Anthony DeRobertis.
15457 * tests/conflicts.at (%expect with reduce conflicts): New test.
15458
15459 Don't use m4_include on relative file names, as it doesn't work as
15460 desired if there happens to be a file with that name under ".".
15461
15462 * m4sugar/version.m4: Remove; it was included but it wasn't used.
15463 * data/Makefile.am (dist_m4sugar_DATA): Remove m4sugar/version.m4.
15464 * data/m4sugar/m4sugar.m4: Don't include m4sugar/version.m4.
15465 * data/glr.c, data/lalr1.cc, data/yacc.c: Don't include c.m4.
15466 * src/output.c (output_skeleton): Use full path names when
15467 specifying a file to include; don't rely on include path, as
15468 it's unreliable when the working file contains a file with
15469 that name.
15470
15471 2002-12-25 Paul Eggert <eggert@twinsun.com>
15472
15473 Remove obsolete references to bison.simple and bison.hairy.
15474 Problem mentioned by Aubin Mahe in
15475 <http://lists.gnu.org/archive/html/help-bison/2002-12/msg00010.html>.
15476 * data/glr.c: Comment fix.
15477 * doc/bison.1: Remove references. Also, mention "yacc".
15478
15479 * src/getargs.c (getargs) [MSDOS]: Don't assume optarg != NULL
15480 with -g option.
15481
15482 * src/parse-gram.y (declaration): Use enum "report_states" rather
15483 than its numeric value 1.
15484
15485 * src/scan-skel.l ("@output ".*\n): Close any old yyout before
15486 opening a new one. This fixes Debian bug 165349, reported by
15487 Bruce Stephens.
15488
15489 2002-12-24 Paul Eggert <eggert@twinsun.com>
15490
15491 Version 1.75e.
15492
15493 * Makefile.maint (cvs-update): Don't assume that the shell
15494 supports $(...), as Solaris sh doesn't.
15495
15496 * src/parse-gram.y (lloc_default): Remove test for empty
15497 nonterminals at the end, since it didn't change the result.
15498
15499 2002-12-24 Paul Eggert <eggert@twinsun.com>
15500
15501 If the user does not define YYSTYPE as a macro, Bison now declares it
15502 using typedef instead of defining it as a macro. POSIX requires this.
15503 For consistency, YYLTYPE is also declared instead of defined.
15504
15505 %union directives can now have a tag before the `{', e.g., the
15506 directive `%union foo {...}' now generates the C code
15507 `typedef union foo { ... } YYSTYPE;'; this is for Yacc compatibility.
15508 The default union tag is `YYSTYPE', for compatibility with Solaris 9
15509 Yacc. For consistency, YYLTYPE's struct tag is now `YYLTYPE'
15510 instead of `yyltype'.
15511
15512 `yystype' and `yyltype' are now obsolescent macros instead of being
15513 typedefs or tags; they are no longer documented and will be
15514 withdrawn in a future release.
15515
15516 * data/glr.c (b4_location_type): Remove.
15517 (YYSTYPE): Renamed from yystype.
15518 (YYSTYPE_IS_DECLARED): New macro, used to prevent double-typedef.
15519 (struct YYLTYPE): Renamed from struct yyltype.
15520 (YYLTYPE): Renamed from yyltype.
15521 (yyltype, yystype): New (and obsolescent) macros,
15522 for backward compatibility.
15523 * data/yacc.c: Likewise.
15524
15525 * data/yacc.c (YYSTYPE): Declare as union YYSTYPE if the user
15526 does not specify a union tag. This is for compatibility with
15527 Solaris 9 yacc.
15528
15529 * src/parse-gram.y (add_param): 2nd arg is now char * not char
15530 const *, since it is now modified by stripping surrounding { }.
15531 (current_braced_code): Remove.
15532 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_UNION,
15533 PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Change names to include
15534 trailing " {...}". Now of type <chars>.
15535 (grammar_declaration): Adjust to bundled tokens.
15536 (code_content): Remove; stripping is now done by add_param.
15537 (print_token_value): Print contents of bundled tokens.
15538 (token_name): New function.
15539
15540 * src/reader.h (braced_code, current_braced_code): Remove.
15541 (token_name): New decl.
15542
15543 * src/scan-gram.l (handle_dollar, handle_at): Now takes int
15544 token_type, not braced_code code_kind. All uses changed.
15545 (SC_PRE_CODE): New state, for scanning after a keyword that
15546 has (or usually has) an immediately-following braced code.
15547 (token_type): New local var, to keep track of which token type
15548 to return when scanning braced code.
15549 (<INITIAL>"%destructor", <INITIAL>"%lex-param",
15550 <INITIAL>"%parse-param", <INITIAL>"%printer",
15551 <INITIAL>"%union"): Set token type and BEGIN SC_PRE_CODE
15552 instead of returning a token type immediately.
15553 (<INITIAL>"{"): Set token type.
15554 (<SC_BRACED_CODE>"}"): Use it.
15555 (handle_action_dollar, handle_action_at): Now returns bool
15556 indicating success. Fail if ! current_rule; this prevents a core dump.
15557 (handle_symbol_code_dollar, handle_symbol_code_at):
15558 Remove; merge body into caller.
15559 (handle_dollar, handle_at): Complain in invalid contexts.
15560
15561 * NEWS, doc/bison.texinfo: Document the above.
15562 * NEWS: Fix years and program names in copyright notice.
15563
15564 2002-12-17 Paul Eggert <eggert@twinsun.com>
15565
15566 * NEWS, doc/bison.texinfo (Parser Function, Pure Calling, Error
15567 Reporting, Table of Symbols): Omit mentions of %lex-param and
15568 %parse-param from the documentation for now.
15569
15570 2002-12-15 Paul Eggert <eggert@twinsun.com>
15571
15572 Undo most of the 2002-11-12 yychar -> yytoken patch, as it broke
15573 GCC 3.2.1 (which depends on yychar == YYEMPTY when there is no
15574 lookahead symbol, and which sets yychar in parser actions) and it
15575 disagreed with the Bison documentation. Bug
15576 reported by Andrew Walrond.
15577
15578 * data/yacc.c (YYTRANSLATE): Don't check for negative argument,
15579 as the caller now does that.
15580 (yyclearin, YYBACKUP, yyparse): Use yychar, not yytoken.
15581 (YYEMPTY): Parenthesize right hand side, since others use it.
15582 (yyparse): Don't assume that our generated code is the only code
15583 that sets yychar.
15584
15585 2002-12-13 Paul Eggert <eggert@twinsun.com>
15586
15587 Version 1.75d.
15588
15589 POSIX requires a "yacc" command.
15590 * src/Makefile.am (bin_SCRIPTS): New macro, for yacc.
15591 (MOSTLYCLEANFILES): Add yacc.
15592 (yacc): New rule.
15593 * doc/bison.texinfo (Invocation, Bison Options): Mention yacc
15594 as an alias for bison y.
15595
15596 * po/LINGUAS: Add da.
15597
15598 * src/getargs.c (__GNU_LIBRARY__) [lint]: Define to work around
15599 problem with latest <getopt.h>.
15600 (HACK_FOR___GNU_LIBRARY___PROTOTYPE): New macro.
15601
15602 * doc/fdl.texi: Upgrade to 1.2.
15603 * lib/alloca.c, lib/error.c, lib/getopt.c, lib/getopt.h
15604 lib/getopt1.c, lib/gettext.h, lib/memrchr.c, lib/obstack.c,
15605 lib/obstack.h, lib/strnlen.c, lib/unlocked-io.h: Sync with
15606 gnulib.
15607 * config/install-sh: Sync with autotools.
15608
15609 Fix a bad interaction with flex 2.5.23 reported by Bruce Lilly in
15610 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
15611 * data/yacc.c (YYLTYPE, struct yyltype): Do not define unless
15612 locations are requested.
15613 (union yyalloc): Do not depend on YYLTYPE_IS_TRIVIAL unless
15614 locations are requested.
15615
15616 2002-12-12 Paul Eggert <eggert@twinsun.com>
15617
15618 Remove unportable casts and storage allocation tricks.
15619 While we're at it, remove almost all casts, since they
15620 usually aren't needed and are a sign of trouble.
15621
15622 * configure.ac (AC_CHECK_TYPES): Check for uintptr_t.
15623
15624 * src/derives.c (derives_compute): Do not subtract NTOKENS from
15625 the pointer DSET returned by malloc; this isn't portable.
15626 Instead, always use DSET[i - NTOKENS] rather than DSET[i].
15627 Similarly for DERIVES.
15628 * src/lalr.c (set_goto_map): Likewise, for GOTO_MAP and TEMP_MAP.
15629 * src/nullable.c (nullable_compute): Likewise, for RSETS and NULLABLE.
15630 * src/reduce.c (reduce_grammar_tables): Likewise, for nontermmap
15631
15632 * src/derives.c (derives_compute): Do not bother invoking
15633 int_of_rule_number, since rule numbers are integers.
15634
15635 * src/files.c (concat2, tr, compute_base_name): Use xmalloc (N)
15636 rather than XMALLOC (char, N).
15637
15638 * src/files.c (filename_split): Rewrite to avoid cast.
15639
15640 * src/gram.h (symbol_number_as_item_number,
15641 item_number_as_symbol_number, rule_number_as_item_number,
15642 item_number_as_rule_number):
15643 Now inline functions rather than macros, to avoid casts.
15644 * src/state.h (state_number_as_int): Likewise.
15645 * src/tables.c (state_number_to_vector_number,
15646 symbol_number_to_vector_number): Likewise.
15647
15648 * src/gram.h (int_of_rule_number): Remove; no longer used.
15649
15650 * src/lalr.c (add_lookback_edge): Use malloc rather than calloc,
15651 since the resulting storage is always stored into.
15652
15653 * src/main.c (alloca) [C_ALLOCA]: Add decl here, the only place
15654 where it's needed.
15655
15656 * src/muscle_tab.c (muscle_m4_output):
15657 Now inline. Return bool, not int.
15658 * src/state.c (state_compare): Likewise.
15659 * src/symtab.c (symbol_check_defined,
15660 symbol_check_alias_consistency, symbol_pack, symbol_translation,
15661 hash_compare_symbol, hash_symbol):
15662 Likewise.
15663 * src/uniqstr.c (uniqstr_print): Likewise.
15664 * src/muscle_tab.c (muscle_m4_output_processor):
15665 New function, to avoid casts.
15666 * src/state.c (state_comparator, stage_hasher): Likewise.
15667 * src/symtab.c (symbol_check_defined_processor,
15668 symbol_check_alias_consistency_processor, symbol_pack_processor,
15669 symbol_translation_processor, hash_symbol_comparator,
15670 hash_symbol_hasher): Likewise.
15671 * src/uniqstr.c (uniqstr_print_processor): Likewise.
15672 * src/muscle_tab.c (muscles_m4_output):
15673 Use new functions instead of casting old functions unportably.
15674 * src/state.c (state_hash_new): Likewise.
15675 * src/symtab.c (symbols_new, symbols_do, symbols_check_defined,
15676 symbols_token_translations_init):
15677 Likewise.
15678 * src/uniqstr.c (uniqstrs_new, hash_initialize, uniqstrs_do): Likewise.
15679
15680 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): Use long local
15681 var instead of casting to long, to avoid casts.
15682 (prepare_states): Use MALLOC rather than alloca, so that we don't
15683 have to worry about alloca.
15684 * src/state.c (state_hash_lookup): Likewise.
15685
15686 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>"'"): Use unsigned char
15687 local var instead of casting to unsigned char, to avoid casts.
15688
15689 * src/state.c (TRANSITIONS_ALLOC, ERRS_ALLOC, REDUCTIONS_ALLOC,
15690 STATE_ALLOC): Remove.
15691 (transitions_new, errs_new, reductions_new, state_new): Use malloc
15692 rather than calloc, and use offsetof to avoid allocating slightly
15693 too much storage.
15694 (state_new): Initialize all members.
15695
15696 * src/state.c (state_hash): Use unsigned accumulator, not signed.
15697
15698 * src/symtab.c (symbol_free): Remove; unused.
15699 (symbol_get): Remove cast in lhs of assignment.
15700 (symbols_do): Now static. Accept generic arguments, not
15701 hashing-related ones.
15702
15703 * src/symtab.h: (NUMBER_UNDEFINED): Remove unnecessary cast.
15704 (symbol_processor): Remove.
15705 (symbols_do): Remove decl; now static.
15706
15707 * src/system.h (alloca): Remove; decl no longer needed.
15708 (<stddef.h>): Include, for offsetof.
15709 (<inttypes.>, <stdint.h>): Include if available.
15710 (uintptr_t): New type, if system lacks it.
15711 (CALLOC, MALLOC, REALLOC): New macros.
15712 All uses of XCALLOC, XMALLOC, and XREALLOC changed to use these
15713 new macros.
15714
15715 * src/tables.c (table_size): Now int, to pacify GCC.
15716 (table_grow, table_ninf_remap): Use signed table size.
15717 (save_row): Don't bother initializing locals when not needed.
15718 (default_goto, goto_actions, pack_vector): Remove unnecessary casts.
15719 * src/uniqstr.c (hash_compare_uniqstr): Likewise.
15720
15721 * src/vcg.h: Correct misspellings.
15722
15723 * src/vcg_defaults.h (G_CMAX): Now INT_MAX.
15724
15725
15726 * src/getargs.c (getargs): Don't assume EOF == -1.
15727
15728 2002-12-09 Paul Eggert <eggert@twinsun.com>
15729
15730 Change identifier spellings to avoid collisions with names
15731 that are reserved by POSIX.
15732
15733 Don't use names ending in _t, since POSIX reserves them.
15734 For consistency, remove _e and _s endings -- they're weren't
15735 needed to remove ambiguity. All uses changed.
15736 * src/uniqstr.h (uniqstr): Renamed from uniqstr_t, which in
15737 turn was just renamed from struniq_t.
15738 * src/uniqstr.c (uniqstr_processor): Renamed from struniq_processor,
15739 which in turn was just renamed from struniq_processor_t.
15740 (hash_compare_uniqstr): Renamed from hash_compare_struniq, which
15741 in turn was renamed from hash_compare_struniq_t.
15742 * src/LR0.c (struct state_list): Renamed from struct state_list_s.
15743 (state_list): Renamed from state_list_t.
15744 * src/assoc.h (assoc): Renamed from assoc_t.
15745 * src/conflicts.c (enum conflict_resolution): Renamed from
15746 enum conflict_resolution_e.
15747 * src/derives.c (struct rule_list): Renamed from struct rule_list_s.
15748 (rule_list): Renamed from rule_list_t.
15749 * src/getargs.h (enum trace): Renamed from enum trace_e.
15750 (enum report): Renamed from enum report_e.
15751 * src/gram.h (item_number): Renamed from item_number_t.
15752 (rule_number): Renamed from rule_number_t.
15753 (struct rule_s): Remove the "rule_s" part; not used.
15754 (rule): Renamed from rule_t.
15755 (rule_filter): Renamed from rule_filter_t.
15756 * src/lalr.c (struct goto_list): Renamed from struct goto_list_s.
15757 (goto_list): Renamed from goto_list_t.
15758 * src/lalr.h (goto_number): Renamed from goto_number_t.
15759 * src/location.h (location): Renamed from location_t.
15760 * src/muscle_tab.c (muscle_entry): Renamed from muscle_entry_t,
15761 and moved here from:
15762 * src/muscle_tab.h (muscle_entry_t): here.
15763 * src/nullable.c (struct rule_list): Renamed from struct rule_list_s.
15764 (rule_list): Renamed from rule_list_t.
15765 * src/print_graph.c (static_graph): Renamed from graph.
15766 * src/reader.h (braced_code): Renamed from braced_code_t.
15767 Remove brace_code_e tag.
15768 * src/relation.h (relation_node): Renamed from relation_node_t.
15769 (relation_nodes): Renamed from relation_nodes_t.
15770 (relation): Renamed from relation_t.
15771 * src/state.h (state_number): Renamed from state_number_t.
15772 (struct state): Renamed from struct state_s.
15773 (state): Renamed from state_t.
15774 (transitions): Renamed from transitions_t. Unused (and
15775 misspelled) transtion_s tag removed.
15776 (errs): Renamed from errs_t. Unused errs_s tag removed.
15777 (reductions): Renamed from reductions_t. Unused tag
15778 reductions_s removed.
15779 * src/symlist.h (symbol_list): Renamed from symbol_list_t.
15780 (struct symbol_list): Renamed from struct symbol_list_s.
15781 * src/symtab.h (symbol_number): Renamed from symbol_number_t.
15782 (struct symbol): Renamed from struct symbol_s.
15783 (symbol): Renamed from symbol_t.
15784 * src/tables.c (vector_number): Renamed from vector_number_t.
15785 (action_number): Renamed from action_t.
15786 * src/tables.h (base_number): Renamed from base_t.
15787 * src/vcg.h (enum color): Renamed from enum color_e.
15788 (enum textmode): Renamed from enum textmode_e.
15789 (enum shape): Renamed from enum shape_e.
15790 (struct colorentry): Renamed from struct colorentry_s.
15791 (struct classname): Renamed from struct classname_s.
15792 (struct infoname): Renamed from struct infoname_s.
15793 (enum layoutalgorithm): Renamed from enum layoutalgorithm_e.
15794 (enum decision): Renamed from enum decision_e.
15795 (enum orientation): Renamed from enum orientation_e.
15796 (enum alignment): Renamed from enum alignment_e.
15797 (enum arrow_mode): Renamed from enum arrow_mode_e.
15798 (enum crossing_type): Renamed from enum crossing_type_e.
15799 (enum view): Renamed from enum view_e.
15800 (struct node): Renamed from struct node_s.
15801 (node): Renamed from node_t.
15802 (enum linestyle): Renamed from enum linestyle_e.
15803 (enum arrowstyle): Renamed from enum arrowstyle_e.
15804 (struct edge): Renamed from struct edge.
15805 (edge): Renamed from edge_t.
15806 (struct graph): Renamed from struct graph_s.
15807 (graph): Renamed from graph_t.
15808 * tests/calc.at (_AT_DATA_CALC_Y, Simple LALR Calculator):
15809 Rename value_t -> value.
15810 * tests/input.at (Torturing the Scanner): Rename value_t -> value,
15811 value_t_as_yystype -> value_as_yystype.
15812
15813 Don't include <errno.h> in the mainstream code, since it
15814 reserves E[A-Z0-9]* and we want to use symbols like 'EQUALS'.
15815 * lib/get-errno.c, lib/get-errno.h: New files.
15816 * lib/Makefile.am (libbison_a_SOURCES): Add get-errno.h,
15817 get-errno.c.
15818 * src/files.c (xfopen, xfclose): Use get_errno instead of errno.
15819 * src/output.c (output_skeleton): Likewise.
15820 * src/scan-gram.l (<INITIAL>{int}): Use set_errno and get_errno
15821 instead of errno.
15822 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>\\x[0-9abcdefABCDEF]+):
15823 Likewise.
15824 (handle_action_dollar, handle_action_at): Likewise.
15825 * src/system.h: Do not include <errno.h>.
15826 (TAB_EXT): Renamed from EXT_TAB.
15827 (OUTPUT_EXT): Renamed from EXT_OUTPUT.
15828
15829 Avoid str[a-z]*, since <string.h> reserves that name space.
15830 Change all instances of "struniq" in names to "uniqstr", and
15831 likewise for "STRUNIQ" and "UNIQSTR".
15832 * src/uniqstr.c: Renamed from src/struniq.c.
15833 * src/uniqstr.h: Renamed from src/struniq.h.
15834 * src/Makefile.am (bison_SOURCES): Adjust to these renamings.
15835 * src/files.c (strsuffix): Remove; unused.
15836 (concat2): Renamed from stringappend. Now static.
15837 * src/files.h (strsuffix, stringappend): Remove; unused.
15838 * src/parse-gram.y (<chars>): Renamed from <string>.
15839 (<uniqstr>): Renamed from <struniq>.
15840 * src/scan-gram.l (obstack_for_string): Renamed from string_obstack.
15841 * src/vcg.h (struct node_s.expand): Renamed from struct node_s.stretch.
15842 (struct graph_s.expand): Renamed from struct graph_s.stretch.
15843 * src/vcg_defaults.h (G_EXPAND): Renamed from G_STRETCH.
15844 (G_LONG_STRAIGHT_PHASE): Renamed from G_STRAIGHT_PHASE.
15845 (N_EXPAND): Renamed from N_STRETCH.
15846
15847 Avoid *_MAX and *_MIN, since <limits.h> reserves that name space.
15848 * data/yacc.c (YYSTACK_GAP_MAXIMUM): Renamed from YYSTACK_GAP_MAX.
15849 * src/gram.h (ITEM_NUMBER_MAX, ITEM_NUMBER_MIN, RULE_NUMBER_MAX):
15850 Remove; unused.
15851 * src/lalr.h (GOTO_NUMBER_MAXIMUM): Renamed from GOTO_NUMBER_MAX.
15852 * src/state.h (STATE_NUMBER_MAXIMUM): Renamed from STATE_NUMBER_MAX.
15853 * src/symtab.h (SYMBOL_NUMBER_MAXIMUM): Renamed from SYMBOL_NUMBER_MAX.
15854 * src/tables.c (VECTOR_NUMBER_MAX, VECTOR_NUMBER_MIN): Remove; unused.
15855 (BASE_MAXIMUM): Renamed from BASE_MAX.
15856 (BASE_MINIMUM): Renamed from BASE_MIN.
15857 (ACTION_MAX): Remove; unused.
15858 (ACTION_NUMBER_MINIMUM): Renamed from ACTION_MIN.
15859 Unnecessary casts removed from above defines.
15860
15861
15862 Fix misspelling in names.
15863 * src/vcg.h (enum_alignment_e): Renamed from enum_alignement_e.
15864 * src/vcg_defaults.h (G_NODE_ALIGNMENT): Renamed from
15865 G_NODE_ALIGNEMENT.
15866
15867
15868 * lib/timevar.c (timevar_report): Renamed from time_report,
15869 for consistency with other names.
15870 * lib/timevar.h (timevar_report): New decl.
15871 * src/system.h (time_report): Remove; decl is now in lib/timevar.h.
15872
15873
15874 Sort include-file uses.
15875
15876 Reorder all include files under src to be in the order "system.h".
15877 then the ../lib include files in angle brackets (alphabetized),
15878 then the . include files in double-quotes (alphabetized). Fix
15879 dependency breakages encountered in this process, as follows:
15880 * src/closure.h, src/derives.h, src/state.h: Include "gram.h".
15881 * src/complain.c: Don't include stdlib.h, string.h _LIBC stuff.
15882 * src/state.h: Include "symtab.h".
15883
15884 2002-12-08 Paul Eggert <eggert@twinsun.com>
15885
15886 * data/glr.c, data/lalr1.cc, data/yacc.c: Do not use __file__,
15887 since this causes problems when __file__ contains character
15888 sequences like "@" that are treated specially by src/scan-skel.l.
15889 Instead, just use the file's basename. This fixes the bug
15890 reported by Martin Mokrejs in
15891 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00007.html>.
15892
15893 2002-12-06 Paul Eggert <eggert@twinsun.com>
15894
15895 Add support for rules that do not have trailing semicolons, as
15896 POSIX requires. Improve the quality of locations in Bison
15897 diagnostics.
15898
15899 * src/location.c: Include <quotearg.h>.
15900 (empty_location): Now const.
15901 (location_print): New function. Follow the recommendation of the
15902 GNU Coding Standards for locations that span file boundaries.
15903 * src/location.h: Do not include <quotearg.h>; no longer needed.
15904 (boundary): New type.
15905 (location_t): Use it. This allows locations to span file boundaries.
15906 All member uses changed: file -> start.file or end.file (as needed),
15907 first_line -> start.line, first_column -> start.column,
15908 last_line -> end.line, last_column -> end.column.
15909 (equal_boundaries): New function.
15910 (LOCATION_RESET, LOCATION_STEP): Remove.
15911 (LOCATION_PRINT): Remove. All callers changed to use location_print.
15912 (empty_location): Now const.
15913 (location_print): New decl.
15914 * src/parse-gram.y (lloc_default): New function, which handles
15915 empty locations more accurately.
15916 (YYLLOC_DEFAULT): Use it.
15917 (%token COLON): Remove.
15918 (%token ID_COLON): New token.
15919 (rules): Use it.
15920 (declarations, rules): Remove trailing semicolon.
15921 (declaration, rules_or_grammar_declaration):
15922 Allow empty (";") declaration.
15923 (symbol_def): Remove empty actions; no longer needed.
15924 (rules_or_grammar_declaration): Remove trailing semicolon.
15925 (semi_colon.opt): Remove.
15926 * src/reader.h: Include location.h.
15927 (scanner_cursor): New decl.
15928 * src/reduce.c (nonterminals_reduce): Use warn_at rather than
15929 rolling our own.
15930 * src/scan-gram.l (YY_USER_INIT): Initialize scanner_cursor instead
15931 of *loc.
15932 (STEP): Remove. No longer needed, now that adjust_location does
15933 the work. All uses removed.
15934 (scanner_cursor): New var.
15935 (adjust_location): Renamed from extend_location. It now sets
15936 *loc and adjusts the scanner cursor. All uses changed.
15937 Don't bother testing for CR.
15938 (handle_syncline): Remove location arg; now updates scanner cursor.
15939 All callers changed.
15940 (unexpected_end_of_file): Now accepts start boundary of token or
15941 comment, not location. All callers changed. Update scanner cursor,
15942 not the location.
15943 (SC_AFTER_IDENTIFIER): New state.
15944 (context_state): Renamed from c_context. All uses changed.
15945 (id_loc, code_start, token_start): New local vars.
15946 (<INITIAL,SC_AFTER_IDENTIFIER>): New initial context. Move all
15947 processing of Yacc white space and equivalents here.
15948 (<INITIAL>{id}): Save id_loc. Begin state SC_AFTER_IDENTIFIER
15949 instead of returning ID immediately, since we need to search for
15950 a subsequent colon.
15951 (<INITIAL>"'", "\""): Save token_start.
15952 (<INITIAL>"%{", "{", "%%"): Save code_start.
15953 (<SC_AFTER_IDENTIFIER>): New state, looking for a colon.
15954 (<SC_YACC_COMMENT>, <SC_COMMENT>, <SC_LINE_COMMENT>):
15955 BEGIN context_state at end, not INITIAL.
15956 (<SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'",
15957 <SC_BRACED_CODE>"}", <SC_PROLOGUE>"%}", <SC_EPILOGUE><<EOF>>):
15958 Return correct token start.
15959 (<SC_BRACED_CODE,SC_PROLOGUE,SC_EPILOGUE>): Save start boundary when
15960 the start of a character, string or multiline comment is found.
15961 * tests/conflicts.at (S/R in initial, Defaulted Conflicted
15962 Reduction): Adjust reported locations to match the more-precise
15963 results now expected.
15964 * tests/input.at (Invalid $n, Invalid @n, Type Clashes): Likewise.
15965 * tests/reduce.at (Useless Rules, Reduced Automaton,
15966 Underivable Rules): Likewise.
15967 * tests/regression.at (Invalid inputs): No longer `expecting ";"
15968 or "|"' now that so many other tokens are allowed by the new grammar.
15969
15970 * src/complain.h (current_file): Remove duplicate decl;
15971 current_file is now owned by files.h.
15972 * src/complain.c, src/scan-gram.l: Include files.h.
15973
15974 2002-12-06 Paul Eggert <eggert@twinsun.com>
15975
15976 * data/glr.c (yy_reduce_print): Don't assume that yyrline[yyrule]
15977 promotes to int; it might be unsigned int.
15978 * data/yacc.c (yy_reduce_print): Likewise.
15979
15980 * doc/bison.texinfo (Table of Symbols): YYERROR_VERBOSE should
15981 be #defined in the prologue, not in the Bison declarations.
15982 This fixes Debian Bug 102878, reported by Shaul Karl.
15983
15984 2002-12-02 Paul Eggert <eggert@twinsun.com>
15985
15986 * configure.ac (AC_REPLACE_FUNCS): Add strtoul.
15987 * lib/strtoul.c: New file, from gnulib.
15988 This fixes a porting bug reported by Peter Klein in
15989 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00000.html>.
15990
15991 2002-11-30 Paul Eggert <eggert@twinsun.com>
15992
15993 * src/scan-gram.l (no_cr_read, extend_location): Move to epilogue,
15994 and put only a forward declaration in the prologue. This is for
15995 consistency with the other scanner helper functions.
15996
15997 Type clashes now generate warnings, not errors, since it
15998 appears that POSIX may allow some grammars with type clashes.
15999 * src/reader.c (grammar_current_rule_check): Warn about
16000 type clashes instead of complaining.
16001 * tests/input.at (Type Clashes): Expect warnings, not complaints.
16002
16003 Add Yacc library, since POSIX requires it.
16004 * doc/bison.texinfo (Yacc Library): New node. Regenerate top menu.
16005 * lib/Makefile.am (lib_LIBRARIES, liby_a_SOURCES): New macros.
16006 * lib/main.c, lib/yyerror.c: New files.
16007
16008 gram_error can be static; it need not be extern.
16009 * src/reader.h (gram_error): Remove decl.
16010 * src/parse-gram.y (gram_error): Now static. Add static decl.
16011 (print_token_value): Omit parameter names from forward decl,
16012 for consistency.
16013
16014 2002-11-29 Paul Eggert <eggert@twinsun.com>
16015
16016 * doc/bison.texinfo: Emphasize that yylex and yyerror must
16017 be declared before being used. E.g., one should typically
16018 declare them in the prologue. Use GNU coding style in examples.
16019 Put "const" consistently after the type it modifies. Mention
16020 that C99 supports "inline". Mention that yyerror traditionally
16021 returns "int".
16022
16023 %parse-param and %lex-param now take just one argument, the
16024 declaration; the argument name is deduced from the declaration.
16025
16026 * doc/bison.texinfo (Parser Function, Pure Calling, Error
16027 Reporting, Table of Symbols): Document this.
16028 * src/parse-gram.y (add_param): New function.
16029 (COMMA): Remove.
16030 (declaration): Implement new rule for %parse-param and %lex-param.
16031 * src/scan-gram.l: "," now elicits a warning, rather than being
16032 a token; this is more compatible with byacc.
16033 * tests/calc.at (Simple LALR Calculator): Adopt new convention.
16034
16035 2002-11-27 Paul Eggert <eggert@twinsun.com>
16036
16037 Rename identifiers to avoid real and potential collisions.
16038
16039 * data/c.m4 (b4_yysymprint_generate): yyout -> yyoutput,
16040 to avoid collision with lex macro described by Bruce Lilly in
16041 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
16042 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
16043 * doc/bison.texinfo (Prologue, Tracing): yyprint -> print_token_value.
16044 * src/parse-gram.y (print_token_value): Renamed from yyprint.
16045 All uses changed.
16046 (YYPARSE_PARAM, YYLEX_PARAM, yycontrol): Remove. All uses changed.
16047 The name "yycontrol" violates the name space rules, and this stuff
16048 wasn't being used anyway.
16049 (input): Remove action; this stuff wasn't being used.
16050 (gram_error): Rename local variable yylloc -> loc.
16051 * src/reader.h (struct gram_control_s, gram_control_t): Remove.
16052 (YY_DECL): Don't use "yy" at start of local variables.
16053 All uses changed, e.g., yylloc -> loc.
16054 * src/scan-gram.l (STEP): Renamed from YY_STEP. All uses changed.
16055 (STRING_GROW): Renamed from YY_OBS_GROW. All uses changed.
16056 (STRING_FINISH): Renamed from YY_OBS_FINISH. All uses changed.
16057 (STRING_FREE): Renamed from YY_OBS_FREE. All uses changed.
16058
16059 * src/parse-gram.y (gram_error): loc is now const *.
16060 * src/reader.h (gram_error): Likewise.
16061
16062 2002-11-24 Paul Eggert <eggert@twinsun.com>
16063
16064 Version 1.75c.
16065
16066 * tests/actions.at (Actions after errors): Use an output format
16067 more similar to that of the Printers and Destructors test.
16068 Test the position of the ';' token too.
16069 (Printers and Destructors): Likewise.
16070 (Printers and Destructors: %glr-parser): Remove for now, to avoid
16071 unnecessarily alarming people when the test fails.
16072
16073 * data/yacc.c (yyerrlab1): Move this label down, so that the
16074 parser does not discard the lookahead token if the user code
16075 invokes YYERROR. This change is required for POSIX conformance.
16076
16077 * lib/error.c: Sync with gnulib.
16078
16079 2002-11-22 Paul Eggert <eggert@twinsun.com>
16080
16081 * lib/quotearg.c, lib/quotearg.h: Sync with gnulib.
16082 * lib/mbswidth.c, lib/mbswidth.h: Likewise.
16083 * lib/xmalloc.c: Likewise.
16084
16085 2002-11-20 Paul Eggert <eggert@twinsun.com>
16086
16087 * lib/argmatch.c, lib/argmatch.h: Sync with gnulib.
16088
16089 2002-11-20 Paul Eggert <eggert@twinsun.com>
16090
16091 Avoid use of <assert.h>, as the GNU Coding Standards hint that one
16092 should use `if (! x) abort ();' rather than `assert (x);', and
16093 anyway it's one less thing to worry about configuring.
16094
16095 * data/glr.c, lib/hash.c, src/system.h: Do not include <assert.h>.
16096 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise,
16097 and replace all instances of assert with abort.
16098 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
16099 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Likewise.
16100
16101 * data/glr.c (yydoAction, yyglrReduce, yysplitStack, yyresolveStates,
16102 yyresolveAction, yyprocessOneStack): Use abort rather than assert.
16103 * lib/hash.c (hash_lookup, hash_get_first, hash_get_next,
16104 hash_find_entry, hash_rehash, hash_insert): Likewise.
16105 * src/conflicts.c (resolve_sr_conflict): Likewise.
16106 * src/lalr.c (set_goto_map, map_goto): Likewise.
16107 * src/nullable.c (nullable_compute): Likewise.
16108 * src/output.c (prepare_rules, token_definitions_output): Likewise.
16109 * src/reader.c (packgram, reader): Likewise.
16110 * src/state.c (state_new, state_free, state_transitions_set,
16111 state_reduction_find): Likewise.
16112 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias,
16113 symbol_pack): Likewise.
16114 * src/tables.c (conflict_row, pack_vector): Likewise.
16115 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
16116 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
16117 get_node_alignement_str, get_arrow_mode_str, get_crossing_type_str,
16118 get_view_str, get_linestyle_str, get_arrowstyle_str): Likewise.
16119
16120 * lib/argmatch.h (ARRAY_CARDINALITY): Do not bother to #undef.
16121 (ARGMATCH_CONSTRAINT): New macro.
16122 (ARGMATCH_ASSERT): Use it.
16123
16124 * src/system.h (verify): New macro.
16125 * src/getargs.c (trace_argmatch, report_argmatch): Use verify
16126 rather than assert.
16127 * src/tables.c (tables_generate): Likewise.
16128
16129 * src/struniq.c (struniq_assert): Now returns void, and aborts
16130 if the assertion is false.
16131 (struniq_assert_p): Remove.
16132 * src/struniq.h: Likewise.
16133
16134 2002-11-18 Paul Eggert <eggert@twinsun.com>
16135
16136 * data/glr.c (yygetLRActions): Replace `yyindex' with
16137 `yytable[yyindex]' to fix typo introduced in my 2002-11-09 patch.
16138 This fixes the regression with Sun ONE Studio 7 cc that I reported in
16139 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00077.html>.
16140
16141 2002-11-18 Akim Demaille <akim@epita.fr>
16142
16143 * doc/bison.texinfo (Tracing): `yyprint' shouldn't prepend a
16144 space.
16145 From Tim Van Holder.
16146
16147 2002-11-17 Paul Eggert <eggert@twinsun.com>
16148
16149 Pacify Sun ONE Studio 7 lint. Also, rename "ParseError"
16150 to "SyntaxError" for consistency with my 2002-11-15 change.
16151
16152 * data/glr.c (YYDPRINTF, YYDSYMPRINT, YYDSYMPRINTF) [!YYDEBUG]: Do
16153 not define to {}, since this breaks the common use of `YYDPRINTF
16154 ((...));' if a single statement is desired (e.g. before `else').
16155 Work around GCC warnings by surrounding corresponding calls with
16156 {} if needed.
16157 (yyhasResolvedValue): Remove unused function.
16158 (yymergeOptionSets, yyresolvStack): Use `continue;' for empty
16159 loop body.
16160 (yyreportSyntaxError): Renamed from yyreportParseError.
16161 (yyrecoverSyntaxError): Renamed from yyrecoverParseError.
16162 All uses changed.
16163 * tests/calc.at (_AT_DATA_CALC_Y): Make vars static instead of
16164 extern when possible. Remove unused initializations.
16165
16166 2002-11-16 Akim Demaille <akim@epita.fr>
16167
16168 Augment the similarity between GLR and LALR traces.
16169
16170 * data/yacc.c (yy_stack_print, YY_STACK_PRINT, yy_reduce_print)
16171 (YY_REDUCE_PRINT): New.
16172 (yyparse): Use them.
16173 * data/glr.c (yy_reduce_print): Use YYFPRINTF, no need for
16174 YYDPRINT here.
16175 (yyglrReduce, yyrecoverParseError, yyparse): Don't report the
16176 state reached after the reduction/recovery, since...
16177 (yyparse, yyprocessOneStack): Report the state we are entering in.
16178
16179 2002-11-16 Akim Demaille <akim@epita.fr>
16180
16181 * src/getargs.h, src/getargs.c (trace_e, trace_args, trace_types):
16182 Add support for --trace=skeleton.
16183 * src/scan-skel.l: %option debug.
16184 Scan strings of non-@ or \n instead of character by character.
16185 (scan_skel): Handle trace_skeleton.
16186 (QPUTS): New.
16187 (@output_parser_name@, @output_header_name@): ``Restore'' their
16188 support (used to be M4 macros).
16189 * data/yacc.c: Quote larger chunks, a la glr.c.
16190 * data/lalr1.cc: Likewise.
16191 The header guards are no longer available, so use some other
16192 string than `YYLSP_NEEDED'.
16193
16194 2002-11-16 Akim Demaille <akim@epita.fr>
16195
16196 Make the ``Printers and Destructors'' test more verbose, taking
16197 `yacc.c''s behavior as (possibly wrong) reference.
16198
16199 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use printf
16200 instead of fprint on stdout.
16201 Set and report the last_line of the symbols.
16202 Consistently display values and locations.
16203
16204 2002-11-16 Paul Eggert <eggert@twinsun.com>
16205
16206 * data/yacc.c: Avoid over-quoting of __line__ and __file__.
16207
16208 2002-11-15 Paul Eggert <eggert@twinsun.com>
16209
16210 * tests/actions.at (Actions after errors): New test case.
16211
16212 * data/glr.c, data/lalr1.cc, data/yacc.cc, doc/bison.texinfo,
16213 src/conflicts.c, src/parse-gram.y, src/tables.c, src/tables.h,
16214 tests/action.at, tests/calc.at, tests/conflicts.at,
16215 tests/cxx-type.at, tests/regression.at:
16216 "parse error" -> "syntax error" for POSIX compatibility.
16217 "parsing stack overflow..." -> "parser stack overflow" so
16218 that code matches Bison documentation.
16219
16220 2002-11-15 Akim Demaille <akim@epita.fr>
16221
16222 * src/parse-gram.y (declaration): Have %parse-param and %lex-param
16223 take two BRACED_CODE, not two string_content.
16224 Free the scanner's obstack when we are done.
16225 (code_content): New.
16226 * tests/calc.at: Adjust.
16227 * doc/bison.texinfo: Adjust.
16228 Also, make sure to include the `,' for these declarations.
16229
16230 2002-11-15 Tim Van Holder <tim.van.holder@pandora.be>
16231
16232 * m4/prereq.m4: Removed the commented jm_PREREQ_HASH
16233 definition; avoids potential autoreconf problems.
16234
16235 2002-11-15 Akim Demaille <akim@epita.fr>
16236
16237 Always check the value returned by yyparse.
16238
16239 * tests/calc.at (_AT_DATA_CALC_Y): Have `main' exit with the value
16240 returned by yyparse.
16241 (_AT_CHECK_CALC_ERROR): Take the expected exit value as argument.
16242 Adjust calls.
16243 * tests/glr-regr1.at (glr-regr1.y): Have `main' exit with the value
16244 returned by yyparse.
16245
16246 2002-11-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16247
16248 * data/glr.c (yyFail): Always set yyerrflag. Corrects regression
16249 on input.at test.
16250
16251 2002-11-14 Paul Eggert <eggert@twinsun.com>
16252
16253 * src/output.c (output_skeleton): Call xfopen instead of
16254 duplicating xfopen's body.
16255
16256 Fix bugs reported by Nelson H. F. Beebe in
16257 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00078.html>.
16258
16259 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that
16260 "$CC -E foo.h" is allowed, as this doesn't work with the Portland
16261 Group compiler. Instead, use "$CC -E bar.c". Include the .h
16262 file twice in the grammar, as an extra check.
16263
16264 * tests/input.at (Torturing the Scanner): Surround the
16265 backslash-newline tests with "#if 0", to make it less likely that
16266 we'll run into compiler bugs. Bring back solitary \ inside
16267 comment, but add a closing comment to work around HP C bug. Don't
16268 test backslash-newline in C character constant.
16269
16270 2002-11-14 Akim Demaille <akim@epita.fr>
16271
16272 * tests/synclines.at (AT_SYNCLINES_COMPILE): Ignore the exit
16273 status of the compiler.
16274 Calling `exit 1' is no longer needed.
16275 Reported by Nelson H. F. Beebe.
16276
16277 2002-11-14 Akim Demaille <akim@epita.fr>
16278
16279 * tests/atlocal.in (CPPFLAGS): We have config.h.
16280 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR):
16281 New.
16282 * tests/actions.at, tests/calc.at, tests/conflicts.at,
16283 * tests/cxx-type.at, tests/glr-regr1.at, tests/headers.at,
16284 * tests/regression.at, tests/torture.at: Use them for all the
16285 grammars that are to be compiled.
16286 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Rename as...
16287 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): this.
16288 * doc/bison.texinfo (GLR Parsers): Document `inline'.
16289
16290 2002-11-14 Akim Demaille <akim@epita.fr>
16291
16292 * doc/bison.texinfo: Various formatting changes (alignments in
16293 samples, additional @group/@end group, GCS in samples.
16294 Use @deffn instead of simple @table to define the directives,
16295 macros, variables etc.
16296
16297 2002-11-13 Paul Eggert <eggert@twinsun.com>
16298
16299 Fix some bugs reported by Albert Chin-A-Young in
16300 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00066.html>.
16301
16302 * tests/input.at (Torturing the Scanner): Don't invoke "cc a.c b.c
16303 -o c"; the HP C compiler chatters during compilation.
16304 Instead, invoke "cc -c a.c -o a.o; cc -c b.c -o b.o; cc a.o b.o -o c".
16305 * tests/headers.at (export YYLTYPE): Likewise.
16306
16307 * tests/input.at (Torturing the Scanner): Remove lines containing
16308 solitary backslashes, as they tickle a bug in the HP C compiler.
16309
16310 * tests/glr-regr1.at (Badly Collapsed GLR States): Avoid //
16311 comments, since they're not portable. Use GNU coding style.
16312
16313 2002-11-13 Akim Demaille <akim@epita.fr>
16314
16315 * data/yacc.c: Leave bigger chunks of quoted text.
16316 (YYDSYMPRINTF): New.
16317 Use it to report symbol activities.
16318 * data/glr.c (YYDSYMPRINTF): New.
16319 Use it.
16320
16321 2002-11-12 Paul Eggert <eggert@twinsun.com>
16322
16323 Version 1.75b.
16324
16325 * data/glr.c (yydoAction): Return YYRESULTTAG, not int.
16326 (yyglrReduce): Return yyok, not 0.
16327 This should avoid the enumerated-type warnings reported
16328 by Nelson H. F. Beebe in
16329 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00057.html>.
16330
16331 * lib/bbitset.h (BITSET_INLINE): Remove.
16332 * lib/bitset.h [! BITSET_INLINE]: Remove.
16333 (bitset_set, bitset_reset, bitset_test): Rename local vars
16334 to avoid shadowing warnings by GCC.
16335
16336 * data/glr.c (inline): Remove #define. It's the user's
16337 responsibility to #define it away, just like 'const'.
16338 This fixes one of the bugs reported by Nelson H. F. Beebe in
16339 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00058.html>.
16340
16341 * Makefile.maint (po-check): Scan .l and .y files instead of the
16342 .c and the .h files that they generate. This fixes the bug
16343 reported by Tim Van Holder in:
16344 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00062.html>
16345 Look for N_ as well as for _. Try to avoid matching #define for
16346 N_ and _.
16347 * po/POTFILES.in: Remove src/parse-gram.c, src/scan-gram.c,
16348 src/system.h. Add src/parse-gram.y, src/scan-gram.l.
16349 * src/scan-gram.l: Revamp regular expressions so that " and '
16350 do not confuse xgettext.
16351
16352 * src/struniq.h (struniq_new): Do not declare the return type
16353 to be 'const'; this violates the C standard.
16354 * src/struniq.c (struniq_new): Likewise.
16355
16356 2002-11-12 Albert Chin-A-Young <china@thewrittenword.com>
16357
16358 * src/Makefile.am (LDADD): Link $(LIBINTL) last to avoid the
16359 duplicate definition of optind on Tru64 UNIX 4.0D with the Compaq
16360 linker.
16361
16362 2002-11-12 Akim Demaille <akim@epita.fr>
16363
16364 * Makefile.maint: Sync with Autoconf:
16365 (local_updates): New.
16366
16367 2002-11-12 Akim Demaille <akim@epita.fr>
16368
16369 * po/POTFILES.in (src/lalr.c, src/state.c): Remove
16370
16371 2002-11-12 Akim Demaille <akim@epita.fr>
16372
16373 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Display the
16374 locations.
16375
16376 2002-11-12 Akim Demaille <akim@epita.fr>
16377
16378 * data/c.m4 (b4_yysymprint_generate): Pass *yyvaluep to YYPRINT,
16379 not yyvalue.
16380
16381 2002-11-12 Akim Demaille <akim@epita.fr>
16382
16383 * tests/actions.at (AT_CHECK_PRINTER_AND_DESTRUCTOR): New.
16384 Use it to test the GLR parser.
16385
16386 2002-11-12 Akim Demaille <akim@epita.fr>
16387
16388 * tests/regression.at (input.y): s/YYEOF/MYEOF/, as the skeleton
16389 defines it.
16390 * data/glr.c (yystos): New.
16391 (b4_yysymprint_generate, b4_yydestruct_generate): Invoke.
16392 (YYDSYMPRINT): New.
16393 (yyval): Don't define it, it is handled via M4.
16394 (yyrecoverParseError): Free verbosely the discarded symbols.
16395 * data/yacc.c (yysymprint): Remove, rather...
16396 (b4_yysymprint_generate): invoke.
16397 * data/c.m4 (b4_yysymprint_generate): New.
16398 Accept pointers as arguments, as opposed to the version from
16399 yacc.c.
16400 (b4_yydestruct_generate): Likewise.
16401 * tests/cations.at (Printers and Destructors): Use Bison directives
16402 instead of CPP macros.
16403 Don't rely on internal details.
16404
16405 2002-11-12 Akim Demaille <akim@epita.fr>
16406
16407 * data/c.m4 (b4_yydestruct_generate, b4_symbol_actions): New.
16408 * data/yacc.c: Rename yychar1 as yytoken, as in glr.c.
16409 Don't work on yychar (i.e., do set it to YYEMPTY, don't match
16410 it against YYEMPTY and so forth), work on yytoken (i.e., set
16411 it to YYEMPTY etc.).
16412 (yydestruct): Replace with a b4_yydestruct_generate invocation.
16413 (b4_symbol_actions): Remove.
16414 * data/glr.c (YYTRANSLATE): As for yacc.c, if negative, it stands
16415 for 0, end-of-input.
16416
16417 2002-11-12 Akim Demaille <akim@epita.fr>
16418
16419 * doc/bison.texinfo (Destructor Decl): New.
16420
16421 2002-11-12 Akim Demaille <akim@epita.fr>
16422
16423 * src/tables.c (tables_generate): Use free for pointers that
16424 cannot be NULL, not XFREE.
16425 (pack_vector): Use assert, not fatal, for bound violations.
16426 * src/state.c (state_new): Likewise.
16427 * src/reader.c (reader): Likewise.
16428 * src/lalr.c (set_goto_map): Likewise.
16429 * src/location.h (LOCATION_PRINT): If first_line is 0, just issue
16430 the file name.
16431
16432 2002-11-12 Akim Demaille <akim@epita.fr>
16433
16434 * src/scan-gram.l, src/reader.h (scanner_last_string_free):
16435 Restore.
16436 * src/scan-gram.l (last_string): Is global to the file, not to
16437 yylex.
16438 * src/parse-gram.y (input): Don't append the epilogue here,
16439 (epilogue.opt): do it here, and free the scanner's obstack.
16440 * src/reader.c (epilogue_set): Rename as...
16441 (epilogue_augment): this.
16442 * data/c.m4 (b4_epilogue): Defaults to empty.
16443
16444 2002-11-12 Akim Demaille <akim@epita.fr>
16445
16446 * src/getargs.c (long_options): Remove duplicates.
16447 * src/vmsgetargs.c, src/build.com, src/bison.cld, src/vmshlp.mar:
16448 Remove.
16449 * doc/bison.rnh: Remove.
16450 * doc/bison.texinfo (VMS Invocation): Remove.
16451
16452 2002-11-12 Akim Demaille <akim@epita.fr>
16453
16454 * src/struniq.h, src/struniq.c (struniq_t): Is const.
16455 (STRUNIQ_EQ, struniq_assert, struniq_assert_p): New.
16456
16457 Use struniq for symbols.
16458
16459 * src/symtab.h (symbol_t): The tag member is a struniq.
16460 (symbol_type_set): Adjust.
16461 * src/symtab.c (symbol_new): Takes a struniq.
16462 (symbol_free): Don't free the tag member.
16463 (hash_compare_symbol_t, hash_symbol_t): Rename as...
16464 (hash_compare_symbol, hash_symbol): these.
16465 Use the fact that tags as struniqs.
16466 (symbol_get): Use struniq_new.
16467 * src/symlist.h, src/symlist.c (symbol_list_n_type_name_get):
16468 Returns a strniq.
16469 * src/reader.h (merger_list, grammar_currentmerge_set): The name
16470 and type members are struniqs.
16471 * src/reader.c (get_merge_function)
16472 (grammar_current_rule_merge_set): Adjust.
16473 (TYPE, current_type): Are struniq.
16474
16475 Use struniq for file names.
16476
16477 * src/files.h, src/files.c (infile): Split into...
16478 (grammar_file, current_file): these.
16479 * src/scan-gram.c (YY_USER_INIT, handle_syncline): Adjust.
16480 * src/reduce.c (reduce_print): Likewise.
16481 * src/getargs.c (getargs): Likewise.
16482 * src/complain.h, src/complain.c: Likewise.
16483 * src/main.c (main): Call struniqs_new early enough to use it for
16484 file names.
16485 Don't free the input file name.
16486
16487 2002-11-12 Akim Demaille <akim@epita.fr>
16488
16489 * src/symtab.c (symbol_free): Remove dead deactivated code:
16490 type_name are properly removed.
16491 Don't use XFREE to free items that cannot be NULL.
16492 * src/struniq.h, src/struniq.c: New.
16493 * src/main.c (main): Initialize/free struniqs.
16494 * src/parse-gram.y (%union): Add astruniq member.
16495 (yyprint): Adjust.
16496 * src/scan-gram.l (<{tag}>): Return a struniq.
16497 Free the obstack bit that used to store it.
16498 * src/symtab.h (symbol_t): The 'type_name' member is a struniq.
16499
16500 2002-11-11 Paul Eggert <eggert@twinsun.com>
16501
16502 Revamp to fix many (but not all) of the C- and M4-related quoting
16503 problems. Among other things, this fixes the Bison bug reported
16504 by Jan Hubicka when processing the Bash grammar; see:
16505 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00039.html>
16506
16507 Use new @ escapes consistently. Represent brackets with @{ and @}
16508 rather than @<:@ and @:>@, since this works a bit better with dumb
16509 editors like vi. Represent @ with @@, since @ is now consistently
16510 an escape. Use @oline@ and @ofile@ rather than __oline__ and
16511 __ofile__, to avoid unexpected expansions. Similarly, use @output
16512 rather than #output.
16513
16514 * data/c.m4 (b4_copyright): Omit file name from comment, since
16515 the file name could contain "*/".
16516 (b4_synclines_flag): Don't quote the 2nd argument; it should already
16517 be quoted. All uses changed.
16518
16519 * data/glr.c: Use new @ escapes consistently.
16520 (b4_input_suffix, b4_output_parser_suffix, b4_output_parser_name,
16521 b4_output_header_suffix, b4_output_header_name, b4_header_guard):
16522 Remove, since they couldn't handle arbitrary characters in file
16523 names.
16524 * data/lalr1.cc: Likewise.
16525 * data/yacc.c: Likewise.
16526
16527 * src/files.c (output_infix): Remove; all uses removed.
16528 * src/files.h: Likewise.
16529
16530 * data/glr.c: Remove use of "#ifdef b4_header_guard", since it
16531 mishandled funny characters in file names, and anyway it isn't
16532 needed any more.
16533 * data/yacc.c: Likewise.
16534 * data/lalr1.cc: Use YYSLP_NEEDED instead of b4_header_guard.
16535
16536 * data/glr.c (YYSTYPE_IS_TRIVIAL): Define when the .h file would.
16537 * data/yacc.c: Likewise.
16538
16539 * src/muscle_tab.c: Include quotearg.h, since we need to quote C
16540 strings now.
16541 (muscle_init): Quote filename as a C string.
16542 * src/muscle_tab.h (MUSCLE_GROW_STRING_PAIR): Remove; unused.
16543 (MUSCLE_OBSTACK_SGROW, MUSCLE_INSERT_C_STRING): New macros.
16544 * src/output.c (escaped_file_name_output): New function.
16545 (prepare_symbols): Quote tokens for M4.
16546 (prepare): Don't insert output_infix, output_prefix,
16547 output_parser_name, output_header_name; this is now down by scan-skel.
16548 Insert skeleton as a C string.
16549
16550 * src/output.c (user_actions_output, symbol_destructors_output,
16551 symbol_printers_output): Quote filenames for C and M4.
16552 * src/reader.c (prologue_augment, epilogue_set): Likewise.
16553
16554 * src/scan-gram.l (<SC_CHARACTER>): Don't worry about any backslash
16555 escapes other than \\ and \'; this simplifies the code.
16556 (<SC_STRING>): Likewise, for \\ and \".
16557 (<SC_COMMENT,SC_LINE_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,
16558 SC_PROLOGUE,SC_EPILOGUE>): Escape $ and @, too.
16559 Use new escapes @{ and @} for [ and ].
16560
16561 * src/scan-skel.l (yylineno, yyoutname): Remove static vars, replacing
16562 them with auto vars.
16563 Switch to new escape scheme, where @ is the escape character uniformly.
16564 Abort if a stray escape character is found. Avoid unbounded input
16565 buffer when parsing non-escaped text.
16566
16567 * tests/input.at (Torturing the Scanner): Add tests that @oline@,
16568 __oline__, #output, $@, and @{ do not have unintended meanings.
16569
16570 2002-11-09 Paul Eggert <eggert@twinsun.com>
16571
16572 Fix the test failure due to GCC warnings described in
16573 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00000.html>.
16574 * data/glr.c (yyis_pact_ninf, yyis_table_ninf): New macros, which
16575 evaluate to 0 if it's impossible for NINF to be in the respective
16576 table.
16577 (yygetLRActions, yyrecoverParseError): Use them.
16578
16579 * src/scan-gram.l (unexpected_end_of_file): Fix bug: columns were
16580 counted in the token inserted at end of file. Now takes
16581 location_t *, not location_t, so that the location can be
16582 adjusted. All uses changed.
16583
16584 * tests/regression.at (Invalid inputs): Adjust wording in
16585 diagnostic to match the new behavior.
16586
16587 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR,
16588 AT_DATA_HORIZONTAL_GRAMMAR, AT_DATA_LOOKAHEADS_GRAMMAR,
16589 AT_DATA_STACK_TORTURE): Replace `assert (x);' with `if (! (x))
16590 abort ();'. This reduces the runtime of the "Many lookaheads"
16591 test from 27.6 to 2.7 minutes on a 440 MHz Ultrasparc III running
16592 GCC 3.2.
16593
16594 2002-11-07 Paul Eggert <eggert@twinsun.com>
16595
16596 * src/parse-gram.y (CHARACTER): Remove unused token.
16597 All uses removed.
16598
16599 * src/scan-gram.l: Remove stack option. We no longer use the
16600 stack, since the stack was never deeper than 1; instead, use the
16601 new auto var c_context to record the stacked value.
16602
16603 Remove nounput option. At an unexpected end of file, we now unput
16604 the minimal input necessary to end cleanly; this simplifies the
16605 code.
16606
16607 Avoid unbounded token sizes where this is easy.
16608
16609 (unexpected_end_of_file): New function.
16610 Use it to systematize the error message on unexpected EOF.
16611 (last-string): Now auto, not static.
16612 (YY_OBS_FREE): Remove unnecessary do while (0) wrapper.
16613 (scanner_last_string_free): Remove; not used.
16614 (percent_percent_count): Move decl to just before use.
16615 (SC_ESCAPED_CHARACTER): Return ID at unexpected end of file,
16616 not the (never otherwised-used) CHARACTER.
16617
16618 2002-11-07 Akim Demaille <akim@epita.fr>
16619
16620 Let yyerror always receive the msg as last argument, so that
16621 yyerror can be variadic.
16622
16623 * data/yacc.c (b4_yyerror_args): New.
16624 Use it when calling yyerror.
16625 * data/glr.c (b4_yyerror_args, b4_lyyerror_args): New.
16626 Use it when calling yyerror.
16627 * doc/bison.texinfo (Error Reporting): Adjust.
16628 * tests/calc.at (_AT_DATA_CALC_Y): Adjust.
16629 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Adjust.
16630
16631 2002-11-06 Akim Demaille <akim@epita.fr>
16632
16633 #line should have quoted strings.
16634 Ideally, this should be done by m4_quotearg.
16635
16636 * src/scan-skel.l: Include quotearg.h.
16637 Quote __ofile__.
16638 * src/output.c (symbol_printers_output)
16639 (symbol_destructors_output): Quote the file name.
16640
16641 2002-11-06 Akim Demaille <akim@epita.fr>
16642
16643 * tests/regression.at (Invalid inputs): Adjust to the recent
16644 messages.
16645
16646 2002-11-06 Akim Demaille <akim@epita.fr>
16647
16648 Restore --no-lines.
16649 Reported by Jim Kent.
16650
16651 * data/c.m4 (b4_syncline): New.
16652 * data/glr.c, data/yacc.c, data/lalr1.cc: Use it.
16653 * src/reader.c (prologue_augment, epilogue_set): Use b4_syncline.
16654 * src/output.c (user_actions_output): Likewise.
16655 (prepare): Define 'b4_synclines_flag'.
16656 * src/muscle_tab.c (muscle_init): Don't define b4_linef.
16657
16658 2002-11-06 Akim Demaille <akim@epita.fr>
16659
16660 * src/main.c (main): Free `infile'.
16661 * src/scan-gram.l (handle_syncline): New.
16662 Recognize `#line'.
16663 * src/output.c (user_actions_output, symbol_destructors_output)
16664 (symbol_printers_output): Use the location's file name, not
16665 infile.
16666 * src/reader.c (prologue_augment, epilogue_set): Likewise.
16667
16668 2002-11-05 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16669
16670 * src/tables.c (matching_state): Don't allow states to match if
16671 either has GLR conflict entries.
16672
16673 2002-11-05 Paul Eggert <eggert@twinsun.com>
16674
16675 * src/scan-gram.l: Use more accurate diagnostics, e.g.
16676 "integer out of range" rather than "invalid value".
16677 * tests/input.at (Invalid $n, Invalid @n): Change expected wording
16678 accordingly.
16679
16680 Scan <% and %> digraphs in C code as POSIX 1003.1-2001 requires.
16681 Also, remove one static variable in the scanner.
16682
16683 * src/scan-gram.l (braces_level): Now auto, not static.
16684 Initialize to zero if the compiler is being picky.
16685 (INITIAL): Clear braces_level instead of incrementing it.
16686 (SC_BRACED_CODE): Treat <% and %> as { and } when inside C code,
16687 as POSIX 1003.1-2001 requires.
16688 * src/system.h (IF_LINT): New macro, taken from coreutils.
16689 * configure.ac: Define "lint" if --enable-gcc-warnings.
16690
16691 2002-11-05 Akim Demaille <akim@epita.fr>
16692
16693 * src/scan-gram.l: When it starts with `%', complain about the
16694 whole directive, not just that `invalid character: %'.
16695
16696 2002-11-04 Akim Demaille <akim@epita.fr>
16697
16698 * Makefile.maint: Update from Autoconf.
16699 (update, cvs-update, po-update, do-po-update): New.
16700
16701 2002-11-04 Akim Demaille <akim@epita.fr>
16702
16703 * tests/glr-regr1.at (Badly Collapsed GLR States): Prototype yylex
16704 and yyerror.
16705 Have yyerror `use' its arguments.
16706 * tests/calc.at (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF
16707 returns true when location & yacc & pure & parse-param.
16708 (_AT_DATA_CALC_Y): Let yyerror ``use'' its arguments.
16709
16710 2002-11-04 Akim Demaille <akim@epita.fr>
16711
16712 * src/location.h (LOCATION_PRINT): Use quotearg slot 3 to avoid
16713 clashes.
16714 * src/scan-gram.l: Use [\'] instead of ['] to pacify
16715 font-lock-mode.
16716 Use complain_at.
16717 Use quote, not quote_n since LOCATION_PRINT no longer uses the
16718 slot 0.
16719
16720 2002-11-03 Paul Eggert <eggert@twinsun.com>
16721
16722 * src/reader.c (get_merge_function, grammar_current_rule_check):
16723 Use consistent diagnostics for reporting type name clashes.
16724 Quote the types with <>, for consistency with Yacc.
16725 * tests/input.at (Type Clashes): Adjust to diagnostic changes.
16726
16727 2002-11-03 Akim Demaille <akim@epita.fr>
16728
16729 * data/c.m4 (b4_identification, b4_user_args, b4_parse_param):
16730 New.
16731 * data/yacc.m4 (b4_pure_args, b4_Pure_args): New.
16732 (b4_parse_param): Remove.
16733 Use b4_identification.
16734 Propagate b4_pure_args where needed to pass them to yyerror.
16735 * data/glr.m4 (b4_parse_param): Remove.
16736 (b4_user_formals, b4_pure_args, b4_pure_formals, b4_lpure_args)
16737 (b4_lpure_formals): New.
16738 Use b4_identification.
16739 (YY_USER_FORMALS, YY_USER_ARGS): Remove, replaced by
16740 b4_user_formals and b4_user_args.
16741 (yyexpandGLRStack, yyFail, yyaddDeferredAction, yyglrShiftDefer)
16742 (yyreportAmbiguity): When using a pure parser, also need
16743 the location, and the parse-params.
16744 Adjust callers.
16745 (yyuserAction, yyglrShift, yyreportParseError, yyrecoverParseError):
16746 When using a pure parser, also need the parse-params.
16747 Adjust callers.
16748 * tests/calc.at: Test pure (%pure-parser) and absolutely pure
16749 (%pure-parser + %parse-param) LALR and GLR parsers.
16750 (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): New, define AT_PARAM_IF,
16751 AT_LOCATION_IF, AT_PURE_IF, AT_GLR_IF, AAT_PURE_AND_LOC_IF,
16752 AT_GLR_OR_PARAM_IF, AT_YYERROR_ARG_LOC_IF, AT_YYERROR_SEES_LOC_IF.
16753 (_AT_DATA_CALC_Y): Equip for purity of yyerror.
16754 (_AT_CHECK_CALC_ERROR): Use AT_YYERROR_SEES_LOC_IF.
16755 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Equip for yyerror purity.
16756 * doc/bison.texinfo: Untabify the whole file.
16757 (Parser Function): Document %parse-param, deprecate YYPARSE_PARAM.
16758 (Pure Calling): Document %lex-param, deprecate YYLEX_PARAM.
16759 (Error Reporting): Adjust to these new directives.
16760 Document %error-verbose, deprecate YYERROR_VERBOSE.
16761
16762 2002-11-03 Akim Demaille <akim@epita.fr>
16763
16764 * tests/calc.at: Change all the AT_CHECK_CALC_LALR and
16765 AT_CHECK_CALC_GLR invocations to use % directives, instead of
16766 command line options.
16767 * tests/cxx-type.at: Formatting changes.
16768
16769 2002-11-03 Paul Eggert <eggert@twinsun.com>
16770
16771 * src/scan-gram.l: Revamp to fix POSIX incompatibilities,
16772 to count columns correctly, and to check for invalid inputs.
16773
16774 Use mbsnwidth to count columns correctly. Account for tabs, too.
16775 Include mbswidth.h.
16776 (YY_USER_ACTION): Invoke extend_location rather than LOCATION_COLUMNS.
16777 (extend_location): New function.
16778 (YY_LINES): Remove.
16779
16780 Handle CRLF in C code rather than in Lex code.
16781 (YY_INPUT): New macro.
16782 (no_cr_read): New function.
16783
16784 Scan UCNs, even though we don't fully handle them yet.
16785 (convert_ucn_to_byte): New function.
16786
16787 Handle backslash-newline correctly in C code.
16788 (SC_LINE_COMMENT, SC_YACC_COMMENT): New states.
16789 (eols, blanks): Remove. YY_USER_ACTION now counts newlines etc.;
16790 all uses changed.
16791 (tag, splice): New EREs. Do not allow NUL or newline in tags.
16792 Use {splice} wherever C allows backslash-newline.
16793 YY_STEP after space, newline, vertical-tab.
16794 ("/*"): BEGIN SC_YACC_COMMENT, not yy_push_state (SC_COMMENT).
16795
16796 (letter, id): Don't assume ASCII; e.g., spell out a-z.
16797
16798 ({int}, handle_action_dollar, handle_action_at): Check for integer
16799 overflow.
16800
16801 (YY_STEP): Omit trailing semicolon, so that it's more like C.
16802
16803 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>): Allow \0 and \00
16804 as well as \000. Check for UCHAR_MAX, not 255.
16805 Allow \x with an arbitrary positive number of digits, as in C.
16806 Check for overflow here.
16807 Allow \? and UCNs, for compatibility with C.
16808
16809 (handle_symbol_code_dollar): Use quote_n slot 1 to avoid collision
16810 with quote slot used by complain_at.
16811
16812 * tests/input.at: Add tests for backslash-newline, m4 quotes
16813 in symbols, long literals, and funny escapes in strings.
16814
16815 * configure.ac (jm_PREREQ_MBSWIDTH): Add.
16816 * lib/Makefile.am (libbison_a_SOURCES): Add mbswidth.h, mbswidth.c.
16817 * lib/mbswidth.h, lib/mbswidth.c: New files, from GNU gettext.
16818 * m4/Makefile.am (EXTRA_DIST): Add mbswidth.m4.
16819 * m4/mbswidth.m4: New file, from GNU coreutils.
16820
16821 * doc/bison.texinfo (Grammar Outline): Document // comments.
16822 (Symbols): Document that trigraphs have no special meaning in Bison,
16823 nor is backslash-newline allowed.
16824 (Actions): Document that trigraphs have no special meaning.
16825
16826 * src/location.h (LOCATION_COLUMNS, LOCATION_LINES): Remove;
16827 no longer used.
16828
16829 2002-11-02 Paul Eggert <eggert@twinsun.com>
16830
16831 * src/reader.c: Don't include quote.h; not needed.
16832 (get_merge_function): Reword warning to be consistent with
16833 type clash diagnostic in grammar_current_rule_check.
16834
16835 * lib/quotearg.c (quotearg_buffer_restyled): Fix off-by-two
16836 bug in trigraph handling.
16837
16838 * src/output.c (prepare_symbols): When printing token names,
16839 escape "[" as "@<:@" and likewise for "]".
16840
16841 * src/system.h (errno): Remove declaration, as we are now
16842 assuming C89 or better, and C89 guarantees errno.
16843
16844 2002-10-30 Paul Eggert <eggert@twinsun.com>
16845
16846 * lib/bitset_stats.c (bitset_stats_read, bitset_stats_write):
16847 Check for close failures.
16848 * src/files.h (xfclose): Return void, not int, since it always
16849 returned zero.
16850 * src/files.c (xfclose): Likewise. Report I/O error if ferror
16851 indicates one.
16852 * src/output.c (output_skeleton): Use xfclose rather than fclose
16853 and ferror. xfclose now checks ferror.
16854
16855 * data/glr.c (YYLEFTMOST_STATE): Remove.
16856 (yyreportTree): Use a stack-based leftmost state. This avoids
16857 our continuing battles with bogus warnings about initializers.
16858
16859 2002-10-30 Akim Demaille <akim@epita.fr>
16860
16861 * src/system.h: Don't use #ifdef/#ifndef on HAVE_ values, only
16862 #if.
16863
16864 2002-10-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16865
16866 * tests/glr-regr1.at: New test for reported regressions.
16867 * tests/testsuite.at: Add glr-regr1.at test.
16868 * tests/Makefile.am: Add glr-regr1.at test.
16869
16870 2002-10-24 Paul Eggert <eggert@twinsun.com>
16871
16872 Version 1.75a.
16873
16874 * tests/calc.at (_AT_DATA_CALC_Y): Remove unused strcat declaration.
16875 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Include stdlib.h, since
16876 we use malloc. Don't assume 'A' through 'Z' are contiguous.
16877 Don't assume strdup exists; POSIX says its an XSI extension.
16878 Check for buffer overflow on input.
16879
16880 2002-10-24 Akim Demaille <akim@epita.fr>
16881
16882 * src/output.c (output_skeleton): Don't disable M4sugar comments
16883 too soon: it results in comments being expanded.
16884 * data/yacc.c, data/glr.c, data/lalr1.cc: Do it right before the
16885 first output.
16886
16887 2002-10-24 Akim Demaille <akim@epita.fr>
16888
16889 * data/yacc.c (m4_int_type): New.
16890 * data/c.m4 (m4_int_type): Don't use yysigned_char, but `signed
16891 char' as only yacc.c wants K&R portability.
16892 * data/glr.c (yysigned_char): Remove.
16893 * data/lalr1.cc: Rename the trailing b4_name as b4_parser_class_name.
16894 Reported by Quoc Peyrot.
16895
16896 2002-10-23 Paul Eggert <eggert@twinsun.com>
16897
16898 * src/main.c (main): With --trace=time, report times even if a
16899 non-fatal error occurs. Formerly, the times were reported in some
16900 such cases but not in others.
16901 * src/reader.c (reader): Just return if a complaint has been issued,
16902 instead of exiting, so that 'main' can report times.
16903
16904 2002-10-22 Akim Demaille <akim@epita.fr>
16905
16906 * src/system.h: Include sys/types.
16907 Reported by Bert Deknuydt.
16908
16909 2002-10-23 Paul Eggert <eggert@twinsun.com>
16910
16911 * configure.ac (AC_PROG_LEX): Use instead of AM_PROG_LEX.
16912 Suggested by Art Haas.
16913
16914 2002-10-22 Paul Eggert <eggert@twinsun.com>
16915
16916 * src/complain.c (exit) [! (STDC_HEADERS || _LIBC)]: Remove exit
16917 decl; not needed any more.
16918 * src/main.c (main): Use return to exit, undoing yesterday's change.
16919 The last OS that we could find where this wouldn't work is
16920 SunOS 3.5, and that's too old to worry about now.
16921
16922 * data/glr.c (struct yyltype): Define members even when not
16923 doing locations. This is more consistent with yacc.c, and it
16924 works around the following bug reports:
16925 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00106.html
16926 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00111.html
16927
16928 * doc/bison.texinfo: Minor spelling and typographical fixes. Use
16929 @acronym consistently. Standardize on "Yacc" instead of "YACC",
16930 "Algol" instead of "ALGOL". Give a bit more history about BNF.
16931
16932 2002-10-22 Akim Demaille <akim@epita.fr>
16933
16934 * data/README: New.
16935
16936 2002-10-21 Paul Eggert <eggert@twinsun.com>
16937
16938 Be consistent about 'bool'; the old code used an enum in one
16939 module and an int in another, and this violates the C standard.
16940 * m4/stdbool.m4: New file, from coreutils 4.5.3.
16941 * configure.ac (AC_HEADER_STDBOOL): Add.
16942 * m4/Makefile.am (EXTRA_DIST): Add stdbool.m4.
16943 * src/muscle_tab.c (hash_compare_muscles): (a ? FALSE : TRUE) -> (! a)
16944 * src/symtab.c (hash_compare_symbol_t): Likewise.
16945 * src/system.h (bool, false, true): Use a definition consistent
16946 with ../lib/hash.c. All uses changed.
16947
16948 * src/complain.c (warning_issued): Renamed from warn_message_count,
16949 so that we needn't worry about integer overflow (!).
16950 Now of type bool. All uses changed.
16951 (complaint_issued): Renamed from complain_message_count; likewise.
16952
16953 * src/main.c (main): Use exit to exit with failure.
16954
16955 * src/complain.c (fatal_at, fatal): Use EXIT_FAILURE and EXIT_SUCCESS
16956 rather than 1 and 0.
16957 * src/main.c (main): Likewise.
16958 * src/getargs.c (getargs): Likewise.
16959 * src/reader.c (reader): Likewise.
16960
16961 * src/getarg.c (getargs): Remove duplicate code for
16962 "Try `bison --help'".
16963
16964 * src/files.c (xfopen, xfclose): Use EXIT_FAILURE rather than 2.
16965 What was that "2" for?
16966
16967 * src/complain.h (fatal, fatal_at): Add __attribute__((__noreturn__)).
16968 * src/getargs.c (usage): Likewise.
16969
16970 * src/getargs.c (getargs): When there are too few operands, report
16971 the last one. When there are too many, report the first extra
16972 one. This is how diffutils does it.
16973
16974 2002-10-20 Paul Eggert <eggert@twinsun.com>
16975
16976 Remove K&R vestiges.
16977 * configure.ac (AC_C_CONST, AM_C_PROTOTYPES): Remove.
16978 * src/complain.c (VA_START): Remove. Assume prototypes.
16979 (vfprintf) [! (HAVE_VPRINTF || defined vfprintf)]: New macro.
16980 (private_strerror, warn_at, warn, complain_at, complain, fatal_at,
16981 fatal): Assume prototypes.
16982 * src/complain.h: Assume prototypes.
16983 * src/system.h (PARAMS): Remove.
16984 Include <limits.h> unconditionally, since it's guaranteeed even
16985 for a freestanding C89 compiler.
16986 (SHRT_MIN, SHRT_MAX): Remove, since C89 guarantees them.
16987 * src/vmsgetargs.c (getargs, cli_present, cli_get_value): Prototype.
16988
16989 2002-10-20 Akim Demaille <akim@epita.fr>
16990
16991 * src/muscle_tab.c (muscle_grow): Remove trailing debugging code.
16992 * data/glr.c (YY_USER_FORMALS, YY_USER_ARGS): New.
16993 (yyuserAction, yydoAction, yyglrReduce, yyresolveValue)
16994 (yyresolveStates, yyresolveAction, yyresolveStack)
16995 (yyprocessOneStack): Use them.
16996 (yy_reduce_print): New.
16997 * tests/calc.at (_AT_DATA_CALC_Y): Exercise %parse-param.
16998
16999 2002-10-20 Akim Demaille <akim@epita.fr>
17000
17001 * data/c.m4 (b4_c_ansi_args): Recognize functions with no
17002 arguments and output `void'.
17003 (b4_c_function): Rename as...
17004 (b4_c_function_def): this.
17005 (b4_c_function_decl, b4_c_ansi_function_def)
17006 (b4_c_ansi_function_decl): New.
17007 Change the interpretation of the arguments: before `int, foo', now
17008 `int foo, foo'.
17009 * data/yacc.c (yyparse): Prototype and define thanks to these.
17010 Adjust b4_c_function_def uses.
17011 * data/glr.c (yyparse): Likewise, but ANSI only.
17012
17013 2002-10-20 Akim Demaille <akim@epita.fr>
17014
17015 * src/output.c (prepare): Move the definition of `tokens_number',
17016 `nterms_number', `undef_token_number', `user_token_number_max'
17017 to...
17018 (prepare_tokens): Here.
17019 (prepare_tokens): Rename as...
17020 (prepare_symbols): this.
17021 (prepare): Move the definition of `rules_number' to...
17022 (prepare_rules): here.
17023 (prepare): Move the definition of `last', `final_state_number',
17024 `states_number' to...
17025 (prepare_states): here.
17026 * data/yacc.c, data/lalr1.cc, data/glr.c: Normalize `>' into `<'.
17027
17028 2002-10-20 Akim Demaille <akim@epita.fr>
17029
17030 * src/tables.h, src/tables.c, src/output.c: Comment changes.
17031
17032 2002-10-20 Akim Demaille <akim@epita.fr>
17033
17034 * data/yacc.c, data/yacc.c (b4_location_if, b4_pure_if): Move to...
17035 * data/c.m4: here.
17036
17037 2002-10-20 Akim Demaille <akim@epita.fr>
17038
17039 * src/output.c (prepare): Use MUSCLE_INSERT_STRING.
17040 * src/muscle_tab.c (muscle_pair_list_grow): Rename `val as
17041 `pair'.
17042 (muscle_init): Move the `b4_ltype', `b4_maxdepth', `b4_initdepth',
17043 `name' to...
17044 * data/glr.c, data/lalr1.cc, data/yacc.c (b4_location_type)
17045 (b4_stack_depth_init, b4_stack_depth_max, b4_parser_class_name):
17046 These.
17047
17048 2002-10-19 Paul Eggert <eggert@twinsun.com>
17049
17050 Do not create a temporary file, as that involves security and
17051 cleanup headaches. Instead, use a pair of pipes.
17052 Derived from a suggestion by Florian Krohm.
17053 * lib/subpipe.c, lib/subpipe.h, m4/subpipe.m4: New files.
17054 * lib/mkstemp.c, lib/readpipe.c, lib/tempname.c, m4/mkstemp.m4: Remove.
17055 * configure.ac (UTILS_FUNC_MKSTEMP, jm_PREREQ_TEMPNAME): Remove.
17056 (BISON_PREREQ_SUBPIPE): Add.
17057 * lib/Makefile.am (libbison_a_SOURCES): Remove readpipe.c.
17058 Add subpipe.h, subpipe.c.
17059 * m4/Makefile.am (EXTRA_DIST): Remove mkstemp.m4. Add subpipe.m4.
17060 * po/POTFILES.in: Add lib/subpipe.c.
17061 * src/output.c: Include "subpipe.h".
17062 (m4_invoke): Remove decl.
17063 (scan_skel): New decl.
17064 (output_skeleton): Use pipe rather than temporary file for m4 input.
17065 Check that m4sugar.m4 is readable, to avoid deadlock.
17066 Check for pipe I/O error.
17067 * src/scan-skel.l (readpipe): Remove decl.
17068 (scan_skel): New function, to be used in place of m4_invoke.
17069 Read from stream rather than file.
17070
17071 * lib/timevar.c (TICKS_TO_MSEC, CLOCKS_TO_MSEC): Do not cast to
17072 float, as this generates a warning on Solaris 8 + GCC 3.2 with
17073 --enable-gcc-warnings. Instead, divide into 1.0 rather than 1;
17074 this generates a more-accurate value anyway.
17075
17076 * lib/timevar.c (timervar_accumulate): Rename locals to
17077 avoid confusion with similarly-named more-global.
17078 * src/muscle_tab.c (muscle_pair_list_grow): Likewise.
17079
17080 * src/output.c (prepare): Use xstrdup to convert char const *
17081 to char *, to avoid GCC warning.
17082
17083 2002-10-19 Akim Demaille <akim@epita.fr>
17084
17085 * tests/calc.at (_AT_DATA_CALC_Y): Define VAL, LOC, LEX_FORMALS,
17086 LEX_PRE_FORMALS, LEX_ARGS, LEX_PRE_ARGS, USE_LEX_ARGS.
17087 Use them to have `calc.y' ready for %pure-parser.
17088 * data/yacc.c (YYLEX): Pass a yylex return type to
17089 b4_c_function_call.
17090
17091 2002-10-19 Akim Demaille <akim@epita.fr>
17092
17093 Prototype support of %lex-param and %parse-param.
17094
17095 * src/parse-gram.y: Add the definition of the %lex-param and
17096 %parse-param tokens, plus their rules.
17097 Drop the `_' version of %glr-parser.
17098 Add the "," token.
17099 * src/scan-gram.l (INITIAL): Scan them.
17100 * src/muscle_tab.c: Comment changes.
17101 (muscle_insert, muscle_find): Rename `pair' as `probe'.
17102 * src/muscle_tab.h (MUSCLE_INSERT_PREFIX): Remove unused.
17103 (muscle_entry_s): The `value' member is no longer const.
17104 Adjust all dependencies.
17105 * src/muscle_tab.c (muscle_init): Adjust: use
17106 MUSCLE_INSERT_STRING.
17107 Initialize the obstack earlier.
17108 * src/muscle_tab.h, src/muscle_tab.c (muscle_grow)
17109 (muscle_pair_list_grow): New.
17110 * data/c.m4 (b4_c_function_call, b4_c_args): New.
17111 * data/yacc.c (YYLEX): Use b4_c_function_call to honor %lex-param.
17112 * tests/calc.at: Use %locations, not --locations.
17113 (AT_CHECK_CALC_GLR): Use %glr-parser, not %glr_parser.
17114
17115 2002-10-19 Akim Demaille <akim@epita.fr>
17116
17117 * src/getargs.c (usage): Take status as argument and exit
17118 accordingly.
17119 Report the traditional `Try ... --help' message when status != 0.
17120 (usage, version): Don't take a FILE * as arg, it is pointless.
17121 (getargs): When there is an incorrect number of arguments, make it
17122 an error, and report it GNUlically thanks to `usage ()'.
17123
17124 2002-10-18 Paul Eggert <eggert@twinsun.com>
17125
17126 * data/glr.c (yyreportParseError): Don't assume that sprintf
17127 yields the length of the printed string, as this is not true
17128 on SunOS 4.1.4. Reported by Peter Klein.
17129
17130 * tests/calc.at (_AT_DATA_CALC_Y): #undef memcmp and realloc.
17131 * tests/conflicts.at (%nonassoc and eof): Likewise.
17132 Fixes SunOS 4.1.4 test failure reported by Peter Klein.
17133
17134 2002-10-17 Akim Demaille <akim@epita.fr>
17135
17136 * src/getargs.h (trace_e): Add trace_scan, and trace_parse.
17137 * src/getargs.c (trace_types, trace_args): Adjust.
17138 * src/reader.c (grammar_current_rule_prec_set)
17139 (grammar_current_rule_dprec_set, grammar_current_rule_merge_set):
17140 Standardize error messages.
17141 And s/@prec/%prec/!
17142 (reader): Use trace_flag to enable scanner/parser debugging,
17143 instead of an adhoc scheme.
17144 * src/scan-gram.l: Remove trailing debugging code.
17145
17146 2002-10-16 Paul Eggert <eggert@twinsun.com>
17147
17148 * src/muscle_tab.h (MUSCLE_TAB_H_): Was misspelled as
17149 MUSCLE_TAB_H.
17150
17151 * NEWS: Officially drop support for building Bison with K&R C,
17152 since it didn't work anyway and it's not worth worrying about.
17153 * Makefile.maint (wget_files): Remove ansi2knr.c.
17154 (ansi2knr.c-url_prefix): Remove.
17155 * lib/.cvsignore: Remove ansi2knr, ansi2knr.*.
17156 * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
17157 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
17158
17159 2002-10-15 Paul Eggert <eggert@twinsun.com>
17160
17161 Stop using the "enum_" trick for K&R-style function definitions;
17162 it confused me, and I was the author! Instead, assume that people
17163 who want to use K&R C compilers (when using these modules in GCC,
17164 perhaps?) will run ansi2knr.
17165
17166 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): Remove.
17167 All uses of "enum_" changed to "enum ".
17168 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
17169 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
17170
17171 * lib/abitset.c (abitset_and, abitset_and_cmp, abitset_and_or,
17172 abitset_and_or_cmp, abitset_andn, abitset_andn_cmp,
17173 abitset_andn_or, abitset_andn_or_cmp, abitset_bytes, abitset_copy,
17174 abitset_copy1, abitset_disjoint_p, abitset_empty_p,
17175 abitset_equal_p, abitset_init, abitset_list, abitset_list_reverse,
17176 abitset_not, abitset_ones, abitset_or, abitset_or_and,
17177 abitset_or_and_cmp, abitset_or_cmp, abitset_reset, abitset_set,
17178 abitset_size, abitset_small_list, abitset_subset_p, abitset_test,
17179 abitset_unused_clear, abitset_xor, abitset_xor_cmp, abitset_zero):
17180 Use function prototypes; this removes the need for declaring
17181 static functions simply to provide their prototypes.
17182 * lib/bitset.c (bitset_alloc, bitset_and_or_, bitset_and_or_cmp_,
17183 bitset_andn_or_, bitset_andn_or_cmp_, bitset_bytes, bitset_copy_,
17184 bitset_count_, bitset_create, bitset_dump, bitset_first,
17185 bitset_free, bitset_init, bitset_last, bitset_next,
17186 bitset_obstack_alloc, bitset_obstack_free, bitset_only_set_p,
17187 bitset_op4_cmp, bitset_or_and_, bitset_or_and_cmp_, bitset_prev,
17188 bitset_print, bitset_release_memory, bitset_toggle_,
17189 bitset_type_choose, bitset_type_get, bitset_type_name_get,
17190 debug_bitset): Likewise.
17191 * lib/bitset.h (bitset_set, bitset_reset, bitset_test): Likewise.
17192 * lib/bitset_stats.c (bitset_log_histogram_print,
17193 bitset_percent_histogram_print, bitset_stats_and,
17194 bitset_stats_and_cmp, bitset_stats_and_or,
17195 bitset_stats_and_or_cmp, bitset_stats_andn, bitset_stats_andn_cmp,
17196 bitset_stats_andn_or, bitset_stats_andn_or_cmp, bitset_stats_copy,
17197 bitset_stats_count, bitset_stats_disable, bitset_stats_disjoint_p,
17198 bitset_stats_dump, bitset_stats_empty_p, bitset_stats_enable,
17199 bitset_stats_equal_p, bitset_stats_free, bitset_stats_init,
17200 bitset_stats_list, bitset_stats_list_reverse, bitset_stats_not,
17201 bitset_stats_ones, bitset_stats_or, bitset_stats_or_and,
17202 bitset_stats_or_and_cmp, bitset_stats_or_cmp, bitset_stats_print,
17203 bitset_stats_print_1, bitset_stats_read, bitset_stats_reset,
17204 bitset_stats_set, bitset_stats_size, bitset_stats_subset_p,
17205 bitset_stats_test, bitset_stats_toggle, bitset_stats_type_get,
17206 bitset_stats_write, bitset_stats_xor, bitset_stats_xor_cmp,
17207 bitset_stats_zero): Likewise.
17208 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
17209 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
17210 bitsetv_dump, debug_bitsetv): Likewise.
17211 * lib/ebitset.c (ebitset_and, ebitset_and_cmp, ebitset_andn,
17212 ebitset_andn_cmp, ebitset_bytes, ebitset_copy, ebitset_copy_,
17213 ebitset_copy_cmp, ebitset_disjoint_p, ebitset_elt_add,
17214 ebitset_elt_alloc, ebitset_elt_calloc, ebitset_elt_find,
17215 ebitset_elt_free, ebitset_elt_last, ebitset_elt_remove,
17216 ebitset_elt_zero_p, ebitset_elts_grow, ebitset_empty_p,
17217 ebitset_equal_p, ebitset_free, ebitset_init, ebitset_list,
17218 ebitset_list_reverse, ebitset_not, ebitset_ones, ebitset_op3_cmp,
17219 ebitset_or, ebitset_or_cmp, ebitset_release_memory, ebitset_reset,
17220 ebitset_set, ebitset_size, ebitset_subset_p, ebitset_test,
17221 ebitset_weed, ebitset_xor, ebitset_xor_cmp, ebitset_zero):
17222 Likewise.
17223 * lib/lbitset.c (debug_lbitset, lbitset_and, lbitset_and_cmp,
17224 lbitset_andn, lbitset_andn_cmp, lbitset_bytes, lbitset_copy,
17225 lbitset_copy_cmp, lbitset_disjoint_p, lbitset_elt_alloc,
17226 lbitset_elt_calloc, lbitset_elt_find, lbitset_elt_free,
17227 lbitset_elt_link, lbitset_elt_unlink, lbitset_elt_zero_p,
17228 lbitset_empty_p, lbitset_equal_p, lbitset_free, lbitset_init,
17229 lbitset_list, lbitset_list_reverse, lbitset_not, lbitset_ones,
17230 lbitset_op3_cmp, lbitset_or, lbitset_or_cmp, lbitset_prune,
17231 lbitset_release_memory, lbitset_reset, lbitset_set, lbitset_size,
17232 lbitset_subset_p, lbitset_test, lbitset_weed, lbitset_xor,
17233 lbitset_xor_cmp, lbitset_zero): Likewise.
17234
17235 2002-10-14 Akim Demaille <akim@epita.fr>
17236
17237 Version 1.75.
17238
17239 2002-10-14 Akim Demaille <akim@epita.fr>
17240
17241 * tests/Makefile.am (maintainer-check-posix): New.
17242
17243 2002-10-14 Akim Demaille <akim@epita.fr>
17244
17245 * data/glr.c [YYDEBUG] (YYLEFTMOST_STATE): Initialize the yyloc
17246 member.
17247
17248 2002-10-14 Akim Demaille <akim@epita.fr>
17249
17250 * src/tables.c (table_ninf_remap): base -> tab.
17251 Reported by Matt Rosing.
17252
17253 2002-10-14 Paul Eggert <eggert@twinsun.com>
17254
17255 * tests/action.at, tests/calc.at, tests/conflicts.at,
17256 tests/cxx-type.at, tests/headers.at, tests/input.at,
17257 tests/regression.at, tests/synclines.at, tests/torture.at:
17258 Say "bison -o foo.c foo.y", not "bison foo.y -o foo.c",
17259 so that the tests still work even if POSIXLY_CORRECT is set.
17260 * doc/bison.texinfo (Rpcalc Compile, Invocation): Likewise.
17261
17262 * data/c.m4 (b4_int_type): Use yysigned_char instead of signed char,
17263 for portability to K&R hosts. Fix typo: signed char is guaranteed
17264 only to 127, not to 128.
17265 * data/glr.c (yysigned_char): New type.
17266 * data/yacc.c (yysigned_char): Likewise.
17267 * tests/regression.at (Web2c Actions): signed char -> yysigned_char.
17268
17269 2002-10-13 Paul Eggert <eggert@twinsun.com>
17270
17271 * data/yacc.c (yyparse): Rewrite to avoid "comparison is always
17272 true due to limited range of data type" warning from GCC.
17273
17274 * data/c.m4 (b4_token_defines): Protect against double-inclusion
17275 by wrapping enum yytokentype's definition inside #ifndef
17276 YYTOKENTYPE. This undoes a bug I introduced on 2002-10-12.
17277
17278 2002-10-13 Akim Demaille <akim@epita.fr>
17279
17280 * data/glr.c (yyglrShiftDefer, yyaddDeferredAction, yydoAction):
17281 Un yy- yyrhs to avoid the name clash with the global YYRHS.
17282
17283 2002-10-13 Akim Demaille <akim@epita.fr>
17284
17285 * Makefile.maint: Update from Autoconf 2.54.
17286 * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Remove, shipped with 2.54.
17287
17288 2002-10-13 Akim Demaille <akim@epita.fr>
17289
17290 * src/print.c (print_state): Separate the list of solved conflicts
17291 from the other items.
17292 * tests/conflicts.at (Resolved SR Conflicts): Adjust.
17293
17294 2002-10-13 Akim Demaille <akim@epita.fr>
17295
17296 Let nondeterministic skeletons be usable with deterministic
17297 tables.
17298
17299 With the patch, GAWK compiled by GCC without -O2 passes its test
17300 suite using a GLR parser driven by LALR tables. It fails with -O2
17301 because `struct stat' gives two different answers on my machine:
17302 88 (definition of an auto var) and later 96 (memset on this var).
17303 Hence the stack is badly corrumpted. The headers inclusion is to
17304 blame: if I move the awk.h inclusion before GLR's system header
17305 inclusion, the two struct stat have the same size.
17306
17307 * src/tables.c (pack_table): Always create conflict_table.
17308 (token_actions): Always create conflict_list.
17309 * data/glr.c (YYFLAG): Remove, unused.
17310
17311 2002-10-13 Akim Demaille <akim@epita.fr>
17312
17313 * configure.ac (AC_GNU_SOURCE): Use it instead of hand written code.
17314 (O0FLAGS): New.
17315 (VALGRIND, GXX): New.
17316 * tests/atlocal.in (CFLAGS): Use O0FLAGS.
17317 * tests/bison.in: Run $PREBISON a pre-command.
17318 * tests/Makefile.am (maintainer-check, maintainer-check-valgrind)
17319 (maintainer-check-g++): New.
17320 * Makefile.am (maintainer-check): New.
17321
17322 2002-10-13 Akim Demaille <akim@epita.fr>
17323
17324 * data/glr.c: Formatting changes.
17325 Tweak some trace messages to match yacc.c's.
17326
17327 2002-10-13 Akim Demaille <akim@epita.fr>
17328
17329 GLR parsers sometimes raise parse errors instead of performing the
17330 default reduction.
17331 Reported by Charles-Henry de Boysson.
17332
17333 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Don't
17334 check the length of the traces when %glr.
17335 (_AT_CHECK_CALC_ERROR): Also skip `^Stack' lines, coming from
17336 GLR's traces.
17337 (AT_CHECK_CALC_LALR, AT_CHECK_CALC_GLR): New.
17338 Test GLR parsers.
17339 * data/glr.c (YYLEFTMOST_STATE): Fix its value.
17340 (yyltype): Remove the yy prefix from the member names.
17341 (yytable): Complete its comment.
17342 (yygetLRActions): Map error action number from YYTABLE from
17343 YYTABLE_NINF to 0.
17344 (yyisErrorAction): No longer compare YYACTION to YYPACT_NINF
17345 (which was a bug: it should have been YYTABEL_NINF, and yet it was
17346 not satisfying as we could compare an YYACTION computed from
17347 YYDEFACT to YYTABLE_NINF although they are unrelated): 0 is the
17348 only value for error actions.
17349 (yyreportParseError): In verbose parse error messages, don't issue
17350 `error' in the list of expected tokens.
17351 * data/yacc.c (yyparse) <yybackup>: Rewrite the decoding of the
17352 next action to perform to match glr.c's decoding.
17353 (yytable): Complete its comment.
17354
17355 2002-10-13 Paul Eggert <eggert@twinsun.com>
17356
17357 Fix problem reported by Henrik Grubbstroem in
17358 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00098.html>:
17359 "nonterm: { $$ = 123; } { $$ = $1; };" was wrongly rejected,
17360 because the Bison parser reads the second action before reducing
17361 the first one.
17362 * src/scan-gram.l (rule_length): New static var.
17363 Use it to keep track of the rule length in the scanner, since
17364 we can't expect the parser to be in lock-step sync with the scanner.
17365 (handle_action_dollar, handle_action_at): Use this var.
17366 * tests/actions.at (Exotic Dollars): Test for the problem.
17367
17368 2002-10-12 Paul Eggert <eggert@twinsun.com>
17369
17370 * lib/timevar.c [! IN_GCC && HAVE_SYS_TIME_H]: Include <sys/time.h>.
17371 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): Check for <sys/time.h>.
17372 Include <sys/time.h> when checking for clock_t and struct tms.
17373 Use same include order as source.
17374 This is for the SunOS 4.1.4 porting bug reported by Peter Klein in
17375 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00016.html>.
17376
17377 * lib/timevar.c: Update copyright date and clarify comments.
17378 (get_time) [IN_GCC]: Keep the GCC version for reference.
17379
17380 * lib/timevar.c, lib/timevar.h, lib/timevar.def: Import
17381 GCC version as of today, then merge Bison's changes.
17382 Change "GCC" to "Bison" in copyright notice. timevar.def's
17383 author is Akim, so change that too.
17384
17385 * src/reader.c (grammar_current_rule_check):
17386 Don't worry about the default action if $$ is untyped.
17387 Prevents bogus warnings reported by Jim Gifford in
17388 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00015.html>.
17389
17390 * data/c.m4 (b4_token_enum): Do not define YYTOKENTYPE.
17391 * data/glr.c, data/lalr1.cc, data/yacc.c:
17392 Output token definitions before the first part of user declarations.
17393 Fixes compatibility problem reported by Jim Gifford for kbd in
17394 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00014.html>.
17395
17396 2002-10-11 Paul Eggert <eggert@twinsun.com>
17397
17398 * data/yacc.c (yyreport_parse_error): Remove, putting its body into...
17399 (yyparse): here. This undoes some of the 2002-07-25 change.
17400 Compatibility problem reported by Ralf S. Engelschall with
17401 OSSP cfg <http://www.ossp.org/pkg/lib/cfg/>.
17402
17403 2002-10-11 Akim Demaille <akim@epita.fr>
17404
17405 * tests/regression.at Characters Escapes): New.
17406 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Accept \' in strings and
17407 characters.
17408 Reported by Jan Nieuwenhuizen.
17409
17410 2002-10-11 Akim Demaille <akim@epita.fr>
17411
17412 * po/id.po: New.
17413
17414 2002-10-10 Paul Eggert <eggert@twinsun.com>
17415
17416 Portability fixes for bitsets; this also avoids several GCC
17417 warnings.
17418
17419 * lib/abitset.c: Include <stddef.h>, for offsetof.
17420 * lib/lbitset.c: Likewise.
17421
17422 * lib/abitset.c (abitset_bytes): Return a size that is aligned
17423 properly for vectors of objects. Do not assume that adding a
17424 header size to a multiple of a word size yields a value that is
17425 properly aligned for the whole union.
17426 * lib/bitsetv.c (bitsetv_alloc): Likewise.
17427
17428 * lib/bitset_stats.c (bitset_stats_bytes): Adjust to new,
17429 unique names for structures.
17430 * lib/ebitset.c (ebitset_bytes): Likewise.
17431 * lib/lbitset.c (lbitset_bytes): Likewise.
17432
17433 * lib/abitset.c (abitset_ones, abitset_zero, abitset_empty_p,
17434 abitset_copy1, abitset_not, abitset_equal_p, abitset_subset_p,
17435 abitset_disjoint_p, abitset_and, abitset_and_cmp, abitset_andn,
17436 abitset_andn_cmp, abitset_or, abitset_or_cmp, abitset_xor,
17437 abitset_xor_cmp, abitset_and_or, abitset_and_or_cmp,
17438 abitset_andn_or, abitset_andn_or_cmp, abitset_or_and,
17439 abitset_or_and_cmp, abitset_copy): Supply prototype decls,
17440 to improve the type-checking that GCC can do.
17441 * lib/bitset.c (bitset_op4_cmp): Likewise.
17442 * lib/bitset_stats.c (bitset_stats_count,
17443 bitset_stats_empty_p, bitset_stats_ones, bitset_stats_zero,
17444 bitset_stats_copy, bitset_stats_disjoint_p,
17445 bitset_stats_equal_p, bitset_stats_not, bitset_stats_subset_p,
17446 bitset_stats_and, bitset_stats_and_cmp, bitset_stats_andn,
17447 bitset_stats_andn_cmp, bitset_stats_or, bitset_stats_or_cmp,
17448 bitset_stats_xor, bitset_stats_xor_cmp, bitset_stats_and_or,
17449 bitset_stats_and_or_cmp, bitset_stats_andn_or,
17450 bitset_stats_andn_or_cmp, bitset_stats_or_and,
17451 bitset_stats_or_and_cmp): Likewise.
17452 * lib/lbitset.c (lbitset_and, lbitset_and_cmp, lbitset_andn,
17453 lbitset_andn_cmp, lbitset_or, lbitset_or_cmp, lbitset_xor,
17454 lbitset_xor_cmp, lbitset_empty_p, lbitset_ones, lbitset_not,
17455 lbitset_subset_p, lbitset_disjoint_p, debug_lbitset): Likewise.
17456
17457 * lib/abitset.h: Include bitset.h, not bbitset.h.
17458 * lib/ebitset.h: Likewise.
17459 * lib/lbitset.h: Likewise.
17460
17461 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): New types.
17462 All instances of parameters of type enum bitset_opts are now of
17463 type enum_bitset_opts, to conform to the C Standard, and similarly
17464 for enum_bitset_type.
17465 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
17466 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
17467
17468 Do not use "struct bitset_struct" to mean different things in
17469 different modules. Not only is this confusing, it violates
17470 the C Standard, which requires that structure types in different
17471 modules must be compatible if one is to be passed to the other.
17472 * lib/bbitset.h (bitset): Now points to a union, not to a struct.
17473 All instances of "struct bitset_struct *" replaced with "bitset".
17474 * lib/bitset.h (struct bitset_struct): Remove, replacing with....
17475 (union bitset_union, struct abitset_struct, struct ebitset_struct,
17476 struct lbitset_struct, struct bitset_stats_struct): New types.
17477 All uses of struct bitset_struct changed to union bitset_union,
17478 etc.
17479 * lib/abitset.c (struct abitset_struct, abitset,
17480 struct bitset_struct): Remove.
17481 * lib/bitset_stats.c (struct bitset_stats_struct, bitset_stats,
17482 struct bitset_struct): Remove.
17483 * lib/ebitset.c (struct ebitset_struct, ebitset, struct
17484 bitset_struct): Remove.
17485 * lib/lbitset.c (struct lbitset_struct, lbitset, bitset_struct):
17486 Likewise.
17487
17488 Do not call a function of type T using a call that assumes the
17489 function is of a different type U. Standard C requires that a
17490 function must be called with a type that is compatible with its
17491 definition.
17492 * lib/bbitset.h (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
17493 New decls.
17494 * lib/bitset.c (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
17495 New functions.
17496 * lib/ebitset.c (PFV): Remove.
17497 * lib/lbitset.c (PFV): Likewise.
17498 * lib/ebitset.c (ebitset_and, ebitset_andn, ebitset_or,
17499 ebitset_xor, ebitset_copy, ebitset_ones, ebitset_empty_p): New
17500 decls.
17501 (ebitset_and, ebitset_andn, ebitset_or, ebitset_xor): New functions.
17502 (ebitset_vtable): Use them.
17503 * lib/lbitset.c (lbitset_and, lbitset_andn, lbitset_or,
17504 lbitset_xor): New functions.
17505 (lbitset_vtable): Use them.
17506
17507 * lib/bitset.h (bitset_next, bitset_prev, bitset_only_set_p):
17508 Declare.
17509
17510 * lib/bitsetv.c (bitsetv_alloc): Add a cast to (void *) to avoid a
17511 GCC warning.
17512 * lib/lbitset.c (LBITSET_CURRENT1): Likewise.
17513 Use offsetof, for simplicity.
17514
17515 2002-10-06 Paul Eggert <eggert@twinsun.com>
17516
17517 * lib/bitset.h (bitset_reset): Do not assume that bitset_word is
17518 the same width as int. This reapplies a hunk of the 2002-08-12 patch
17519 <http://lists.gnu.org/archive/html/bison-patches/2002-08/msg00007.html>,
17520 which was inadvertently undone by the 2002-09-30 patch.
17521 * lib/lbitset.c (debug_lbitset): Do not assume that bitset_word is
17522 the same width as int.
17523
17524 2002-10-04 Paul Eggert <eggert@twinsun.com>
17525
17526 Version 1.50.
17527
17528 * configure.ac (AC_INIT), NEWS: Increment version number.
17529
17530 * doc/bison.texinfo: Minor spelling, grammar, and white space
17531 fixes.
17532 (Symbols): Mention that any negative value returned from yylex
17533 signifies end-of-input. Warn about negative chars. Mention
17534 the portable Standard C character set.
17535
17536 The GNU coding standard says CFLAGS and YFLAGS are reserved
17537 for the installer to set.
17538 * lib/Makefile.am (AM_CFLAGS): Renamed from CFLAGS.
17539 * src/Makefile.am (AM_CFLAGS): Likewise.
17540 (AM_YFLAGS): Renamed from YFLAGS.
17541
17542 Fix some MAX and MIN problems.
17543 * src/gram.h (ITEM_NUMBER_MIN): MIN_MAX -> INT_MIN.
17544 * src/lalr.h (GOTO_NUMBER_MAX): INT_MAX -> SHRT_MAX.
17545 * src/symtab.h (SYMBOL_NUMBER_MAX): New macro.
17546 * src/reader.c (reader): Use it.
17547
17548 * tests/regression.at (Braces parsing): Use grep, not fgrep, as
17549 POSIX 1003.1-2001 has removed fgrep.
17550
17551 2002-10-04 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
17552
17553 * lib/bbitset.h (BITSET_WINDEX_MAX): Redefine so that it cannot be
17554 interpreted as signed.
17555 * lib/ebitset.c (ebitset_list): Fix bug.
17556
17557 2002-10-01 Paul Eggert <eggert@twinsun.com>
17558
17559 More fixes for 64-bit hosts and large bitsets.
17560
17561 * lib/abitset.c (struct abitset_struct.n_bits, abitset_small_list,
17562 abitset_size, abitset_list, abitset_list_reverse, abitset_list):
17563 Use bitset_bindex, not int or unsigned int or size_t, to count bits.
17564 * lib/bbitset.h (struct bitset_vtable.size, struct bitset_vtable.count,
17565 struct bitset_vtable.list, struct bitset_vtable.list_reverse,
17566 bitset_count_, bitset_next, bitset_prev, bitset_first, bitset_last,
17567 bitset_count_): Likewise.
17568 * lib/bitset.h (bitset_iterator.num, bitset_iterator.i,
17569 bitset_first, bitset_last): Likewise.
17570 * lib/bitset_stats.c (bitset_stats_size, bitset_stats_list,
17571 bitset_stats_list_reverse, bitset_stats_size,
17572 bitset_stats_count, bitset_stats_list, bitset_stat_list_reverse):
17573 Likewise.
17574 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
17575 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
17576 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
17577 bitsetv_reflexive_transitive_closure): Likewise.
17578 * lib/bitsetv.h (bitsetv_alloc, bitsetv_create): Likewise.
17579 * lib/ebitset.c (ebitset_size, ebitset_list, ebitset_list_reverse):
17580 Likewise.
17581 * lib/lbitset.c (lbitset_size, lbitset_list, lbitset_list_merge):
17582 Likewise.
17583
17584 * lib/abitset.c (abitset_ones, abitset_zero, abitset_bytes):
17585 Use size_t, not unsigned int, to count bytes.
17586 * lib/abitset.h (abitset_bytes): Likewise.
17587 * lib/bitset.c (bitset_bytes, bitset_alloc, bitset_obstack_alloc):
17588 Likewise.
17589 * lib/bitset.h (bitset_bytes): Likewise.
17590 * lib/bitset_stats.c (bitset_stats_bytes, bitset_stats_init): Likewise.
17591 * lib/bitset_stats.h (bitset_stats_bytes): Likewise.
17592 * lib/bitsetv.c (bitsetv_alloc): Likewise.
17593 * lib/ebitset.c (ebitset_bytes): Likewise.
17594 * lib/ebitset.h (ebitset_bytes): Likewise.
17595 * lib/lbitset.c (lbitset_bytes): Likewise.
17596 * lib/lbitset.h (lbitset_bytes): Likewise.
17597
17598 * lib/abitset.c (abitset_empty_p, abitset_not, abitset_equal_p,
17599 abitset_subset_p, abitset_disjoint_p, abitset_and,
17600 abitset_and_cmp, abitset_andn, abitset_andn_cmp, abitset_or,
17601 abitset_or_cmp, abitset_xor, abitset_xor_cmp, abitset_and_or,
17602 abitset_and_or_cmp, abitset_andn_or, abitset_andn_or_cmp,
17603 abitset_or_and, abitset_or_and_cmp):
17604 Use bitset_windex instead of unsigned int.
17605 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
17606 * lib/ebitset.c (struct ebitset_struct.size, ebitset_elts_grow,
17607 ebitset_elt_add, ebitset_elt_remove, ebitset_weed,
17608 ebitset_elt_find, ebitset_list_reverse, ebitset_list, ebitset_init):
17609 Likewise.
17610 * lib/lbitset.c (lbitset_ones, lbitset_not): Likewise.
17611
17612 * lib/bitset.c (bitset_print):
17613 Use proper printf formats for widths of integer types.
17614 * lib/bitset_stats.c (bitset_percent_histogram_print,
17615 bitset_log_histogram_print, bitset_stats_print_1): Likewise.
17616 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
17617 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
17618 * lib/lbitset.c (lbitset_bytes): Likewise.
17619
17620 * lib/bbitset.h (BITSET_BINDEX_MAX, BITSET_WINDEX_MAX,
17621 BITSET_SIZE_MAX): New macros.
17622 (BITSET_INDEX_MAX): Remove. It wasn't right, since it assumed that
17623 sizeof (bitset_word) == sizeof (bitset_windex). All uses changed
17624 to BITSET_WINDEX_MAX.
17625
17626 * lib/bitset.c (bitset_next, bitset_prev, bitset_first,
17627 bitset_last): Return BITSET_BINDEX_MAX (not -1) for no value,
17628 since we now return the bitset_bindex type (not int).
17629
17630 * lib/bitsetv.c (bitsetv_alloc): Check for arithmetic overflow
17631 when computing sizes.
17632 * lib/ebitset.c (ebitset_elts_grow): Likewise.
17633
17634 * lib/lbitset.c (lbitset_elt_find): Simplify windex calculation
17635 and avoid cast to unsigned.
17636
17637 2002-09-30 Akim Demaille <akim@epita.fr>
17638
17639 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
17640 * lib/bitset_stats.c, lib/bitsetv.c, lib/ebitset.c, lib/lbitset.c:
17641 Updates from Michael Hayes.
17642
17643 2002-09-30 Art Haas <ahaas@neosoft.com>
17644
17645 * configure.ac: Update AC_OUTPUT and AM_CONFIG_HEADER
17646 invocations.
17647 * tests/cxx-type.at (declarator): Don't rely on NDEBUG being not
17648 defined.
17649
17650 2002-09-27 Akim Demaille <akim@epita.fr>
17651
17652 Version 1.49c.
17653
17654 2002-09-27 Akim Demaille <akim@epita.fr>
17655
17656 * configure.ac (AM_INIT_AUTOMAKE): We _need_ 1.7.
17657 (Because of AC_LIBSOURCE).
17658
17659 2002-09-27 Akim Demaille <akim@epita.fr>
17660
17661 Playing with Autoscan.
17662
17663 * configure.ac: Remove the old LIBOBJ tweaks.
17664 (AC_REPLACE_FUNCS): Add strrchr and strtol.
17665 * lib/strrchr.c: New.
17666 * lib/strtol.c: New, from the Coreutils 4.5.1.
17667
17668 2002-09-27 Akim Demaille <akim@epita.fr>
17669
17670 Playing with Autoscan.
17671
17672 * m4/prereq.m4 (jm_PREREQ_ARGMATCH, jm_FUNC_ARGMATCH): New.
17673 * lib/Makefile.am (libbison_a_SOURCES): No longer include
17674 argmatch.c and argmatch.h, since they are AC_LIBSOURCE'd.
17675 * lib/strcasecmp.c, lib/strncasecmp.c, lib/memcmp.c: New, from the
17676 Coreutils 4.5.1.
17677
17678 2002-09-24 Akim Demaille <akim@epita.fr>
17679
17680 * doc/bison.texinfo (Stack Overflow): xref to Recursion.
17681 (Frequently Asked Questions, Parser Stack Overflow): New.
17682
17683 2002-09-13 Akim Demaille <akim@epita.fr>
17684
17685 Playing with autoscan.
17686
17687 * src/reader.c (get_merge_function): Use xstrdup, not strdup.
17688 * src/files.c (skeleton_find): Remove, unused.
17689 * m4/memcmp.m4: New, from the Coreutils 4.5.1.
17690 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Run jm_FUNC_MEMCMP.
17691
17692 2002-09-13 Akim Demaille <akim@epita.fr>
17693
17694 * configure.ac (AM_INIT_AUTOMAKE): Require Automake 1.6.3.
17695 * Makefile.am (AUTOMAKE_OPTIONS): Don't.
17696
17697 2002-09-13 Akim Demaille <akim@epita.fr>
17698
17699 * configure.ac: Require 2.54.
17700 s/jm_FUNC_MALLOC/AC_FUNC_MALLOC/.
17701 s/jm_FUNC_REALLOC/AC_FUNC_REALLOC/.
17702 * m4/c-bs-a.m4, m4/malloc.m4, m4/mbstate_t.m4, m4/realloc.m4:
17703 Remove, provided by Autoconf macros.
17704
17705 2002-09-12 Akim Demaille <akim@epita.fr>
17706
17707 * m4/prereq.m4: Update, from Coreutils 4.5.1.
17708
17709 2002-09-12 Akim Demaille <akim@epita.fr>
17710
17711 * m4/prereq.m4: Update, from Fileutils 4.1.5.
17712 * configure.ac (jm_PREREQ_TEMPNAME): Invoke it.
17713 Reported by Martin Mokrejs.
17714
17715 2002-09-10 Akim Demaille <akim@epita.fr>
17716
17717 * src/parse-gram.y: Associate a human readable string to each
17718 token type.
17719 * tests/regression.at (Invalid inputs): Adjust.
17720
17721 2002-09-10 Gary V. Vaughan <gary@gnu.org>
17722
17723 * tests/Makefile.am ($(srcdir)/package.m4): Bison now ships
17724 with an Autoconf-2.5x style configure.ac.
17725
17726 2002-09-06 Paul Eggert <eggert@twinsun.com>
17727
17728 * doc/bison.texinfo (Conditions): Make explicit that the GPL
17729 exception applies only to yacc.c. This is a modification of a
17730 patch originally suggested by Akim Demaille.
17731
17732 2002-09-06 Akim Demaille <akim@epita.fr>
17733
17734 * data/c.m4 (b4_copyright): Move the GPL exception comment from
17735 here to...
17736 * data/yacc.c: here.
17737
17738 * data/lalr1.cc (struct yyltype): Don't define it, since we use
17739 LocationType.
17740 (b4_ltype): Default to yy::Location from location.hh.
17741
17742 2002-09-04 Jim Meyering <jim@meyering.net>
17743
17744 * data/yacc.c: Guard the declaration of yytoknum also with
17745 `#ifdef YYPRINT', so it is declared only when used.
17746
17747 2002-09-04 Akim Demaille <akim@epita.fr>
17748
17749 * configure.in: Rename as...
17750 * configure.ac: this.
17751 Bump to 1.49c.
17752
17753 2002-09-04 Akim Demaille <akim@epita.fr>
17754
17755 * src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
17756 * src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't
17757 translate maintainer only messages.
17758
17759 2002-08-12 Paul Eggert <eggert@twinsun.com>
17760
17761 Version 1.49b.
17762
17763 * Makefile.am (SUBDIRS): Remove intl.
17764 (DISTCLEANFILES): Remove.
17765 * NEWS: Mention that GNU M4 is now required. Clarify what is
17766 meant by "larger grammars". Mention the pt_BR translation.
17767 * configure.in (AC_CHECK_DECLS): Add getenv, getopt.
17768 (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var.
17769 Bump version from 0.11.2 to 0.11.5.
17770 (BISON_PREREQ_STAGE): Remove.
17771 (AM_GNU_GETTEXT): Use external gettext.
17772 (AC_OUTPUT): Remove intl/Makefile.
17773
17774 * config/depcomp, config/install-sh: Sync with Automake 1.6.3.
17775
17776 * data/glr.c: Include string.h, for strlen.
17777 (yyreportParseError): Use size_t for yysize.
17778 (yy_yypstack): No longer nested inside yypstates, as nested
17779 functions are not portable. Do not assume size_t is the
17780 same width as int.
17781 (yypstates): Do not assume that ptrdiff_t is the same width
17782 as int, and similarly for yyposn and YYINDEX.
17783
17784 * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.
17785
17786 * lib/Makefile.am (INCLUDES): Do not include from the intl
17787 directory, which has been removed.
17788 * src/Makefile.am (INCLUDES): Likewise.
17789
17790 * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
17791 (bitsets_sources, additional_bitsets_sources, timevars_sources):
17792 New vars.
17793
17794 * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
17795 * tests/Makefile.am (EXTRA_DIST): Likewise.
17796
17797 * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
17798 Do not assume that bitset_windex is the same width as unsigned.
17799
17800 * lib/abitset.c (abitset_unused_clear): Do not assume that
17801 bitset_word is the same width as int.
17802 * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise.
17803 * lib/bitset.h (bitset_set, bitset_reset): Likewise.
17804 * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise.
17805 * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise.
17806 * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise.
17807
17808 * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for
17809 portability to one's complement hosts!).
17810 * lib/ebitset.c (ebitset_op1): Likewise.
17811 * lib/lbitset.c (lbitset_op1): Likewise.
17812
17813 * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar.
17814 * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
17815 lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c:
17816 Sync with fileutils.
17817 * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
17818 lib/gettext.h: Sync with diffutils.
17819
17820 * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
17821 lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.
17822
17823 * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
17824 PROTOTYPES to check for prototypes, and "defined __STDC__" to
17825 check for void *.
17826
17827 * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not
17828 size_t; the old version tried to do this but casted improperly.
17829 (bitset_bindex, bitset_windex): Now size_t, not unsigned long.
17830 (bitset_test): Now returns int, not unsigned long.
17831
17832 * lib/bitset_stats.c: Include "gettext.h".
17833 (_): New macro.
17834 (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
17835 name locals "index", as it generates unnecessary warnings on some
17836 hosts that have an "index" function.
17837
17838 * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print,
17839 bitset_stats_read, bitset_stats_write): Wrap strings in _() if
17840 they need translation.
17841 * src/LR0.c (state_list_append, new_itemsets, get_state,
17842 append_states, generate_states): Likewise.
17843 * src/assoc.c (assoc_to_string): Likewise.
17844 * src/closure.c (print_closure, set_firsts, closure): Likewise.
17845 * src/gram.c (grammar_dump): Likewise.
17846 * src/injections.c (injections_compute): Likewise.
17847 * src/lalr.c (lookaheads_print): Likewise.
17848 * src/relation.c (relation_transpose): Likewise.
17849 * src/scan-gram.l: Likewise.
17850 * src/tables.c (table_grow, pack_vector): Likewise.
17851
17852 * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4,
17853 glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4.
17854 * m4/malloc.m4, m4/realloc.m4: Sync with diffutils.
17855 * m4/mbstate_t.m4: Sync with fileutils.
17856 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T.
17857
17858 * po/LINGUAS: Add pt_BR.
17859 * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c,
17860 src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c,
17861 lib/timevar.c.
17862 Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
17863 manual recommends.
17864 Similarly, use src/scan-gram.l instead of src/scan-gram.c.
17865
17866 * src/complain.c (strerror_r): Remove decl; not needed.
17867 (strerror): Use same pattern as ../lib/error.c.
17868
17869 * src/files.c, src/files.h (compute_header_macro): Remove; unused.
17870
17871 * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.
17872
17873 * src/main.c (main): Cast result of bindtextdomain and textdomain
17874 to void, to avoid a GCC warning when --disable-nls is in effect.
17875
17876 * src/scan-gram.l: Use strings rather than escapes when possible,
17877 to minimize the number of warnings from xgettext.
17878 (handle_action_dollar, handle_action_at): Don't use isdigit,
17879 as it mishandles negative chars and it may not work as expected
17880 outside the C locale.
17881
17882 * src/symtab.c (symbol_get): Don't cast LHS of an assignment;
17883 this is a GCC extension and is not portable to other compilers.
17884
17885 * src/system.h (alloca): Use same pattern as ../lib/error.c.
17886 Do not include <ctype.h>; no longer needed.
17887 Do not include <malloc.h>; no longer needed (and generates
17888 warnings on OpenBSD 3.0).
17889
17890 * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
17891 it's not portable.
17892
17893 * tests/regression.at: Do not use 'cc -c input.c -o input';
17894 Sun C rejects this. Instead, use 'cc -c input.c -o input.o'.
17895
17896 * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero
17897 exit status as failure, not just exit status 1. Sun C exits
17898 with status 2 sometimes.
17899
17900 * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
17901 Use it for the two large tests.
17902
17903 2002-08-02 Akim Demaille <akim@epita.fr>
17904
17905 * src/conflicts.c (conflicts_output): Don't output rules never
17906 reduced here, since anyway that computation doesn't work.
17907 * src/gram.h, src/gram.h (rule_filter_t, rule_useful_p)
17908 (rule_useless_p, rule_never_reduced_p): New.
17909 (grammar_rules_partial_print): Use a filter instead of a range.
17910 Display the title only if needed.
17911 (grammar_rules_print): Adjust.
17912 (grammar_rules_never_reduced_report): New.
17913 * src/tables.c (action_row): Move the computation of rules never
17914 reduced to...
17915 (token_actions): here.
17916 * src/main.c (main): Make the parser before making the report, so
17917 that rules never reduced are computed.
17918 Call grammar_rules_never_reduced_report.
17919 * src/print.c (print_results): Report rules never reduced.
17920 * tests/conflicts.at, tests/reduce.at: Adjust.
17921
17922 2002-08-01 Akim Demaille <akim@epita.fr>
17923
17924 Instead of attaching lookaheads and duplicating the rules being
17925 reduced by a state, attach the lookaheads to the reductions.
17926
17927 * src/state.h (state_t): Remove the `lookaheads',
17928 `lookaheads_rule' member.
17929 (reductions_t): Add a `lookaheads' member.
17930 Use a regular array for the `rules'.
17931 * src/state.c (reductions_new): Initialize the lookaheads member
17932 to 0.
17933 (state_rule_lookaheads_print): Adjust.
17934 * src/state.h, src/state.c (state_reductions_find): New.
17935 * src/conflicts.c (resolve_sr_conflict, set_conflicts)
17936 (count_rr_conflicts): Adjust.
17937 * src/lalr.c (LArule): Remove.
17938 (add_lookback_edge): Adjust.
17939 (state_lookaheads_count): New.
17940 (states_lookaheads_initialize): Merge into...
17941 (initialize_LA): this.
17942 (lalr_free): Adjust.
17943 * src/main.c (main): Don't free nullable and derives too early: it
17944 is used by --verbose.
17945 * src/print.c, src/print_graph.c, src/tables.c: Adjust.
17946
17947 2002-08-01 Akim Demaille <akim@epita.fr>
17948
17949 * src/derives.h, src/derives.c (derives): A `rule_t***' instead of
17950 `rule_number_t**'.
17951 (set_derives, free_derives): Rename as...
17952 (derives_compute, derives_free): this.
17953 Adjust all dependencies.
17954 * src/nullable.c (set_nullable, free_nullable): Rename as...
17955 (nullable_compute, nullable_free): these.
17956 (rule_list_t): Store rule_t *, not rule_number_t.
17957 * src/state.c (state_rule_lookaheads_print): Directly compare rule
17958 pointers, instead of their numbers.
17959 * src/main.c (main): Call nullable_free, and derives_free earlier,
17960 as they were lo longer used.
17961
17962 2002-08-01 Akim Demaille <akim@epita.fr>
17963
17964 * lib/timevar.c (get_time): Include children time.
17965 * src/lalr.h (LA, LArule): Don't export them: used with the
17966 state_t.
17967 * src/lalr.c (LA, LArule): Static.
17968 * src/lalr.h, src/lalr.c (lalr_free): New.
17969 * src/main.c (main): Call it.
17970 * src/tables.c (pack_vector): Check whether loc is >= to the
17971 table_size, not >.
17972 (pack_tables): Don't free froms, tos, conflict_tos, and pos...
17973 (tables_generate): do it, since that's also it which allocates
17974 them.
17975 Don't free LA and LArule, main does.
17976
17977 2002-07-31 Akim Demaille <akim@epita.fr>
17978
17979 Separate parser tables computation and output.
17980
17981 * src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
17982 (conflict_list, conflict_list_cnt, table, check, table_ninf)
17983 (yydefgoto, yydefact, high): Move to...
17984 * src/tables.h, src/tables.c: here.
17985 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
17986 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
17987 (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
17988 (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
17989 (ACTION_MIN, actrow, order, nentries, pos, conflrow)
17990 (conflict_list_free, table_size, lowzero, table_grow, conflict_row)
17991 (action_row, save_row, token_actions, save_column, default_goto)
17992 (goto_actions, sort_actions, matching_state, pack_vector)
17993 (table_ninf_remap, pack_table, prepare_actions): Move to...
17994 * src/tables.c: here.
17995 * src/tables.h, src/tables.c(tables_generate, tables_free): New.
17996 * src/output.c (token_actions, output_base, output_conflicts)
17997 (output_check): Merge into...
17998 (prepare_actions): this.
17999 (actions_output): Rename as...
18000 (user_actions_output): this.
18001 * src/main.c (main): Call tables_generate and tables_free.
18002
18003 2002-07-31 Akim Demaille <akim@epita.fr>
18004
18005 Steal GCC's --time-report support.
18006
18007 * lib/timevar.c, lib/timevar.h, lib/timevar.def: New,
18008 stolen/adjusted from GCC.
18009 * m4/stage.m4: Remove time related checks.
18010 * m4/timevar.m4: New.
18011 * configure.in: Adjust.
18012 * src/system.h: Adjust to using timevar.h.
18013 * src/getargs.h, src/getargs.c: Support trace_time for
18014 --trace=time.
18015 * src/main.c (stage): Remove.
18016 (main): Replace `stage' invocations with timevar calls.
18017 * src/output.c: Insert pertinent timevar calls.
18018
18019 2002-07-31 Akim Demaille <akim@epita.fr>
18020
18021 Let --trace have arguments.
18022
18023 * src/getargs.h (enum trace_e): New.
18024 * src/getargs.c (trace_args, trace_types, trace_argmatch): New.
18025 (long_options, short_options): --trace/-T takes an optional
18026 argument.
18027 Change all the uses of trace_flag to reflect the new flags.
18028 * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
18029
18030 Strengthen `stage' portability.
18031
18032 * m4/stage.m4 (BISON_PREREQ_STAGE): New.
18033 * configure.in: Use it.
18034 Don't check for malloc.h and sys/times.h.
18035 * src/system.h: Include them when appropriate.
18036 * src/main.c (stage): Compile only when mallinfo, struct mallinfo,
18037 times and struct tms are available.
18038
18039 2002-07-30 Akim Demaille <akim@epita.fr>
18040
18041 In verbose parse error message, don't report `error' as an
18042 expected token.
18043 * tests/actions.at (Printers and Destructors): Adjust.
18044 * tests/calc.at (Calculator $1): Adjust.
18045 * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose
18046 error message, do not report the parser accepts the error token in
18047 that state.
18048
18049 2002-07-30 Akim Demaille <akim@epita.fr>
18050
18051 Normalize conflict related messages.
18052
18053 * src/complain.h, src/complain.c (warn, complain): New.
18054 * src/conflicts.c (conflicts_print): Use them.
18055 (conflict_report_yacc): New, extracted from...
18056 (conflicts_print): here.
18057 * tests/conflicts.at, tests/existing.at: Adjust.
18058
18059 2002-07-30 Akim Demaille <akim@epita.fr>
18060
18061 Report rules which are never reduced by the parser: those hidden
18062 by conflicts.
18063
18064 * src/LR0.c (save_reductions): Don't make the final state too
18065 different: save its reduction (accept) instead of having a state
18066 without any action (no shift or goto, no reduce).
18067 Note: the final state is now a ``regular'' state, i.e., the
18068 parsers now contain `reduce 0' as default reduction.
18069 Nevertheless, since they decide to `accept' when yystate =
18070 final_state, they still will not reduce rule 0.
18071 * src/print.c (print_actions, print_reduction): Adjust.
18072 * src/output.c (action_row): Track reduced rules.
18073 (token_actions): Report rules never reduced.
18074 * tests/conflicts.at, tests/regression.at: Adjust.
18075
18076 2002-07-30 Akim Demaille <akim@epita.fr>
18077
18078 `stage' was accidently included in a previous patch.
18079 Initiate its autoconfiscation.
18080
18081 * configure.in: Look for malloc.h and sys/times.h.
18082 * src/main.c (stage): Adjust.
18083 Report only when trace_flag.
18084
18085 2002-07-29 Akim Demaille <akim@epita.fr>
18086
18087 * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not
18088 state_number_t.
18089 (errs_t): symbol_t*, not symbol_number_t.
18090 (reductions_t): rule_t*, not rule_number_t.
18091 (FOR_EACH_SHIFT): New.
18092 * src/LR0.c, src/conflicts.c, src/lalr.c, src/output.c
18093 * src/print.c, src/print_graph.c: Adjust.
18094
18095 2002-07-29 Akim Demaille <akim@epita.fr>
18096
18097 Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
18098
18099 * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
18100 (endtoken, accept): these.
18101 * src/reader.c (reader): Set endtoken's default tag to "$end".
18102 Set undeftoken's tag to "$undefined" instead of "$undefined.".
18103 * doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
18104 Adjust.
18105
18106 2002-07-29 Akim Demaille <akim@epita.fr>
18107
18108 * src/reduce.c (reduce_grammar): When the language is empty,
18109 complain about the start symbol, not the axiom.
18110 Use its location.
18111 * tests/reduce.at (Empty Language): New.
18112
18113 2002-07-26 Akim Demaille <akim@epita.fr>
18114
18115 * src/reader.h, src/reader.c (gram_error): ... can't get
18116 yycontrol without making too strong assumptions on the parser
18117 itself.
18118 * src/output.c (prepare_tokens): Use the real 0th value of
18119 token_translations instead of `0'.
18120 * src/parse-gram.y (yyerror): Don't rely on yycontrol being
18121 visible here.
18122 * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
18123 for the time being: %locations ought to provide it to yyerror.
18124
18125 2002-07-25 Akim Demaille <akim@epita.fr>
18126
18127 * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
18128 * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
18129 * tests/regression.at (Web2c Actions): Adjust.
18130
18131 2002-07-25 Akim Demaille <akim@epita.fr>
18132
18133 Stop storing rules from 1 to nrules + 1.
18134
18135 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
18136 * src/nullable.c, src/output.c, src/print.c, src/reader.c
18137 * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
18138 Iterate from 0 to nrules.
18139 Use rule_number_as_item_number and item_number_as_rule_number.
18140 Adjust to `derive' now containing possibly 0.
18141 * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
18142 Handle the `- 1' part in rule numbers from/to item numbers.
18143 * src/conflicts.c (log_resolution): Fix the message which reversed
18144 shift and reduce.
18145 * src/output.c (action_row): Initialize default_rule to -1.
18146 (token_actions): Adjust.
18147 * tests/sets.at (Nullable, Firsts): Fix the previously bogus
18148 expected output.
18149 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
18150
18151 2002-07-25 Akim Demaille <akim@epita.fr>
18152
18153 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
18154 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
18155 (b4_c_knr_arg_decl): New.
18156 * data/yacc.c: Use it to define yysymprint, yydestruct, and
18157 yyreport_parse_error.
18158
18159 2002-07-25 Akim Demaille <akim@epita.fr>
18160
18161 * data/yacc.c (yyreport_parse_error): New, extracted from...
18162 (yyparse): here.
18163 (yydestruct, yysymprint): Move above yyparse.
18164 Be K&R compliant.
18165
18166 2002-07-25 Akim Demaille <akim@epita.fr>
18167
18168 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
18169 replace...
18170 (b4_sint_type, b4_uint_type): these.
18171 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
18172 * tests/regression.at (Web2c Actions): Adjust.
18173
18174 2002-07-25 Akim Demaille <akim@epita.fr>
18175
18176 * src/gram.h (TIEM_NUMBER_MAX): New.
18177 (item_number_of_rule_number, rule_number_of_item_number): Rename
18178 as...
18179 (rule_number_as_item_number, item_number_as_rule_number): these.
18180 Adjust dependencies.
18181 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
18182 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
18183 (symbol_number_to_vector_number): New.
18184 (order): Of vector_number_t* type.
18185 (base_t, BASE_MAX, BASE_MIN): New.
18186 (froms, tos, width, pos, check): Of base_t type.
18187 (action_number_t, ACTION_MIN, ACTION_MAX): New.
18188 (actrow): Of action_number_t type.
18189 (conflrow): Of unsigned int type.
18190 (table_ninf, base_ninf): New.
18191 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
18192 (muscle_insert_int_table, muscle_insert_base_table)
18193 (muscle_insert_rule_number_table): New.
18194 (prepare_tokens): Output `toknum' as int_table.
18195 (action_row): Returns a rule_number_t.
18196 Use ACTION_MIN, not SHRT_MIN.
18197 (token_actions): yydefact is rule_number_t*.
18198 (table_ninf_remap): New.
18199 (pack_table): Use it for `base' and `table'.
18200 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
18201 replaced with...
18202 (YYPACT_NINF, YYTABLE_NINF): these.
18203 (yypact, yytable): Compute their types instead of hard-coded
18204 `short'.
18205 * tests/regression.at (Web2c Actions): Adjust.
18206
18207 2002-07-19 Akim Demaille <akim@epita.fr>
18208
18209 * src/scan-gram.l (id): Can start with an underscore.
18210
18211 2002-07-16 Akim Demaille <akim@epita.fr>
18212
18213 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
18214 Adjust all former `associativity' dependencies.
18215 * src/symtab.c (symbol_new): Default associativity is `undef', not
18216 `right'.
18217 (symbol_check_alias_consistence): Adjust.
18218
18219 2002-07-09 Akim Demaille <akim@epita.fr>
18220
18221 * doc/bison.texinfo: Properly set the ``header'' part.
18222 Use @dircategory ``GNU programming tools'' as per Texinfo's
18223 documentation.
18224 Use @copying.
18225
18226 2002-07-09 Akim Demaille <akim@epita.fr>
18227
18228 * lib/quotearg.h: Protect against multiple inclusions.
18229 * src/location.h (location_t): Add a `file' member.
18230 (LOCATION_RESET, LOCATION_PRINT): Adjust.
18231 * src/complain.c (warn_at, complain_at, fatal_at): Drop
18232 `error_one_per_line' support.
18233
18234 2002-07-09 Akim Demaille <akim@epita.fr>
18235
18236 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
18237 * src/reader.c (lineno): Remove.
18238 Adjust all dependencies.
18239 (get_merge_function): Take a location and use complain_at.
18240 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
18241 * tests/regression.at (Invalid inputs, Mixing %token styles):
18242 Adjust.
18243
18244 2002-07-09 Akim Demaille <akim@epita.fr>
18245
18246 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
18247 recovery rule, and forbid extensions when --yacc.
18248 (gram_error): Use complain_at.
18249 * src/reader.c (reader): Exit if there were parse errors.
18250
18251 2002-07-09 Akim Demaille <akim@epita.fr>
18252
18253 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
18254 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
18255 Reported by R Blake <blakers@mac.com>.
18256
18257 2002-07-09 Akim Demaille <akim@epita.fr>
18258
18259 * data/yacc.c: Output the copyright notive in the header.
18260
18261 2002-07-03 Akim Demaille <akim@epita.fr>
18262
18263 * src/output.c (froms, tos): Are state_number_t.
18264 (save_column): sp, sp1, and sp2 are state_number_t.
18265 (prepare): Rename `final' as `final_state_number', `nnts' as
18266 `nterms_number', `nrules' as `rules_number', `nstates' as
18267 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
18268 unused.
18269 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
18270 * data/lalr1.cc (nsym_): Remove, unused.
18271
18272 2002-07-03 Akim Demaille <akim@epita.fr>
18273
18274 * src/lalr.h, src/lalr.c (goto_number_t): New.
18275 * src/lalr.c (goto_list_t): New.
18276 Propagate them.
18277 * src/nullable.c (rule_list_t): New.
18278 Propagate.
18279 * src/types.h: Remove.
18280
18281 2002-07-03 Akim Demaille <akim@epita.fr>
18282
18283 * src/closure.c (print_fderives): Use rule_rhs_print.
18284 * src/derives.c (print_derives): Use rule_rhs_print.
18285 (rule_list_t): New, replaces `shorts'.
18286 (set_derives): Add comments.
18287 * tests/sets.at (Nullable, Firsts): Adjust.
18288
18289 2002-07-03 Akim Demaille <akim@epita.fr>
18290
18291 * src/output.c (prepare_actions): Free `tally' and `width'.
18292 (prepare_actions): Allocate and free `order'.
18293 * src/symtab.c (symbols_free): Free `symbols'.
18294 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
18295 * src/output.c (m4_invoke): Move to...
18296 * src/scan-skel.l: here.
18297 (<<EOF>>): Close yyout, and free its name.
18298
18299 2002-07-03 Akim Demaille <akim@epita.fr>
18300
18301 Fix some memory leaks, and fix a bug: state 0 was examined twice.
18302
18303 * src/LR0.c (new_state): Merge into...
18304 (state_list_append): this.
18305 (new_states): Merge into...
18306 (generate_states): here.
18307 (set_states): Don't ensure a proper `errs' state member here, do it...
18308 * src/conflicts.c (conflicts_solve): here.
18309 * src/state.h, src/state.c: Comment changes.
18310 (state_t): Rename member `shifts' as `transitions'.
18311 Adjust all dependencies.
18312 (errs_new): For consistency, also take the values as argument.
18313 (errs_dup): Remove.
18314 (state_errs_set): New.
18315 (state_reductions_set, state_transitions_set): Assert that no
18316 previous value was assigned.
18317 (state_free): New.
18318 (states_free): Use it.
18319 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
18320 temporary storage: use `errs' and `nerrs' as elsewhere.
18321 (set_conflicts): Allocate and free this `errs'.
18322
18323 2002-07-02 Akim Demaille <akim@epita.fr>
18324
18325 * lib/libiberty.h: New.
18326 * lib: Update the bitset implementation from upstream.
18327 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
18328 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
18329 * src/main.c: Adjust bitset stats calls.
18330
18331 2002-07-01 Paul Eggert <eggert@twinsun.com>
18332
18333 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
18334 char, so that negative chars don't collide with $.
18335
18336 2002-06-30 Akim Demaille <akim@epita.fr>
18337
18338 Have the GLR tests be `warning' checked, and fix the warnings.
18339
18340 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
18341 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
18342 (yyremoveDeletes): `yyi' and `yyj' are size_t.
18343 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
18344 (yyaddDeferredAction): static.
18345 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
18346 (yyreportParseError): yyprefix is const.
18347 yytokenp is used only when verbose.
18348 (yy__GNUC__): Replace with __GNUC__.
18349 (yypdumpstack): yyi is size_t.
18350 (yypreference): Un-yy local variables and arguments, to avoid
18351 clashes with `yyr1'. Anyway, we are not in the user name space.
18352 (yytname_size): be an int, as is compared with ints.
18353 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
18354 Use them.
18355 * tests/cxx-gram.at: Use quotation to protect $1.
18356 Use AT_COMPILE to enable warnings hunts.
18357 Prototype yylex and yyerror.
18358 `Use' argc.
18359 Include `string.h', not `strings.h'.
18360 Produce and prototype stmtMerge only when used.
18361 yylex takes a location.
18362
18363 2002-06-30 Akim Demaille <akim@epita.fr>
18364
18365 We spend a lot of time in quotearg, in particular when --verbose.
18366
18367 * src/symtab.c (symbol_get): Store a quoted version of the key.
18368 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
18369 Adjust all callers.
18370
18371 2002-06-30 Akim Demaille <akim@epita.fr>
18372
18373 * src/state.h (reductions_t): Rename member `nreds' as num.
18374 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
18375 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
18376
18377 2002-06-30 Akim Demaille <akim@epita.fr>
18378
18379 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
18380 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
18381 (shifts_to): Rename as...
18382 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
18383 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
18384 (TRANSITION_IS_DISABLED, transitions_to): these.
18385
18386 2002-06-30 Akim Demaille <akim@epita.fr>
18387
18388 * src/print.c (print_shifts, print_gotos): Merge into...
18389 (print_transitions): this.
18390 (print_transitions, print_errs, print_reductions): Align the
18391 lookaheads columns.
18392 (print_core, print_transitions, print_errs, print_state,
18393 print_grammar): Output empty lines separator before, not after.
18394 (state_default_rule_compute): Rename as...
18395 (state_default_rule): this.
18396 * tests/conflicts.at (Defaulted Conflicted Reduction),
18397 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
18398 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
18399
18400 2002-06-30 Akim Demaille <akim@epita.fr>
18401
18402 Display items as we display rules.
18403
18404 * src/gram.h, src/gram.c (rule_lhs_print): New.
18405 * src/gram.c (grammar_rules_partial_print): Use it.
18406 * src/print.c (print_core): Likewise.
18407 * tests/conflicts.at (Defaulted Conflicted Reduction),
18408 (Unresolved SR Conflicts): Adjust.
18409 (Unresolved SR Conflicts): Adjust and rename as...
18410 (Resolved SR Conflicts): this, as was meant.
18411 * tests/regression.at (Web2c Report): Adjust.
18412
18413 2002-06-30 Akim Demaille <akim@epita.fr>
18414
18415 * src/print.c (state_default_rule_compute): New, extracted from...
18416 (print_reductions): here.
18417 Pessimize, but clarify the code.
18418 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
18419
18420 2002-06-30 Akim Demaille <akim@epita.fr>
18421
18422 * src/output.c (action_row): Let default_rule be always a rule
18423 number.
18424
18425 2002-06-30 Akim Demaille <akim@epita.fr>
18426
18427 * src/closure.c (print_firsts, print_fderives, closure):
18428 Use BITSET_EXECUTE.
18429 * src/lalr.c (lookaheads_print): Likewise.
18430 * src/state.c (state_rule_lookaheads_print): Likewise.
18431 * src/print_graph.c (print_core): Likewise.
18432 * src/print.c (print_reductions): Likewise.
18433 * src/output.c (action_row): Likewise.
18434 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
18435
18436 2002-06-30 Akim Demaille <akim@epita.fr>
18437
18438 * src/print_graph.c: Use report_flag.
18439
18440 2002-06-30 Akim Demaille <akim@epita.fr>
18441
18442 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
18443 to...
18444 * src/relation.h, src/relation.c (traverse, relation_digraph)
18445 (relation_print, relation_transpose): New.
18446
18447 2002-06-30 Akim Demaille <akim@epita.fr>
18448
18449 * src/state.h, src/state.c (shifts_to): New.
18450 * src/lalr.c (build_relations): Use it.
18451
18452 2002-06-30 Akim Demaille <akim@epita.fr>
18453
18454 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
18455 (item_number_of_rule_number, rule_number_of_item_number): New.
18456 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
18457 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
18458 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
18459 Propagate their use.
18460 Much remains to be done, in particular wrt `shorts' from types.h.
18461
18462 2002-06-30 Akim Demaille <akim@epita.fr>
18463
18464 * src/symtab.c (symbol_new): Initialize the `printer' member.
18465
18466 2002-06-30 Akim Demaille <akim@epita.fr>
18467
18468 * src/LR0.c (save_reductions): Remove, replaced by...
18469 * src/state.h, src/state.c (state_reductions_set): New.
18470 (reductions, errs): Rename as...
18471 (reductions_t, errs_t): these.
18472 Adjust all dependencies.
18473
18474 2002-06-30 Akim Demaille <akim@epita.fr>
18475
18476 * src/LR0.c (state_list_t, state_list_append): New.
18477 (first_state, last_state): Now symbol_list_t.
18478 (this_state): Remove.
18479 (new_itemsets, append_states, save_reductions): Take a state_t as
18480 argument.
18481 (set_states, generate_states): Adjust.
18482 (save_shifts): Remove, replaced by...
18483 * src/state.h, src/state.c (state_shifts_set): New.
18484 (shifts): Rename as...
18485 (shifts_t): this.
18486 Adjust all dependencies.
18487 * src/state.h (state_t): Remove the `next' member.
18488
18489 2002-06-30 Akim Demaille <akim@epita.fr>
18490
18491 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
18492 escaped in slot 0.
18493
18494 2002-06-30 Akim Demaille <akim@epita.fr>
18495
18496 Use hash.h for the state hash table.
18497
18498 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
18499 (allocate_storage): Use state_hash_new.
18500 (free_storage): Use state_hash_free.
18501 (new_state, get_state): Adjust.
18502 * src/lalr.h, src/lalr.c (states): Move to...
18503 * src/states.h (state_t): Remove the `link' member, no longer
18504 used.
18505 * src/states.h, src/states.c: here.
18506 (state_hash_new, state_hash_free, state_hash_lookup)
18507 (state_hash_insert, states_free): New.
18508 * src/states.c (state_table, state_compare, state_hash): New.
18509 * src/output.c (output_actions): Do not free states now, since we
18510 still need to know the final_state number in `prepare', called
18511 afterwards. Do it...
18512 * src/main.c (main): here: call states_free after `output'.
18513
18514 2002-06-30 Akim Demaille <akim@epita.fr>
18515
18516 * src/state.h, src/state.c (state_new): New, extracted from...
18517 * src/LR0.c (new_state): here.
18518 * src/state.h (STATE_ALLOC): Move to...
18519 * src/state.c: here.
18520 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
18521 * src/state.h, src/state.c: here.
18522
18523 2002-06-30 Akim Demaille <akim@epita.fr>
18524
18525 * src/reader.c (gensym): Rename as...
18526 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
18527 (getsym): Rename as...
18528 (symbol_get): this.
18529
18530 2002-06-30 Akim Demaille <akim@epita.fr>
18531
18532 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
18533 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
18534 * src/output.c, src/print.c, src/print_graph.c: Propagate.
18535 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
18536
18537 2002-06-30 Akim Demaille <akim@epita.fr>
18538
18539 Make the test suite pass with warnings checked.
18540
18541 * tests/actions.at (Printers and Destructors): Improve.
18542 Avoid unsigned vs. signed issues.
18543 * tests/calc.at: Don't exercise the scanner here, do it...
18544 * tests/input.at (Torturing the Scanner): here.
18545
18546 2002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18547
18548 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
18549 reorganize first lines parallel to yacc.c.
18550
18551 2002-06-28 Akim Demaille <akim@epita.fr>
18552
18553 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
18554 (b4_token_enum, b4_token_defines): New, factored from...
18555 * data/lalr1.cc, data/yacc.c, glr.c: here.
18556
18557 2002-06-28 Akim Demaille <akim@epita.fr>
18558
18559 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
18560 unused variables.
18561 * src/output.c (merger_output): static.
18562
18563 2002-06-28 Akim Demaille <akim@epita.fr>
18564
18565 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
18566 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
18567 pacify GCC.
18568 * src/output.c (save_row): Initialize all the variables to pacify GCC.
18569
18570 2002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18571
18572 Accumulated changelog for new GLR parsing features.
18573
18574 * src/conflicts.c (count_total_conflicts): Change name to
18575 conflicts_total_count.
18576 * src/conflicts.h: Ditto.
18577 * src/output.c (token_actions): Use the new name.
18578 (output_conflicts): Change conflp => conflict_list_heads, and
18579 confl => conflict_list for better readability.
18580 * data/glr.c: Use the new names.
18581 * NEWS: Add self to GLR announcement.
18582
18583 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
18584
18585 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
18586 Akim Demaille.
18587
18588 * data/bison.glr: Change name to glr.c
18589 * data/glr.c: Renamed from bison.glr.
18590 * data/Makefile.am: Add glr.c
18591
18592 * src/getargs.c:
18593
18594 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
18595 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
18596
18597 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18598
18599 * data/bison.glr: Be sure to restore the
18600 current #line when returning to the skeleton contents after having
18601 exposed the input file's #line.
18602
18603 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18604
18605 * data/bison.glr: Bring up to date with changes to bison.simple.
18606
18607 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18608
18609 * data/bison.glr: Correct definitions that use b4_prefix.
18610 Various reformatting.
18611 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
18612 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
18613 yytokenp argument; now part of stack.
18614 (yychar): Define to behave as documented.
18615 (yyclearin): Ditto.
18616
18617 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18618
18619 * src/reader.h: Add declaration for free_merger_functions.
18620
18621 * src/reader.c (merge_functions): New variable.
18622 (get_merge_function): New function.
18623 (free_merger_functions): New function.
18624 (readgram): Check for %prec that is not followed by a symbol.
18625 Handle %dprec and %merge declarations.
18626 (packgram): Initialize dprec and merger fields in rules array.
18627
18628 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
18629 conflict_list_cnt, conflict_list_free): New variables.
18630 (table_grow): Also grow conflict_table.
18631 (prepare_rules): Output dprec and merger tables.
18632 (conflict_row): New function.
18633 (action_row): Output conflict lists for GLR parser. Don't use
18634 default reduction in conflicted states for GLR parser so that there
18635 are spaces for the conflict lists.
18636 (save_row): Also save conflict information.
18637 (token_actions): Allocate conflict list.
18638 (merger_output): New function.
18639 (pack_vector): Pack conflict table, too.
18640 (output_conflicts): New function to output yyconflp and yyconfl.
18641 (output_check): Allocate conflict_tos.
18642 (output_actions): Output conflict tables, also.
18643 (output_skeleton): Output b4_mergers definition.
18644 (prepare): Output b4_max_rhs_length definition.
18645 Use 'bison.glr' as default skeleton for GLR parsers.
18646
18647 * src/gram.c (glr_parser): New flag.
18648 (grammar_free): Call free_merger_functions.
18649
18650 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
18651 all pairs of conflicting reductions, rather than just all tokens
18652 causing conflicts. Needed to size conflict tables.
18653 (conflicts_output): Modify call to count_rr_conflicts for new
18654 interface.
18655 (conflicts_print): Ditto.
18656 (count_total_conflicts): New function.
18657
18658 * src/reader.h (merger_list): New type.
18659 (merge_functions): New variable.
18660
18661 * src/lex.h (tok_dprec, tok_merge): New token types.
18662
18663 * src/gram.h (rule_s): Add dprec and merger fields.
18664 (glr_parser): New flag.
18665
18666 * src/conflicts.h (count_total_conflicts): New function.
18667
18668 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
18669
18670 * doc/bison.texinfo (Generalized LR Parsing): New section.
18671 (GLR Parsers): New section.
18672 (Language and Grammar): Mention GLR parsing.
18673 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
18674 Correct typo ("tge" -> "the").
18675
18676 * data/bison.glr: New skeleton for GLR parsing.
18677
18678 * tests/cxx-gram.at: New tests for GLR parsing.
18679
18680 * tests/testsuite.at: Include cxx-gram.at.
18681
18682 * tests/Makefile.am: Add cxx-gram.at.
18683
18684 * src/parse-gram.y:
18685
18686 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
18687
18688 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
18689
18690 2002-06-27 Akim Demaille <akim@epita.fr>
18691
18692 * src/options.h, src/options.c: Remove.
18693 * src/getargs.c (short_options, long_options): New.
18694
18695 2002-06-27 Akim Demaille <akim@epita.fr>
18696
18697 * data/bison.simple, data/bison.c++: Rename as...
18698 * data/yacc.c, data/lalr1.cc: these.
18699 * doc/bison.texinfo (Environment Variables): Remove.
18700
18701 2002-06-25 Raja R Harinath <harinath@cs.umn.edu>
18702
18703 * src/getargs.c (report_argmatch): Initialize strtok().
18704
18705 2002-06-20 Akim Demaille <akim@epita.fr>
18706
18707 * data/bison.simple (b4_symbol_actions): New, replaces...
18708 (b4_symbol_destructor, b4_symbol_printer): these.
18709 (yysymprint): Be sure to call YYPRINT only for tokens, and using
18710 user token numbers.
18711
18712 2002-06-20 Akim Demaille <akim@epita.fr>
18713
18714 * data/bison.simple (yydestructor): Rename as...
18715 (yydestruct): this.
18716
18717 2002-06-20 Akim Demaille <akim@epita.fr>
18718
18719 * src/symtab.h, src/symtab.c (symbol_type_set)
18720 (symbol_destructor_set, symbol_precedence_set): The location is
18721 the last argument.
18722 Adjust all callers.
18723
18724 2002-06-20 Akim Demaille <akim@epita.fr>
18725
18726 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
18727 internals.
18728 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
18729 Takes a location.
18730 * src/symtab.h, src/symtab.c (symbol_class_set)
18731 (symbol_user_token_number_set): Likewise.
18732 Adjust all callers.
18733 Promote complain_at.
18734 * tests/input.at (Type Clashes): Adjust.
18735
18736 2002-06-20 Akim Demaille <akim@epita.fr>
18737
18738 * data/bison.simple (YYLEX): Fix the declaration when
18739 %pure-parser.
18740
18741 2002-06-20 Akim Demaille <akim@epita.fr>
18742
18743 * data/bison.simple (yysymprint): Don't print the token number,
18744 just its name.
18745 * tests/actions.at (Destructors): Rename as...
18746 (Printers and Destructors): this.
18747 Also exercise %printer.
18748
18749 2002-06-20 Akim Demaille <akim@epita.fr>
18750
18751 * data/bison.simple (YYDSYMPRINT): New.
18752 Use it to remove many of the #if YYDEBUG/if (yydebug).
18753
18754 2002-06-20 Akim Demaille <akim@epita.fr>
18755
18756 * src/symtab.h, src/symtab.c (symbol_t): printer and
18757 printer_location are new members.
18758 (symbol_printer_set): New.
18759 * src/parse-gram.y (PERCENT_PRINTER): New token.
18760 Handle its associated rule.
18761 * src/scan-gram.l: Adjust.
18762 (handle_destructor_at, handle_destructor_dollar): Rename as...
18763 (handle_symbol_code_at, handle_symbol_code_dollar): these.
18764 * src/output.c (symbol_printers_output): New.
18765 (output_skeleton): Call it.
18766 * data/bison.simple (yysymprint): New. Cannot be named yyprint
18767 since there are already many grammar files with a user `yyprint'.
18768 Replace the calls to YYPRINT to calls to yysymprint.
18769 * tests/calc.at: Adjust.
18770 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
18771 taking advantage of parser very internal details (stack size!).
18772
18773 2002-06-20 Akim Demaille <akim@epita.fr>
18774
18775 * src/scan-gram.l: Complete the scanner with the missing patterns
18776 to pacify Flex.
18777 Use `quote' and `symbol_tag_get' where appropriate.
18778
18779 2002-06-19 Akim Demaille <akim@epita.fr>
18780
18781 * tests/actions.at (Destructors): Augment to test locations.
18782 * data/bison.simple (yydestructor): Pass it the current location
18783 if locations are enabled.
18784 Prototype only when __STDC__ or C++.
18785 Change the argument names to move into the yy name space: there is
18786 user code here.
18787
18788 2002-06-19 Akim Demaille <akim@epita.fr>
18789
18790 * data/bison.simple (b4_pure_if): New.
18791 Use it instead of #ifdef YYPURE.
18792
18793 2002-06-19 Akim Demaille <akim@epita.fr>
18794
18795 * data/bison.simple (b4_location_if): New.
18796 Use it instead of #ifdef YYLSP_NEEDED.
18797
18798 2002-06-19 Akim Demaille <akim@epita.fr>
18799
18800 Prepare @$ in %destructor, but currently don't bind it in the
18801 skeleton, as %location use is not cleaned up yet.
18802
18803 * src/scan-gram.l (handle_dollar, handle_destructor_at)
18804 (handle_action_at): New.
18805 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
18806 a braced_code_t and a location as additional arguments.
18807 (handle_destructor_dollar): Instead of requiring `b4_eval', just
18808 unquote one when outputting `b4_dollar_dollar'.
18809 Adjust callers.
18810 * data/bison.simple (b4_eval): Remove.
18811 (b4_symbol_destructor): Adjust.
18812 * tests/input.at (Invalid @n): Adjust.
18813
18814 2002-06-19 Zack Weinberg <zack@codesourcery.com>
18815
18816 * doc/bison.texinfo: Document ability to have multiple
18817 prologue sections.
18818
18819 2002-06-18 Akim Demaille <akim@epita.fr>
18820
18821 * src/files.c (compute_base_names): When computing the output file
18822 names from the input file name, strip the directory part.
18823
18824 2002-06-18 Akim Demaille <akim@epita.fr>
18825
18826 * data/bison.simple.new: Comment changes.
18827 Reported by Andreas Schwab.
18828
18829 2002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
18830
18831 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
18832 there are no `label `yyoverflowlab' defined but not used' warnings
18833 when yyoverflow is defined.
18834
18835 2002-06-18 Akim Demaille <akim@epita.fr>
18836
18837 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
18838 new member.
18839 (symbol_destructor_set): Adjust.
18840 * src/output.c (symbol_destructors_output): Output the destructor
18841 locations.
18842 Output the symbol name.
18843 * data/bison.simple (b4_symbol_destructor): Adjust.
18844
18845 2002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
18846 and Akim Demaille <akim@epita.fr>
18847
18848 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
18849 what's left on the stack when the error recovery hits EOF.
18850 * tests/actions.at (Destructors): Complete to exercise this case.
18851
18852 2002-06-17 Akim Demaille <akim@epita.fr>
18853
18854 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
18855 arguments is really empty, not only equal to `[]'.
18856 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
18857 member.
18858 (symbol_destructor_set): New.
18859 * src/output.c (symbol_destructors_output): New.
18860 * src/reader.h (brace_code_t, current_braced_code): New.
18861 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
18862 (handle_dollar): Rename as...
18863 (handle_action_dollar): this.
18864 (handle_destructor_dollar): New.
18865 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
18866 (grammar_declaration): Use it.
18867 * data/bison.simple (yystos): Is always defined.
18868 (yydestructor): New.
18869 * tests/actions.at (Destructors): New.
18870 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
18871
18872 2002-06-17 Akim Demaille <akim@epita.fr>
18873
18874 * src/symlist.h, src/symlist.c (symbol_list_length): New.
18875 * src/scan-gram.l (handle_dollar, handle_at): Compute the
18876 rule_length only when needed.
18877 * src/output.c (actions_output, token_definitions_output): Output
18878 the full M4 block.
18879 * src/symtab.c: Don't access directly to the symbol tag, use
18880 symbol_tag_get.
18881 * src/parse-gram.y: Use symbol_list_free.
18882
18883 2002-06-17 Akim Demaille <akim@epita.fr>
18884
18885 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
18886 (symbol_list_prepend, get_type_name): Move to...
18887 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
18888 (symbol_list_prepend, symbol_list_n_type_name_get): here.
18889 Adjust all callers.
18890 (symbol_list_free): New.
18891 * src/scan-gram.l (handle_dollar): Takes a location.
18892 * tests/input.at (Invalid $n): Adjust.
18893
18894 2002-06-17 Akim Demaille <akim@epita.fr>
18895
18896 * src/reader.h, src/reader.c (symbol_list_new): Export it.
18897 (symbol_list_prepend): New.
18898 * src/parse-gram.y (%union): `list' is a new member.
18899 (symbols.1): New, replaces...
18900 (terms_to_prec.1, nterms_to_type.1): these.
18901 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
18902 Take a location as additional argument.
18903 Adjust all callers.
18904
18905 2002-06-15 Akim Demaille <akim@epita.fr>
18906
18907 * src/parse-gram.y: Move %token in the declaration section so that
18908 we don't depend upon CVS Bison.
18909
18910 2002-06-15 Akim Demaille <akim@epita.fr>
18911
18912 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
18913 * src/print.c (print_core): Use it.
18914
18915 2002-06-15 Akim Demaille <akim@epita.fr>
18916
18917 * src/conflicts.c (log_resolution): Accept the rule involved in
18918 the sr conflicts instead of the lookahead number that points to
18919 that rule.
18920 (flush_reduce): Accept the current lookahead vector as argument,
18921 instead of the index in LA.
18922 (resolve_sr_conflict): Accept the current number of lookahead
18923 bitset to consider for the STATE, instead of the index in LA.
18924 (set_conflicts): Adjust.
18925 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
18926
18927 2002-06-15 Akim Demaille <akim@epita.fr>
18928
18929 * src/state.h (state_t): Replace the `lookaheadsp' member, a
18930 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
18931 Adjust all dependencies.
18932 * src/lalr.c (initialize_lookaheads): Split into...
18933 (states_lookaheads_count, states_lookaheads_initialize): these.
18934 (lalr): Adjust.
18935
18936 2002-06-15 Akim Demaille <akim@epita.fr>
18937
18938 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
18939 out of...
18940 (grammar_rules_print): here.
18941 * src/reduce.c (reduce_output): Use it.
18942 * tests/reduce.at (Useless Rules, Reduced Automaton)
18943 (Underivable Rules): Adjust.
18944
18945 2002-06-15 Akim Demaille <akim@epita.fr>
18946
18947 Copy BYacc's nice way to report the grammar.
18948
18949 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
18950 New.
18951 Don't print the rules' location, it is confusing and useless.
18952 (rule_print): Use grammar_rhs_print.
18953 * src/print.c (print_grammar): Use grammar_rules_print.
18954
18955 2002-06-15 Akim Demaille <akim@epita.fr>
18956
18957 Complete and rationalize `useless thing' warnings.
18958
18959 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
18960 (symbol_tag_print): New.
18961 Use them everywhere in place of accessing directly the tag member.
18962 * src/gram.h, src/gram.c (rule_print): New.
18963 Use it where a rule used to be printed `by hand'.
18964 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
18965 (reduce_grammar_tables): Report the useless rules.
18966 (reduce_print): Useless things are a warning, not an error.
18967 Report it as such.
18968 * tests/reduce.at (Useless Nonterminals, Useless Rules):
18969 (Reduced Automaton, Underivable Rules): Adjust.
18970 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
18971 * tests/conflicts.at (Unresolved SR Conflicts)
18972 (Solved SR Conflicts): Adjust.
18973
18974 2002-06-15 Akim Demaille <akim@epita.fr>
18975
18976 Let symbols have a location.
18977
18978 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
18979 (getsym): Adjust.
18980 Adjust all callers.
18981 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
18982 Use location_t, not int.
18983 * src/symtab.c (symbol_check_defined): Take advantage of the
18984 location.
18985 * tests/regression.at (Invalid inputs): Adjust.
18986
18987 2002-06-15 Akim Demaille <akim@epita.fr>
18988
18989 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
18990 (input): Don't try to initialize yylloc here, do it in the
18991 scanner.
18992 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
18993 * src/gram.h (rule_t): Change line and action_line into location
18994 and action_location, of location_t type.
18995 Adjust all dependencies.
18996 * src/location.h, src/location.c (empty_location): New.
18997 * src/reader.h, src/reader.c (grammar_start_symbol_set)
18998 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
18999 (grammar_current_rule_symbol_append)
19000 (grammar_current_rule_action_append): Expect a location as argument.
19001 * src/reader.c (grammar_midrule_action): Adjust to attach an
19002 action's location as dummy symbol location.
19003 * src/symtab.h, src/symtab.c (startsymbol_location): New.
19004 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
19005 the line numbers.
19006
19007 2002-06-14 Akim Demaille <akim@epita.fr>
19008
19009 Grammar declarations may be found in the grammar section.
19010
19011 * src/parse-gram.y (rules_or_grammar_declaration): New.
19012 (declarations): Each declaration may end with a semicolon, not
19013 just...
19014 (grammar_declaration): `"%union"'.
19015 (grammar): Branch to rules_or_grammar_declaration.
19016
19017 2002-06-14 Akim Demaille <akim@epita.fr>
19018
19019 * src/main.c (main): Invoke scanner_free.
19020
19021 2002-06-14 Akim Demaille <akim@epita.fr>
19022
19023 * src/output.c (m4_invoke): Extracted from...
19024 (output_skeleton): here.
19025 Free tempfile.
19026
19027 2002-06-14 Akim Demaille <akim@epita.fr>
19028
19029 * src/parse-gram.y (directives, directive, gram)
19030 (grammar_directives, precedence_directives, precedence_directive):
19031 Rename as...
19032 (declarations, declaration, grammar, grammar_declaration)
19033 (precedence_declaration, precedence_declarator): these.
19034 (symbol_declaration): New.
19035
19036 2002-06-14 Akim Demaille <akim@epita.fr>
19037
19038 * src/files.c (action_obstack): Remove, unused.
19039 (output_obstack): Remove it, and all its dependencies, as it is no
19040 longer needed.
19041 * src/reader.c (epilogue_set): Build the epilogue in the
19042 muscle_obstack.
19043 * src/output.h, src/output.c (muscle_obstack): Move to...
19044 * src/muscle_tab.h, src/muscle_tab.h: here.
19045 (muscle_init): Initialize muscle_obstack.
19046 (muscle_free): New.
19047 * src/main.c (main): Call it.
19048
19049 2002-06-14 Akim Demaille <akim@epita.fr>
19050
19051 * src/location.h: New, extracted from...
19052 * src/reader.h: here.
19053 * src/Makefile.am (noinst_HEADERS): Merge into
19054 (bison_SOURCES): this.
19055 Add location.h.
19056 * src/parse-gram.y: Use location_t instead of Bison's.
19057 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
19058 Use location_t instead of ints.
19059
19060 2002-06-14 Akim Demaille <akim@epita.fr>
19061
19062 * data/bison.simple, data/bison.c++: Be sure to restore the
19063 current #line when returning to the skeleton contents after having
19064 exposed the input file's #line.
19065
19066 2002-06-12 Akim Demaille <akim@epita.fr>
19067
19068 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
19069 eager.
19070 * tests/actions.at (Exotic Dollars): New.
19071
19072 2002-06-12 Akim Demaille <akim@epita.fr>
19073
19074 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
19075 ['"/] too eagerly.
19076 * tests/input.at (Torturing the Scanner): New.
19077
19078 2002-06-11 Akim Demaille <akim@epita.fr>
19079
19080 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
19081 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
19082 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
19083 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
19084 * src/reader.c (reader): Use it.
19085
19086 2002-06-11 Akim Demaille <akim@epita.fr>
19087
19088 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
19089 Adjust all callers.
19090 (scanner_last_string_free): New.
19091
19092 2002-06-11 Akim Demaille <akim@epita.fr>
19093
19094 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
19095 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
19096 (last_string, YY_OBS_FREE): New.
19097 Use them when returning an ID.
19098
19099 2002-06-11 Akim Demaille <akim@epita.fr>
19100
19101 Have Bison grammars parsed by a Bison grammar.
19102
19103 * src/reader.c, src/reader.h (prologue_augment): New.
19104 * src/reader.c (copy_definition): Remove.
19105
19106 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
19107 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
19108 (grammar_current_rule_prec_set, grammar_current_rule_check)
19109 (grammar_current_rule_symbol_append)
19110 (grammar_current_rule_action_append): Export.
19111 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
19112 (symbol_list_action_append): Remove.
19113 Hook the routines from reader.
19114 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
19115 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
19116
19117 * src/reader.c (read_declarations): Remove, unused.
19118
19119 * src/parse-gram.y: Handle the epilogue.
19120 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
19121 (grammar_start_symbol_set): this.
19122 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
19123 * src/reader.c (readgram): Remove, unused.
19124 (reader): Adjust to insert eoftoken and axiom where appropriate.
19125
19126 * src/reader.c (copy_dollar): Replace with...
19127 * src/scan-gram.h (handle_dollar): this.
19128 * src/parse-gram.y: Remove `%thong'.
19129
19130 * src/reader.c (copy_at): Replace with...
19131 * src/scan-gram.h (handle_at): this.
19132
19133 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
19134 New.
19135
19136 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
19137 time being.
19138
19139 * src/reader.h, src/reader.c (grammar_rule_end): New.
19140
19141 * src/parse.y (current_type, current_class): New.
19142 Implement `%nterm', `%token' support.
19143 Merge `%term' into `%token'.
19144 (string_as_id): New.
19145 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
19146 type name.
19147
19148 * src/parse-gram.y: Be sure to handle properly the beginning of
19149 rules.
19150
19151 * src/parse-gram.y: Handle %type.
19152 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
19153
19154 * src/parse-gram.y: More directives support.
19155 * src/options.c: No longer handle source directives.
19156
19157 * src/parse-gram.y: Fix %output.
19158
19159 * src/parse-gram.y: Handle %union.
19160 Use the prologue locations.
19161 * src/reader.c (parse_union_decl): Remove.
19162
19163 * src/reader.h, src/reader.c (epilogue_set): New.
19164 * src/parse-gram.y: Use it.
19165
19166 * data/bison.simple, data/bison.c++: b4_stype is now either not
19167 defined, then default to int, or to the contents of %union,
19168 without `union' itself.
19169 Adjust.
19170 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
19171
19172 * src/output.c (actions_output): Don't output braces, as they are
19173 already handled by the scanner.
19174
19175 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
19176 characters to themselves.
19177
19178 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
19179 that the epilogue has a proper #line.
19180
19181 * src/parse-gram.y: Handle precedence/associativity.
19182
19183 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
19184 a terminal.
19185 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
19186 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
19187 at all to define terminals that cannot be emitted.
19188
19189 * src/scan-gram.l: Escape M4 characters.
19190
19191 * src/scan-gram.l: Working properly with escapes in user
19192 strings/characters.
19193
19194 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
19195 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
19196 grammar.
19197 Use more modest sizes, as for the time being the parser does not
19198 release memory, and therefore the process swallows a huge amount
19199 of memory.
19200
19201 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
19202 stricter %token grammar.
19203
19204 * src/symtab.h (associativity): Add `undef_assoc'.
19205 (symbol_precedence_set): Do nothing when passed an undef_assoc.
19206 * src/symtab.c (symbol_check_alias_consistence): Adjust.
19207
19208 * tests/regression.at (Invalid %directive): Remove, as it is now
19209 meaningless.
19210 (Invalid inputs): Adjust to the new error messages.
19211 (Token definitions): The new grammar doesn't allow too many
19212 eccentricities.
19213
19214 * src/lex.h, src/lex.c: Remove.
19215 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
19216 (copy_character, copy_string2, copy_string, copy_identifier)
19217 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
19218 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
19219 (parse_action): Remove.
19220 * po/POTFILES.in: Adjust.
19221
19222 2002-06-11 Akim Demaille <akim@epita.fr>
19223
19224 * src/reader.c (parse_action): Don't store directly into the
19225 rule's action member: return the action as a string.
19226 Don't require `rule_length' as an argument: compute it.
19227 (grammar_current_rule_symbol_append)
19228 (grammar_current_rule_action_append): New, eved out from
19229 (readgram): here.
19230 Remove `action_flag', `rulelength', unused now.
19231
19232 2002-06-11 Akim Demaille <akim@epita.fr>
19233
19234 * src/reader.c (grammar_current_rule_prec_set).
19235 (grammar_current_rule_check): New, eved out from...
19236 (readgram): here.
19237 Remove `xaction', `first_rhs': useless.
19238 * tests/input.at (Type clashes): New.
19239 * tests/existing.at (GNU Cim Grammar): Adjust.
19240
19241 2002-06-11 Akim Demaille <akim@epita.fr>
19242
19243 * src/reader.c (grammar_midrule_action): New, Eved out from
19244 (readgram): here.
19245
19246 2002-06-11 Akim Demaille <akim@epita.fr>
19247
19248 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
19249 New.
19250 (readgram): Use them as replacement of inlined code, crule and
19251 crule1.
19252
19253 2002-06-11 Akim Demaille <akim@epita.fr>
19254
19255 * src/reader.c (grammar_end, grammar_symbol_append): New.
19256 (readgram): Use them.
19257 Make the use of `p' as local as possible.
19258
19259 2002-06-10 Akim Demaille <akim@epita.fr>
19260
19261 GCJ's parser requires the tokens to be defined before the prologue.
19262
19263 * data/bison.simple: Output the token definition before the user's
19264 prologue.
19265 * tests/regression.at (Braces parsing, Duplicate string)
19266 (Mixing %token styles): Check the output from bison.
19267 (Early token definitions): New.
19268
19269 2002-06-10 Akim Demaille <akim@epita.fr>
19270
19271 * src/symtab.c (symbol_user_token_number_set): Don't complain when
19272 assigning twice the same user number to a token, so that we can
19273 use it in...
19274 * src/lex.c (lex): here.
19275 Also use `symbol_class_set' instead of hand written code.
19276 * src/reader.c (parse_assoc_decl): Likewise.
19277
19278 2002-06-10 Akim Demaille <akim@epita.fr>
19279
19280 * src/symtab.c, src/symtab.c (symbol_class_set)
19281 (symbol_user_token_number_set): New.
19282 * src/reader.c (parse_token_decl): Use them.
19283 Use a switch instead of ifs.
19284 Use a single argument.
19285
19286 2002-06-10 Akim Demaille <akim@epita.fr>
19287
19288 Remove `%thong' support as it is undocumented, unused, duplicates
19289 `%token's job, and creates useless e-mail traffic with people who
19290 want to know what it is, why it is undocumented, unused, and
19291 duplicates `%token's job.
19292
19293 * src/reader.c (parse_thong_decl): Remove.
19294 * src/options.c (option_table): Remove "thong".
19295 * src/lex.h (tok_thong): Remove.
19296
19297 2002-06-10 Akim Demaille <akim@epita.fr>
19298
19299 * src/symtab.c, src/symtab.c (symbol_type_set)
19300 (symbol_precedence_set): New.
19301 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
19302 (value_components_used): Remove, unused.
19303
19304 2002-06-09 Akim Demaille <akim@epita.fr>
19305
19306 Move symbols handling code out of the reader.
19307
19308 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
19309 (axiom): Move to...
19310 * src/symtab.h, src/symtab.c: here.
19311
19312 * src/gram.c (start_symbol): Remove: use startsymbol->number.
19313 * src/reader.c (startval): Rename as...
19314 * src/symtab.h, src/symtab.c (startsymbol): this.
19315 * src/reader.c: Adjust.
19316
19317 * src/reader.c (symbol_check_defined, symbol_make_alias)
19318 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
19319 (token_translations_init)
19320 Move to...
19321 * src/symtab.c: here.
19322 * src/reader.c (packsymbols): Move to...
19323 * src/symtab.h, src/symtab.c (symbols_pack): here.
19324 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
19325 argument.
19326
19327 2002-06-03 Akim Demaille <akim@epita.fr>
19328
19329 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
19330 then statements.
19331
19332 2002-06-03 Akim Demaille <akim@epita.fr>
19333
19334 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
19335 structs with non literals.
19336 * src/scan-skel.l: never-interactive.
19337 * src/conflicts.c (enum conflict_resolution_e): No trailing
19338 comma.
19339 * src/getargs.c (usage): Split long literal strings.
19340 Reported by Hans Aberg.
19341
19342 2002-05-28 Akim Demaille <akim@epita.fr>
19343
19344 * data/bison.c++: Use C++ ostreams.
19345 (cdebug_): New member.
19346
19347 2002-05-28 Akim Demaille <akim@epita.fr>
19348
19349 * src/output.c (output_skeleton): Be sure to allocate enough room
19350 for `/' _and_ for `\0' in full_skeleton.
19351
19352 2002-05-28 Akim Demaille <akim@epita.fr>
19353
19354 * data/bison.c++: Catch up with bison.simple:
19355 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
19356 and Paul Eggert <eggert@twinsun.com>: `error' handing.
19357 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
19358 and popping traces.
19359
19360 2002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
19361
19362 * src/output.c (output_skeleton): Put an explicit path in front of
19363 the skeleton file name, rather than relying on the -I directory,
19364 to partially alleviate effects of having a skeleton file lying around
19365 in the current directory.
19366
19367 2002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
19368
19369 * src/conflicts.c (log_resolution): Correct typo:
19370 obstack_printf should be obstack_fgrow1.
19371
19372 2002-05-26 Akim Demaille <akim@epita.fr>
19373
19374 * src/state.h (state_t): `solved_conflicts' is a new member.
19375 * src/LR0.c (new_state): Set it to 0.
19376 * src/conflicts.h, src/conflicts.c (print_conflicts)
19377 (free_conflicts, solve_conflicts): Rename as...
19378 (conflicts_print, conflicts_free, conflicts_solve): these.
19379 Adjust callers.
19380 * src/conflicts.c (enum conflict_resolution_e)
19381 (solved_conflicts_obstack): New, used by...
19382 (log_resolution): this.
19383 Adjust to attach the conflict resolution to each state.
19384 Complete the description with the precedence/associativity
19385 information.
19386 (resolve_sr_conflict): Adjust.
19387 * src/print.c (print_state): Output its solved_conflicts.
19388 * tests/conflicts.at (Unresolved SR Conflicts)
19389 (Solved SR Conflicts): Exercise --report=all.
19390
19391 2002-05-26 Akim Demaille <akim@epita.fr>
19392
19393 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
19394 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
19395 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
19396 (token_number_t, item_number_as_token_number)
19397 (token_number_as_item_number, muscle_insert_token_number_table):
19398 Rename as...
19399 (symbol_number_t, item_number_as_symbol_number)
19400 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
19401 these, since it is more appropriate.
19402
19403 2002-05-26 Akim Demaille <akim@epita.fr>
19404
19405 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
19406 `Error:' lines.
19407 * data/bison.simple (yystos) [YYDEBUG]: New.
19408 (yyparse) [YYDEBUG]: Display the symbols which are popped during
19409 error recovery.
19410 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
19411
19412 2002-05-25 Akim Demaille <akim@epita.fr>
19413
19414 * doc/bison.texinfo (Debugging): Split into...
19415 (Tracing): this new section, its former contents, and...
19416 (Understanding): this new section.
19417 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
19418 by...
19419 (report_flag): this.
19420 Adjust all dependencies.
19421 (report_args, report_types, report_argmatch): New.
19422 (usage, getargs): Report/support -r, --report.
19423 * src/options.h
19424 (struct option_table_struct): Rename as..,
19425 (struct option_table_s): this.
19426 Rename the `set_flag' member to `flag' to match with getopt_long's
19427 struct.
19428 * src/options.c (option_table): Split verbose into an entry for
19429 %verbose, and another for --verbose.
19430 Support --report/-r, so remove -r from the obsolete --raw.
19431 * src/print.c: Attach full item sets and lookaheads reports to
19432 report_flag instead of trace_flag.
19433 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
19434
19435 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
19436 and Paul Eggert <eggert@twinsun.com>
19437
19438 * data/bison.simple (yyparse): Correct error handling to conform to
19439 POSIX and yacc. Specifically, after syntax error is discovered,
19440 do not reduce further before shifting the error token.
19441 Clean up the code a bit by removing the labels yyerrdefault,
19442 yyerrhandle, yyerrpop.
19443 * NEWS: Document the above.
19444
19445 2002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
19446
19447 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
19448 type; it isn't always big enough, since it doesn't necessarily
19449 include non-terminals.
19450 (yytranslate): Expand definition of yy_token_number_type, so that
19451 the latter can be removed.
19452 (yy_token_number_type): Remove, only one use.
19453 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
19454 don't use TokenNumberType as element type.
19455
19456 * tests/regression.at: Modify expected output to agree with change
19457 to yyr1 and yytranslate.
19458
19459 2002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
19460
19461 * src/reader.c (parse_action): Use copy_character instead of
19462 obstack_1grow.
19463
19464 2002-05-13 Akim Demaille <akim@epita.fr>
19465
19466 * tests/regression.at (Token definitions): Prototype yylex and
19467 yyerror.
19468
19469 2002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
19470
19471 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
19472 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
19473 32-bit arithmetic.
19474 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
19475
19476 2002-05-07 Akim Demaille <akim@epita.fr>
19477
19478 * tests/synclines.at: Be sure to prototype yylex and yyerror to
19479 avoid GCC warnings.
19480
19481 2002-05-07 Akim Demaille <akim@epita.fr>
19482
19483 Kill GCC warnings.
19484
19485 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
19486 over the RHS of each rule.
19487 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
19488 * src/state.h (state_t): Member `nitems' is unsigned short.
19489 * src/LR0.c (get_state): Adjust.
19490 * src/reader.c (packgram): Likewise.
19491 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
19492 `Type'.
19493 (muscle_insert_int_table): Remove, unused.
19494 (prepare_rules): Remove `max'.
19495
19496 2002-05-06 Akim Demaille <akim@epita.fr>
19497
19498 * src/closure.c (print_firsts): Display of the symbol tags.
19499 (bitmatrix_print): Move to...
19500 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
19501 here.
19502 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
19503
19504 2002-05-06 Akim Demaille <akim@epita.fr>
19505
19506 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
19507 hash_do_for_each.
19508
19509 2002-05-06 Akim Demaille <akim@epita.fr>
19510
19511 * src/LR0.c (new_state, get_state): Instead of using the global
19512 `kernel_size' and `kernel_base', have two new arguments:
19513 `core_size' and `core'.
19514 Adjust callers.
19515
19516 2002-05-06 Akim Demaille <akim@epita.fr>
19517
19518 * src/reader.c (packgram): No longer end `ritem' with a 0
19519 sentinel: it is not used.
19520
19521 2002-05-05 Akim Demaille <akim@epita.fr>
19522
19523 New experimental feature: display the lookaheads in the report and
19524 graph.
19525
19526 * src/print (print_core): When --trace-flag, display the rules
19527 lookaheads.
19528 * src/print_graph.c (print_core): Likewise.
19529 Swap the arguments.
19530 Adjust caller.
19531
19532 2002-05-05 Akim Demaille <akim@epita.fr>
19533
19534 * tests/torture.at (Many lookaheads): New test.
19535
19536 2002-05-05 Akim Demaille <akim@epita.fr>
19537
19538 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
19539 (GENERATE_MUSCLE_INSERT_TABLE): this.
19540 (output_int_table, output_unsigned_int_table, output_short_table)
19541 (output_token_number_table, output_item_number_table): Replace with...
19542 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
19543 (muscle_insert_short_table, muscle_insert_token_number_table)
19544 (muscle_insert_item_number_table): these.
19545 Adjust all callers.
19546 (prepare_tokens): Don't free `translations', since...
19547 * src/reader.h, src/reader.c (grammar_free): do it.
19548 Move to...
19549 * src/gram.h, src/gram.c (grammar_free): here.
19550 * data/bison.simple, data/bison.c++: b4_token_number_max is now
19551 b4_translate_max.
19552
19553 2002-05-05 Akim Demaille <akim@epita.fr>
19554
19555 * src/output.c (output_unsigned_int_table): New.
19556 (prepare_rules): `i' is unsigned.
19557 `prhs', `rline', `r2' are unsigned int.
19558 Rename muscle `rhs_number_max' as `rhs_max'.
19559 Output muscles `prhs_max', `rline_max', and `r2_max'.
19560 Free rline and r1.
19561 * data/bison.simple, data/bison.c++: Adjust to use these muscles
19562 to compute types instead of constant types.
19563 * tests/regression.at (Web2c Actions): Adjust.
19564
19565 2002-05-04 Akim Demaille <akim@epita.fr>
19566
19567 * src/symtab.h (SALIAS, SUNDEF): Rename as...
19568 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
19569 Adjust dependencies.
19570 * src/output.c (token_definitions_output): Be sure not to output a
19571 `#define 'a'' when fed with `%token 'a' "a"'.
19572 * tests/regression.at (Token definitions): New.
19573
19574 2002-05-03 Paul Eggert <eggert@twinsun.com>
19575
19576 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
19577 for K&R C.
19578
19579 2002-05-03 gettextize <bug-gnu-gettext@gnu.org>
19580
19581 * Makefile.am (SUBDIRS): Remove intl.
19582 (EXTRA_DIST): Add config/config.rpath.
19583
19584 2002-05-03 Akim Demaille <akim@epita.fr>
19585
19586 * data/bison.simple (m4_if): Don't output empty enums.
19587 And actually, output valid enum definitions :(.
19588
19589 2002-05-03 Akim Demaille <akim@epita.fr>
19590
19591 * configure.bat: Remove, completely obsolete.
19592 * Makefile.am (EXTRA_DIST): Adjust.
19593 Don't distribute config.rpath...
19594 * config/Makefile.am (EXTRA_DIST): Do it.
19595
19596 2002-05-03 Akim Demaille <akim@epita.fr>
19597
19598 * configure.in (GETTEXT_VERSION): New.
19599 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
19600
19601 2002-05-03 Akim Demaille <akim@epita.fr>
19602
19603 * data/bison.simple (b4_token_enum): New.
19604 (b4_token_defines): Use it to output tokens both as #define and
19605 enums.
19606 Suggested by Paul Eggert.
19607 * src/output.c (token_definitions_output): Don't output spurious
19608 white spaces.
19609
19610 2002-05-03 Akim Demaille <akim@epita.fr>
19611
19612 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
19613
19614 2002-05-02 Robert Anisko <robert@lrde.epita.fr>
19615
19616 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
19617 Update the stack class, give a try to deque as the default container.
19618
19619 2002-05-02 Akim Demaille <akim@epita.fr>
19620
19621 * data/bison.simple (yyparse): Do not implement @$ = @1.
19622 (YYLLOC_DEFAULT): Adjust to do it.
19623 * doc/bison.texinfo (Location Default Action): Fix.
19624
19625 2002-05-02 Akim Demaille <akim@epita.fr>
19626
19627 * src/reader.c (parse_braces): Merge into...
19628 (parse_action): this.
19629
19630 2002-05-02 Akim Demaille <akim@epita.fr>
19631
19632 * configure.in (ALL_LINGUAS): Remove.
19633 * po/LINGUAS, hr.po: New.
19634
19635 2002-05-02 Akim Demaille <akim@epita.fr>
19636
19637 Remove the so called hairy (semantic) parsers.
19638
19639 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
19640 * src/gram.h, src/gram.c (semantic_parser): Remove.
19641 (rule_t): Remove the guard and guard_line members.
19642 * src/lex.h (token_t): remove tok_guard.
19643 * src/options.c (option_table): Remove %guard and %semantic_parser
19644 support.
19645 * src/output.c, src/output.h (guards_output): Remove.
19646 (prepare): Adjust.
19647 (token_definitions_output): Don't output the `T'
19648 tokens (???).
19649 (output_skeleton): Don't output the guards.
19650 * src/files.c, src/files.c (attrsfile): Remove.
19651 * src/reader.c (symbol_list): Remove the guard and guard_line
19652 members.
19653 Adjust dependencies.
19654 (parse_guard): Remove.
19655 * data/bison.hairy: Remove.
19656 * doc/bison.texinfo (Environment Variables): Remove occurrences of
19657 BISON_HAIRY.
19658
19659 2002-05-02 Akim Demaille <akim@epita.fr>
19660
19661 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
19662 (parse_guard): Rename the formal argument `stack_offset' as
19663 `rule_length', which is more readable.
19664 Adjust callers.
19665 (copy_at, copy_dollar): Instead of outputting the hard coded
19666 values of $$, $n and so forth, output invocation to b4_lhs_value,
19667 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
19668 Note: this patch partially drops `semantic-parser' support: it
19669 always does `rule_length - n', where semantic parsers ought to
19670 always use `-n'.
19671 * data/bison.simple, data/bison.c++ (b4_lhs_value)
19672 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
19673
19674 2002-05-02 Akim Demaille <akim@epita.fr>
19675
19676 * configure.in (AC_INIT): Bump to 1.49b.
19677 (AM_INIT_AUTOMAKE): Short invocation.
19678
19679 2002-05-02 Akim Demaille <akim@epita.fr>
19680
19681 Version 1.49a.
19682
19683 2002-05-01 Akim Demaille <akim@epita.fr>
19684
19685 * src/skeleton.h: Remove.
19686
19687 2002-05-01 Akim Demaille <akim@epita.fr>
19688
19689 * src/skeleton.h: Fix the #endif.
19690 Reported by Magnus Fromreide.
19691
19692 2002-04-26 Paul Eggert <eggert@twinsun.com>
19693
19694 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
19695 Define if we define YYSTYPE and YYLTYPE, respectively.
19696 (YYCOPY): Fix [] quoting problem in the non-GCC case.
19697
19698 2002-04-25 Robert Anisko <robert@lrde.epita.fr>
19699
19700 * src/scan-skel.l: Postprocess quadrigraphs.
19701
19702 * src/reader.c (copy_character): New function, used to output
19703 single characters while replacing `[' and `]' with quadrigraphs, to
19704 avoid troubles with M4 quotes.
19705 (copy_comment): Output characters with copy_character.
19706 (read_additionnal_code): Likewise.
19707 (copy_string2): Likewise.
19708 (copy_definition): Likewise.
19709
19710 * tests/calc.at: Exercise M4 quoting.
19711
19712 2002-04-25 Akim Demaille <akim@epita.fr>
19713
19714 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
19715 between `!' and the command.
19716 Reported by Paul Eggert.
19717
19718 2002-04-24 Robert Anisko <robert@lrde.epita.fr>
19719
19720 * tests/calc.at: Exercise prologue splitting.
19721
19722 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
19723 `b4_post_prologue' instead of `b4_prologue'.
19724
19725 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
19726 muscles.
19727 (output): Free pre_prologue_obstack and post_prologue_obstack.
19728 * src/files.h, src/files.c (attrs_obstack): Remove.
19729 (pre_prologue_obstack, post_prologue_obstack): New.
19730 * src/reader.c (copy_definition): Add a parameter to specify the
19731 obstack to fill, instead of using attrs_obstack unconditionally.
19732 (read_declarations): Pass pre_prologue_obstack to copy_definition if
19733 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
19734
19735 2002-04-23 Paul Eggert <eggert@twinsun.com>
19736
19737 * data/bison.simple: Remove unnecessary commentary and white
19738 space differences from 1_29-branch.
19739 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
19740
19741 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
19742 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
19743 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
19744 constructors or destructors.
19745
19746 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
19747
19748 2002-04-23 Akim Demaille <akim@epita.fr>
19749
19750 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
19751 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
19752 location with columns.
19753 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
19754 All reported by Paul Eggert.
19755
19756 2002-04-22 Akim Demaille <akim@epita.fr>
19757
19758 * src/reduce.c (dump_grammar): Move to...
19759 * src/gram.h, src/gram.c (grammar_dump): here.
19760 Be sure to separate long item numbers.
19761 Don't read the members of a rule's prec if its nil.
19762
19763 2002-04-22 Akim Demaille <akim@epita.fr>
19764
19765 * src/output.c (table_size, table_grow): New.
19766 (MAXTABLE): Remove, replace uses with table_size.
19767 (pack_vector): Instead of dying when the table is too big, grow it.
19768
19769 2002-04-22 Akim Demaille <akim@epita.fr>
19770
19771 * data/bison.simple (yyr1): Its type is that of a token number.
19772 * data/bison.c++ (r1_): Likewise.
19773 * tests/regression.at (Web2c Actions): Adjust.
19774
19775 2002-04-22 Akim Demaille <akim@epita.fr>
19776
19777 * src/reader.c (token_translations_init): 256 is now the default
19778 value for the error token, i.e., it will be assigned another
19779 number if the user assigned 256 to one of her tokens.
19780 (reader): Don't force 256 to error.
19781 * doc/bison.texinfo (Symbols): Adjust.
19782 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
19783 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
19784 etc. instead of 10, 20, 30 (which was used to `jump' over error
19785 (256) and undefined (2)).
19786
19787 2002-04-22 Akim Demaille <akim@epita.fr>
19788
19789 Propagate more token_number_t.
19790
19791 * src/gram.h (token_number_as_item_number)
19792 (item_number_as_token_number): New.
19793 * src/output.c (GENERATE_OUTPUT_TABLE): New.
19794 Use it to create output_item_number_table and
19795 output_token_number_table.
19796 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
19797 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
19798 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
19799 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
19800
19801 2002-04-22 Akim Demaille <akim@epita.fr>
19802
19803 * src/output.h, src/output.c (get_lines_number): Remove.
19804
19805 2002-04-19 Akim Demaille <akim@epita.fr>
19806
19807 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
19808 as Lex/Flex'.
19809 (Debugging): More details about enabling the debugging features.
19810 (Table of Symbols): Describe $$, $n, @$, and @n.
19811 Suggested by Tim Josling.
19812
19813 2002-04-19 Akim Demaille <akim@epita.fr>
19814
19815 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
19816
19817 2002-04-10 Akim Demaille <akim@epita.fr>
19818
19819 * src/system.h: Rely on HAVE_LIMITS_H.
19820 Suggested by Paul Eggert.
19821
19822 2002-04-09 Akim Demaille <akim@epita.fr>
19823
19824 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
19825 full stderr, and strip it according to the bison options, instead
19826 of composing the error message from different bits.
19827 This makes it easier to check for several error messages.
19828 Adjust all the invocations.
19829 Add an invocation exercising the error token.
19830 Add an invocation demonstrating a stupid error message.
19831 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
19832 Adjust the tests.
19833 Error message are for stderr, not stdout.
19834
19835 2002-04-09 Akim Demaille <akim@epita.fr>
19836
19837 * src/gram.h, src/gram.c (error_token_number): Remove, use
19838 errtoken->number.
19839 * src/reader.c (reader): Don't specify the user token number (2)
19840 for $undefined, as it uselessly prevents using it.
19841 * src/gram.h (token_number_t): Move to...
19842 * src/symtab.h: here.
19843 (state_t.number): Is a token_number_t.
19844 * src/print.c, src/reader.c: Use undeftoken->number instead of
19845 hard coded 2.
19846 (Even though this 2 is not the same as above: the number of the
19847 undeftoken remains being 2, it is its user token number which
19848 might not be 2).
19849 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
19850 `user_token_number_max'.
19851 Output `undef_token_number'.
19852 * data/bison.simple, data/bison.c++: Use them.
19853 Be sure to map invalid yylex return values to
19854 `undef_token_number'. This saves us from gratuitous SEGV.
19855
19856 * tests/conflicts.at (Solved SR Conflicts)
19857 (Unresolved SR Conflicts): Adjust.
19858 * tests/regression.at (Web2c Actions): Adjust.
19859
19860 2002-04-08 Akim Demaille <akim@epita.fr>
19861
19862 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
19863 Adding #line.
19864 Remove the duplicate `typedefs'.
19865 (RhsNumberType): Fix the declaration and various other typos.
19866 Use __ofile__.
19867 * data/bison.simple: Use __ofile__.
19868 * src/scan-skel.l: Handle __ofile__.
19869
19870 2002-04-08 Akim Demaille <akim@epita.fr>
19871
19872 * src/gram.h (item_number_t): New, the type of item numbers in
19873 RITEM. Note that it must be able to code symbol numbers as
19874 positive number, and the negation of rule numbers as negative
19875 numbers.
19876 Adjust all dependencies (pretty many).
19877 * src/reduce.c (rule): Remove this `short *' pointer: use
19878 item_number_t.
19879 * src/system.h (MINSHORT, MAXSHORT): Remove.
19880 Include `limits.h'.
19881 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
19882 (shortcpy): Remove.
19883 (MAXTABLE): Move to...
19884 * src/output.c (MAXTABLE): here.
19885 (prepare_rules): Use output_int_table to output rhs.
19886 * data/bison.simple, data/bison.c++: Adjust.
19887 * tests/torture.at (Big triangle): Move the limit from 254 to
19888 500.
19889 * tests/regression.at (Web2c Actions): Ajust.
19890
19891 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
19892 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
19893 passes, but produces negative #line number, once fixed, GCC is
19894 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
19895 C), it passes.
19896 * src/state.h (state_h): Code input lines on ints, not shorts.
19897
19898 2002-04-08 Akim Demaille <akim@epita.fr>
19899
19900 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
19901 and then the grammar.
19902
19903 2002-04-08 Akim Demaille <akim@epita.fr>
19904
19905 * src/system.h: No longer using strndup.
19906
19907 2002-04-07 Akim Demaille <akim@epita.fr>
19908
19909 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
19910 * src/output.c (output_table_data): Return the longest number.
19911 (prepare_tokens): Output `token_number_max').
19912 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
19913 New.
19914 Use them to define yy_token_number_type/TokenNumberType.
19915 Use this type for yytranslate.
19916 * tests/torture.at (Big triangle): Push the limit from 124 to
19917 253.
19918 * tests/regression.at (Web2c Actions): Adjust.
19919
19920 2002-04-07 Akim Demaille <akim@epita.fr>
19921
19922 * tests/torture.at (Big triangle): New.
19923 (GNU AWK Grammar, GNU Cim Grammar): Move to...
19924 * tests/existing.at: here.
19925
19926 2002-04-07 Akim Demaille <akim@epita.fr>
19927
19928 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
19929 nritems.
19930 Adjust dependencies.
19931
19932 2002-04-07 Akim Demaille <akim@epita.fr>
19933
19934 * src/reader.c: Normalize increments to prefix form.
19935
19936 2002-04-07 Akim Demaille <akim@epita.fr>
19937
19938 * src/reader.c, symtab.c: Remove debugging code.
19939
19940 2002-04-07 Akim Demaille <akim@epita.fr>
19941
19942 Rename all the `bucket's as `symbol_t'.
19943
19944 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
19945 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
19946 * src/symtab.c, src/symtab.h (bucket): Rename as...
19947 (symbol_t): this.
19948 (symbol_list_new, bucket_check_defined, bucket_make_alias)
19949 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
19950 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
19951 (buckets_new, buckets_free, buckets_do): Rename as...
19952 (symbol_list_new, symbol_check_defined, symbol_make_alias)
19953 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
19954 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
19955 (symbols_new, symbols_free, symbols_do): these.
19956
19957 2002-04-07 Akim Demaille <akim@epita.fr>
19958
19959 Use lib/hash for the symbol table.
19960
19961 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
19962 EOF.
19963 * src/lex.c (lex): Set the `number' member of new terminals.
19964 * src/reader.c (bucket_check_defined, bucket_make_alias)
19965 (bucket_check_alias_consistence, bucket_translation): New.
19966 (reader, grammar_free, readgram, token_translations_init)
19967 (packsymbols): Adjust.
19968 (reader): Number the predefined tokens.
19969 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
19970 for predefined tokens.
19971 * src/symtab.h (bucket): Remove all the hash table related
19972 members.
19973 * src/symtab.c (symtab): Replace by...
19974 (bucket_table): this.
19975 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
19976 (buckets_new, buckets_do): New.
19977
19978 2002-04-07 Akim Demaille <akim@epita.fr>
19979
19980 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
19981 (start_symbol, max_user_token_number, semantic_parser)
19982 (error_token_number): Initialize.
19983 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
19984 Initialize.
19985 (reader): Don't.
19986 (errtoken, eoftoken, undeftoken, axiom): Extern.
19987
19988 2002-04-07 Akim Demaille <akim@epita.fr>
19989
19990 * src/gram.h (rule_s): prec and precsym are now pointers
19991 to the bucket giving the priority/associativity.
19992 Member `associativity' removed: useless.
19993 * src/reduce.c, src/conflicts.c: Adjust.
19994
19995 2002-04-07 Akim Demaille <akim@epita.fr>
19996
19997 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
19998 Properly escape the symbols' TAG when outputting them.
19999
20000 2002-04-07 Akim Demaille <akim@epita.fr>
20001
20002 * src/lalr.h (LA): Is a bitsetv, not bitset*.
20003
20004 2002-04-07 Akim Demaille <akim@epita.fr>
20005
20006 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
20007 (LArule): this, which is an array to rule_t*.
20008 * src/print.c, src/conflicts.c: Adjust.
20009
20010 2002-04-07 Akim Demaille <akim@epita.fr>
20011
20012 * src/gram.h (rule_t): Rename `number' as `user_number'.
20013 `number' is a new member.
20014 Adjust dependencies.
20015 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
20016
20017 2002-04-07 Akim Demaille <akim@epita.fr>
20018
20019 As a result of the previous patch, it is no longer needed
20020 to reorder ritem itself.
20021
20022 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
20023
20024 2002-04-07 Akim Demaille <akim@epita.fr>
20025
20026 Be sure never to walk through RITEMS, but use only data related to
20027 the rules themselves. RITEMS should be banished.
20028
20029 * src/output.c (output_token_translations): Rename as...
20030 (prepare_tokens): this.
20031 In addition to `translate', prepare the muscles `tname' and
20032 `toknum', which were handled by...
20033 (output_rule_data): this.
20034 Remove, and move the remainder of its outputs into...
20035 (prepare_rules): this new routines, which also merges content from
20036 (output_gram): this.
20037 (prepare_rules): Be sure never to walk through RITEMS.
20038 (output_stos): Rename as...
20039 (prepare_stos): this.
20040 (output): Always invoke prepare_states, after all, just don't use it
20041 in the output if you don't need it.
20042
20043 2002-04-07 Akim Demaille <akim@epita.fr>
20044
20045 * src/LR0.c (new_state): Display `nstates' as the name of the
20046 newly created state.
20047 Adjust to initialize first_state and last_state if needed.
20048 Be sure to distinguish the initial from the final state.
20049 (new_states): Create the itemset of the initial state, and use
20050 new_state.
20051 * src/closure.c (closure): Now that the initial state has its
20052 items properly set, there is no need for a special case when
20053 creating `ruleset'.
20054
20055 As a result, now the rule 0, reducing to $axiom, is visible in the
20056 outputs. Adjust the test suite.
20057
20058 * tests/conflicts.at (Solved SR Conflicts)
20059 (Unresolved SR Conflicts): Adjust.
20060 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
20061 * tests/conflicts.at (S/R in initial): New.
20062
20063 2002-04-07 Akim Demaille <akim@epita.fr>
20064
20065 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
20066 the RHS of the rules.
20067 * src/output.c (output_gram): Likewise.
20068
20069 2002-04-07 Akim Demaille <akim@epita.fr>
20070
20071 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
20072 bucket.
20073 Adjust all dependencies.
20074 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
20075 `number' of the buckets too.
20076 * src/gram.h: Include `symtab.h'.
20077 (associativity): Move to...
20078 * src/symtab.h: here.
20079 No longer include `gram.h'.
20080
20081 2002-04-07 Akim Demaille <akim@epita.fr>
20082
20083 * src/gram.h, src/gram.c (rules_rhs_length): New.
20084 (ritem_longest_rhs): Use it.
20085 * src/gram.h (rule_t): `number' is a new member.
20086 * src/reader.c (packgram): Set it.
20087 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
20088 the end of `rules', and count them out of `nrules'.
20089 (reduce_output, dump_grammar): Adjust.
20090 * src/print.c (print_grammar): It is no longer needed to check for
20091 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
20092 * tests/reduce.at (Reduced Automaton): New test.
20093
20094 2002-04-07 Akim Demaille <akim@epita.fr>
20095
20096 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
20097 lacking `+ 1' to nrules, Bison reported as useless a token if it
20098 was used solely to set the precedence of the last rule...
20099
20100 2002-04-07 Akim Demaille <akim@epita.fr>
20101
20102 * data/bison.c++, data/bison.simple: Don't output the current file
20103 name in #line, to avoid useless diffs between two identical
20104 outputs under different names.
20105
20106 2002-04-07 Akim Demaille <akim@epita.fr>
20107
20108 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
20109 Normalize loops to using `< nrules + 1', not `<= nrules'.
20110
20111 2002-04-07 Akim Demaille <akim@epita.fr>
20112
20113 * TODO: Update.
20114
20115 2002-04-07 Akim Demaille <akim@epita.fr>
20116
20117 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
20118 bucket.value as bucket.number.
20119
20120 2002-04-07 Akim Demaille <akim@epita.fr>
20121
20122 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
20123 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
20124 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
20125 RHS, instead of being an index in RITEMS.
20126
20127 2002-04-04 Paul Eggert <eggert@twinsun.com>
20128
20129 * doc/bison.texinfo: Update copyright date.
20130 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
20131 (Symbols): Warn about running Bison in one character set,
20132 but compiling and/or running in an incompatible one.
20133 Warn about character code 256, too.
20134
20135 2002-04-03 Paul Eggert <eggert@twinsun.com>
20136
20137 * src/bison.data (YYSTACK_ALLOC): Depend on whether
20138 YYERROR_VERBOSE is nonzero, not whether it is defined.
20139
20140 Merge changes from bison-1_29-branch.
20141
20142 2002-03-20 Paul Eggert <eggert@twinsun.com>
20143
20144 Merge fixes from Debian bison_1.34-1.diff.
20145
20146 * configure.in (AC_PREREQ): 2.53.
20147
20148 2002-03-20 Akim Demaille <akim@epita.fr>
20149
20150 * src/conflicts.c (log_resolution): Argument `resolution' is const.
20151
20152 2002-03-19 Paul Eggert <eggert@twinsun.com>
20153
20154 * src/bison.simple (YYCOPY): New macro.
20155 (YYSTACK_RELOCATE): Use it.
20156 Remove Type arg; no longer needed. All callers changed.
20157 (yymemcpy): Remove; no longer needed.
20158
20159 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
20160 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
20161
20162 2002-03-19 Akim Demaille <akim@epita.fr>
20163
20164 Test and fix the #line outputs.
20165
20166 * tests/atlocal.at (GCC): New.
20167 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
20168 (Prologue synch line, %union synch line, Postprologue synch line)
20169 (Action synch line, Epilogue synch line): New tests.
20170 * src/reader.c (parse_union_decl): Define the muscle stype_line.
20171 * data/bison.simple, data/bison.c++: Use it.
20172
20173 2002-03-19 Akim Demaille <akim@epita.fr>
20174
20175 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
20176 (Solved SR Conflicts, %expect not enough, %expect right)
20177 (%expect too much): Move to...
20178 * tests/conflicts.at: this new file.
20179
20180 2002-03-19 Akim Demaille <akim@epita.fr>
20181
20182 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
20183 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
20184 that we can move to enums for instance.
20185 * src/output.c (token_definitions_output): Output a list of
20186 `token-name, token-number' instead of the #define.
20187 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
20188
20189 2002-03-14 Akim Demaille <akim@epita.fr>
20190
20191 Use Gettext 0.11.1.
20192
20193 2002-03-09 Robert Anisko <robert@lrde.epita.fr>
20194
20195 * data/bison.c++: Make the user able to add members to the generated
20196 parser by subclassing.
20197
20198 2002-03-05 Robert Anisko <robert@lrde.epita.fr>
20199
20200 * src/reader.c (read_additionnal_code): `c' should be an integer, not
20201 a character.
20202 Reported by Nicolas Tisserand and Nicolas Burrus.
20203
20204 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
20205
20206 * src/reader.c: Warn about lacking semi-colons, do not complain.
20207
20208 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
20209
20210 * data/bison.c++: Remove a debug line.
20211
20212 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
20213
20214 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
20215 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
20216 provide a default implementation.
20217
20218 2002-03-04 Akim Demaille <akim@epita.fr>
20219
20220 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
20221 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
20222 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
20223 * tests/semantic.at (Parsing Guards): Similarly.
20224 * src/reader.at (readgram): Complain if the last rule is not ended
20225 with a semi-colon.
20226
20227 2002-03-04 Akim Demaille <akim@epita.fr>
20228
20229 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
20230 * src/closure.c: here.
20231 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
20232 RTC.
20233 * src/warshall.h, src/warshall.c: Remove.
20234 * tests/sets.at (Broken Closure): Adjust.
20235
20236 2002-03-04 Akim Demaille <akim@epita.fr>
20237
20238 * src/output.c (output_skeleton): tempdir is const.
20239 bytes_read is unused.
20240
20241 2002-03-04 Akim Demaille <akim@epita.fr>
20242
20243 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
20244 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
20245 Update.
20246 From Michael Hayes.
20247
20248 2002-03-04 Akim Demaille <akim@epita.fr>
20249
20250 * src/closure.c (closure): `r' is unused.
20251
20252 2002-03-04 Akim Demaille <akim@epita.fr>
20253
20254 * tests/sets.at (Broken Closure): Add the ending `;'.
20255 * src/reader.at (readgram): Complain if a rule is not ended with a
20256 semi-colon.
20257
20258 2002-03-04 Akim Demaille <akim@epita.fr>
20259
20260 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
20261 (count_sr_conflicts): Use bitset_count.
20262 * src/reduce.c (inaccessable_symbols): Ditto.
20263 (bits_size): Remove.
20264 * src/warshall.h, src/warshall.c: Convert to bitsetv.
20265
20266 2002-03-04 Akim Demaille <akim@epita.fr>
20267
20268 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
20269 * src/reduce.c: Remove the `bitset_zero's following the
20270 `bitset_create's, as now it is performed by the latter.
20271
20272 2002-03-04 Akim Demaille <akim@epita.fr>
20273
20274 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
20275 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
20276 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
20277 latest sources from Michael.
20278
20279 2002-03-04 Akim Demaille <akim@epita.fr>
20280
20281 * src/output.c (output): Don't free the grammar.
20282 * src/reader.c (grammar_free): New.
20283 * src/main.c (main): Call it and don't free symtab here.
20284
20285 2002-03-04 Akim Demaille <akim@epita.fr>
20286
20287 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
20288 before returning.
20289 Reported by Benoit Perrot.
20290
20291 2002-03-04 Akim Demaille <akim@epita.fr>
20292
20293 Use bitset operations when possible, not loops over bits.
20294
20295 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
20296 bitset_or.
20297 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
20298 * src/reduce.c (useless_nonterminals): Formatting changes.
20299 * src/warshall.c (TC): Use bitset_or.
20300
20301 2002-03-04 Akim Demaille <akim@epita.fr>
20302
20303 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
20304 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
20305 Ditto.
20306
20307 2002-03-04 Akim Demaille <akim@epita.fr>
20308
20309 * src/lalr.c (F): Now a bitset*.
20310 Adjust all dependencies.
20311
20312 2002-03-04 Akim Demaille <akim@epita.fr>
20313
20314 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
20315 Adjust all dependencies.
20316
20317 2002-03-04 Akim Demaille <akim@epita.fr>
20318
20319 * src/L0.c, src/LR0.h (nstates): Be size_t.
20320 Adjust comparisons (signed vs unsigned).
20321 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
20322 bitset*.
20323 Adjust all dependencies.
20324
20325 2002-03-04 Akim Demaille <akim@epita.fr>
20326
20327 * src/closure.c (firsts): Now, also a bitset.
20328 Adjust all dependencies.
20329 (varsetsize): Remove, now unused.
20330 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
20331
20332 2002-03-04 Akim Demaille <akim@epita.fr>
20333
20334 * src/print.c: Convert to use bitset.h, not hand coded iterations
20335 over ints.
20336
20337 2002-03-04 Akim Demaille <akim@epita.fr>
20338
20339 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
20340
20341 2002-03-04 Akim Demaille <akim@epita.fr>
20342
20343 * src/closure.c (ruleset): Be a bitset.
20344 (rulesetsize): Remove.
20345
20346 2002-03-04 Akim Demaille <akim@epita.fr>
20347
20348 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
20349 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
20350 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
20351 * src/closure.c (fderives): Be an array of bitsets.
20352
20353 2002-02-28 Robert Anisko <robert@lrde.epita.fr>
20354
20355 * data/bison.c++: Merge the two generated headers. Insert a copyright
20356 notice in each output file.
20357
20358 2002-02-28 Akim Demaille <akim@epita.fr>
20359
20360 * data/bison.c++: Copy the prologue of bison.simple to fetch
20361 useful M4 definitions, such as b4_header_guard.
20362
20363 2002-02-25 Akim Demaille <akim@epita.fr>
20364
20365 * src/getargs.c (version): Give the name of the authors, and use a
20366 translator friendly scheme for the bgr
20367 copyright notice.
20368
20369 2002-02-25 Akim Demaille <akim@epita.fr>
20370
20371 * src/output.c (header_output): Remove, now handled completely via
20372 M4.
20373
20374 2002-02-25 Akim Demaille <akim@epita.fr>
20375
20376 * m4/m4.m4: New, from CVS Autoconf.
20377 * configure.in: Invoke it.
20378 * src/output.c (output_skeleton): Use its result instead of the
20379 hard coded name.
20380
20381 2002-02-25 Akim Demaille <akim@epita.fr>
20382
20383 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
20384 Fileutils 4.1.5.
20385 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
20386 * src/output.c (output_skeleton): Use mkstemp to create a real
20387 temporary file.
20388 Move the filling of `skeleton' and its muscle to...
20389 (prepare): here.
20390 (output): Move the definition of the prologue muscle to...
20391 (prepare): here.
20392 * src/system.h (DEFAULT_TMPDIR): New.
20393
20394 2002-02-14 Paul Eggert <eggert@twinsun.com>
20395
20396 Remove the support for C++ namespace cleanliness; it was
20397 causing more problems than it was curing, since it didn't work
20398 properly on some nonstandard C++ compilers. This can wait
20399 for a proper C++ parser.
20400
20401 * NEWS: Document this.
20402 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
20403 of C++, as it's treated like C now.
20404 * src/bison.simple (YYSTD): Remove.
20405 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
20406 Treat C++ just like Standard C instead of trying to support
20407 namespace cleanliness.
20408
20409 2002-02-14 Akim Demaille <akim@epita.fr>
20410
20411 * tests/regression.at (else): Adjust to Andreas' change.
20412
20413 2002-02-14 Akim Demaille <akim@epita.fr>
20414
20415 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
20416
20417 2002-02-13 Andreas Schwab <schwab@suse.de>
20418
20419 * src/output.c (output_rule_data): Don't output NULL, it might
20420 not be defined yet.
20421
20422 2002-02-11 Robert Anisko <robert@lrde.epita.fr>
20423
20424 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
20425 (Copyright notice): Update.
20426
20427 2002-02-11 Akim Demaille <akim@epita.fr>
20428
20429 * tests/regression.at (%nonassoc and eof): Don't include
20430 nonportable headers.
20431
20432 2002-02-08 Robert Anisko <robert@lrde.epita.fr>
20433
20434 * data/bison.c++: Correct error recovery. Make the user able to
20435 initialize the starting location.
20436
20437 2002-02-07 Akim Demaille <akim@epita.fr>
20438
20439 * tests/input.at: New.
20440
20441 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
20442
20443 * data/bison.c++: Replace some direct m4 expansions by constants. Be
20444 more consistent when naming methods and variables. Put preprocessor
20445 directives around tables only needed for debugging.
20446
20447 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
20448
20449 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
20450 C++ parsers.
20451 (yy::b4_name::parse): Use print_.
20452
20453 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
20454
20455 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
20456
20457 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
20458
20459 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
20460 C++ parsers.
20461 (yy::b4_name::parse): Build verbose error messages, and use error_.
20462
20463 2002-02-06 Robert Anisko <robert@lrde.epita.fr>
20464
20465 * data/bison.c++: Fix m4 quoting in comments.
20466
20467 2002-02-06 Robert Anisko <robert@lrde.epita.fr>
20468
20469 * data/bison.c++: Adjust the parser code. Fix some muscles that were
20470 not expanded by m4.
20471
20472 2002-02-05 Akim Demaille <akim@epita.fr>
20473
20474 * data/bison.c++: Adjust to the M4 back end.
20475 More is certainly needed.
20476
20477 2002-02-05 Akim Demaille <akim@epita.fr>
20478
20479 Give a try to M4 as a back end.
20480
20481 * lib/readpipe.c: New, from wdiff.
20482 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
20483 BISON_HAIRY.
20484 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
20485 specific values. Now it is m4 that performs the lookup.
20486 * src/parse-skel.y: Remove.
20487 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
20488 * src/output.c (actions_output, guards_output)
20489 (token_definitions_output): No longer keeps track of the output
20490 line number, hence remove the second argument.
20491 (guards_output): Check against the guard member of a rule, not the
20492 action member.
20493 Adjust callers.
20494 (output_skeleton): Don't look for the skeleton location, let m4 do
20495 that.
20496 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
20497 file will be used.
20498 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
20499 (prepare): Given that for the time being changesyntax is not
20500 usable in M4, rename the muscles using `-' to `_'.
20501 Define `defines_flag', `output_parser_name' and `output_header_name'.
20502 * src/output.h (actions_output, guards_output)
20503 (token_definitions_output): Adjust prototypes.
20504 * src/scan-skel.l: Instead of scanning the skeletons, it now
20505 processes the output of m4: `__oline__' and `#output'.
20506 * data/bison.simple: Adjust to be used by M4(sugar).
20507 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
20508 to date.
20509 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
20510 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
20511 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
20512 shamelessly stolen from CVS Autoconf.
20513
20514 2002-02-05 Akim Demaille <akim@epita.fr>
20515
20516 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
20517 * configure.in: Check for the declarations of free and malloc.
20518 * src/muscle_tab.c: Adjust.
20519
20520 2002-02-05 Akim Demaille <akim@epita.fr>
20521
20522 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
20523 which have no values.
20524
20525 2002-02-05 Akim Demaille <akim@epita.fr>
20526
20527 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
20528 * data/: here.
20529
20530 2002-01-29 Paul Eggert <eggert@twinsun.com>
20531
20532 * src/bison.simple (YYSIZE_T): Do not define merely because
20533 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
20534 On some platforms, <alloca.h> does not declare YYSTD (size_t).
20535
20536 2002-01-27 Akim Demaille <akim@epita.fr>
20537
20538 Fix `%nonassoc and eof'.
20539
20540 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
20541 which were not properly copied! Replace
20542 memcpy (res->errs, src->errs, src->nerrs);
20543 with
20544 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
20545 !!!
20546 * tests/regression.at (%nonassoc and eof): Adjust to newest
20547 Autotest: `.' is not in the PATH.
20548
20549 2002-01-27 Akim Demaille <akim@epita.fr>
20550
20551 * tests/sets.at (AT_EXTRACT_SETS): New.
20552 (Nullable): Use it.
20553 (Firsts): New.
20554
20555 2002-01-26 Akim Demaille <akim@epita.fr>
20556
20557 * tests/actions.at, tests/calc.at, tests/headers.at,
20558 * tests/torture.at: Adjust to the newest Autotest which no longer
20559 forces `.' in the PATH.
20560
20561 2002-01-25 Akim Demaille <akim@epita.fr>
20562
20563 * tests/regression.at (%nonassoc and eof): New.
20564 Suggested by Robert Anisko.
20565
20566 2002-01-24 Akim Demaille <akim@epita.fr>
20567
20568 Bison dumps core when trying to complain about broken input files.
20569 Reported by Cris van Pelt.
20570
20571 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
20572 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
20573 into...
20574 (Invalid inputs): Strengthen: exercise parse_percent_token.
20575
20576 2002-01-24 Robert Anisko <robert.anisko@epita.fr>
20577
20578 * src/Makefile.am: Add bison.c++.
20579 * src/bison.c++: New skeleton.
20580
20581 2002-01-21 Paolo Bonzini <bonzini@gnu.org>
20582
20583 * po/it.po: New.
20584
20585 2002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
20586
20587 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
20588
20589 2002-01-20 Marc Autret <marc@gnu.org>
20590
20591 * src/files.c (compute_output_file_names): Fix
20592
20593 2002-01-20 Marc Autret <marc@gnu.org>
20594
20595 * tests/output.at: New test.
20596 * src/files.c (compute_base_names): Don't map extensions when
20597 the YACC flag is set, use defaults.
20598 Reported by Evgeny Stambulchik.
20599
20600 2002-01-20 Marc Autret <marc@gnu.org>
20601
20602 * src/system.h: Need to define __attribute__ away for non-GCC
20603 compilers as well (i.e., the vendor C compiler).
20604 Suggested by Albert Chin-A-Young.
20605
20606 2002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
20607
20608 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
20609 canonical definition.
20610 * src/system.h: Use the canonical definition for PARAMS (avoids
20611 a conflict with the macro from lib/hash.h).
20612
20613 2002-01-11 Akim Demaille <akim@epita.fr>
20614
20615 * configure.in: Use AC_FUNC_STRNLEN.
20616 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
20617
20618 2002-01-09 Akim Demaille <akim@epita.fr>
20619
20620 * src/files.c, src/files.h (output_infix): New.
20621 (tab_extension): Remove.
20622 (compute_base_names): Compute the former, drop the latter.
20623 * src/output.c (prepare): Insert the muscles `output-infix', and
20624 `output-suffix'.
20625 * src/parse-skel.y (string, string.1): New.
20626 (section.header): Use it.
20627 (section.yacc): Remove.
20628 (prefix): Remove too.
20629 * src/scan-skel.l: Adjust.
20630 * src/bison.simple, src/bison.hairy: Adjust.
20631
20632 2002-01-09 Akim Demaille <akim@epita.fr>
20633
20634 * configure.in (WERROR_CFLAGS): Compute it.
20635 * src/Makefile.am (CFLAGS): Pass it.
20636 * tests/atlocal.in (CFLAGS): Idem.
20637 * src/files.c: Fix a few warnings.
20638 (get_extension_index): Remove, unused.
20639
20640 2002-01-08 Akim Demaille <akim@epita.fr>
20641
20642 * src/getargs.c (AS_FILE_NAME): New.
20643 (getargs): Use it to convert DOSish file names.
20644 * src/files.c (base_name): Rename as full_base_name to avoid
20645 clashes with `base_name ()'.
20646 (filename_split): New.
20647 (compute_base_names): N-th rewrite, using filename_split.
20648
20649 2002-01-08 Akim Demaille <akim@epita.fr>
20650
20651 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
20652 New, stolen from the Fileutils 4.1.
20653 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
20654 * configure.in: Check for the presence of memrchr, and of its
20655 prototype.
20656
20657 2002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
20658
20659 * lib/hash.h (__P): Added definition for this macro.
20660 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
20661 BUILT_SOURCES, to ensure they are generated first.
20662 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
20663 %error-verbose to allow bootstrapping with bison 1.30x.
20664
20665 2002-01-06 Akim Demaille <akim@epita.fr>
20666
20667 * src/reader.c (parse_braces): Don't fetch the next char, the
20668 convention is to fetch on entry.
20669 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
20670 'switch' without a following semicolon.
20671 * tests/regression.at (braces parsing): New.
20672
20673 2002-01-06 Akim Demaille <akim@epita.fr>
20674
20675 Bison is dead wrong in its RR conflict reports.
20676
20677 * tests/torture.at (GNU Cim Grammar): New.
20678 * src/conflicts.c (count_rr_conflicts): Fix.
20679
20680 2002-01-06 Akim Demaille <akim@epita.fr>
20681
20682 Creating package.m4 from configure.ac causes too many problems.
20683
20684 * tests/Makefile.am (package.m4): Create it by hand,
20685 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
20686
20687 2002-01-06 Akim Demaille <akim@epita.fr>
20688
20689 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
20690 skeleton.h.
20691
20692 2002-01-04 Paul Eggert <eggert@twinsun.com>
20693
20694 * doc/bison.texinfo (Debugging):
20695 Remove YYSTDERR; it's no longer defined or used.
20696 Also, s/cstdio.h/cstdio/.
20697
20698 2002-01-03 Akim Demaille <akim@epita.fr>
20699
20700 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
20701
20702 2002-01-03 Akim Demaille <akim@epita.fr>
20703
20704 * src/parse-skel.y (process_skeleton): Don't bind the parser's
20705 tracing code to --trace, wait for a better --trace option, with
20706 args.
20707
20708 2002-01-03 Akim Demaille <akim@epita.fr>
20709
20710 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
20711 The ISO C++ standard is extremely clear about it: stderr is
20712 considered a macro, not a regular symbol (see table 94 `Header
20713 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
20714 Therefore std:: does not apply to it. It still does with fprintf.
20715 Also, s/cstdio.h/cstdio/.
20716
20717 2002-01-03 Akim Demaille <akim@epita.fr>
20718
20719 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
20720 for non system headers.
20721
20722 2002-01-02 Akim Demaille <akim@epita.fr>
20723
20724 Equip the skeleton chain with location tracking, runtime trace,
20725 pure parser and scanner.
20726
20727 * src/parse-skel.y: Request a pure parser, locations, and prefix
20728 renaming.
20729 (%union): Having several members with the same type does not help
20730 type mismatches, simplify.
20731 (YYPRINT, yyprint): New.
20732 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
20733 (skel_error): this.
20734 Handle locations.
20735 * src/scan-skel.l: Adjust to these changes.
20736 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
20737 (LOCATION_PRINT, skel_control_t): New.
20738
20739 2001-12-30 Akim Demaille <akim@epita.fr>
20740
20741 * src/parse-skel.y: Get rid of the shift/reduce conflict:
20742 replace `gb' with BLANKS.
20743 * src/scan-skel.l: Adjust.
20744
20745 2001-12-30 Akim Demaille <akim@epita.fr>
20746
20747 * src/system.h: We don't need nor want bcopy.
20748 Throw away MS-DOS crap: we don't need getpid.
20749 * configure.in: We don't need strndup. It was even causing
20750 problems: because Flex includes the headers *before* us,
20751 _GNU_SOURCE is not defined by config.h, and therefore strndup was
20752 not visible.
20753 * lib/xstrndup.c: New.
20754 * src/scan-skel.l: Use it.
20755 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
20756 * src/parse-skel.y: Use %directives instead of #defines.
20757
20758 2001-12-30 Akim Demaille <akim@epita.fr>
20759
20760 * src/skeleton.h: New.
20761 * src/output.c (output_parser, output_master_parser): Remove, dead
20762 code.
20763 * src/output.h (get_lines_number, actions_output, guards_output)
20764 (token_definitions_output): Prototype them.
20765 * src/parse-skel.y: Add the license notice.
20766 Include output.h and skeleton.h.
20767 (process_skeleton): Returns void, and takes a single parameter.
20768 * src/scan-skel.l: Add the license notice.
20769 Include skeleton.h.
20770 Don't use %option yylineno: it seems that then Flex imagines
20771 REJECT has been used, and therefore it won't reallocate its
20772 buffers (which makes no other sense to me than a bug). It results
20773 in warnings for `unused: yy_flex_realloc'.
20774
20775 2001-12-30 Robert Anisko <robert.anisko@epita.fr>
20776
20777 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
20778 (MUSCLE_INSERT_PREFIX): ...to there.
20779 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
20780 (MUSCLE_INSERT_PREFIX): Move from here...
20781
20782 * src/bison.hairy: Add a section directive. Put braces around muscle
20783 names. This parser skeleton is still broken, but Bison should not
20784 choke on a bad muscle 'syntax'.
20785 * src/bison.simple: Add a section directive. Put braces around muscle
20786 names.
20787
20788 * src/files.h (strsuffix, stringappend): Add declarations.
20789 (tab_extension): Add declaration.
20790 (short_base_name): Add declaration.
20791
20792 * src/files.c (strsuffix, stringappend): No longer static. These
20793 functions are used in the skeleton parser.
20794 (tab_extension): New.
20795 (compute_base_names): Use the computations done in this function
20796 to guess if the generated parsers should have '.tab' in their
20797 names.
20798 (short_base_name): No longer static.
20799
20800 * src/output.c (output_skeleton): New.
20801 (output): Disable call to output_master_parser, and give a try to
20802 a new skeleton handling system.
20803 (guards_output, actions_output): No longer static.
20804 (token_definitions_output, get_lines_number): No longer static.
20805
20806 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
20807
20808 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
20809 parse-skel.y.
20810
20811 * src/parse-skel.y: New file.
20812 * src/scan-skel.l: New file.
20813
20814 2001-12-29 Akim Demaille <akim@epita.fr>
20815
20816 %name-prefix is broken.
20817
20818 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
20819 Adjust all dependencies.
20820 * tests/headers.at (export YYLTYPE): Strengthen this test: use
20821 %name-prefix.
20822
20823 Renaming yylval but not yylloc is not consistent. Now we do.
20824
20825 * src/bison.simple: Prefix yylloc if used.
20826 * doc/bison.texinfo (Decl Summary): Document that.
20827
20828 2001-12-29 Akim Demaille <akim@epita.fr>
20829
20830 * doc/bison.texinfo: Promote `%long-directive' over
20831 `%long_directive'.
20832 Remove all references to fixed-output-files, yacc is enough.
20833
20834 2001-12-29 Akim Demaille <akim@epita.fr>
20835
20836 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
20837 user prologue. These are defaults.
20838 * tests/actions.at (Mid-rule actions): Make sure the user can
20839 define YYDEBUG and YYERROR_VERBOSE.
20840
20841 2001-12-29 Akim Demaille <akim@epita.fr>
20842
20843 * src/output.c (header_output): Don't forget to export YYLTYPE and
20844 yylloc.
20845 * tests/headers.at (export YYLTYPE): New, make sure it does.
20846 * tests/regression.at (%union and --defines, Invalid CPP headers):
20847 Move to...
20848 * tests/headers.at: here.
20849
20850 2001-12-29 Akim Demaille <akim@epita.fr>
20851
20852 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
20853
20854 2001-12-29 Akim Demaille <akim@epita.fr>
20855
20856 * tests/actions.at (Mid-rule actions): Output on a single line
20857 instead of several.
20858
20859 2001-12-29 Akim Demaille <akim@epita.fr>
20860
20861 * doc/bison.texinfo: Formatting changes.
20862
20863 2001-12-29 Akim Demaille <akim@epita.fr>
20864
20865 Don't store the token defs in a muscle, just be ready to output it
20866 on command. Now possible via `symbols'. Fixes a memory leak.
20867
20868 * src/output.c (token_definitions_output): New.
20869 (output_parser, header_output): Use it.
20870 * src/reader.c (symbols_save): Remove.
20871
20872 2001-12-29 Akim Demaille <akim@epita.fr>
20873
20874 * src/bison.simple: Do not provide a default for YYSTYPE and
20875 YYLTYPE before the user's prologue. Otherwise it's hardly... a
20876 default.
20877
20878 2001-12-29 Akim Demaille <akim@epita.fr>
20879
20880 Mid-rule actions are simply... ignored!
20881
20882 * src/reader.c (readgram): Be sure to attach mid-rule actions to
20883 the empty-rule associated to the dummy symbol, not to the host
20884 rule.
20885 * tests/actions.at (Mid-rule actions): New.
20886
20887 2001-12-29 Akim Demaille <akim@epita.fr>
20888
20889 Memory leak.
20890
20891 * src/reader.c (reader): Free grammar.
20892
20893 2001-12-29 Akim Demaille <akim@epita.fr>
20894
20895 Memory leak.
20896
20897 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
20898 since it allocates it for each state, although only one is needed.
20899 (allocate_storage): Do it here.
20900
20901 2001-12-29 Akim Demaille <akim@epita.fr>
20902
20903 * src/options.h, src/options.c (create_long_option_table): Rename
20904 as...
20905 (long_option_table_new): this, with a clearer prototype.
20906 (percent_table): Remove, unused,
20907 * src/getargs.c (getargs): Adjust.
20908
20909 2001-12-29 Akim Demaille <akim@epita.fr>
20910
20911 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
20912 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
20913 as states.
20914
20915 2001-12-29 Akim Demaille <akim@epita.fr>
20916
20917 * src/lalr.c (build_relations): Rename `states' as `states1'.
20918 Sorry, I don't understand exactly what it is, no better name...
20919
20920 2001-12-29 Akim Demaille <akim@epita.fr>
20921
20922 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
20923 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
20924 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
20925 as rules.
20926
20927 2001-12-29 Akim Demaille <akim@epita.fr>
20928
20929 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
20930 ago.
20931
20932 2001-12-29 Akim Demaille <akim@epita.fr>
20933
20934 * src/reader.c, src/reader.h (user_toknums): Remove.
20935 Adjust all users to use symbols[i]->user_token_number.
20936
20937 2001-12-29 Akim Demaille <akim@epita.fr>
20938
20939 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
20940 Adjust all users to use symbols[i]->prec or ->assoc.
20941
20942 2001-12-29 Akim Demaille <akim@epita.fr>
20943
20944 * src/reader.c, src/reader.h (tags): Remove.
20945 Adjust all users to use symbols[i]->tag.
20946
20947 2001-12-29 Akim Demaille <akim@epita.fr>
20948
20949 * src/gram.h, src/gram.c (symbols): New, similar to state_table
20950 and rule_table.
20951 * src/reader.c (packsymbols): Fill this table.
20952 Drop sprec.
20953 * src/conflicts.c (resolve_sr_conflict): Adjust.
20954 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
20955 single table.
20956 Use symbols[i]->tag instead of tags[i].
20957
20958 2001-12-29 Akim Demaille <akim@epita.fr>
20959
20960 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
20961 In addition, put a comment in there, to replace...
20962 * tests/regression.at (%union and C comments): Remove.
20963
20964 2001-12-29 Akim Demaille <akim@epita.fr>
20965
20966 * tests/regression.at (Web2c Actions): Blindly move the actual
20967 output as expected output. The contents *seem* right to me, but I
20968 can't pretend reading perfectly parser tables... Nonetheless, all
20969 the other tests pass correctly, the table look OK, even though the
20970 presence of `$axiom' is to be noted: AFAICS it is useless (but
20971 harmless).
20972
20973 2001-12-29 Akim Demaille <akim@epita.fr>
20974
20975 * src/reader.c (readgram): Don't add the rule 0 if there were no
20976 rules read. In other words, add it _after_ having performed
20977 grammar sanity checks.
20978 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
20979
20980 2001-12-29 Akim Demaille <akim@epita.fr>
20981
20982 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
20983 visible, and some states have now a different number.
20984
20985 2001-12-29 Akim Demaille <akim@epita.fr>
20986
20987 * src/reader.c (readgram): Bind the initial rule's lineno to that
20988 of the first rule.
20989 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
20990 (Solved SR Conflicts): Adjust rule 0's line number.
20991
20992 2001-12-29 Akim Demaille <akim@epita.fr>
20993
20994 Fix the `GAWK Grammar' failure.
20995
20996 * src/LR0.c (final_state): Initialize to -1 so that we do compute
20997 the reductions of the first state which was mistakenly confused
20998 with the final state because precisely final_state was initialized
20999 to 0.
21000 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
21001 now noticed by Bison.
21002 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
21003 have a reduction on $default.
21004
21005 2001-12-29 Akim Demaille <akim@epita.fr>
21006
21007 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
21008 rule line numbers.
21009 * src/closure.c (print_closure): Likewise.
21010 * src/derives.c (print_derives): Likewise.
21011 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
21012 now.
21013
21014 2001-12-29 Akim Demaille <akim@epita.fr>
21015
21016 * src/lalr.c (lookaheads_print): New.
21017 (lalr): Call it when --trace-flag.
21018 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
21019 are dumped.
21020
21021 2001-12-29 Akim Demaille <akim@epita.fr>
21022
21023 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
21024 when walking through ritem, even via rule->rhs.
21025 * src/reduce.c (dump_grammar, useful_production, reduce_output)
21026 (useful_production, useless_nonterminals): Likewise.
21027 (reduce_grammar_tables): Likewise, plus update nritems.
21028 * src/nullable.c (set_nullable): Likewise.
21029 * src/lalr.c (build_relations): Likewise.
21030 * tests/sets.at (Nullable): Adjust.
21031 Fortunately, now, the $axiom is no longer nullable.
21032
21033 2001-12-29 Akim Demaille <akim@epita.fr>
21034
21035 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
21036 the 0-sentinel.
21037 * src/gram.c (ritem_longest_rhs): Likewise.
21038 * src/reduce.c (nonterminals_reduce): Likewise.
21039 * src/print_graph.c (print_graph): Likewise.
21040 * src/output.c (output_rule_data): Likewise.
21041 * src/nullable.c (set_nullable): Likewise.
21042
21043 2001-12-29 Akim Demaille <akim@epita.fr>
21044
21045 * src/output.c: Comment changes.
21046
21047 2001-12-27 Paul Eggert <eggert@twinsun.com>
21048
21049 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
21050 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
21051 Sparc, as they were causing more porting problems than the
21052 (minor) performance improvement was worth.
21053
21054 Also, catch up with 1.31's YYSTD.
21055
21056 2001-12-27 Akim Demaille <akim@epita.fr>
21057
21058 * src/output.c (output_gram): Rely on nritems, not the
21059 0-sentinel. See below.
21060 Use -1 as separator, not 0.
21061 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
21062 Rely on -1 as separator in yyrhs, instead of 0.
21063 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
21064 twice `Now at end of input', therefore there are two lines less to
21065 expect.
21066
21067 2001-12-27 Akim Demaille <akim@epita.fr>
21068
21069 * tests/regression.at (Unresolved SR Conflicts):
21070 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
21071 below.
21072
21073 2001-12-27 Akim Demaille <akim@epita.fr>
21074
21075 * src/LR0.c (new_state): Recognize the final state by the fact it
21076 is reached by eoftoken.
21077 (insert_start_shifting_state, insert_eof_shifting_state)
21078 (insert_accepting_state, augment_automaton): Remove, since now
21079 these states are automatically computed from the initial state.
21080 (generate_states): Adjust.
21081 * src/print.c: When reporting a rule number to the user, substract
21082 1, so that the axiom rule is rule 0, and the first user rule is 1.
21083 * src/reduce.c: Likewise.
21084 * src/print_graph.c (print_core): For the time being, just as for
21085 the report, depend upon --trace-flags to dump the full set of
21086 items.
21087 * src/reader.c (readgram): Once the grammar read, insert the rule
21088 0: `$axiom: START-SYMBOL $'.
21089 * tests/set.at: Adjust: rule 0 is now displayed, and since the
21090 number of the states has changed (the final state is no longer
21091 necessarily the last), catch up.
21092
21093 2001-12-27 Akim Demaille <akim@epita.fr>
21094
21095 Try to make the use of the eoftoken valid. Given that its value
21096 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
21097 is used instead of > 0 where appropriate, (ii), depend upon nritems
21098 instead of the 0-sentinel.
21099
21100 * src/gram.h, src/gram.c (nritems): New.
21101 Expected to be duplication of nitems, but for the time being...
21102 * src/reader.c (packgram): Assert nritems and nitems are equal.
21103 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
21104 * src/closure.c (print_closure, print_fderives): Likewise.
21105 * src/gram.c (ritem_print): Likewise.
21106 * src/print.c (print_core, print_grammar): Likewise.
21107 * src/print_graph.c: Likewise.
21108
21109 2001-12-27 Akim Demaille <akim@epita.fr>
21110
21111 * src/main.c (main): If there are complains after grammar
21112 reductions, then output the report anyway if requested, then die.
21113 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
21114 * src/reader.c (eoftoken): New.
21115 (parse_token_decl): If the token being defined has value `0', it
21116 is the eoftoken.
21117 (packsymbols): No longer hack `tags' to insert `$' by hand.
21118 Be sure to preserve the value of the eoftoken.
21119 (reader): Make sure eoftoken is defined.
21120 Initialize nsyms to 0: now eoftoken is created just like the others.
21121 * src/print.c (print_grammar): Don't special case the eof token.
21122 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
21123 lie anyway, albeit pleasant.
21124 * tests/calc.at: Exercise error messages with eoftoken.
21125 Change the grammar so that empty input is invalid.
21126 Adjust expectations.
21127 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
21128
21129 2001-12-27 Akim Demaille <akim@epita.fr>
21130
21131 * configure.in: Check the protos of strchr ans strspn.
21132 Replace strchr if needed.
21133 * src/system.h: Provide the protos of strchr, strspn and memchr if
21134 missing.
21135 * lib/strchr.c: New.
21136 * src/reader.c (symbols_save): Use strchr.
21137
21138 2001-12-27 Akim Demaille <akim@epita.fr>
21139
21140 * src/print.c, src/print_graph.c (escape): New.
21141 Use it to quote the TAGS outputs.
21142 * src/print_graph.c (print_state): Now errors are in red, and
21143 reductions in green.
21144 Prefer high to wide: output the state number on a line of its own.
21145
21146 2001-12-27 Akim Demaille <akim@epita.fr>
21147
21148 * src/state.h, src/state.c (reductions_new): New.
21149 * src/LR0.c (set_state_table): Let all the states have a
21150 `reductions', even if reduced to 0.
21151 (save_reductions): Adjust.
21152 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
21153 * src/print.c (print_reductions, print_actions): Adjust.
21154 * src/output.c (action_row): Adjust.
21155
21156 2001-12-27 Akim Demaille <akim@epita.fr>
21157
21158 * src/state.h, src/state.c (errs_new, errs_dup): New.
21159 * src/LR0.c (set_state_table): Let all the states have an errs,
21160 even if reduced to 0.
21161 * src/print.c (print_errs, print_reductions): Adjust.
21162 * src/output.c (output_actions, action_row): Adjust.
21163 * src/conflicts.c (resolve_sr_conflict): Adjust.
21164
21165 2001-12-27 Akim Demaille <akim@epita.fr>
21166
21167 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
21168
21169 2001-12-27 Akim Demaille <akim@epita.fr>
21170
21171 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
21172 * src/print.c: here.
21173 (lookaheadset, shiftset): New, used as additional storage by
21174 print_reductions.
21175 (print_results): Adjust.
21176 (print_shifts, print_gotos, print_errs): New, extracted from...
21177 (print_actions): here.
21178 * src/print_graph.c (print_actions): Remove dead code.
21179
21180 2001-12-27 Akim Demaille <akim@epita.fr>
21181
21182 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
21183 `$n' and `@n'.
21184
21185 2001-12-27 Akim Demaille <akim@epita.fr>
21186
21187 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
21188 (build_relations): Adjust.
21189
21190 2001-12-27 Akim Demaille <akim@epita.fr>
21191
21192 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
21193 duplication.
21194
21195 2001-12-27 Akim Demaille <akim@epita.fr>
21196
21197 * src/reader.c (packgram): Catch nitems overflows.
21198
21199 2001-12-27 Akim Demaille <akim@epita.fr>
21200
21201 * src/files.c, src/files.h (guard_obstack): Remove.
21202 * src/output.c (output): Adjust.
21203 * src/reader.c (parse_braces): New, factoring...
21204 (copy_action, copy_guard): these two which are renamed as...
21205 (parse_action, parse_guard): these.
21206 As a voluntary consequence, using braces around guards is now
21207 mandatory.
21208
21209 2001-12-27 Akim Demaille <akim@epita.fr>
21210
21211 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
21212 * src/reader.c (symbol_list): `guard' and `guard_line' are new
21213 members.
21214 (symbol_list_new): Adjust.
21215 (copy_action): action_line is the first line, not the last.
21216 (copy_guard): Just as for actions, store the `action' only, not
21217 the switch/case/break flesh.
21218 Don't parse the user action that might follow the guard, let...
21219 (readgram): do it, i.e., now, there can be an action after a
21220 guard.
21221 In other words the guard is just explicitly optional.
21222 (packgram): Adjust.
21223 * src/output.c (guards_output): New.
21224 (output_parser): Call it when needed.
21225 (output): Also free the guard and attrs obstacks.
21226 * src/files.c, src/files.h (obstack_save): Remove.
21227 (output_files): Remove.
21228 As a result, if one needs the former `.act' file, using an
21229 appropriate skeleton which requires actions and guards is now
21230 required.
21231 * src/main.c (main): Adjust.
21232 * tests/semantic.at: New.
21233 * tests/regression.at: Use `input.y' as input file name.
21234 Avoid 8+3 problems by requiring input.c when the test needs the
21235 parser.
21236
21237 2001-12-27 Akim Demaille <akim@epita.fr>
21238
21239 * src/reader.c (symbol_list_new): Be sure to initialize all the
21240 fields.
21241
21242 2001-12-27 Akim Demaille <akim@epita.fr>
21243
21244 All the hacks using a final pseudo state are now useless.
21245
21246 * src/LR0.c (set_state_table): state_table holds exactly nstates.
21247 * src/lalr.c (nLA): New.
21248 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
21249 instead of lookaheadsp from the pseudo state (nstate + 1).
21250
21251 2001-12-27 Akim Demaille <akim@epita.fr>
21252
21253 * src/output.c (action_row, token_actions): Use a state_t instead
21254 of a integer, and nlookaheads instead of the following state's
21255 lookaheadsp.
21256
21257 2001-12-27 Akim Demaille <akim@epita.fr>
21258
21259 * src/conflicts.c (log_resolution, flush_shift)
21260 (resolve_sr_conflict, set_conflicts, solve_conflicts)
21261 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
21262 (conflicts_print, print_reductions): Use a state_t instead of an
21263 integer when referring to a state.
21264 As much as possible, depend upon nlookaheads, instead of the
21265 `lookaheadsp' member of the following state (since lookaheads of
21266 successive states are successive, the difference between state n + 1
21267 and n served as the number of lookaheads for state n).
21268 * src/lalr.c (add_lookback_edge): Likewise.
21269 * src/print.c (print_core, print_actions, print_state)
21270 (print_results): Likewise.
21271 * src/print_graph.c (print_core, print_actions, print_state)
21272 (print_graph): Likewise.
21273 * src/conflicts.h: Adjust.
21274
21275 2001-12-27 Akim Demaille <akim@epita.fr>
21276
21277 * src/bison.hairy: Formatting/comment changes.
21278 ANSIfy.
21279 Remove `register' indications.
21280 Add plenty of `static'.
21281
21282 2001-12-27 Akim Demaille <akim@epita.fr>
21283
21284 * src/output.c (prepare): Drop the muscle `ntbase' which
21285 duplicates ntokens.
21286 * src/bison.simple: Formatting/comment changes.
21287 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
21288 is an undocumented synonym.
21289
21290 2001-12-22 Akim Demaille <akim@epita.fr>
21291
21292 * src/output.c (output_table_data): Change the prototype to use
21293 `int' for array ranges: some invocations do pass an int, not a
21294 short.
21295 Reported by Wayne Green.
21296
21297 2001-12-22 Akim Demaille <akim@epita.fr>
21298
21299 Some actions of web2c.y are improperly triggered.
21300 Reported by Mike Castle.
21301
21302 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
21303 * tests/regression.at (Web2c): Rename as...
21304 (Web2c Report): this.
21305 (Web2c Actions): New.
21306
21307 2001-12-22 Akim Demaille <akim@epita.fr>
21308
21309 Reductions in web2c.y are improperly reported.
21310 Reported by Mike Castle.
21311
21312 * src/conflicts.c (print_reductions): Fix.
21313 * tests/regression.at (Web2c): New.
21314
21315 2001-12-18 Akim Demaille <akim@epita.fr>
21316
21317 Some host fail on `assert (!"foo")', which expands to
21318 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
21319 Reported by Nelson Beebee.
21320
21321 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
21322 `#define it_succeeded 0' and `assert (it_succeeded)'.
21323
21324 2001-12-17 Marc Autret <autret_m@epita.fr>
21325
21326 * src/bison.simple: Don't hard code the skeleton line and filename.
21327 * src/output.c (output_parser): Rename 'line' as 'output_line'.
21328 New line counter 'skeleton_line' (skeleton-line muscle).
21329
21330 2001-12-17 Paul Eggert <eggert@twinsun.com>
21331
21332 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
21333 YYDEBUG must be defined to a nonzero value.
21334
21335 * src/bison.simple (yytname): Do not assume that the user defines
21336 YYDEBUG to a properly parenthesized expression.
21337
21338 2001-12-17 Akim Demaille <akim@epita.fr>
21339
21340 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
21341 nlookaheads is a new member.
21342 Adjust all users.
21343 * src/lalr.h (nlookaheads): Remove this orphan declaration.
21344 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
21345 state.
21346
21347 2001-12-17 Akim Demaille <akim@epita.fr>
21348
21349 * src/files.h, src/files.c (open_files, close_files): Remove.
21350 * src/main.c (main): Don't open/close files, nor invoke lex_free,
21351 let...
21352 * src/reader.c (reader): Do it.
21353
21354 2001-12-17 Akim Demaille <akim@epita.fr>
21355
21356 * src/conflicts.c (print_reductions): Formatting changes.
21357
21358 2001-12-17 Akim Demaille <akim@epita.fr>
21359
21360 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
21361 (flush_reduce): New.
21362 (resolve_sr_conflict): Adjust.
21363
21364 2001-12-17 Akim Demaille <akim@epita.fr>
21365
21366 * src/output.c (output_obstack): Be static and rename as...
21367 (format_obstack): this, to avoid any confusion with files.c's
21368 output_obstack.
21369 * src/reader.h (muscle_obstack): Move to...
21370 * src/output.h: here, since it's defined in output.c.
21371
21372 2001-12-17 Akim Demaille <akim@epita.fr>
21373
21374 * src/output.c (action_row, save_column, default_goto)
21375 (sort_actions, matching_state, pack_vector): Better variable
21376 locality.
21377
21378 2001-12-17 Akim Demaille <akim@epita.fr>
21379
21380 * src/output.c: Various formatting changes.
21381
21382 2001-12-17 Akim Demaille <akim@epita.fr>
21383
21384 * src/files.c (output_files): Free the output_obstack.
21385 * src/main.c (main): Call print and print_graph conditionally.
21386 * src/print.c (print): Work unconditionally.
21387 * src/print_graph.c (print_graph): Work unconditionally.
21388 * src/conflicts.c (log_resolution): Output only if verbose_flag.
21389
21390 2001-12-16 Marc Autret <autret_m@epita.fr>
21391
21392 * src/output.c (actions_output): Fix. When we use %no-lines,
21393 there is one less line per action.
21394
21395 2001-12-16 Marc Autret <autret_m@epita.fr>
21396
21397 * src/bison.simple: Remove a useless #line directive.
21398 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
21399 * src/output.c (get_lines_number): New.
21400 (output_parser): Adjust, now takes care about the lines of a
21401 output muscles.
21402 Fix line numbering.
21403 (actions_output): Computes the number of lines taken by actions.
21404 (output_master_parser): Insert new skeleton which is the name of
21405 the output parser file name.
21406
21407 2001-12-15 Marc Autret <autret_m@epita.fr>
21408
21409 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
21410
21411 2001-12-15 Marc Autret <autret_m@epita.fr>
21412
21413 * src/output.c (output_gram): Keep track of the hairy one.
21414
21415 2001-12-15 Akim Demaille <akim@epita.fr>
21416
21417 Make `make distcheck' work.
21418
21419 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
21420 system.h which uses libgettext.h.
21421
21422 2001-12-15 Akim Demaille <akim@epita.fr>
21423
21424 * src/nullable.c (set_nullable): Useless rules must be skipped,
21425 otherwise, since we range over their symbols, we might look at a
21426 nonterminal which no longer ``exists'', i.e., it is not counted in
21427 `nvars', hence we overflow our arrays.
21428
21429 2001-12-15 Akim Demaille <akim@epita.fr>
21430
21431 The header can also be produced directly, without any obstack!
21432 Yahoo!
21433
21434 * src/files.c, src/files.h (defines_obstack): Remove.
21435 (compute_header_macro): Global.
21436 (defines_obstack_save): Remove.
21437 * src/reader.c (parse_union_decl): No longer output to
21438 defines_obstack: its content can be found in the `stype' muscle
21439 anyway.
21440 (output_token_translations): Merge into...
21441 (symbols_output): this.
21442 Rename as...
21443 (symbols_save): this.
21444 (reader): Adjust.
21445 * src/output.c (header_output): New.
21446 (output): Call it.
21447
21448 2001-12-15 Akim Demaille <akim@epita.fr>
21449
21450 * src/reader.c (parse_union_decl): Instead of handling two obstack
21451 simultaneously, use one to define the `stype' muscle, and use the
21452 value of the latter to fill defines_obstack.
21453 (copy_comment): Remove.
21454 (copy_comment2): Work for a single obstack.
21455 Rename as...
21456 (copy_comment): this.
21457
21458 2001-12-15 Akim Demaille <akim@epita.fr>
21459
21460 * src/lex.c, src/lex.h (xgetc): No longer static.
21461 * src/reader.c (parse_union_decl): Revamp.
21462
21463 2001-12-15 Akim Demaille <akim@epita.fr>
21464
21465 Still making progress in separating Bison into (i) input, (ii)
21466 process, (iii) output: now we can directly output the parser file
21467 without using table_obstack at all.
21468
21469 * src/files.c, src/files.h (table_obstack): Bye bye.
21470 (parser_file_name): New.
21471 * src/files.c (compute_output_file_names): Compute it.
21472 * src/output.c (actions_output, output_parser)
21473 (output_master_parser): To a file instead of an obstack.
21474
21475 2001-12-15 Akim Demaille <akim@epita.fr>
21476
21477 Attach actions to rules, instead of pre-outputting them to
21478 actions_obstack.
21479
21480 * src/gram.h (rule_t): action and action_line are new members.
21481 * src/reader.c (symbol_list): Likewise.
21482 (copy_action): Save the actions within the rule.
21483 (packgram): Save them in rule_table.
21484 * src/output.c (actions_output): New.
21485 (output_parser): Use it on `%%actions'.
21486 (output_rule_data): Don't free rule_table.
21487 (output): Do it.
21488 (prepare): Don't save the `action' muscle.
21489 * src/bison.simple: s/%%action/%%actions/.
21490
21491 2001-12-15 Akim Demaille <akim@epita.fr>
21492
21493 * src/reader.c (copy_action): When --yacc, don't append a `;'
21494 to the user action: let it fail if lacking.
21495 Suggested by Arnold Robbins and Tom Tromey.
21496
21497 2001-12-14 Akim Demaille <akim@epita.fr>
21498
21499 * src/lex.c (literalchar): Simply return the char you decoded, non
21500 longer mess around with obstacks and int pointers.
21501 Adjust all callers.
21502
21503 2001-12-14 Akim Demaille <akim@epita.fr>
21504
21505 * src/lex.c (literalchar): Don't escape the special characters,
21506 just decode them, and keep them as char (before, eol was output as
21507 the 2 char string `\n' etc.).
21508 * src/output.c (output_rule_data): Use quotearg to output the
21509 token strings.
21510
21511 2001-12-13 Paul Eggert <eggert@twinsun.com>
21512
21513 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
21514 Do not infringe on the global user namespace when using C++.
21515 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
21516 All uses of `fprintf' and `stderr' changed.
21517
21518 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
21519
21520 2001-12-13 Akim Demaille <akim@epita.fr>
21521
21522 The computation of nullable is broken: it doesn't handle empty
21523 RHS's properly.
21524
21525 * tests/torture.at (GNU AWK Grammar): New.
21526 * tests/sets.at (Nullable): New.
21527 * src/nullable.c (set_nullable): Instead of blindly looping over
21528 `ritems', loop over the rules, and then over their rhs's.
21529
21530 Work around Autotest bugs.
21531
21532 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
21533 frame, because Autotest understand lines starting with a `+' as
21534 traces from the shell. Then, they are not processed properly.
21535 Admittedly an Autotest bug, but we don't have time to wait for
21536 Autotest to catch up.
21537 * tests/regression.at (Broken Closure): Adjust to the new table
21538 frames.
21539 Move to...
21540 * tests/sets.at: here.
21541
21542 2001-12-13 Akim Demaille <akim@epita.fr>
21543
21544 * src/closure.c (closure): Use nrules instead of playing tricks
21545 with BITS_PER_WORD.
21546
21547 2001-12-13 Akim Demaille <akim@epita.fr>
21548
21549 * src/print.c (print_actions): Output the handling of `$' as the
21550 traces do: shifting the token EOF. Before EOF was treated as a
21551 nonterminal.
21552 * tests/regression.at: Adjust some tests.
21553 * src/print_graph.c (print_core): Complete the set of items via
21554 closure. The next-to-final and final states are still unsatisfying,
21555 but that's to be addressed elsewhere.
21556 No longer output the rule numbers, but do output the state number.
21557 A single loop for the shifts + gotos is enough, but picked a
21558 distinct color for each.
21559 (print_graph): Initialize and finalize closure.
21560
21561 2001-12-13 Akim Demaille <akim@epita.fr>
21562
21563 * src/reader.c (readgram): Remove dead code, an strip useless
21564 braces.
21565 (get_type): Remove, unused.
21566
21567 2001-12-12 Akim Demaille <akim@epita.fr>
21568
21569 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
21570 on that of lib/error.c.
21571
21572 2001-12-12 Akim Demaille <akim@epita.fr>
21573
21574 Some hosts don't like `/' in includes.
21575
21576 * src/system.h: Include libgettext.h without qualifying the path.
21577 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
21578 $(top_srcdir).
21579
21580 2001-12-11 Marc Autret <autret_m@epita.fr>
21581
21582 * src/output.c (output_parser): Remove useless muscle.
21583
21584 2001-12-11 Marc Autret <autret_m@epita.fr>
21585
21586 * src/bison.simple: Remove #line just before %%epilogue. It
21587 is now handled in ...
21588 * src/reader.c (read_additionnal_code): Add the output of a
21589 #line for the epilogue.
21590
21591 2001-12-10 Marc Autret <autret_m@epita.fr>
21592
21593 * src/reader.c (copy_definition): Re-use CPP-outed code which
21594 replace precedent remove.
21595 * src/bison.simple: Remove #line before %%prologue because
21596 %%input-line is wrong at this time.
21597
21598 2001-12-10 Marc Autret <autret_m@epita.fr>
21599
21600 * src/reader.c (symbols_output): Clean up.
21601 * src/output.c (output_gram, output): Clean up.
21602
21603 2001-12-10 Akim Demaille <akim@epita.fr>
21604
21605 * src/lalr.c (initialize_lookaheads): New. Extracted from...
21606 * src/LR0.c (set_state_table): here.
21607 * src/lalr.c (lalr): Call it.
21608
21609 2001-12-10 Akim Demaille <akim@epita.fr>
21610
21611 * src/state.h (shifts): Remove the `number' member: shifts are
21612 attached to state, hence no longer need to be labelled with a
21613 state number.
21614
21615 2001-12-10 Akim Demaille <akim@epita.fr>
21616
21617 Now that states have a complete set of members, the linked list of
21618 shifts is useless: just fill directly the state's shifts member.
21619
21620 * src/state.h (shifts): Remove the `next' member.
21621 * src/LR0.c (first_state, last_state): Remove.
21622 Adjust the callers.
21623 (augment_automaton): Don't look for the shifts that must be added
21624 a shift on EOF: it is those of the state we looked for! But now,
21625 since shifts are attached, it is no longer needed to looking
21626 merely by its id: its number.
21627
21628 2001-12-10 Akim Demaille <akim@epita.fr>
21629
21630 * src/LR0.c (augment_automaton): Better variable locality.
21631 Remove an impossible branch: if there is a state corresponding to
21632 the start symbol being shifted, then there is shift for the start
21633 symbol from the initial state.
21634
21635 2001-12-10 Akim Demaille <akim@epita.fr>
21636
21637 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
21638 only when appropriate: when insert_start_shifting_state' is not
21639 invoked.
21640 * tests/regression.at (Rule Line Numbers): Adjust.
21641
21642 2001-12-10 Akim Demaille <akim@epita.fr>
21643
21644 * src/LR0.c (augment_automaton): Now that all states have shifts,
21645 merge the two cases addition shifts to the initial state.
21646
21647 2001-12-10 Akim Demaille <akim@epita.fr>
21648
21649 * src/lalr.c (set_state_table): Move to...
21650 * src/LR0.c: here.
21651 * src/lalr.c (lalr): Don't call it...
21652 * src/LR0.c (generate_states): do it.
21653 * src/LR0.h (first_state): Remove, only the table is used.
21654
21655 2001-12-10 Akim Demaille <akim@epita.fr>
21656
21657 * src/LR0.h (first_shift, first_reduction): Remove.
21658 * src/lalr.c: Don't use first_shift: find shifts through the
21659 states.
21660
21661 2001-12-10 Akim Demaille <akim@epita.fr>
21662
21663 * src/LR0.c: Attach shifts to states as soon as they are
21664 computed.
21665 * src/lalr.c (set_state_table): Instead of assigning shifts to
21666 state, just assert that the mapping was properly done.
21667
21668 2001-12-10 Akim Demaille <akim@epita.fr>
21669
21670 * src/LR0.c (insert_start_shift): Rename as...
21671 (insert_start_shifting_state): this.
21672 (insert_eof_shifting_state, insert_accepting_state): New.
21673 (augment_automaton): Adjust.
21674 Better locality of the variables.
21675 When looking if the start_symbol is shifted from the initial
21676 state, using `while (... symbol != start_symbol ...)' sounds
21677 better than `while (... symbol < start_symbol ...)': If fail
21678 to see how the order between symbols could be relevant!
21679
21680 2001-12-10 Akim Demaille <akim@epita.fr>
21681
21682 * src/getargs.h: Don't declare `spec_name_prefix' and
21683 `spec_file_prefix', declared by src/files.h.
21684 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
21685 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
21686 * src/output.c (prepare): Adjust.
21687 * src/reader.c (symbols_output): Likewise.
21688 * src/vmsgetargs.c: Vaguely adjust, but who cares?
21689
21690 2001-12-10 Akim Demaille <akim@epita.fr>
21691
21692 * src/muscle_tab.c (muscle_init): NULL is a better default than
21693 `"0"'.
21694
21695 2001-12-10 Akim Demaille <akim@epita.fr>
21696
21697 * src/reader.c (reader): Calling symbols_output once is enough.
21698
21699 2001-12-10 Akim Demaille <akim@epita.fr>
21700
21701 Now that states have a complete set of members, the linked list of
21702 reductions is useless: just fill directly the state's reductions
21703 member.
21704
21705 * src/state.h (struct reductions): Remove member `number' and
21706 `next'.
21707 * src/LR0.c (first_reduction, last_reduction): Remove.
21708 (save_reductions): Don't link the new reductions, store them in
21709 this_state.
21710 * src/lalr.c (set_state_table): No need to attach reductions to
21711 states, it's already done.
21712 * src/output.c (output_actions): No longer free the shifts, then
21713 the reductions, then the states: free all the states and their
21714 members.
21715
21716 2001-12-10 Akim Demaille <akim@epita.fr>
21717
21718 * src/options.c (OPTN, DRTV, BOTH): New.
21719 (option_table): Use them.
21720
21721 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
21722 the job of system.h.
21723 * src/options.c: Don't include stdio.h and xalloc.h for the same
21724 reasons.
21725
21726 2001-12-10 Akim Demaille <akim@epita.fr>
21727
21728 * src/output.c (output, prepare): Make sure the values of the
21729 muscles `action' and `prologue' are 0-terminated.
21730
21731 2001-12-10 Akim Demaille <akim@epita.fr>
21732
21733 Clean up GCC warnings.
21734
21735 * src/reader.c (copy_action): `buf' is not used.
21736 (parse_skel_decl): Be static.
21737 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
21738 * src/options.h (create_long_option_table): Have a real prototype.
21739 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
21740 (hash_delete_at): Return const void *.
21741 Adjust casts to preserve the const.
21742
21743 2001-12-10 Akim Demaille <akim@epita.fr>
21744
21745 * configure.in: Require 2.52g.
21746 M4 is not needed, but AUTOM4TE is.
21747 * m4/m4.m4: Remove.
21748 * tests/Makefile.am: Adjust.
21749
21750 2001-12-10 Akim Demaille <akim@epita.fr>
21751
21752 One structure for states is enough, even though theoretically
21753 there are LR(0) states and LALR(1) states.
21754
21755 * src/lalr.h (state_t): Remove.
21756 (state_table): Be state_t **, not state_t *.
21757 * src/state.h (core, CORE_ALLOC): Rename as...
21758 (state_t, STATE_ALLOC): this.
21759 Add the LALR(1) members: shifts, reductions, errs.
21760 * src/LR0.c (state_table): Rename as...
21761 (state_hash): this, to avoid name clashes with the global
21762 `state_table'.
21763 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
21764 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
21765
21766 2001-12-10 Akim Demaille <akim@epita.fr>
21767
21768 Bison dumps core on bash.y.
21769 Reported by Pascal Bart.
21770
21771 * src/warshall.c (bitmatrix_print): New.
21772 (TC): Use it.
21773 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
21774 j must be the outer loop.
21775 * tests/regression.at (Broken Closure): New.
21776
21777 2001-12-05 Akim Demaille <akim@epita.fr>
21778
21779 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
21780 its argument.
21781 Reported by Peter Hamorsky.
21782
21783 2001-12-05 Akim Demaille <akim@epita.fr>
21784
21785 * src/conflicts.c (err_table): Remove.
21786 (resolve_sr_conflict): Adjust.
21787 * src/lalr.h (state_t.reduction_table, state_t.shift_table):
21788 Rename as...
21789 (state_t.reductions, state_t.shifts): this.
21790
21791 2001-12-05 Akim Demaille <akim@epita.fr>
21792
21793 * src/reduce.c (reduce_grammar_tables): No longer disable the
21794 removal of useless rules via CPP but via `if (0)', so that the
21795 compiler still check the code is valid.
21796 For instance, it should have noticed `rline' no longer exists: use
21797 the `line' member of rule_t.
21798 * src/gram.c (dummy, rline): Remove, unused.
21799
21800 2001-12-05 Akim Demaille <akim@epita.fr>
21801
21802 * src/output.c (pack_vector): Use assert, not berror.
21803 * src/main.c (berror): Remove, unused.
21804
21805 2001-12-05 Akim Demaille <akim@epita.fr>
21806
21807 New experimental feature: if --verbose --trace output all the
21808 items of a state, not only its kernel.
21809
21810 * src/print.c (print_core): If `trace_flag', then invoke closure
21811 before outputting the items of the state (print_core is no longer
21812 a correct name them).
21813 (print_results): Invoke new_closure/free_closure if needed.
21814
21815 2001-12-05 Akim Demaille <akim@epita.fr>
21816
21817 * src/LR0.c (new_itemsets): Use nshifts only, not shiftcount.
21818 * src/closure.c, src/closure.h (itemsetsize): Rename as...
21819 (nitemset): for consistency with the rest of the project.
21820
21821 2001-12-05 Akim Demaille <akim@epita.fr>
21822
21823 * src/closure.c (print_closure): Improve.
21824 (closure): Use it for printing input and output.
21825
21826 2001-12-05 Akim Demaille <akim@epita.fr>
21827
21828 * src/closure.c (FIRSTS, FDERIVES): Adjust to reality: they are
21829 indexed by nonterminals.
21830
21831 2001-12-05 Akim Demaille <akim@epita.fr>
21832
21833 * src/warshall.c (TC, RTC): De-obsfucate (source reduced to 22% of
21834 what it was!).
21835 * src/warshall.h: Remove accidental duplication of the content.
21836
21837 2001-12-05 Akim Demaille <akim@epita.fr>
21838
21839 * src/closure.c (set_fderives): De-obfuscate.
21840
21841 2001-12-05 Akim Demaille <akim@epita.fr>
21842
21843 * src/closure.c (print_firsts, print_fderives): De-obfuscate.
21844
21845 2001-12-05 Akim Demaille <akim@epita.fr>
21846
21847 * src/closure.c (set_firsts): De-obfuscate.
21848
21849 2001-12-05 Akim Demaille <akim@epita.fr>
21850
21851 * src/output.c (action_row): De-obfuscate
21852 using the good o' techniques: arrays not pointers, variable
21853 locality, BITISSET, RESETBIT etc.
21854
21855 2001-12-05 Akim Demaille <akim@epita.fr>
21856
21857 Pessimize the code to simplify it: from now on, all the states
21858 have a valid SHIFTS, which NSHIFTS is possibly 0.
21859
21860 * src/LR0.c (shifts_new): Be global and move to..
21861 * src/state.c, src/state.h: here.
21862 * src/conflicts, src/lalr.c, src/output.c, src/print.c,
21863 * src/print_graph: Adjust.
21864
21865 2001-12-05 Akim Demaille <akim@epita.fr>
21866
21867 * src/state.h (SHIFT_DISABLE, SHIFT_IS_DISABLED): New.
21868 * src/conflicts.c: Use it.
21869 Restore a few missing `if (!SHIFT_IS_DISABLED)' which were
21870 incorrectly ``simplified''.
21871
21872 2001-12-05 Akim Demaille <akim@epita.fr>
21873
21874 * src/conflicts.c (flush_shift, resolve_sr_conflict): De-obfuscate
21875 using the good o' techniques: arrays not pointers, variable
21876 locality, BITISSET, RESETBIT etc.
21877
21878 2001-12-05 Akim Demaille <akim@epita.fr>
21879
21880 * src/state.h (SHIFT_SYMBOL): New.
21881 * src/conflicts.c: Use it to deobfuscate.
21882
21883 2001-12-05 Akim Demaille <akim@epita.fr>
21884
21885 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts)
21886 (print_reductions): De-obfuscate using the good o' techniques:
21887 arrays not pointers, variable locality, BITISSET.
21888
21889 2001-12-05 Akim Demaille <akim@epita.fr>
21890
21891 * src/conflicts.c (print_reductions): Arrays, not pointers.
21892 Use BITISSET.
21893
21894 2001-12-05 Akim Demaille <akim@epita.fr>
21895
21896 * src/conflicts.c (print_reductions): Pessimize, but clarify.
21897
21898 2001-12-05 Akim Demaille <akim@epita.fr>
21899
21900 * src/conflicts.c (print_reductions): Improve variable locality.
21901
21902 2001-12-05 Akim Demaille <akim@epita.fr>
21903
21904 * src/conflicts.c (print_reductions): Pessimize, but clarify.
21905
21906 2001-12-05 Akim Demaille <akim@epita.fr>
21907
21908 * src/conflicts.c (print_reductions): Improve variable locality.
21909
21910 2001-12-05 Akim Demaille <akim@epita.fr>
21911
21912 * src/state.h (SHIFT_IS_ERROR, SHIFT_IS_GOTO, SHIFT_IS_SHIFT): New.
21913 * src/lalr.c: Use them.
21914
21915 2001-12-05 Akim Demaille <akim@epita.fr>
21916
21917 * src/LR0.c (augment_automaton): Formatting changes.
21918 Better variable locality.
21919
21920 2001-12-05 Akim Demaille <akim@epita.fr>
21921
21922 * src/lalr.c (matrix_print): New.
21923 (transpose): Use it.
21924 Use arrays instead of pointers.
21925
21926 2001-12-05 Akim Demaille <akim@epita.fr>
21927
21928 * src/lalr.c (maxrhs): Move to...
21929 * src/gram.c, src/gram.h (ritem_longest_rhs): here.
21930 * src/lalr.c (build_relations): Adjust.
21931
21932 2001-12-05 Akim Demaille <akim@epita.fr>
21933
21934 * src/lalr.c (transpose): Free the memory allocated to the
21935 argument, as it is replaced by the results by the unique caller.
21936 (build_relations): Merely invoke transpose: it handles the memory
21937 deallocation.
21938 Improve variable locality.
21939 Avoid variables used as mere abbreviations.
21940 (compute_lookaheads): Use arrays instead of pointers.
21941
21942 2001-12-05 Akim Demaille <akim@epita.fr>
21943
21944 * src/lalr.c (initialize_F): Improve variable locality.
21945 Avoid variables used as mere abbreviations.
21946
21947 2001-12-05 Akim Demaille <akim@epita.fr>
21948
21949 * src/derives.c (print_derives): Display the ruleno.
21950 * src/lalr.c (initialize_F, transpose): Better variable locality
21951 to improve readability.
21952 Avoid variables used as mere abbreviations.
21953
21954 2001-12-05 Akim Demaille <akim@epita.fr>
21955
21956 * src/lalr.c (traverse): Use arrays instead of pointers.
21957
21958 2001-12-05 Akim Demaille <akim@epita.fr>
21959
21960 * src/nullable.c (set_nullable): Use a for loop to de-obfuscate
21961 the handling of squeue.
21962 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
21963
21964 2001-12-05 Akim Demaille <akim@epita.fr>
21965
21966 Because useless nonterminals are now kept alive (instead of being
21967 `destroyed'), we now sometimes examine them, and store information
21968 related to them. Hence we need to know their number, and adjust
21969 memory allocations.
21970
21971 * src/reduce.c, src/reduce.h (nuseless_nonterminals): No longer
21972 static.
21973 * src/LR0.c (allocate_itemsets): The memory allocated to
21974 `symbol_count' was used for two different purpose: once to count
21975 the number of occurrences of each symbol, and later reassigned to
21976 `shift_symbol', containing the symbol that can be shifted from a
21977 given state.
21978 Deobfuscate, i.e., allocate, use and free `symbol_count' here
21979 only, and...
21980 (new_itemsets): Allocate `shift_symbol' here.
21981 (allocate_itemsets): symbol_count includes useless nonterminals.
21982 Make room for them.
21983 (free_storage): Use `free', not `XFREE', for pointers that cannot
21984 be null.
21985
21986 2001-12-05 Akim Demaille <akim@epita.fr>
21987
21988 * src/nullable.c (set_nullable): Deobfuscate the handling of
21989 ritem.
21990 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
21991
21992 2001-12-05 Akim Demaille <akim@epita.fr>
21993
21994 * src/gram.c, src/gram.h (ritem_print): New.
21995 * src/gram.c (dummy): Remove, now there is actual code in gram.c.
21996 (This useless function was defined only to work around VMS linkers
21997 that can't handle compilation units with variables only).
21998 * src/reduce.c (dump_grammar): Use it to trace the construction of
21999 ritem.
22000
22001 2001-12-04 Paul Eggert <eggert@twinsun.com>
22002
22003 * src/bison.simple (union yyalloc): Change member names
22004 to be the same as the stack names.
22005 (yyparse): yyptr is now union yyalloc *, not char *.
22006 (YYSTACK_RELOCATE): Likewise. This avoids a GCC warning,
22007 and may generate better code on some machines.
22008 (yystpcpy): Use prototype if __STDC__ is defined, not just
22009 if __cplusplus is defined.
22010
22011 2001-11-30 Akim Demaille <akim@epita.fr>
22012
22013 * configure.in (WARNING_CFLAGS): Add -Werror when possible.
22014 (CFLAGS): Do not include the WARNING_CFLAGS here, since GNU
22015 Gettext doesn't compile cleanly, and dies with -Werror.
22016 * src/Makefile.am, lib/Makefile.am, tests/atlocal.in (CFLAGS):
22017 Include WARNING_CFLAGS here.
22018 * lib/xstrdup.c: Include xalloc.h, so that xstrdup be declared
22019 before being defined.
22020
22021 2001-11-27 Paul Eggert <eggert@twinsun.com>
22022
22023 * lib/quotearg.h (quotearg_n, quotearg_n_style):
22024 First arg is int, not unsigned.
22025 * lib/quotearg.c (quotearg_n, quotearg_n_style): Likewise.
22026 (SIZE_MAX, UINT_MAX): New macros.
22027 (quotearg_n_options): Abort if N is negative.
22028 Avoid overflow check on hosts where size_t is 64 bits and int
22029 is 32 bits, as overflow is impossible there.
22030 Fix off-by-one typo that caused unnecessary reallocation.
22031
22032 2001-11-29 Paul Eggert <eggert@twinsun.com>
22033
22034 Name space cleanup in generated parser.
22035
22036 * doc/bison.texinfo (Bison Parser): Discuss system headers
22037 and their effect on the user name space.
22038
22039 * src/bison.simple:
22040 (YYSTACK_ALLOC, YYSTACK_FREE, union yyalloc, YYSTACK_GAP_MAX,
22041 YYSTACK_BYTES, YYSTACK_RELOCATE): Do not define unless necessary,
22042 i.e. unless ! defined (yyoverflow) || defined (YYERROR_VERBOSE).
22043
22044 (YYSIZE_T): New macro. Use it instead of size_t, to avoid infringing
22045 on user names when possible.
22046
22047 (YYSTACK_USE_ALLOCA): Do not define; just use any existing defn.
22048 Simplify test for whather <alloca.h> exists.
22049
22050 (<stdlib.h>): Include if we will use malloc, and if standard C or C++.
22051
22052 (<stdio.h>): Include if YYDEBUG.
22053
22054 (yymemcpy): Renamed from __yy_memcpy. Do not define unless
22055 ! defined (yyoverflow) && ! defined (yymemcpy).
22056
22057 (yymemcpy, yyparse): Rename local variables as needed so that
22058 they all begin with 'yy'.
22059
22060 (yystrlen, yystpcpy): New functions.
22061
22062 (YY_DECL_NON_LSP_VARIABLES): Renamed from _YY_DECL_VARIABLES.
22063 All uses changed.
22064
22065 (yyparse): size_t -> YYSIZE_T. Use yystrlen and yystpcpy
22066 instead of relying on string.h functions. Use YYSTACK_ALLOC
22067 and YYSTACK_FREE instead of malloc and free.
22068
22069 2001-11-30 Akim Demaille <akim@epita.fr>
22070
22071 * src/bison.simple (YYSTYPE, YYLTYPE): Move their definitions
22072 before their first uses.
22073 (YYBISON, YYPURE): Move to the top of the output.
22074
22075 2001-11-30 Akim Demaille <akim@epita.fr>
22076
22077 * tests/reduce.at (Useless Nonterminals): Fix.
22078
22079 2001-11-30 Akim Demaille <akim@epita.fr>
22080
22081 * src/bison.simple (YYSTACK_FREE): Use `do {;} while (0)' as empty
22082 if body instead of `;' to pacify GCC's warnings.
22083
22084 2001-11-30 Akim Demaille <akim@epita.fr>
22085
22086 Instead of mapping the LHS of unused rules to -1, keep the LHS
22087 valid, but flag the rules as invalid.
22088
22089 * src/gram.h (rule_t): `useful' is a new member.
22090 * src/print.c (print_grammar): Adjust.
22091 * src/derives.c (set_derives): Likewise.
22092 * src/reader.c (packgram, reduce_output): Likewise.
22093 * src/reduce.c (reduce_grammar_tables): Likewise.
22094 * tests/reduce.at (Underivable Rules, Useless Rules): New.
22095
22096 2001-11-30 Akim Demaille <akim@epita.fr>
22097
22098 * src/reduce.c (reduce_output): Formatting changes.
22099 * src/print.c (print_results, print_grammar): Likewise.
22100 * tests/regression.at (Rule Line Numbers)
22101 (Solved SR Conflicts, Unresolved SR Conflicts): Adjust.
22102
22103 2001-11-30 Akim Demaille <akim@epita.fr>
22104
22105 * src/reduce.c (nonterminals_reduce): Instead of throwing away
22106 useless nonterminals, move them at the end of the symbol arrays.
22107 (reduce_output): Adjust.
22108 * tests/reduce.at (Useless Nonterminals): Adjust.
22109
22110 2001-11-30 Akim Demaille <akim@epita.fr>
22111
22112 * src/reduce.c: Various comment/formatting changes.
22113 (nonterminals_reduce): New, extracted from...
22114 (reduce_grammar_tables): here.
22115 (reduce_grammar): Call nonterminals_reduce.
22116
22117 2001-11-29 Paul Eggert <eggert@twinsun.com>
22118
22119 * src/bison.simple (YYSTACK_REALLOC): Remove.
22120 (YYSTACK_ALLOC): Resurrect this macro, with its old meaning.
22121 (YYSTACK_FREE, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYSTACK_RELOCATE):
22122 New macros.
22123 (union yyalloc): New type.
22124 (__yy_memcpy): Last arg is size_t, not unsigned int, to remove
22125 an arbitrary restriction on hosts where size_t is wider than int.
22126
22127 (yyparse): Don't dump core if alloca or malloc fails; instead, report
22128 a parser stack overflow. Allocate just one block of memory for all
22129 three stacks, instead of allocating three blocks; this typically is
22130 faster and reduces fragmentation.
22131
22132 Do not limit the number of items in the stack to a value that fits
22133 in 'int', as this is an arbitrary limit on hosts with 64-bit
22134 size_t and 32-bit int.
22135
22136 2001-11-29 Marc Autret <autret_m@epita.fr>
22137
22138 * tests/calc.at [AT_DATA_CALC_Y]: Use %error-verbose instead
22139 of defining YYERROR_VERBOSE.
22140 [AT_DATA]: $4 is now out of C declarations in the prologue.
22141
22142 2001-11-28 Marc Autret <autret_m@epita.fr>
22143
22144 * src/reader.c (parse_dquoted_param): New.
22145 (parse_skel_decl): Use it.
22146 * src/lex.h: Add its prototype.
22147 * src/lex.c (literalchar): Become not static.
22148
22149 2001-11-28 Marc Autret <autret_m@epita.fr>
22150
22151 * src/output.h: And put its extern declaration here.
22152 * src/output.c (error_verbose): Define here.
22153 (prepare): Echo name modification.
22154 * src/getargs.h: Clean its extern declaration.
22155 * src/getargs.c (error_verbose_flag): Remove.
22156 (getargs): Remove case 'e'.
22157 * src/options.c (option_table): 'error-verbose' is now seen as simple
22158 percent option.
22159 Include output.h.
22160
22161 * src/reader.c (read_declarations): Remove case tok_include.
22162 (parse_include_decl): Remove.
22163 * src/lex.h (token_t): Remove tok_include.
22164 * src/options.c (option_table): 'include' is now a simple command line
22165 option.
22166
22167 2001-11-28 Marc Autret <autret_m@epita.fr>
22168
22169 * src/bison.simple: Adjust muscle names.
22170 * src/muscle_tab.c (muscle_init): Also rename the muscles.
22171 * src/output.c (prepare): s/_/-/ for the muscles names.
22172 (output_parser): When scanning for a muscle, allow '-' instead of '_'.
22173
22174 2001-11-28 Marc Autret <autret_m@epita.fr>
22175
22176 * src/bison.simple: Fix debug.
22177 [YYERROR_VERBOSE]: Re-integrate as an internal macro.
22178
22179 2001-11-28 Akim Demaille <akim@epita.fr>
22180
22181 * src/LR0.c (shifts_new): New.
22182 (save_shifts, insert_start_shift, augment_automaton): Use it.
22183
22184 2001-11-28 Akim Demaille <akim@epita.fr>
22185
22186 * src/closure.c (closure): `b' and `ruleno' denote the same value:
22187 keep ruleno only.
22188
22189 2001-11-28 Akim Demaille <akim@epita.fr>
22190
22191 * src/closure.c (closure): Instead of looping over word in array
22192 then bits in words, loop over bits in array.
22193
22194 2001-11-28 Akim Demaille <akim@epita.fr>
22195
22196 * src/closure.c (closure): No longer optimize the special case
22197 where all the bits of `ruleset[r]' are set to 0, to make the code
22198 clearer.
22199
22200 2001-11-28 Akim Demaille <akim@epita.fr>
22201
22202 * src/closure.c (closure): `r' and `c' are new variables, used to
22203 de-obfuscate accesses to RULESET and CORE.
22204
22205 2001-11-28 Akim Demaille <akim@epita.fr>
22206
22207 * src/reduce.c (reduce_print): Use ngettext.
22208 (dump_grammar): Improve the trace accuracy.
22209
22210 2001-11-28 Akim Demaille <akim@epita.fr>
22211
22212 * src/reduce.c (dump_grammar): Don't translate trace messages.
22213
22214 2001-11-28 Akim Demaille <akim@epita.fr>
22215
22216 * tests/reduce.at (Useless Terminals, Useless Nonterminals): New.
22217 * src/reduce.c (reduce_grammar_tables): Do not free useless tags,
22218 as all tags are free'ed afterwards.
22219 From Enrico Scholz.
22220
22221 2001-11-27 Paul Eggert <eggert@twinsun.com>
22222
22223 * src/bison.simple (YYSTACK_REALLOC): Fix typo that caused us to
22224 use alloca when we didn't want to, and vice versa.
22225
22226 2001-11-27 Marc Autret <autret_m@epita.fr>
22227
22228 * src/muscle_tab.c (muscle_init): Remove 'verbose' muscle
22229 initialization.
22230 * src/output.c (prepare): Remove its update.
22231
22232 2001-11-27 Marc Autret <autret_m@epita.fr>
22233
22234 * tests/torture.at [AT_DATA]: Remove YYERROR_VERBOSE definition.
22235 Use %error-verbose.
22236
22237 2001-11-27 Marc Autret <autret_m@epita.fr>
22238
22239 * src/bison.simple: Remove YYERROR_VERBOSE using.
22240 Use %%error_verbose.
22241 (yyparse): Likewise.
22242 * src/output.c (prepare): Give its final value.
22243 * src/muscle_tab.c (muscle_init): Init new muscle 'error_verbose'.
22244 * src/getargs.h: Add its extern declaration.
22245 * src/getargs.c (error_verbose_flag): New int.
22246 (getargs): Update to catch new case.
22247 * src/options.c (option_table): 'error-verbose' is a new option.
22248 (shortopts): Update.
22249
22250 2001-11-27 Akim Demaille <akim@epita.fr>
22251
22252 * src/system.h: Use intl/libgettext.h.
22253 * src/Makefile.am (INCLUDES): Add -I $(top_srcdir).
22254
22255 2001-11-27 Akim Demaille <akim@epita.fr>
22256
22257 * tests/torture.at (Exploding the Stack Size with Malloc):
22258 s/YYSTACK_USE_ALLOCA_ALLOCA/YYSTACK_USE_ALLOCA/.
22259
22260 2001-11-27 Akim Demaille <akim@epita.fr>
22261
22262 * src/files.c: Include error.h.
22263 Reported by Hans Aberg.
22264
22265 2001-11-26 Marc Autret <autret_m@epita.fr>
22266
22267 * src/reader.c (parse_include_decl): New, not yet implemented.
22268 (read_declarations): Add case tok_include.
22269 * src/getargs.h (include): Add its extern definition.
22270 * src/getargs.c (include): New const char *.
22271 (getargs): Add case '-I'.
22272 * src/options.c (option_table): Add include as command line and
22273 percent option.
22274 * src/lex.h (token_t): Add tok_include.
22275
22276 2001-11-26 Akim Demaille <akim@epita.fr>
22277
22278 * src/reader.c (readgram): Make sure rules for mid-rule actions
22279 have a lineno equal to that of their host rule.
22280 Reported by Hans Aberg.
22281 * tests/regression.at (Rule Line Numbers): New.
22282
22283 2001-11-26 Akim Demaille <akim@epita.fr>
22284
22285 * src/LR0.c (allocate_itemsets): kernel_size contains ints, not
22286 size_ts.
22287
22288 2001-11-26 Akim Demaille <akim@epita.fr>
22289
22290 * src/complain.c, src/complain.h (error): Remove, provided by
22291 lib/error.[ch].
22292
22293 2001-11-26 Akim Demaille <akim@epita.fr>
22294
22295 * src/reader.c (read_declarations): Don't abort on tok_illegal,
22296 issue an error message.
22297 * tests/regression.at (Invalid %directive): New.
22298 Reported by Hans Aberg.
22299
22300 2001-11-26 Akim Demaille <akim@epita.fr>
22301
22302 * configure.in: Invoke AC_FUNC_OBSTACK and AC_FUNC_ERROR_AT_LINE.
22303 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
22304
22305 2001-11-26 Akim Demaille <akim@epita.fr>
22306
22307 * src/conflicts.c (conflicts_print): Don't complain at all when
22308 there are no reduce/reduce conflicts, and as many shift/reduce
22309 conflicts as expected.
22310 * tests/regression.at (%expect right): Adjust.
22311
22312 2001-11-23 Akim Demaille <akim@epita.fr>
22313
22314 * lib/alloca.c: Update, from fileutils.
22315
22316 2001-11-23 Akim Demaille <akim@epita.fr>
22317
22318 * lib/Makefile.am (libbison_a_LIBADD): Add @ALLOCA@.
22319
22320 2001-11-23 Akim Demaille <akim@epita.fr>
22321
22322 * src/system.h: Include alloca.h.
22323 * src/main.c (main) [C_ALLOCA]: Call alloca (0).
22324
22325 2001-11-23 Akim Demaille <akim@epita.fr>
22326
22327 * src/print_graph.c (print_actions): Remove `rule', unused.
22328 * src/LR0.c (kernel_size): Contain `int' instead of `size_t' to
22329 pacify GCC's signed < unsigned warnings.
22330 * src/closure.c (itemsetsize): Likewise.
22331 * src/reader.c (symbol_list_new): Static.
22332
22333 2001-11-23 Akim Demaille <akim@epita.fr>
22334
22335 Attaching lineno to buckets is stupid, since only one copy of each
22336 symbol is kept, only the line of the first occurrence is kept too.
22337
22338 * src/symtab.h, src/symtab.c (bucket): Remove the line member.
22339 * src/reader.c (rline_allocated): Remove, unused.
22340 (symbol_list): Have a `line' member.
22341 (symbol_list_new): New.
22342 (readgram): Use it.
22343 * src/print.c (print_grammar): Output the rule line numbers.
22344 * tests/regression.at (Solved SR Conflicts)
22345 (Unresolved SR Conflicts): Adjust.
22346 Reported by Hans Aberg.
22347
22348 2001-11-22 Marc Autret <autret_m@epita.fr>
22349
22350 * src/bison.simple [YYERROR_VERBOSE]: Force its value to be 1 or 0.
22351
22352 2001-11-22 Marc Autret <autret_m@epita.fr>
22353
22354 * src/muscle_tab.c (muscle_init): Remove initialization of
22355 skeleton muscle.
22356 * src/output.c (output_master_parser): Do it here.
22357
22358 2001-11-20 Akim Demaille <akim@epita.fr>
22359
22360 * po/sv.po: New.
22361 * configure.in (ALL_LINGUAS): Adjust.
22362 * po/POTFILE.in: Remove `nullable.c' and `derives.c' which no
22363 longer contains strings to translate.
22364
22365 2001-11-19 Akim Demaille <akim@epita.fr>
22366
22367 * src/conflicts.c (conflicts_print): Add a missing \n.
22368
22369 2001-11-19 Akim Demaille <akim@epita.fr>
22370
22371 * src/nullable.c (nullable_print): New.
22372 (set_nullable): Call it when tracing.
22373 Better locality of variables.
22374
22375 2001-11-19 Akim Demaille <akim@epita.fr>
22376
22377 * src/print.c (print_actions): Better locality of variables.
22378
22379 2001-11-19 Akim Demaille <akim@epita.fr>
22380
22381 * src/derives.c (print_derives): Fix and enrich.
22382 * src/closure.c (print_fderives): Likewise.
22383
22384 2001-11-19 Akim Demaille <akim@epita.fr>
22385
22386 * src/closure.c (itemsetend): Remove, replaced with...
22387 (itemsetsize): new.
22388
22389 2001-11-19 Akim Demaille <akim@epita.fr>
22390
22391 * src/LR0.c (kernel_end): Remove, replaced with...
22392 (kernel_size): new.
22393
22394 2001-11-19 Akim Demaille <akim@epita.fr>
22395
22396 * src/conflicts.c (set_conflicts): Use arrays instead of pointers
22397 to clarify.
22398
22399 2001-11-19 Akim Demaille <akim@epita.fr>
22400
22401 * src/closure.c (closure): Use arrays instead of pointers to clarify.
22402
22403 2001-11-19 Akim Demaille <akim@epita.fr>
22404
22405 * src/closure.c, src/derives.c, src/nullable.c: Adjust various
22406 trace messages.
22407 * src/LR0.c: Likewise.
22408 (allocate_itemsets): Use arrays instead of pointers to clarify.
22409
22410 2001-11-19 Akim Demaille <akim@epita.fr>
22411
22412 * src/getargs.c (statistics_flag): Replace with...
22413 (trace_flag): New.
22414 (longopts): Accept --trace instead of --statistics.
22415 * src/getargs.h, src/options.c: Adjust.
22416 * src/LR0.c, src/closure.c, src/derives.c, src/nullable.c,
22417 * src/reduce.c: Use trace_flags instead of the CPP conditional TRACE.
22418
22419 2001-11-19 Akim Demaille <akim@epita.fr>
22420
22421 * src/LR0.c (new_itemsets, get_state): Use more arrays and fewer
22422 pointers to clarify the code.
22423 (save_reductions, save_shifts): Factor common parts of alternatives.
22424
22425 2001-11-19 Akim Demaille <akim@epita.fr>
22426
22427 * src/LR0.c (new_state, get_state): Complete TRACE code.
22428 * src/closure.c: Include `reader.h' to get `tags', needed by the
22429 trace code.
22430 Rename the conditional DEBUG as TRACE.
22431 Output consistently TRACEs to stderr, not stdout.
22432 * src/derives.c: Likewise.
22433 * src/reduce.c: (inaccessable_symbols): Using if is better style
22434 than goto.
22435 Use `#if TRACE' instead of `#if 0' for tracing code.
22436
22437 2001-11-19 Akim Demaille <akim@epita.fr>
22438
22439 * src/system.h (LIST_FREE, shortcpy): New.
22440 * src/LR0.c: Use them.
22441 * src/output.c (free_itemsets, free_reductions, free_shifts):
22442 Remove, replaced by LIST_FREE.
22443
22444 2001-11-19 Akim Demaille <akim@epita.fr>
22445
22446 * src/state.h (CORE_ALLOC, SHIFTS_ALLOC, ERRS_ALLOC)
22447 (REDUCTIONS_ALLOC): New.
22448 * src/LR0.c, src/conflicts.c: Use them to de-obfuscate memory
22449 allocation.
22450
22451 2001-11-19 Akim Demaille <akim@epita.fr>
22452
22453 * src/LR0.c (new_state): Complete trace code.
22454 * src/nullable.c (set_nullable): Don't translate traces.
22455
22456 2001-11-19 Akim Demaille <akim@epita.fr>
22457
22458 * src/print_graph.c (print_core): Better locality of variables.
22459 * src/print.c (print_core): Likewise.
22460
22461 2001-11-19 Akim Demaille <akim@epita.fr>
22462
22463 * src/vcg.c: You do the output, so you are responsible of the
22464 handling of VCG syntax, in particular: use quotearg.
22465 * src/print_graph.c: Don't.
22466 (print_actions): Don't output the actions as part of the nodes,
22467 since that's the job of the edges.
22468 (print_state): Don't output by hand: fill the node description,
22469 and ask for its output.
22470
22471 2001-11-19 Akim Demaille <akim@epita.fr>
22472
22473 * src/bison.simple (yyparse): When verbosely reporting an error,
22474 no longer put additional quotes around token names.
22475 * tests/calc.at: Adjust.
22476
22477 2001-11-19 Akim Demaille <akim@epita.fr>
22478
22479 * src/symtab.h, src/symtab.c: `line' is a new member of `bucket'.
22480 * src/reader.c (record_rule_lines, rline, rline_allocated): Remove.
22481 * src/output.c: Adjust.
22482
22483 2001-11-19 Akim Demaille <akim@epita.fr>
22484
22485 * src/gram.h (rprec, rprecsym, rassoc): Remove, now part of...
22486 (rule_t): this.
22487 * src/conflicts.c, src/reader.c, src/reduce.c: Adjust.
22488
22489 2001-11-19 Akim Demaille <akim@epita.fr>
22490
22491 * src/gram.h (rule_t): New.
22492 (rule_table): New.
22493 (rrhs, rlhs): Remove, part of state_t.
22494 * src/print_graph.c, src/closure.c, src/conflicts.c, src/derives.c,
22495 * src/lalr.c, src/nullable.c, src/output.c, src/print.c,
22496 * src/reader.c, src/reduce.c: Adjust.
22497
22498 2001-11-19 Akim Demaille <akim@epita.fr>
22499
22500 * src/reader.c (symbols_output): New, extracted from...
22501 (packsymbols): Here.
22502 (reader): Call it.
22503
22504 2001-11-19 Akim Demaille <akim@epita.fr>
22505
22506 * src/lalr.c (set_maxrhs, maxrhs): Remove, replaced with...
22507 (maxrhs): this new function.
22508
22509 2001-11-19 Akim Demaille <akim@epita.fr>
22510
22511 * src/lalr.c (F): New macro to access the variable F.
22512 Adjust.
22513
22514 2001-11-19 Akim Demaille <akim@epita.fr>
22515
22516 * src/lalr.h (LA): New macro to access the variable LA.
22517 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
22518 * src/lalr.c: Adjust.
22519
22520 2001-11-19 Akim Demaille <akim@epita.fr>
22521
22522 * src/lalr.c (initialize_LA): Only initialize LA. Let...
22523 (set_state_table): handle the `lookaheads' members.
22524
22525 2001-11-19 Akim Demaille <akim@epita.fr>
22526
22527 * src/lalr.h (lookaheads): Removed array, whose contents is now
22528 a member of...
22529 (state_t): this structure.
22530 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
22531 Adjust.
22532
22533 2001-11-19 Akim Demaille <akim@epita.fr>
22534
22535 * src/lalr.h (consistent): Removed array, whose contents is now
22536 a member of...
22537 (state_t): this structure.
22538 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
22539 Adjust.
22540
22541 2001-11-19 Akim Demaille <akim@epita.fr>
22542
22543 * src/lalr.h (reduction_table, shift_table): Removed arrays, whose
22544 contents are now members of...
22545 (state_t): this structure.
22546 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
22547 Adjust.
22548
22549 2001-11-19 Akim Demaille <akim@epita.fr>
22550
22551 * src/lalr.h (state_t): New.
22552 (state_table): Be a state_t * instead of a core **.
22553 (accessing_symbol): Remove, part of state_t.
22554 * src/lalr.c: Adjust.
22555 (set_accessing_symbol): Merge into...
22556 (set_state_table): this.
22557 * src/print_graph.c, src/conflicts.c: Adjust.
22558
22559 2001-11-14 Akim Demaille <akim@epita.fr>
22560
22561 * tests/calc.at, tests/output.at, tests/regression.at,
22562 * tests/testsuite.at, tests/torture.at: Rely on Autotest 2.52g:
22563 now the tests are run in private dirs, therefore AC_CLEANUP and
22564 family can be simplified to 0-ary.
22565 * tests/atlocal.in: Now that we run `elsewhere' than in tests/,
22566 use abs. path to find config.h.
22567 * tests/calc.at (AT_CHECK_CALC): Don't try to check the compiler's
22568 stderr, there can be way too much random noise.
22569 Instead pass -Werror to GCC and rely on the exit status.
22570 Reported by Wolfram Wagner.
22571
22572 2001-11-14 Akim Demaille <akim@epita.fr>
22573
22574 * src/bison.simple (yyparse): Let yyls1, yyss1 and yyvs1 be
22575 defined only if yyoverflow is defined, to avoid `warning: unused
22576 variable `yyvs1''.
22577 Reported by The Test Suite.
22578
22579 2001-11-14 Akim Demaille <akim@epita.fr>
22580
22581 * src/print.c: Include reduce.h.
22582 Reported by Hans Aberg.
22583
22584 2001-11-14 Akim Demaille <akim@epita.fr>
22585
22586 * src/lex.c, src/lex.h (token_buffer, unlexed_token_buffer):
22587 Revert a previous patch: these are really const.
22588 * src/conflicts.c (conflict_report): Additional useless pair of
22589 braces to pacify GCC's warnings for `if () if () {} else {}'.
22590 * src/lex.c (parse_percent_token): Replace equal_offset with
22591 arg_offset.
22592 arg is const.
22593 Be sure to strdup `arg' when used, since there is no reason for
22594 token_buffer not to change.
22595
22596 2001-11-14 Akim Demaille <akim@epita.fr>
22597
22598 * src/system.h (EXIT_SUCCESS, EXIT_FAILURE): Ensure a proper
22599 definition.
22600 * src/main.c (main): Use them.
22601 Suggested by Hans Aberg.
22602
22603 2001-11-12 Akim Demaille <akim@epita.fr>
22604
22605 * src/system.h (ngettext): Now that we use ngettext, be sure to
22606 provide a default definition when NLS are not used.
22607
22608 2001-11-12 Akim Demaille <akim@epita.fr>
22609
22610 * doc/bison.texinfo: Use `$' as shell prompt, not `%'.
22611 Use @kbd to denote user input.
22612 (Language and Grammar): ANSIfy the example.
22613 Adjust its layout for info/notinfo.
22614 (Location Tracking Calc): Output error messages to stderr.
22615 Output locations in a more GNUtically correct way.
22616 Fix a couple of Englishos.
22617 Adjust @group/@end group pairs.
22618
22619 2001-11-12 Akim Demaille <akim@epita.fr>
22620
22621 %expect was not functioning at all.
22622
22623 * src/conflicts.c (expected_conflicts): Set to -1.
22624 (conflict_report): Use ngettext.
22625 (conflicts_print): Check %expect and make its violation an error.
22626 * doc/bison.texinfo (Expect Decl): Adjust.
22627 * configure.in (AM_GNU_GETTEXT): Ask for ngettext.
22628 * tests/regression.at (%expect not enough, %expect right)
22629 (%expect too much): New.
22630
22631 2001-11-12 Akim Demaille <akim@epita.fr>
22632
22633 * tests/regression.at (Conflicts): Rename as...
22634 (Unresolved SR Conflicts): this.
22635 (Solved SR Conflicts): New.
22636
22637 2001-11-12 Akim Demaille <akim@epita.fr>
22638
22639 * src/reduce.c (print_results): Rename as...
22640 (reduce_output): This.
22641 Output to OUT, passed as argument, instead of output_obstack.
22642 (dump_grammar): Likewise.
22643 (reduce_free): New.
22644 Also free V1.
22645 (reduce_grammar): No longer call reduce_output, since...
22646 * src/print.c (print_results): do it.
22647 * src/main.c (main): Call reduce_free;
22648
22649 2001-11-12 Akim Demaille <akim@epita.fr>
22650
22651 * src/conflicts.c (print_reductions): Accept OUT as argument.
22652 Output to it, not to output_obstack.
22653 * src/print.c (print_actions): Adjust.
22654
22655 2001-11-12 Akim Demaille <akim@epita.fr>
22656
22657 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts): Return
22658 the result instead of using...
22659 (src_total, rrc_total, src_count, rrc_count): Remove.
22660 (any_conflicts): Remove.
22661 (print_conflicts): Split into...
22662 (conflicts_print, conflicts_output): New.
22663 * src/conflicts.h: Adjust.
22664 * src/main.c (main): Invoke both conflicts_output and conflicts_print.
22665 * src/print.c (print_grammar): Issue `\n' between two rules.
22666 * tests/regression.at (Conflicts): New.
22667 Reported by Tom Lane.
22668
22669 2001-11-12 Akim Demaille <akim@epita.fr>
22670
22671 * tests/regression.at (Invalid input): Remove, duplicate with
22672 ``Invalid input: 1''.
22673
22674 2001-11-12 Akim Demaille <akim@epita.fr>
22675
22676 * tests/torture.at (AT_DATA_STACK_TORTURE)
22677 (Exploding the Stack Size with Alloca)
22678 (Exploding the Stack Size with Malloc): New.
22679
22680 2001-11-12 Akim Demaille <akim@epita.fr>
22681
22682 * src/bison.simple (YYSTACK_REALLOC): New.
22683 (yyparse) [!yyoverflow]: Use it and free the old stack.
22684 Reported by Per Allansson.
22685
22686 2001-11-12 Pascal Bart <pascal.bart@epita.fr>
22687
22688 * src/bison.simple: Define type yystype instead of YYSTYPE, and
22689 define CPP macro, which substitute YYSTYPE by yystype.
22690 * src/reader.c (parse_union_decl): Output yystype/YYSTYPE as we do
22691 with yyltype/YYLTYPE. This allows inclusion of the generated
22692 header within the parser if the compiler, such as GGC, accepts
22693 multiple equivalent #defines.
22694 From Akim.
22695
22696 2001-11-05 Akim Demaille <akim@epita.fr>
22697
22698 * src/reader.c (symbols_output): New, extracted from...
22699 (packsymbols): here.
22700 (reader): Adjust.
22701
22702 2001-11-05 Akim Demaille <akim@epita.fr>
22703
22704 * src/lex.c (parse_percent_token): s/quotearg/quote/.
22705
22706 2001-11-05 Akim Demaille <akim@epita.fr>
22707
22708 * tests/regression.at (AT_TEST_CPP_GUARD_H): Adjust the clean up
22709 pattern.
22710
22711 2001-11-05 Akim Demaille <akim@epita.fr>
22712
22713 * src/options.h (struct option_table_struct): set_flags is void*.
22714 * src/options.c (longopts): Support `--output' and `%output'.
22715 (usage): Adjust.
22716 * src/lex.h (tok_setopt): Remove, replaced with...
22717 (tok_intopt, tok_stropt): these new guys.
22718 * src/lex.c (getopt.h): Not needed.
22719 (token_buffer, unlexed_token_buffer): Not const.
22720 (percent_table): Promote `-' over `_' in directive names.
22721 Active `%name-prefix', `file-prefix', and `output'.
22722 (parse_percent_token): Accept possible arguments to directives.
22723 Promote `-' over `_' in directive names.
22724
22725 2001-11-04 Akim Demaille <akim@epita.fr>
22726
22727 * doc/bison.texinfo (Decl Summary): Split the list into
22728 `directives for grammars' and `directives for bison'.
22729 Sort'em.
22730 Add description of `%name-prefix', `file-prefix', and `output'.
22731 Promote `-' over `_' in directive names.
22732 (Bison Options): s/%locactions/%locations/. Nice Freudian slip.
22733 Simplify the description of `--name-prefix'.
22734 Promote `-' over `_' in directive names.
22735 Promote `--output' over `--output-file'.
22736 Fix the description of `--defines'.
22737 * tests/output.at: Exercise %file-prefix and %output.
22738
22739 2001-11-02 Akim Demaille <akim@epita.fr>
22740
22741 * doc/refcard.tex: Update.
22742
22743 2001-11-02 Akim Demaille <akim@epita.fr>
22744
22745 * src/symtab.h (SUNDEF): New.
22746 * src/symtab.c (bucket_new): Init user_token_number to SUNDEF to
22747 stand for `uninitialized', instead of 0.
22748 * src/reader.c (packsymbols, parse_thong_decl): Adjust.
22749 * src/lex.c (lex): Adjust.
22750
22751 * tests/calc.at (_AT_DATA_CALC_Y): Declare a token for EOF.
22752 Number it 0.
22753 Let yylex return it instead of a plain 0.
22754 Reported by Dick Streefland.
22755
22756 2001-11-02 Akim Demaille <akim@epita.fr>
22757
22758 * tests/regression.at (Mixing %token styles): New test.
22759
22760 2001-11-02 Akim Demaille <akim@epita.fr>
22761
22762 * src/reader.c (parse_thong_decl): Formatting changes.
22763 (token_translations_init): New, extracted from...
22764 (packsymbols): Here.
22765 Adjust.
22766
22767 2001-11-01 Akim Demaille <akim@epita.fr>
22768
22769 * tests/regression.at (AT_TEST_CPP_GUARD_H): New.
22770 Check that `9foo.y' produces correct cpp guards.
22771 * src/files.c (compute_header_macro): Prepend `BISON_' to CPP
22772 guards.
22773 Reported by Wwp.
22774
22775 2001-11-01 Akim Demaille <akim@epita.fr>
22776
22777 * tests/regression.at (Invalid input: 2): New.
22778 * src/lex.c (unlexed_token_buffer): New.
22779 (lex, unlex): Adjust: when unlexing, be sure to save token_buffer
22780 too.
22781 Reported by Wwp.
22782
22783 2001-11-01 Akim Demaille <akim@epita.fr>
22784
22785 * tests/calc.at: Catch up with 1.30.
22786 * configure.in: Bump to 1.49a.
22787 Adjust to newer Autotest.
22788
22789 2001-10-19 Pascal Bart <pascal.bart@epita.fr>
22790
22791 * src/conflicts.c: Move global variables rrc_total and src_total ...
22792 (print_conflicts): here.
22793 * src/output.c (output): Free global variable user_toknums.
22794 * src/lex.c (token_obstack): Become static.
22795
22796 2001-10-18 Akim Demaille <akim@epita.fr>
22797
22798 * tests/atlocal.in (GCC): Add.
22799 * tests/calc.at: s/m4_match/m4_bmatch/.
22800 s/m4_patsubst/m4_bpatsubst/.
22801 (AT_CHECK_CALC): Check the compiler's stderr only if it's GCC.
22802 * configure.in: AC_SUBST(GCC).
22803
22804 2001-10-14 Marc Autret <autret_m@epita.fr>
22805
22806 * src/options.c (create_long_option_table): Fix.
22807
22808 2001-10-10 Akim Demaille <akim@epita.fr>
22809
22810 * src/bison.simple: Be sure to set YYSTACK_USE_ALLOCA.
22811
22812 2001-10-04 Akim Demaille <akim@epita.fr>
22813
22814 * src/reader.c (parse_union_decl): Push the caracters in
22815 union_obstack, not attrs_obstack.
22816
22817 2001-10-04 Akim Demaille <akim@epita.fr>
22818
22819 Merge in the branch 1.29.
22820
22821 * src/reader.c (packsymbols): Use a temporary obstack for
22822 `%%tokendef', since output_stack is already used elsewhere.
22823
22824 2001-10-02 Akim Demaille <akim@epita.fr>
22825
22826 Bump 1.29d.
22827
22828 2001-10-02 Akim Demaille <akim@epita.fr>
22829
22830 Version 1.29c.
22831
22832 2001-10-02 Akim Demaille <akim@epita.fr>
22833
22834 * tests/regression.at (Invalid CPP headers): New.
22835 From Alexander Belopolsky.
22836 * src/files.c (compute_header_macro): Map non alnum chars to `_'.
22837
22838 2001-10-02 Akim Demaille <akim@epita.fr>
22839
22840 * tests/regression.at (Invalid input): New.
22841 * src/lex.c (lex): Be sure to set `token_buffer' in any case.
22842 Reported by Shura.
22843
22844 2001-10-02 Akim Demaille <akim@epita.fr>
22845
22846 * tests/calc.at: Now that --debug works, the tests must be adjusted.
22847
22848 2001-10-02 Akim Demaille <akim@epita.fr>
22849
22850 * src/output.c (output_parser): Assert `skeleton'.
22851 * src/files.c (skeleton_find): Look harder for skeletons on DOSish
22852 systems.
22853 From Shura.
22854
22855 2001-10-01 Marc Autret <autret_m@epita.fr>
22856
22857 * src/lex.h: Echo modifications.
22858 * src/lex.c (unlex): Parameter is now token_t.
22859 From Hans Aberg.
22860
22861 2001-10-01 Marc Autret <autret_m@epita.fr>
22862
22863 * src/main.c: Include lex.h.
22864 From Hans Aberg.
22865
22866 2001-09-29 Akim Demaille <akim@epita.fr>
22867
22868 * src/getargs.c (longopts): `--debug' is `-t', not `-d'.
22869
22870 2001-09-28 Akim Demaille <akim@epita.fr>
22871
22872 * tests/testsuite.at: Update to newer Autotest.
22873 * tests/Makefile.am (EXTRA_DIST): bison is not to be shipped.
22874
22875 2001-09-27 Akim Demaille <akim@epita.fr>
22876
22877 Position independent wrapper.
22878
22879 * tests/bison: Remove.
22880 * tests/bison.in: New.
22881 * configure.in: Adjust.
22882
22883 2001-09-27 Paul Eggert <eggert@twinsun.com>
22884
22885 Port quotearg fixes from tar 1.13.24.
22886
22887 * lib/quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
22888 tm to be declared.
22889 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
22890 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
22891
22892 * m4/Makefile.am (EXTRA_DIST): Add mbrtowc.m4.
22893 * m4/mbrtowc.m4: New file.
22894 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Check for mbsinit and stddef.h.
22895 Use jm_FUNC_MBRTOWC instead of AC_CHECK_FUNCS(mbrtowc).
22896
22897 2001-09-27 Akim Demaille <akim@epita.fr>
22898
22899 Bump to 1.29c.
22900
22901 2001-09-27 Akim Demaille <akim@epita.fr>
22902
22903 Version 1.29b.
22904
22905 2001-09-25 Akim Demaille <akim@epita.fr>
22906
22907 * src/system.h: Include `xalloc.h'.
22908 Remove it from the C files.
22909 * src/files.c (output_files): Free the obstacks.
22910 * src/lex.c (init_lex): Rename as...
22911 (lex_init): this.
22912 (lex_free): New.
22913 * src/main.c (main): Use it.
22914
22915 2001-09-24 Marc Autret <autret_m@epita.fr>
22916
22917 * src/vcg.c (open_edge, close_edge, open_node, close_node): Change
22918 to output informations in fout (FILE*).
22919 (open_graph, close_graph): Likewise.
22920 (output_graph, output_edge, output_node): Likewise.
22921 * src/vcg.h: Update function prototypes.
22922 * src/print_graph.c (print_graph): Open output graph file.
22923 (print_actions): Adjust.
22924 * src/files.h: Remove extern declaration.
22925 * src/files.c: Remove graph_obstack declaration.
22926 (open_files): Remove graph_obstack initialization.
22927 (output_files): Remove graph_obstack saving.
22928
22929 2001-09-24 Marc Autret <autret_m@epita.fr>
22930
22931 * src/files.c (compute_output_file_names): Fix.
22932
22933 2001-09-24 Marc Autret <autret_m@epita.fr>,
22934 Akim Demaille <akim@epita.fr>
22935
22936 * src/reader.c (reader): Remove call to free_symtab ().
22937 * src/main.c (main): Call it here.
22938 Include symtab.h.
22939 * src/conflicts.c (initialize_conflicts): Rename as...
22940 (solve_conflicts): this.
22941 * src/print.c (print_core, print_actions, print_state)
22942 (print_grammar): Dump to a file instead a `output_obstack'.
22943 (print_results): Dump `output_obstack', and then proceed with the
22944 FILE *.
22945 * src/files.c (compute_output_file_names, close_files): New.
22946 (output_files): Adjust.
22947 * src/main.c (main): Adjust.
22948
22949 2001-09-23 Marc Autret <autret_m@epita.fr>
22950
22951 * src/files.c (compute_header_macro): Computes header macro name
22952 from spec_defines_file when given.
22953
22954 2001-09-23 Marc Autret <autret_m@epita.fr>
22955
22956 * src/files.c (output_files): Add default extensions.
22957
22958 2001-09-22 Akim Demaille <akim@epita.fr>
22959
22960 * src/conflicts.c (finalize_conflicts): Rename as...
22961 (free_conflicts): this.
22962
22963 2001-09-22 Akim Demaille <akim@epita.fr>
22964
22965 * src/gram.c (gram_free): Rename back as...
22966 (dummy): this.
22967 (output_token_translations): Free `token_translations'.
22968 * src/symtab.c (free_symtab): Free the tag field.
22969
22970 2001-09-22 Akim Demaille <akim@epita.fr>
22971
22972 Remove `translations' as it is always set to true.
22973
22974 * src/gram.h: Adjust.
22975 * src/reader.c (packsymbols, parse_token_decl): Adjust
22976 * src/print.c (print_grammar): Adjust.
22977 * src/output.c (output_token_translations): Adjust.
22978 * src/lex.c (lex): Adjust.
22979 * src/gram.c: Be sure the set pointers to NULL.
22980 (dummy): Rename as...
22981 (gram_free): this.
22982
22983 2001-09-22 Akim Demaille <akim@epita.fr>
22984
22985 * configure.in: Invoke AM_LIB_DMALLOC.
22986 * src/system.h: Use dmalloc.
22987 * src/LR0.c: Be sure to have pointers initialized to NULL.
22988 (allocate_itemsets): Allocate kernel_items only if needed.
22989
22990 2001-09-22 Akim Demaille <akim@epita.fr>
22991
22992 * configure.in: Bump to 1.29b.
22993 * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
22994 * tests/calc.at (_AT_DATA_CALC_Y): #undef malloc so that we don't
22995 need xmalloc.c in calc.y.
22996 From Pascal Bart.
22997
22998 2001-09-21 Akim Demaille <akim@epita.fr>
22999
23000 Version 1.29a.
23001 * Makefile.maint, config/config.guess, config/config.sub,
23002 * config/missing: Update from masters.
23003 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): No longer depend
23004 upon package.m4.
23005 * configure.in (ALL_LINGUAS): Add `tr'.
23006
23007 2001-09-21 Akim Demaille <akim@epita.fr>
23008
23009 * tests/Makefile.am (package.m4): Move to...
23010 ($(srcdir)/$(TESTSUITE)): here.
23011
23012 2001-09-20 Akim Demaille <akim@epita.fr>
23013
23014 * src/complain.c: No longer try to be standalone: use system.h.
23015 Don't assume __STDC__ is defined to 1. Just test if it is defined.
23016 * src/complain.h: Likewise.
23017 * src/reduce.c (useless_nonterminals, inaccessable_symbols):
23018 Remove the unused variable `n'.
23019 From Albert Chin-A-Young.
23020
23021 2001-09-18 Marc Autret <autret_m@epita.fr>
23022
23023 * doc/bison.1: Update.
23024 * doc/bison.texinfo (Bison Options): Update --defines and --graph
23025 descriptions.
23026 (Option Cross Key): Update.
23027 Add --graph.
23028
23029 2001-09-18 Marc Autret <autret_m@epita.fr>
23030
23031 * tests/regression.at: New test (comment in %union).
23032
23033 2001-09-18 Marc Autret <autret_m@epita.fr>
23034
23035 * src/reader.c (parse_union_decl): Do not output '/'. Let copy_comment
23036 do that.
23037 Reported by Keith Browne.
23038
23039 2001-09-18 Marc Autret <autret_m@epita.fr>
23040
23041 * tests/output.at: Add tests for --defines and --graph.
23042
23043 2001-09-18 Marc Autret <autret_m@epita.fr>
23044
23045 * tests/output.at: Removes tests of %{header,src}_extension features.
23046
23047 2001-09-18 Akim Demaille <akim@epita.fr>
23048
23049 * tests/Makefile.am (package.m4): New.
23050 * tests/calc.at (_AT_CHECK_CALC): Just run `calc input'.
23051 (_AT_CHECK_CALC_ERROR): Likewise.
23052 Factor the `, ' part of verbose error messages.
23053
23054 2001-09-18 Marc Autret <autret_m@epita.fr>
23055
23056 * src/getargs.c (longopts): Declare --defines and --graph as options
23057 with optional arguments.
23058 * src/files.h: Add extern declarations.
23059 * src/files.c (spec_graph_file, spec_defines_file): New.
23060 (output_files): Update.
23061 Remove CPP-outed code.
23062
23063 2001-09-18 Marc Autret <autret_m@epita.fr>
23064
23065 Turn off %{source,header}_extension feature.
23066
23067 * src/files.c (compute_exts_from_gf): Update.
23068 (compute_exts_from_src): Update.
23069 (output_files): CPP-out useless code.
23070 * src/files.h: Remove {header,source}_extension extern declarations.
23071 * src/reader.c (parse_dquoted_param): CPP-out.
23072 (parse_header_extension_decl): Remove.
23073 (parse_source_extension_decl): Remove.
23074 (read_declarations): Remove cases tok_{hdrext,srcext}.
23075 * src/lex.c (percent_table): Remove {header,source}_extension entries.
23076 * src/lex.h (token_t): Remove tok_hdrext and tok_srcext.
23077
23078 2001-09-10 Akim Demaille <akim@epita.fr>
23079
23080 * tests/output.at (AT_CHECK_BISON_FLAGS, AT_CHECK_BISON_PERCENT):
23081 (AT_CHECK_BISON_PERCENT_FLAGS): Merge into...
23082 (AT_CHECK_OUTPUT): this.
23083 Merely check ls' exit status, its output is useless.
23084
23085 2001-09-10 Akim Demaille <akim@epita.fr>
23086
23087 * tests/calc.at: Use m4_match.
23088 (_AT_DATA_CALC_Y): Check `yyin != NULL', not `stdin != NULL'.
23089
23090 2001-09-10 Marc Autret <autret_m@epita.fr>,
23091 Akim Demaille <akim@epita.fr>
23092
23093 * src/vcg.h (graph_s): color, textcolor, bordercolor are now
23094 enum color_e.
23095 * src/print_graph.c (print_graph): Initalize graph.layoutalgorithm
23096 to `normal'.
23097 * src/reader.c (parse_token_decl): Initialize token with tok_eof.
23098 * src/lex.h: Adjust prototype.
23099 (token_t): Add `tok_undef'.
23100 * src/lex.c (struct percent_table_struct): Retval is now a token_t.
23101 (parse_percent_token): Now returns token_t.
23102 Add default statement in switch.
23103 (lex): Separate `c' as an input variable, from the token_t result
23104 part.
23105 (unlexed): Is a token_t.
23106
23107 2001-09-10 Akim Demaille <akim@epita.fr>
23108
23109 * configure.in: Bump to 1.29a.
23110
23111 2001-09-07 Akim Demaille <akim@epita.fr>
23112
23113 Version 1.29.
23114
23115 2001-08-30 Akim Demaille <akim@epita.fr>
23116
23117 * tests/atgeneral.m4, tests/atconfig.in, tests/suite.at: Remove.
23118 * m4/atconfig.m4: Remove.
23119 * tests/testsuite.at, tests/atlocal.in, tests/output.at,
23120 * tests/bison: New.
23121 * tests/regression.at, tests/calc.at: Use m4_define, AT_BANNER,
23122 m4_if, m4_patsubst, and m4_regexp.
23123 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Use an
23124 `input' file instead of echo.
23125
23126 2001-08-29 Akim Demaille <akim@epita.fr>
23127
23128 Bump to 1.28e.
23129
23130 2001-08-29 Akim Demaille <akim@epita.fr>
23131
23132 Version 1.28d.
23133
23134 2001-08-29 Paul Eggert <eggert@twinsun.com>
23135
23136 * src/bison.simple (yyparse): Don't take the address of an
23137 item before the start of an array, as that doesn't conform to
23138 the C Standard.
23139
23140 2001-08-29 Robert Anisko <anisko_r@epita.fr>
23141
23142 * doc/bison.texinfo (Location Tracking Calc): New node.
23143
23144 2001-08-29 Paul Eggert <eggert@twinsun.com>
23145
23146 * src/output.c (output): Do not define const, as this now
23147 causes more problems than it cures.
23148
23149 2001-08-29 Akim Demaille <akim@epita.fr>
23150
23151 * doc/bison.texinfo: Modernize `@node' and `@top' use: just name
23152 the nodes.
23153 Be sure to tag the `detailmenu'.
23154
23155 2001-08-29 Akim Demaille <akim@epita.fr>
23156
23157 * Makefile.maint (do-po-update): Wget refuses to overwrite files:
23158 download in a tmp dir.
23159
23160 2001-08-28 Marc Autret <autret_m@epita.fr>
23161
23162 * config/depcomp: New file.
23163
23164 2001-08-28 Marc Autret <autret_m@epita.fr>
23165
23166 * doc/bison.1 (mandoc): Adjust.
23167 From Juan Manuel Guerrero.
23168
23169 2001-08-28 Marc Autret <autret_m@epita.fr>
23170
23171 * src/print_graph.c (print_state): Fix.
23172
23173 2001-08-27 Marc Autret <autret_m@epita.fr>
23174
23175 * src/vcg.h (classname_s, infoname_s, node_s): Constify the
23176 char * members.
23177 Echo modifications to the functions prototypes.
23178 * src/vcg.c (add_classname, add_infoname): Adjust arguments.
23179
23180 2001-08-27 Marc Autret <autret_m@epita.fr>
23181
23182 * src/vcg.c: Include `xalloc.h'.
23183 (add_colorentry): New.
23184 (add_classname): New.
23185 (add_infoname): New.
23186 * src/vcg.h: Add new prototypes.
23187
23188 2001-08-27 Akim Demaille <akim@epita.fr>
23189
23190 * Makefile.maint: Sync. again with CVS Autoconf.
23191
23192 2001-08-27 Akim Demaille <akim@epita.fr>
23193
23194 * Makefile.maint: Formatting changes.
23195 (po-update, cvs-update, update): New targets.
23196 (AMTAR): Remove.
23197
23198 2001-08-27 Akim Demaille <akim@epita.fr>
23199
23200 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
23201 * Makefile.maint: Sync. with CVS Autoconf.
23202
23203 2001-08-27 Marc Autret <autret_m@epita.fr>
23204
23205 * src/vcg.h (struct infoname_s): New.
23206 (struct colorentry_s): New.
23207 (graph_s): New fields {vertical,horizontal}_order in structure.
23208 Add `infoname' field.
23209 Add `colorentry' field;
23210 * src/vcg_defaults.h (G_VERTICAL_ORDER): New.
23211 (G_HORIZONTAL_ORDER): New.
23212 (G_INFONAME): New.
23213 (G_COLORENTRY): New.
23214 * src/vcg.c (output_graph): Add output of {vertical,horizontal}_order.
23215 Add output of `infoname'.
23216 Add output of `colorentry'.
23217
23218 2001-08-27 Marc Autret <autret_m@epita.fr>
23219
23220 * src/reader.c (parse_dquoted_param): Rename variable `index' to `i'.
23221 This one shadowed a global parameter.
23222
23223 2001-08-24 Marc Autret <autret_m@epita.fr>
23224
23225 * src/print_graph.c (node_output_size): Declared POSIX `size_t' type,
23226 instead of `unsigned'.
23227 (print_state): Do not call obstack_object_size () in obstack_grow ()
23228 to avoid macro variables shadowing.
23229
23230 2001-08-23 Marc Autret <autret_m@epita.fr>
23231
23232 * src/lex.c (percent_table): Typo: s/naem/name/.
23233 Add graph option.
23234 Normalize new options declarations.
23235
23236 2001-08-20 Pascal Bart <pascal.bart@epita.fr>
23237
23238 * tests/suite.at: Exercise %header_extension and %source_extension.
23239
23240 2001-08-16 Marc Autret <autret_m@epita.fr>
23241
23242 * src/reader.c (parse_dquoted_param): New.
23243 (parse_header_extension_decl): Use it.
23244 (parse_source_extension_decl): Likewise.
23245
23246 2001-08-16 Marc Autret <autret_m@epita.fr>
23247
23248 * src/vcg.c: Remove includes of `complain.h' and `xalloc.h'.
23249 (get_xxxx_str): Use assert () instead of complain ().
23250 Remove return invokations in default cases.
23251 (get_decision_str): Modify default behaviour. Remove second argument.
23252 Echo modifications on calls.
23253 (output_graph): Fix.
23254
23255 2001-08-16 Marc Autret <autret_m@epita.fr>
23256
23257 * src/getargs.c (usage): Update with ``-g, --graph''.
23258
23259 2001-08-16 Marc Autret <autret_m@epita.fr>
23260
23261 * doc/bison.texinfo (Bison Options): Add items `-g', `--graph'.
23262 (Option Cross Key): Likewise.
23263 * doc/bison.1: Update.
23264
23265 2001-09-25 Pascal Bart <pascal.bart@epita.fr>
23266
23267 * src/output.c (output_master_parser): Don't finish action_obstack.
23268 (output_parser): Don't care about the muscle action, here.
23269 (prepare): Copy the action_obstack in the action muscle.
23270 (output): Free action_obstack.
23271
23272 2001-09-23 Pascal Bart <pascal.bart@epita.fr>
23273
23274 * src/reader.c (parse_union_decl): Add new obstack union_obstack. Which
23275 will contain `%union' declaration.
23276 (parse_union_decl): Delete #line directive output.
23277 (parse_union_decl): Substitute /attrs_obstack/union_obstack for all
23278 informations about %union.
23279 (parse_union_decl): Copy the union_obstack in the muscle stype.
23280 * src/bison.simple: Add new #line directive.
23281 Add typdef %%stype YYSTYPE.
23282
23283 2001-09-23 Pascal Bart <pascal.bart@epita.fr>
23284
23285 * src/bison.simple: Add new `#line' directive.
23286
23287 2001-09-22 Pascal Bart <pascal.bart@epita.fr>
23288
23289 * src/bison.simple: New `#line' directive.
23290 * src/output.c (output_parser): Support new dynamic muscle input_line.
23291
23292 2001-09-22 Marc Autret <autret_m@epita.fr>
23293
23294 * src/output.c (output_master_parser): New.
23295 (output_parser): Be more re-entrant.
23296
23297 2001-09-21 Marc Autret <autret_m@epita.fr>
23298
23299 * src/reader.c (copy_definition, parse_union_decl): Update and use
23300 `linef' muscle.
23301 (copy_action): Likewise.
23302 Use obstack_1grow ().
23303 * src/muscle_tab.c (muscle_init): Add muscle `linef'.
23304
23305 2001-09-21 Marc Autret <autret_m@epita.fr>
23306
23307 * src/options.c (option_table): Adjust.
23308 * src/lex.c (parse_percent_token): Fix.
23309
23310 2001-09-20 Pascal Bart <pascal.bart@epita.fr>
23311
23312 * src/options.c (symtab.h): Include it, need by lex.h.
23313
23314 2001-09-20 Pascal Bart <pascal.bart@epita.fr>
23315
23316 * src/lex.c (parse_percent_token): Change type of variable `tx', which
23317 is now an option_table_struct*.
23318 (option_strcmp): New function option_strcmp.
23319 (parse_percent_token): Call option_strcmp.
23320 * src/getargs.c (xalloc.h, options.h): Include it.
23321 (getargs): Call create_long_option_table.
23322 (getargs): Free longopts at the end of the function.
23323 (shortopts): Move in options.c.
23324 * src/options.c (create_long_option_table): New function. Convert
23325 information from option_table to option structure.
23326 * src/reader.c (options.h): Include it.
23327
23328 * src/Makefile.am: Adjust.
23329 * src/options.c (option_table): Create from longopts and percent_table.
23330 * src/getargs.c (longopts): Delete.
23331 * src/lex.c (struct percent_table_struct): Delete.
23332 (percent_table): Delete.
23333 (options.h): Include it.
23334 * src/options.c: Create.
23335 * src/options.h: Create.
23336 Declare enum opt_access_e.
23337 Define struct option_table_struct.
23338
23339 2001-09-20 Marc Autret <autret_m@epita.fr>
23340
23341 * doc/bison.texinfo: Adjust terminologies about prologue and epilogue
23342 sections of Bison.
23343
23344 2001-09-19 Pascal Bart <pascal.bart@epita.fr>
23345
23346 * src/bison.simple: s/%%filename/%%skeleton.
23347 * src/muscle_tab.c (getargs.h): Include it.
23348 (muscle_init): Insert new muscle skeleton.
23349
23350 2001-09-18 Pascal Bart <pascal.bart@epita.fr>
23351
23352 * src/output.c (output_parser): Delete unused variable actions_dumped.
23353
23354 2001-09-07 Pascal Bart <pascal.bart@epita.fr>
23355
23356 * src/output.c (output): Delete call to reader_output_yylsp.
23357 * src/reader.c (reader): Likewise.
23358 * src/reader.h: Delete declaration of reader_output_yylsp.
23359
23360 2001-09-02 Marc Autret <autret_m@epita.fr>
23361
23362 * src/reader.c: Include muscle_tab.h.
23363 (parse_union_decl): Update.
23364 (parse_macro_decl): Rename parse_muscle_decl.
23365 Update to use renamed functions and variable.
23366 (read_declarations, copy_action, read_additionnal_code, : Updated
23367 with correct variables and functions names.
23368 (packsymbols, reader): Likewise.
23369
23370 * src/reader.h (muscle_obstack): Extern declaration update.
23371
23372 * src/output.c: Include muscle_tab.h
23373 In all functions using macro_insert, change by using muscle_insert ().
23374 (macro_obstack): Rename muscle_obstack.
23375 Echo modifications in the whole file.
23376 (MACRO_INSERT_INT): Rename MUSCLE_INSERT_INT.
23377 (MACRO_INSERT_STRING): Rename MUSCLE_INSERT_STRING.
23378 (MACRO_INSERT_PREFIX): Rename MUSCLE_INSERT_PREFIX.
23379
23380 * src/muscle_tab.h: Update double inclusion macros.
23381 (macro_entry_s): Rename muscle_entry_s.
23382 Update prototypes.
23383
23384 * src/muscle_tab.c: Include muscle_tab.h.
23385 Rename macro_tabble to muscle_table.
23386 (mhash1, mhash2, mcmp): Use muscle_entry.
23387 (macro_init): Rename muscle_init. Update.
23388 (macro_insert): Rename muscle_insert. Update.
23389 (macro_find): Rename muscle_find. Update.
23390
23391 * src/main.c: Include muscle_tab.h.
23392 (main): Call muscle_init ().
23393 * src/Makefile.am (bison_SOURCES): Echo modifications.
23394
23395 2001-09-02 Marc Autret <autret_m@epita.fr>
23396
23397 Now the files macro_tab.[ch] are named muscle_tab.[ch].
23398
23399 * src/muscle_tab.c, src/muscle_tab.h: Add files.
23400
23401 2001-09-02 Marc Autret <autret_m@epita.fr>
23402
23403 * src/macrotab.c, src/macrotab.h: Remove.
23404
23405 2001-09-01 Pascal Bart <pascal.bart@epita.fr>
23406
23407 * src/reader.c (copy_guard): Use muscle to specify the `#line'
23408 filename.
23409
23410 2001-09-01 Marc Autret <autret_m@epita.fr>
23411
23412 * tests/calc.at (exp): Now, YYERROR_VERBOSE need to be set
23413 to an explicit value to activate the feature. We do it here.
23414
23415 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
23416
23417 * src/output.c (prepare): Delete the `filename' muscule insertion.
23418 * src/reader.c (copy_action): Use `filename' muscule with `#line'.
23419 (parse_union_decl): Likewise.
23420 * src/macrotab.c (macro_init): Initialize filename by infile.
23421
23422 2001-08-31 Marc Autret <autret_m@epita.fr>
23423
23424 * src/bison.simple (YYLSP_NEEDED): New definition.
23425 * src/output.c (prepare): Add macro insertion of `locations_flag'
23426
23427 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
23428
23429 * src/output.c (prepare): Delete insertion of previous muscles,
23430 and insert the `prefix' muscles.
23431 * src/macrotab.c (macro_init): Likewise.
23432 (macro_init): Initialization prefix directive by `yy'.
23433 * src/bison.simple: Substitute all %%yylex, %%yychar, %%yylval,
23434 %%yydebug, %%yyerror, %%yynerrs and %%yyparse by yylex, yychar,
23435 yylval, yydebug, yyerror, yynerrs and yyparse.
23436 New directive `#define' to substitute yydebug, ... with option
23437 name_prefix.
23438
23439 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
23440
23441 * src/main.c (main): Standardize.
23442 * src/output.c (output_table_data, output_parser): Likewise.
23443 * src/macrotab.h, src/macrotab.c, src/bison.simple: Likewise.
23444
23445 2001-08-31 Pascal Bart <pascal.bart@epita.fr>, Marc Autret <autret_m@epita.fr>
23446
23447 * src/reader.c (read_additionnal_code): Rename %%user_code to
23448 %%epilogue.
23449 * src/output.c (output): Rename %%declarations to %%prologue.
23450 * src/bison.simple: Echo modifications.
23451
23452 2001-08-31 Marc Autret <autret_m@epita.fr>
23453
23454 * src/reader.c (readgram): CleanUp.
23455 (output_token_defines): Likewise.
23456 (packsymbols): Likewise.
23457 (reader): Likewise.
23458 * src/output.c (output): CPP-out useless code.
23459
23460 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
23461
23462 * src/reader.c (reader): Delete obsolete call to function
23463 output_trailers and output_headers.
23464 * src/output.h: Remove obsolete functions prototypes of output_headers
23465 and output_trailers.
23466
23467 2001-08-30 Pascal Bart <pascal.bart@epita.fr>
23468
23469 * src/main.c: Include macrotab.h.
23470 * src/macrotab.h (macro_entry_s): Constify fields.
23471 Adjust functions prototypes.
23472 * src/macrotab.c (macro_insert): Constify key and value.
23473 (macro_find): Constify key.
23474 (macro_insert): Include 'xalloc.h'
23475 (macro_insert): Use XMALLOC.
23476 (macro_find): Constify return value.
23477 * src/output.c (output_table_data): Rename table to table_data.
23478 (output_parser): Constify macro_key, macro_value.
23479
23480 2001-08-30 Marc Autret <autret_m@epita.fr>
23481
23482 * src/reader.c (parse_skel_decl): New.
23483 (read_declarations): Add case `tok_skel', call parse_skel_decl ().
23484 * src/lex.h (token_t): New token `tok_skel'.
23485 * src/lex.c (percent_table): Add skeleton option entry.
23486 Standardize.
23487
23488 2001-08-29 Marc Autret <autret_m@epita.fr>
23489
23490 * src/bison.simple: Add %%user_code directive at the end.
23491 * src/reader.c (read_additionnal_code): New.
23492 (reader): Use it.
23493 * src/output.c (output_program): Remove.
23494 (output): Update.
23495
23496 2001-08-28 Marc Autret <autret_m@epita.fr>
23497
23498 * src/output.c (output_actions): Clean up.
23499 (output_gram): CPP-out useless code.
23500 * src/reader.c (reader): Clean up, CPP-out useless code.
23501
23502 2001-08-28 Pascal Bart <pascal.bart@epita.fr>
23503
23504 * src/output.c (output): Copy attrs_obstack in the '%%definitions'
23505 directive.
23506 * src/bison.simple: Add `%%definitions'.
23507
23508 2001-08-28 Marc Autret <autret_m@epita.fr>
23509
23510 * config/depcomp: New file.
23511
23512 2001-08-27 Paul Eggert <eggert@twinsun.com>
23513
23514 * src/bison.simple (yyparse): Don't take the address of an
23515 item before the start of an array, as that doesn't conform to
23516 the C Standard.
23517
23518 2001-08-27 Robert Anisko <robert.anisko@epita.fr>
23519
23520 * src/output.c (output): Remove the initialization of the macro
23521 obstack. It was done too late here.
23522
23523 * src/reader.c (parse_macro_decl): Fix. Use of the macro obstack was
23524 completely wrong.
23525 (reader): Initialize the macro obstack here, since we need it to grow
23526 '%define' directives.
23527
23528 * src/reader.h: Declare the macro obstack as extern.
23529
23530 2001-08-27 Robert Anisko <robert.anisko@epita.fr>
23531
23532 * src/output.c (output_parser): Fix. Store single '%' characters in
23533 the output obstack instead of throwing them away.
23534
23535 2001-08-27 Akim Demaille <akim@epita.fr>
23536
23537 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
23538
23539 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
23540
23541 * lib/Makefile.am: Adjust.
23542
23543 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
23544
23545 * src/bison.simple: Update and add '%%' directives.
23546
23547 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
23548
23549 * src/reader.c (reader): Remove calls to 'output_headers' and
23550 'output_trailers'. Remove some C output.
23551 (readgram): Disable a piece of code that was writing a default
23552 definition for 'YYSTYPE'.
23553 (reader_output_yylsp): Remove.
23554 (packsymbols): Output token defintions to a macro.
23555 (copy_definition): Disable C output.
23556
23557 * src/reader.c (parse_macro_decl): New function used to parse macro
23558 declarations.
23559 (copy_string2): Put the body of copy_string into this new function.
23560 Add a parameter to let the caller choose whether he wants to copy the
23561 string delimiters or not.
23562 (copy_string): Be a simple call to copy_string2 with the last argument
23563 bound to true.
23564 (read_declarations): Add case for macro definition.
23565 (copy_identifier): New.
23566 (parse_macro_decl): Read macro identifiers using copy_identifier
23567 rather than lex.
23568
23569 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
23570
23571 * src/output.c (prepare): Add prefixed names.
23572 (output_parser): Output semantic actions.
23573 (output_parser): Fix bug on '%%line' directives.
23574
23575 * src/output.c (output_headers): Remove. The C code printed by this
23576 function should now be in the skeletons.
23577 (output_trailers): Remove.
23578 (output): Disable call to 'reader_output_yylsp'.
23579 (output_rule_data): Do not output tables to the table obstack.
23580
23581 * src/output.c: Remove some C dedicated output.
23582 Improve the use of macro and output obstacks.
23583 (output_defines): Remove.
23584
23585 * src/output.c (output_token_translations): Associate 'translate'
23586 table with a macro. No output to the table obstack.
23587 (output_gram): Same for 'rhs' and 'prhs'.
23588 (output_stos): Same for 'stos'.
23589 (output_rule_data): Same for 'r1' and 'r2'.
23590 (token_actions): Same for 'defact'.
23591 (goto_actions): Same for 'defgoto'.
23592 (output_base): Same for 'pact' and 'pgoto'.
23593 (output_table): Same for 'table'.
23594 (output_check): Same for 'check'.
23595
23596 * src/output.c (output_table_data): New function.
23597 (output_short_table): Remove.
23598 (output_short_or_char_table): Remove.
23599
23600 * src/output.c (output_parser): Replace most of the skeleton copy code
23601 with something new. Skeletons are now processed character by character
23602 rather than line by line, and Bison looks for '%%' macros. This is the
23603 first step in making Bison's output process (a lot) more flexible.
23604 (output_parser): Use the macro table.
23605
23606 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
23607
23608 * src/main.c (main): Initialize the macro table.
23609
23610 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
23611
23612 * src/lex.c (percent_table): Add tok_define.
23613 * src/lex.h: Add tok_define.
23614
23615 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
23616
23617 * src/macrotab.c: New file.
23618 * src/macrotab.h: New file.
23619 * src/Makefile.am: Update.
23620
23621 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
23622
23623 * lib/hash.c: New file.
23624 * lib/hash.h: New file.
23625 * lib/Makefile.am: Update.
23626
23627 2001-08-15 Akim Demaille <akim@epita.fr>
23628
23629 Version 1.28c.
23630
23631 2001-08-15 Marc Autret <autret_m@epita.fr>
23632
23633 * src/reader.c (readgram): Indent output macro YYSTYPE.
23634 (packsymbols): Likewise.
23635 (output_token_defines): Likewise.
23636 * src/files.c: Standardize.
23637 (compute_header_macro): New.
23638 (defines_obstack_save): New. Use compute_header_macro.
23639 (output_files): Update. Use defines_obstack_save.
23640
23641 2001-08-15 Akim Demaille <akim@epita.fr>
23642
23643 * doc/bison.texinfo (Table of Symbols): Document
23644 YYSTACK_USE_ALLOCA.
23645
23646 2001-08-15 Akim Demaille <akim@epita.fr>
23647
23648 * missing: Update from CVS Automake.
23649 * config/config.guess, config/config.sub, config/texinfo.tex:
23650 Update from gnu.org.
23651
23652 2001-08-15 Akim Demaille <akim@epita.fr>
23653
23654 * Makefile.maint: Sync with CVS Autoconf.
23655
23656 2001-08-14 Pascal Bart <pascal.bart@epita.fr>
23657
23658 * doc/bison.texinfo: Include GNU Free Documentation License from
23659 `fdl.texi'.
23660 * doc/fdl.texi: Add to package.
23661
23662 2001-08-14 Marc Autret <autret_m@epita.fr>
23663
23664 Turn on %{source,header}_extension features.
23665
23666 * src/lex.c (percent_table): Un-CPP out header_extension and
23667 source_extension.
23668 * src/files.c (compute_exts_from_gf): Compare pointers with NULL.
23669 (compute_exts_from_src): Remove conditions. It restores priorities
23670 between options.
23671
23672 2001-08-14 Marc Autret <autret_m@epita.fr>
23673
23674 * src/files.c (compute_base_names): Add extensions computing when
23675 `--file-prefix' used.
23676 Standardize function calls.
23677
23678 2001-08-13 Marc Autret <autret_m@epita.fr>
23679
23680 * src/bison.simple (YYSTACK_USE_ALLOCA): Changed to allow users
23681 defining it (defined but null disables alloca).
23682
23683 2001-08-13 Marc Autret <autret_m@epita.fr>
23684
23685 * src/bison.simple (_yy_memcpy): CPP reformat.
23686
23687 2001-08-13 Pascal Bart <pascal.bart@epita.fr>
23688
23689 * tests/atconfig.in (CPPFLAGS): Fix.
23690
23691 2001-08-10 Pascal Bart <pascal.bart@epita.fr>
23692
23693 * doc/bison.texinfo: Include GNU General Public License from
23694 `gpl.texi'.
23695 * doc/gpl.texi: Add to package.
23696
23697 2001-08-10 Marc Autret <autret_m@epita.fr>
23698
23699 * src/print_graph.h: Fix.
23700 * src/reader.c (read_declarations): Use parse_header_extension_decl ().
23701
23702 2001-08-10 Akim Demaille <akim@epita.fr>
23703
23704 * src/system.h: Provide default declarations for stpcpy, strndup,
23705 and strnlen.
23706
23707 2001-08-10 Robert Anisko <anisko_r@epita.fr>
23708
23709 * doc/bison.texinfo (Locations): Update @$ stuff.
23710
23711 2001-08-09 Robert Anisko <anisko_r@epita.fr>
23712
23713 * src/bison.simple (YYLLOC_DEFAULT): Update.
23714 (yyparse): Adjust.
23715
23716 2001-08-08 Marc Autret <autret_m@epita.fr>
23717
23718 * doc/bison.texinfo: Change @samp{$<@dots{}>} to
23719 @samp{$<@dots{}>@var{n}} in Section Actions in Mid-Rule.
23720 Reported by Fabrice Bauzac.
23721
23722 2001-08-08 Marc Autret <autret_m@epita.fr>
23723
23724 * src/vcg_default.h: Use NULL instead of 0 to initialize pointers.
23725 * src/vcg.c (output_node): Fix.
23726 * src/vcg.h: Cleanup.
23727 * src/print_graph.c: Add comments.
23728 (node_output_size): New global variable. Simplify the formatting of
23729 the VCG graph output.
23730 (print_actions): Unused code is now used. It notifies the final state
23731 and no action states in the VCG graph. It also give the reduce actions.
23732 The `shift and goto' edges are red and the `go to state' edges are
23733 blue.
23734 Get the current node name and node_obstack by argument.
23735 (node_obstack): New variable.
23736 (print_state): Manage node_obstack.
23737 (print_core): Use node_obstack given by argument.
23738 A node is not only computed here but in print_actions also.
23739 (print_graph): CPP out useless code instead of commenting it.
23740
23741 2001-08-07 Pascal Bart <pascal.bart@epita.fr>
23742
23743 * tests/atconfig.in (CPPFLAGS): Fix.
23744
23745 2001-08-07 Akim Demaille <akim@epita.fr>
23746
23747 * src/print_graph.c (quote): New.
23748 (print_core): Use it.
23749
23750 2001-08-06 Akim Demaille <akim@epita.fr>, Marc Autret <autret_m@epita.fr>
23751
23752 * src/vcg.c (complain.h): Include it.
23753 Unepitaize `return' invocations.
23754 [NDEBUG] (main): Remove.
23755 * src/vcg.h (node_t, edge_t, graph_t): Constify the char * members.
23756 * src/files.c (open_files): Initialize graph_obstack.
23757 * src/print_graph.c (print_actions): CPP out useless code.
23758 (print_core): Don't output the last `\n' in labels.
23759 Use `quote'.
23760 * src/files.c (output_files): Output the VCG file.
23761 * src/main.c (main): Invoke print_graph ();
23762
23763 2001-08-06 Marc Autret <autret_m@epita.fr>
23764
23765 Automaton VCG graph output.
23766 Using option ``-g'' or long option ``--graph'', you can generate
23767 a gram_filename.vcg file containing a VCG description of the LALR (1)
23768 automaton of your grammar.
23769
23770 * src/main.c: Call to print_graph() function.
23771 * src/getargs.h: Update.
23772 * src/getargs.c (options): Update to catch `-g' and `--graph' options.
23773 (graph_flag): New flag.
23774 (longopts): Update.
23775 (getargs): Add case `g'.
23776 * src/files.c (graph_obstack): New obstack struct.
23777 (open_files): Initialize new obstack.
23778 (output_files): Saves graph_obstack if required.
23779 * src/files.h (graph_obstack): New extern declaration.
23780 * src/Makefile.am: Add new source files.
23781
23782 2001-08-06 Marc Autret <autret_m@epita.fr>
23783
23784 * src/print_graph.c, src/print_graph.h (graph): New.
23785 * src/vcg.h: New file.
23786 * src/vcg.c: New file, VCG graph handling.
23787
23788 2001-08-06 Marc Autret <autret_m@epita.fr>
23789
23790 Add of %source_extension and %header_extension which specify
23791 the source or/and the header output file extension.
23792
23793 * src/files.c (compute_base_names): Remove initialisation of
23794 src_extension and header_extension.
23795 (compute_exts_from_gf): Update.
23796 (compute_exts_from_src): Update.
23797 (output_files): Update.
23798 * src/reader.c (parse_header_extension_decl): New.
23799 (parse_source_extension_decl): New.
23800 (read_declarations): New case statements for the new tokens.
23801 * src/lex.c (percent_table): Add entries for %source_extension
23802 and %header_extension.
23803 * src/lex.h (token_e): New tokens tok_hdrext and tok_srcext.
23804
23805 2001-08-06 Marc Autret <autret_m@epita.fr>
23806
23807 * configure.in: Bump to 1.28c.
23808 * doc/bison.texinfo: Texinfo thingies.
23809
23810 2001-08-04 Pascal Bart <pascal.bart@epita.fr>
23811
23812 * tests/atconfig.in (CPPFLAGS): Add.
23813 * tests/calc.at (AT_CHECK): Use CPPFLAGS.
23814
23815 2001-08-03 Akim Demaille <akim@epita.fr>
23816
23817 Version 1.28b.
23818
23819 2001-08-03 Akim Demaille <akim@epita.fr>
23820
23821 * tests/Makefile.am (check-local): Ship testsuite.
23822 * tests/calc.at (_AT_DATA_CALC_Y): Prototype all the functions.
23823 Include `string.h'.
23824
23825 2001-08-03 Akim Demaille <akim@epita.fr>
23826
23827 * configure.in: Try using -Wformat when compiling.
23828
23829 2001-08-03 Akim Demaille <akim@epita.fr>
23830
23831 * configure.in: Bump to 1.28b.
23832
23833 2001-08-03 Akim Demaille <akim@epita.fr>
23834
23835 * src/complain.c: Adjust strerror_r portability issues.
23836
23837 2001-08-03 Akim Demaille <akim@epita.fr>
23838
23839 Version 1.28a.
23840
23841 2001-08-03 Akim Demaille <akim@epita.fr>
23842
23843 * src/getargs.c, src/getarg.h (skeleton)): Constify.
23844 * src/lex.c (literalchar): Avoid name clashes on `buf'.
23845 * src/getargs.c: Include complain.h.
23846 * src/files.c, src/files.h (skeleton_find): Avoid name clashes.
23847 * lib/quotearg.c, lib/quotearg.h: Update from fileutils 4.1.
23848
23849 2001-08-03 Akim Demaille <akim@epita.fr>
23850
23851 * src/reader.c (readgram): Display hidden chars in error messages.
23852
23853 2001-08-03 Akim Demaille <akim@epita.fr>
23854
23855 Update to gettext 0.10.39.
23856
23857 2001-08-03 Akim Demaille <akim@epita.fr>
23858
23859 * lib/strspn.c: New.
23860
23861 2001-08-01 Marc Autret <autret_m@epita.fr>
23862
23863 * doc/bison.texinfo: Update.
23864 * doc/bison.1 (mandoc): Update.
23865 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove .c and .h.
23866 * src/files.c: Support output files extensions computing.
23867 (src_extension): New static variable.
23868 (header_extension): New static variable.
23869 (tr): New function.
23870 (get_extension_index): New function, gets the index of an extension
23871 filename in a string.
23872 (compute_exts_from_gf): New function, computes extensions from the
23873 grammar file extension.
23874 (compute_exts_from_src): New functions, computes extensions from the
23875 C source file extension, file given by ``-o'' option.
23876 (compute_base_names): Update.
23877 (output_files): Update.
23878
23879 2001-08-01 Robert Anisko <anisko_r@epita.fr>
23880
23881 * doc/bison.texi: Document @$.
23882 (Locations): New section.
23883
23884 2001-07-18 Akim Demaille <akim@epita.fr>
23885
23886 * Makefile.maint, GNUmakefile: New, from Autoconf 2.52.
23887 * config/prev-version.txt, config/move-if-change: New.
23888 * Makefile.am: Adjust.
23889
23890 2001-07-08 Pascal Bart <pascal.bart@epita.fr>
23891
23892 * src/bison.simple (yyparse): Suppress warning `comparaison
23893 between signed and unsigned'.
23894
23895 2001-07-05 Pascal Bart <pascal.bart@epita.fr>
23896
23897 * src/getargs.h (raw_flag): Remove.
23898 * src/getargs.c: Die on `-r'/`--raw'.
23899 * src/lex.c (parse_percent_token): Die on `%raw'.
23900 * src/reader.c (output_token_defines): Suppress call to `raw_flag'.
23901 * tests/calc.at: Suppress test with option `--raw'.
23902
23903 2001-07-14 Akim Demaille <akim@epita.fr>
23904
23905 * config/: New.
23906 * configure.in: Require Autoconf 2.50.
23907 Update to gettext 0.10.38.
23908
23909 2001-03-16 Akim Demaille <akim@epita.fr>
23910
23911 * doc/bison.texinfo: ANSIfy the examples.
23912
23913 2001-03-16 Akim Demaille <akim@epita.fr>
23914
23915 * getargs.c (skeleton): New variable.
23916 (longopts): --skeleton is a new option.
23917 (shortopts, getargs): -S is a new option.
23918 * getargs.h: Declare skeleton.
23919 * output.c (output_parser): Use it.
23920
23921 2001-03-16 Akim Demaille <akim@epita.fr>
23922
23923 * m4/strerror_r.m4: New.
23924 * m4/error.m4: Run AC_FUNC_STRERROR_R.
23925 * lib/error.h, lib/error.c: Update.
23926
23927 2001-03-16 Akim Demaille <akim@epita.fr>
23928
23929 * src/getargs.c (longopts): Clean up.
23930
23931 2001-02-21 Akim Demaille <akim@epita.fr>
23932
23933 * src/reader.c (gensym): `gensym_count' is your own.
23934 Use a static buf to create the symbol name, as token_buffer is no
23935 longer a buffer.
23936
23937 2001-02-08 Akim Demaille <akim@epita.fr>
23938
23939 * src/conflicts.c (conflict_report): Be sure not to append to res
23940 between two calls, which could happen if both first sprintf were
23941 skipped, but not the first cp += strlen.
23942
23943 2001-02-08 Akim Demaille <akim@epita.fr>
23944
23945 * lib/memchr.c, lib/stpcpy.c, lib/strndup.c, lib/strnlen.c:
23946 New, from fileutils 4.0.37.
23947 * configure.in: Require Autoconf 2.49c. I took some time before
23948 making this decision. This is the only way out for portability
23949 issues in Bison, it would mean way too much duplicate effort to
23950 import in Bison features implemented in 2.49c since 2.13.
23951 AC_REPLACE_FUNCS and AC_CHECK_DECLS the functions above.
23952
23953 2001-02-02 Akim Demaille <akim@epita.fr>
23954
23955 * lib/malloc.c, lib/realloc.c: New, from the fileutils 4.0.37.
23956 * lib/xalloc.h, lib/xmalloc.c: Update.
23957
23958 2001-01-19 Akim Demaille <akim@epita.fr>
23959
23960 Get rid of the ad hoc handling of token_buffer in the scanner: use
23961 the obstacks.
23962
23963 * src/lex.c (token_obstack): New.
23964 (init_lex): Initialize it. No longer call...
23965 (grow_token_buffer): this. Remove it.
23966 Adjust all the places which used it to use the obstack.
23967
23968 2001-01-19 Akim Demaille <akim@epita.fr>
23969
23970 * src/lex.h: Rename all the tokens:
23971 s/\bENDFILE\b/tok_eof/g;
23972 s/\bIDENTIFIER\b/tok_identifier/g;
23973 etc.
23974 Let them be enums, not #define, to ease debugging.
23975 Adjust all the code.
23976
23977 2001-01-18 Akim Demaille <akim@epita.fr>
23978
23979 * src/lex.h (MAXTOKEN, maxtoken, grow_token_buffer): Remove, private.
23980 * src/lex.c (maxtoken, grow_token_buffer): Static.
23981
23982 2001-01-18 Akim Demaille <akim@epita.fr>
23983
23984 Since we now use obstacks, more % directives can be enabled.
23985
23986 * src/lex.c (percent_table): Also accept `%yacc',
23987 `%fixed_output_files', `%defines', `%no_parser', `%verbose', and
23988 `%debug'.
23989 Handle the actions for `%semantic_parser' and `%pure_parser' here,
23990 instead of returning a token.
23991 * src/lex.h (SEMANTIC_PARSER, PURE_PARSER): Remove, unused.
23992 * src/reader.c (read_declarations): Adjust.
23993 * src/files.c (open_files): Don't call `compute_base_names', don't
23994 compute `attrsfile' since they depend upon data which might be
23995 *in* the input file now.
23996 (output_files): Do it here.
23997 * src/output.c (output_headers): Document the fact that this patch
23998 introduces a guaranteed SEGV for semantic parsers.
23999 * doc/bison.texinfo: Document them.
24000 * tests/suite.at: Exercise these %options.
24001
24002 2000-12-20 Akim Demaille <akim@epita.fr>
24003
24004 Also handle the output file (--verbose) with obstacks.
24005
24006 * files.c (foutput): Remove.
24007 (output_obstack): New.
24008 Adjust all dependencies.
24009 * src/conflicts.c: Return a string.
24010 * src/system.h (obstack_grow_string): Rename as...
24011 (obstack_sgrow): this. Be ready to work with non literals.
24012 (obstack_fgrow4): New.
24013
24014 2000-12-20 Akim Demaille <akim@epita.fr>
24015
24016 * src/files.c (open_files): Fix the computation of short_base_name
24017 in the case of `-o foo.tab.c'.
24018
24019 2000-12-20 Akim Demaille <akim@epita.fr>
24020
24021 * src/reader.c (copy_string, copy_comment, copy_comment2, copy_at)
24022 (copy_dollar): Now that everything uses obstacks, get rid of the
24023 FILE * parameters.
24024
24025 2000-12-20 Akim Demaille <akim@epita.fr>
24026
24027 * src/files.c (open_files): Actually the `.output' file is based
24028 on the short_base_name, not base_name.
24029 * tests/suite.at (Checking output file names): Adjust.
24030
24031 2000-12-20 Akim Demaille <akim@epita.fr>
24032
24033 * src/bison.s1: Remove, we now use directly...
24034 * src/bison.simple: this.
24035 * src/Makefile.am: Use pkgdata instead of data.
24036
24037 2000-12-20 Akim Demaille <akim@epita.fr>
24038
24039 * src/files.c (guard_obstack): New.
24040 (open_files): Initialize it.
24041 (output_files): Dump it...
24042 * src/files.h: Export it.
24043 * src/reader.c (copy_guard): Use it.
24044
24045 2000-12-19 Akim Demaille <akim@epita.fr>
24046
24047 * src/files.c (outfile, defsfile, actfile): Removed as global
24048 vars.
24049 (open_files): Don't compute them.
24050 (output_files): Adjust.
24051 (base_name, short_base_name): Be global.
24052 Adjust dependencies.
24053
24054 2000-12-19 Akim Demaille <akim@epita.fr>
24055
24056 * src/files.c (strsuffix): New.
24057 (stringappend): Be just like strcat but allocate.
24058 (base_names): Eve out from open_files.
24059 Try to simplify the rather hairy computation of base_name and
24060 short_base_name.
24061 (open_files): Use it.
24062 * tests/suite.at (Checking output file names): New test.
24063
24064 2000-12-19 Akim Demaille <akim@epita.fr>
24065
24066 * src/system.h (obstack_grow_literal_string): Rename as...
24067 (obstack_grow_string): this.
24068 * src/output.c (output_parser): Recognize `%% actions' instead of
24069 `$'.
24070 * src/bison.s1: s/$/%% actions/.
24071 * src/bison.hairy: Likewise.
24072
24073 2000-12-19 Akim Demaille <akim@epita.fr>
24074
24075 * src/output.c (output_parser): Compute the `#line' lines when
24076 there are.
24077 * src/Makefile.am (bison.simple): Be a simple copy of bison.s1.
24078 Suggested by Hans Aberg.
24079
24080 2000-12-19 Akim Demaille <akim@epita.fr>
24081
24082 Let the handling of the skeleton files be local to the procedures
24083 that use it.
24084
24085 * src/files.c (xfopen, xfclose, skeleton_find, guardfile): No
24086 longer static.
24087 (fparser, open_extra_files): Remove.
24088 (open_files, output_files): Don't take care of fparser.
24089 * src/files.h: Adjust.
24090 * src/output.c (output_parser): Open and close the file to the
24091 skeleton.
24092 * src/reader.c (read_declarations): When %semantic_parser, open
24093 fguard.
24094
24095 2000-12-19 Akim Demaille <akim@epita.fr>
24096
24097 * src/file.h (BISON_SIMPLE, BISON_HAIRY): Move from here...
24098 * src/system.h (BISON_SIMPLE, BISON_HAIRY): ... to here.
24099
24100 2000-12-19 Akim Demaille <akim@epita.fr>
24101
24102 * src/files.c (open_files): Yipee! We no longer need all the code
24103 looking for `/tmp' since we have no tmp file.
24104
24105 2000-12-19 Akim Demaille <akim@epita.fr>
24106
24107 * src/system.h (EXT_TAB, EXT_OUTPUT, EXT_STYPE_H, EXT_GUARD_C):
24108 New macros.
24109 * src/files.c (open_files): Less dependency on MSDOS etc.
24110
24111 2000-12-14 Akim Demaille <akim@epita.fr>
24112
24113 * src/bison.s1 (YYLLOC_DEFAULT): New macro.
24114 Provide a default definition.
24115 Use it when executing the default @ action.
24116 * src/reader.c (reader_output_yylsp): No longer include
24117 `timestamp' and `text' in the default YYLTYPE.
24118
24119 2000-12-12 Akim Demaille <akim@epita.fr>
24120
24121 * src/reader.c (copy_definition, parse_union_decl, copy_action)
24122 (copy_guard): Quote the file names.
24123 Reported by Laurent Mascherpa.
24124
24125 2000-12-12 Akim Demaille <akim@epita.fr>
24126
24127 * src/output.c (output_headers, output_program, output): Be sure
24128 to escape special characters when outputting filenames.
24129 (ACTSTR_PROLOGUE, ACTSTR_EPILOGUE): Remove.
24130 (output_headers): Don't depend on them, Use ACTSTR.
24131
24132 2000-11-17 Akim Demaille <akim@epita.fr>
24133
24134 * lib/obstack.h: Formatting changes.
24135 (obstack_grow, obstack_grow0): Don't cast WHERE at all: it
24136 prevents type checking.
24137 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
24138 cast the value to (void *): assigning a `foo *' to a `void *'
24139 variable is valid.
24140 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
24141 * src/reader.c (parse_union_decl): Typo: use obstack_1grow to
24142 append characters.
24143
24144 2000-11-17 Akim Demaille <akim@epita.fr>
24145
24146 * tests/Makefile.am (suite.m4, regression.m4, calc.m4): Rename
24147 as...
24148 (suite.m4, regression.m4, calc.m4): these.
24149 * tests/atgeneral.m4: Update from CVS Autoconf.
24150
24151 2000-11-17 Akim Demaille <akim@epita.fr>
24152
24153 * tests/regression.m4 (%union and --defines): New test,
24154 demonstrating a current bug in the obstack implementation.
24155
24156 2000-11-17 Akim Demaille <akim@epita.fr>
24157
24158 * src/bison.s1 (_YY_DECL_VARIABLES, YY_DECL_VARIABLES): New
24159 macros.
24160 Use them to declare the variables which are global or local to
24161 `yyparse'.
24162
24163 2000-11-17 Akim Demaille <akim@epita.fr>
24164
24165 * acconfig.h: Remove, no longer used.
24166
24167 2000-11-07 Akim Demaille <akim@epita.fr>
24168
24169 * src: s/Copyright (C)/Copyright/g.
24170
24171 2000-11-07 Akim Demaille <akim@epita.fr>
24172
24173 * src/reader.c (reader): #define YYLSP_NEEDED to 1 instead of just
24174 defining.
24175 * src/bison.s1: s/#ifdef YYLSP_NEEDED/#if YYLSP_NEEDED/.
24176
24177 2000-11-07 Akim Demaille <akim@epita.fr>
24178
24179 * src/bison.s1 (YYLEX): Use #if instead of #ifdef.
24180 Merge in a single CPP if/else.
24181
24182 2000-11-07 Akim Demaille <akim@epita.fr>
24183
24184 * src/output.c (output): Remove useless variables.
24185 * lib/obstack.c (obstack_grow, obstack_grow0): Rename the second
24186 argument `data' for consistency with the prototypes.
24187 Qualify it `const'.
24188 (obstack_copy, obstack_copy0): Rename the second argument as
24189 `address' for consistency. Qualify it `const'.
24190 * lib/obstack.h (obstack_copy, obstack_copy0, obstack_grow)
24191 (obstack_grow0, obstack_ptr_grow, obstack_ptr_grow_fast): Qualify
24192 `const' their input argument (`data' or `address').
24193 Adjust the corresponding macros to include `const' in casts.
24194
24195 2000-11-03 Akim Demaille <akim@epita.fr>
24196
24197 * src/Makefile.am (INCLUDES): s/PFILE/BISON_SIMPLE/.
24198 s/PFILE1/BISON_HAIRY/.
24199 Adjust dependencies.
24200
24201 2000-11-03 Akim Demaille <akim@epita.fr>
24202
24203 For some reason, this was not applied.
24204
24205 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
24206 `unlink': it's no longer used.
24207
24208 2000-11-03 Akim Demaille <akim@epita.fr>
24209
24210 * src/files.c (skeleton_find): New function, eved out of...
24211 (open_files, open_extra_files): here.
24212
24213 2000-11-03 Akim Demaille <akim@epita.fr>
24214
24215 Don't use `atexit'.
24216
24217 * src/files.c (obstack_save): New function.
24218 (done): Rename as...
24219 (output_files): this.
24220 Use `obstack_save'.
24221 * src/main.c (main): Don't use `atexit' to register `done', since
24222 it no longer has to remove tmp files, just call `output_files'
24223 when there are no errors.
24224
24225 2000-11-02 Akim Demaille <akim@epita.fr>
24226
24227 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
24228 `unlink': it's no longer used.
24229 * src/files.h: Formatting changes.
24230
24231 2000-11-02 Akim Demaille <akim@epita.fr>
24232
24233 Remove the last uses of mktemp and unlink/delete.
24234
24235 * src/files.c (fdefines, ftable): Removed.
24236 (defines_ostack, table_obstack): New.
24237 Adjust dependencies of the former into uses of the latter.
24238 * src/output.c (output_short_or_char_table, output_short_table):
24239 Convert to using obstacks.
24240 * src/reader.c (copy_comment2): Accept one FILE * and two
24241 obstacks.
24242 (output_token_defines, reader_output_yylsp): Use obstacks.
24243 * src/system.h (obstack_fgrow3): New.
24244 * po/POTFILES.in: Adjust.
24245
24246 2000-11-01 Akim Demaille <akim@epita.fr>
24247
24248 Change each use of `fattrs' into a use of `attrs_obstack'.
24249
24250 * src/reader.c (copy_at): Typo: s/yylloc/yyloc/.
24251 * src/files.c (fattrs): Remove.
24252 (attrs_obstack): New.
24253 Adjust all dependencies.
24254 (done): If SEMANTIC_PARSER, dump attrs_obstack into attrsfile.
24255
24256 2000-11-01 Akim Demaille <akim@epita.fr>
24257
24258 Introduce obstacks.
24259 Change each use of `faction' into a use of `action_obstack'.
24260
24261 * lib/obstack.h, lib/obstack.c: New files.
24262 * src/files.c (faction): Remove.
24263 (action_obstack): New.
24264 Adjust all dependencies.
24265
24266 2000-10-20 Akim Demaille <akim@epita.fr>
24267
24268 * lib/quote.h (PARAMS): New macro. Use it.
24269
24270 2000-10-16 Akim Demaille <akim@epita.fr>
24271
24272 * src/output.c (output_short_or_char_table): New function.
24273 (output_short_table, output_token_translations): Use it.
24274 (goto_actions): Use output_short_table.
24275
24276 2000-10-16 Akim Demaille <akim@epita.fr>
24277
24278 * src/symtab.c (bucket_new): New function.
24279 (getsym): Use it.
24280
24281 * src/output.c (output_short_table): New argument to display the
24282 comment associated with the table.
24283 Adjust dependencies.
24284 (output_gram): Use it.
24285 (output_rule_data): Nicer output layout for YYTNAME.
24286
24287 2000-10-16 Akim Demaille <akim@epita.fr>
24288
24289 * src/lex.c (read_typename): New function.
24290 (lex): Use it.
24291 * src/reader.c (copy_dollar): Likewise.
24292
24293 2000-10-16 Akim Demaille <akim@epita.fr>
24294
24295 * src/reader.c (copy_comment2): Expect the input stream to be on
24296 the `/' which is suspected to open a comment, instead of being
24297 called after `//' or `/*' was read.
24298 (copy_comment, copy_definition, parse_union_decl, copy_action)
24299 (copy_guard): Adjust.
24300
24301 2000-10-16 Akim Demaille <akim@epita.fr>
24302
24303 * src/reader.c (parse_expect_decl): Use `skip_white_space' and
24304 `read_signed_integer'.
24305
24306 2000-10-16 Akim Demaille <akim@epita.fr>
24307
24308 * src/reader.c (copy_dollar): New function.
24309 (copy_guard, copy_action): Use it.
24310
24311 2000-10-16 Akim Demaille <akim@epita.fr>
24312
24313 * lib/quote.h, lib/quote.c, lib/quotearg.h, lib/quotearg.c:
24314 * m4/prereq.m4, m4/c-bs-a.m4, m4/mbstate.m4:
24315 New files, from Fileutils 4.0.27.
24316 * src/main.c (printable_version): Remove.
24317 * src/lex.c, src/reader.c: Use `quote'.
24318
24319 2000-10-04 Akim Demaille <akim@epita.fr>
24320
24321 * lib/error.c, lib/error.h: New files, needed by xmalloc.c.
24322
24323 2000-10-04 Akim Demaille <akim@epita.fr>
24324
24325 * doc/bison.texinfo: Various typos spotted by Neil Booth.
24326
24327 2000-10-04 Akim Demaille <akim@epita.fr>
24328
24329 When a literal string is used to define two different tokens,
24330 `bison -v' segfaults.
24331 Reported by Piotr Gackiewicz, and fixed by Neil Booth.
24332
24333 * tests/regression.m4: New file.
24334 Include the core of the sample provided by Piotr Gackiewicz.
24335 * src/reader.c (parse_token_decl): Diagnose bad cases, and proceed
24336 properly.
24337
24338 2000-10-04 Akim Demaille <akim@epita.fr>
24339
24340 * src/reader.c (parse_expect_decl): Keep `count' within the size
24341 of `buffer'.
24342 From Neil Booth.
24343
24344 2000-10-02 Paul Eggert <eggert@twinsun.com>
24345
24346 * bison.s1 (yyparse): Assign the default value
24347 unconditionally, to avoid a GCC warning and make the parser a
24348 tad smaller.
24349
24350 2000-10-02 Akim Demaille <akim@epita.fr>
24351
24352 * src/getargs.c (getargs): Don't dump `--help' on unrecognized
24353 options.
24354
24355 2000-10-02 Akim Demaille <akim@epita.fr>
24356
24357 * src/derives.c, src/print.c, src/reduce.c: To ease the
24358 translation, move some `\n' out of the translated strings.
24359
24360 2000-10-02 Akim Demaille <akim@epita.fr>
24361
24362 The location tracking mechanism is precious for parse error
24363 messages. Nevertheless, it is enabled only when `@n' is used in
24364 the grammar, which is a different issue (you can use it in error
24365 message, but not in the grammar per se). Therefore, there should
24366 be another means to enable it.
24367
24368 * src/getargs.c (getargs): Support `--locations'.
24369 (usage): Report it.
24370 * src/getargs.h (locationsflag): Export it.
24371 * src/lex.c (percent_table): Support `%locations'.
24372 * src/reader.c (yylsp_needed): Remove this variable, now replaced
24373 with `locationsflag'.
24374 * doc/bison.texinfo: Document `--locations' and `%locations'.
24375 Sort the options.
24376 * tests/calc.m4: Test it.
24377
24378 For regularity of the names, replace each
24379 (nolineflag, toknumflag, rawtokenumflag, noparserflag): with...
24380 (no_lineflag, token_tableflag, rawflag, no_parserflag): this.
24381 In addition replace each `flag' with `_flag'.
24382
24383 2000-10-02 Akim Demaille <akim@epita.fr>
24384
24385 Also test parse error messages, including with YYERROR_VERBOSE.
24386
24387 * tests/calc.m4 (calc.y): Add support for `exp = exp' (non
24388 associative).
24389 Use it to check the computations.
24390 Use it to check `nonassoc' is honored.
24391 (AT_DATA_CALC_Y): Equip `calc.y' with YYERROR_VERBOSE when passed
24392 `--yyerror-verbose'.
24393 (_AT_CHECK_CALC): Adjust to this option.
24394 (_AT_CHECK_CALC_ERROR): New macro to check parse error messages.
24395
24396 2000-10-02 Akim Demaille <akim@epita.fr>
24397
24398 Test also `--verbose', `--defines' and `--name-prefix'. Testing
24399 the latter demonstrates a flaw in the handling of non debugging
24400 parsers introduced by myself on 2000-03-16: `#define yydebug 0'
24401 was used in order to simplify:
24402
24403 #if YYDEBUG
24404 if (yydebug)
24405 {
24406 ...
24407 }
24408 #endif
24409
24410 into
24411
24412 if (yydebug)
24413 {
24414 ...
24415 }
24416
24417 unfortunately this leads to a CPP conflict when
24418 `--name-prefix=foo' is used since it produces `#define yydebug
24419 foodebug'.
24420
24421 * src/bison.s1 [!YYDEBUG]: Do not define yydebug.
24422 (YYDPRINTF): New macro.
24423 Spread its use.
24424 * tests/calc.m4 (AT_CHECK_CALC): Do require a title, build it from
24425 the bison options.
24426 Also test `--verbose', `--defines' and `--name-prefix'.
24427
24428 2000-10-02 Akim Demaille <akim@epita.fr>
24429
24430 Improve the readability of the produced parsers.
24431
24432 * src/bison.s1: Formatting changes.
24433 Improve the comment related to the `$' mark.
24434 (yydefault): Don't fall through to `yyresume': `goto' there.
24435 * src/output.c (output_parser): When the `$' is met, skip the end
24436 of its line.
24437 New variable, `number_of_dollar_signs', to check there's exactly
24438 one `$' in the parser skeleton.
24439
24440 2000-10-02 Akim Demaille <akim@epita.fr>
24441
24442 * lib/xstrdup.c: New file, from the fileutils.
24443 * src/reader.c (parse_token_decl, get_type_name, parse_type_decl)
24444 (parse_assoc_decl, parse_thong_decl, get_type): Use `xstrdup'
24445 instead of strlen + xmalloc + strcpy.
24446 * src/symtab.c (copys): Remove, use xstrdup instead.
24447
24448 2000-10-02 Akim Demaille <akim@epita.fr>
24449
24450 * src/gram.h (associativity): New enum type which replaces the
24451 former CPP macros `RIGHT_ASSOC', `LEFT_ASSOC' and `NON_ASSOC' with
24452 `right_assoc', `left_assoc' and `non_assoc'.
24453 Adjust all dependencies.
24454 * src/reader.c: Formatting changes.
24455 (LTYPESTR): Don't define it, use it as a literal in
24456 `reader_output_yylsp'.
24457 * src/symtab.h (symbol_class): New enum type which replaces the
24458 former CPP macros `SUNKNOWN', `STOKEN and `SNTERM' with
24459 `sunknown', `stoken and `snterm'.
24460
24461 2000-10-02 Akim Demaille <akim@epita.fr>
24462
24463 * src/getargs.c (fixed_outfiles): Rename as...
24464 (yaccflag): for consistency and accuracy.
24465 Adjust dependencies.
24466
24467 2000-10-02 Akim Demaille <akim@epita.fr>
24468
24469 Use the more standard files `xalloc.h' and `xmalloc.c' instead of
24470 Bison's `allocate.c' and `alloc.h'. This patch was surprisingly
24471 difficult and introduced a lot of core dump. It turns out that
24472 Bison used an implementation of `xmalloc' based on `calloc', and
24473 at various places it does depend upon the initialization to 0. I
24474 have not tried to isolate the pertinent places, and all the former
24475 calls to Bison's `xmalloc' are now using `XCALLOC'. Someday,
24476 someone should address this issue.
24477
24478 * src/allocate.c, src/alloc.h, m4/bison-decl.m4: Remove.
24479 * lib/xmalloc.c, lib/xalloc.h, m4/malloc.m4, m4/realloc.m4: New
24480 files.
24481 Adjust dependencies.
24482 * src/warshall.h: New file.
24483 Propagate.
24484
24485 2000-10-02 Akim Demaille <akim@epita.fr>
24486
24487 Various anti-`extern in *.c' changes.
24488
24489 * src/system.h: Include `assert.h'.
24490
24491 2000-10-02 Akim Demaille <akim@epita.fr>
24492
24493 * src/state.h (nstates, final_state, first_state, first_shift)
24494 (first_reduction): Move their exportation from here...
24495 * src/LR0.h: to here.
24496 Adjust dependencies.
24497 * src/getargs.c (statisticsflag): New variable.
24498 Add support for `--statistics'.
24499 Adjust dependencies.
24500
24501 Remove a lot of now useless `extern' statements in most files.
24502
24503 2000-10-02 Akim Demaille <akim@epita.fr>
24504
24505 * src/LR0.h: New file.
24506 Propagate its use.
24507
24508 2000-10-02 Akim Demaille <akim@epita.fr>
24509
24510 * src/print.h: New file.
24511 Propagate its use.
24512 * src/print.c: Formatting and ordering changes.
24513 (verbose, terse): Replace with...
24514 (print_results): this new function.
24515 Adjust dependencies.
24516
24517 2000-10-02 Akim Demaille <akim@epita.fr>
24518
24519 * src/conflicts.c (conflict_report): New function.
24520 (conflict_log, verbose_conflict_log): Replace with...
24521 (print_conflicts): this function.
24522 Adjust dependencies.
24523 * src/conflicts.h: New file.
24524 Propagate its inclusion.
24525
24526 2000-10-02 Akim Demaille <akim@epita.fr>
24527
24528 * src/nullable.h: New file.
24529 Propagate its inclusion.
24530 * src/nullable.c: Formatting changes.
24531
24532 2000-10-02 Akim Demaille <akim@epita.fr>
24533
24534 * src/reduce.h: New file.
24535 Propagate its inclusion.
24536 * src/reduce.c: Topological sort and other formatting changes.
24537 (bool, TRUE, FALSE): Move their definition to...
24538 * src/system.h: here.
24539
24540 2000-10-02 Akim Demaille <akim@epita.fr>
24541
24542 * src/files.c: Formatting changes.
24543 (tryopen, tryclose, openfiles): Rename as...
24544 (xfopen, xfclose, open_files): this.
24545 (stringappend): static.
24546 * src/files.h: Complete the list of exported symbols.
24547 Propagate its use.
24548
24549 2000-10-02 Akim Demaille <akim@epita.fr>
24550
24551 * src/reader.h: New file.
24552 Propagate its use instead of tedious list of `extern' and
24553 prototypes.
24554 * src/reader.c: Formatting changes, topological sort,
24555 s/register//.
24556
24557 2000-10-02 Akim Demaille <akim@epita.fr>
24558
24559 * src/lex.h: Prototype `lex.c' exported functions.
24560 * src/reader.c: Adjust.
24561 * src/lex.c: Formatting changes.
24562 (safegetc): Rename as...
24563 (xgetc): this.
24564
24565 2000-10-02 Akim Demaille <akim@epita.fr>
24566
24567 * src/lalr.h: New file.
24568 Propagate its inclusion instead of prototypes and `extern'.
24569 * src/lalr.c: Formatting changes, topological sorting etc.
24570
24571 2000-10-02 Akim Demaille <akim@epita.fr>
24572
24573 * src/output.c (token_actions): Introduce a temporary array,
24574 YYDEFACT, that makes it possible for this function to use
24575 output_short_table.
24576
24577 2000-10-02 Akim Demaille <akim@epita.fr>
24578
24579 `user_toknums' is output as a `short[]' in `output.c', while it is
24580 defined as a `int[]' in `reader.c'. For consistency with the
24581 other output tables, `user_toknums' is now defined as a table of
24582 shorts.
24583
24584 * src/reader.c (user_toknums): Be a short table instead of an int
24585 table.
24586 Adjust dependencies.
24587
24588 Factor the short table outputs.
24589
24590 * src/output.c (output_short_table): New function.
24591 * src/output.c (output_gram, output_stos, output_rule_data)
24592 (output_base, output_table, output_check): Use it.
24593
24594 2000-10-02 Akim Demaille <akim@epita.fr>
24595
24596 * src/output.c (output): Topological sort of the functions, in
24597 order to get rid of the `static' prototypes.
24598 No longer use `register'.
24599 * src/output.h: New file.
24600 Propagate its inclusion in files explicitly prototyping functions
24601 from output.c.
24602
24603 2000-09-21 Akim Demaille <akim@epita.fr>
24604
24605 * src/atgeneral.m4: Update from Autoconf.
24606
24607 2000-09-21 Akim Demaille <akim@epita.fr>
24608
24609 * src/closure.h: New file.
24610 * src/closure.c: Formatting changes, topological sort over the
24611 functions, use of closure.h.
24612 (initialize_closure, finalize_closure): Rename as...
24613 (new_closure, free_closure): these. Adjust dependencies.
24614 * src/LR0.c: Formatting changes, topological sort, use of
24615 cloture.h.
24616 (initialize_states): Rename as...
24617 (new_states): this.
24618 * src/Makefile.am (noinst_HEADERS): Adjust.
24619
24620 2000-09-20 Akim Demaille <akim@epita.fr>
24621
24622 * src/acconfig.h: Don't protect config.h against multiple
24623 inclusion.
24624 Don't define PARAMS.
24625 * src/system.h: Define PARAMS.
24626 Remove some of the ad-hoc CPP magic for DOS, VMS etc.: this is the
24627 purpose of config.h. system.h must not try to fix wrong
24628 definitions in config.h.
24629
24630 2000-09-20 Akim Demaille <akim@epita.fr>
24631
24632 * src/derives.h: New file.
24633 * src/main.c, src/derives.h: Use it.
24634 Formatting changes.
24635 * src/Makefile.am (noinst_HEADERS): Adjust.
24636
24637 2000-09-20 Akim Demaille <akim@epita.fr>
24638
24639 * tests/atgeneral.m4: Update from Autoconf.
24640 * tests/calc.m4 (_AT_DATA_CALC_Y, AT_DATA_CALC_Y, _AT_CHECK_CALC)
24641 (AT_CHECK_CALC): New macros.
24642 Use these macros to test bison with options `', `--raw',
24643 `--debug', `--yacc', `--yacc --debug'.
24644
24645 2000-09-19 Akim Demaille <akim@epita.fr>
24646
24647 * src/output.c: Formatting changes.
24648 * src/machine.h: Remove, leaving its contents in...
24649 * src/system.h: here.
24650 Include stdio.h.
24651 Adjust all dependencies on stdio.h and machine.h.
24652 * src/getargs.h: New file.
24653 Let all `extern' declarations about getargs.c be replaced with
24654 inclusion of `getargs.h'.
24655 * src/Makefile.am (noinst_HEADERS): Adjust.
24656
24657 * tests/calc.m4 (yyin): Be initialized in main, not on the global
24658 scope.
24659 (yyerror): Returns void, not int.
24660 * doc/bison.texinfo: Formatting changes.
24661
24662 2000-09-19 Akim Demaille <akim@epita.fr>
24663
24664 * tests/calc.m4 (calc.y): Do not assign to stdin, as it's not
24665 portable.
24666
24667 2000-09-18 Akim Demaille <akim@epita.fr>
24668
24669 * configure.in: Append WARNING_CFLAGS to CFLAGS.
24670 * src/Makefile.am (INCLUDES): Don't.
24671 Be ready to fetch headers in lib/.
24672
24673 2000-09-18 Akim Demaille <akim@epita.fr>
24674
24675 * doc/bison.texinfo: Update the copyright.
24676 ANSIfy and GNUify the examples.
24677 Remove the old menu.
24678
24679 2000-09-18 Akim Demaille <akim@epita.fr>
24680
24681 First set of tests: use the `calc' example from the documentation.
24682
24683 * src/bison.s1 (yyparse): Condition the code using `yytname' which
24684 is defined only when YYDEBUG is.
24685 * m4/atconfig.m4 (AT_CONFIG): Adjust to Autoconf 2.13.
24686 * src/files.c (tryopen, tryclose): Formatting changes.
24687 Move to the top and be static.
24688 * src/reader.c (read_signed_integer): Likewise.
24689 * tests/calc.m4: New file.
24690 * Makefile.am, suite.m4: Adjust.
24691 * m4/atconfig.m4: Set BISON_SIMPLE and BISON_HAIRY.
24692
24693 2000-09-18 Akim Demaille <akim@epita.fr>
24694
24695 Add support for an Autotest test suite for Bison.
24696
24697 * m4/m4.m4, m4/atconfig.m4: New files.
24698 * m4/Makefile.am (EXTRA_DIST): Adjust.
24699 * tests/suite.m4, tests/Makefile.am, tests/atgeneral.m4: New
24700 files.
24701 * src/getargs.c: Display a more standard --version message.
24702 * src/reader.c (reader): Formatting changes.
24703 No longer depend upon VERSION_STRING.
24704 * configure.in: No longer use `dnl'.
24705 Set up the test suite and the new directory `tests/.
24706 (VERSION_STRING): Remove.
24707
24708 2000-04-14 Akim Demaille <akim@epita.fr>
24709
24710 * src/reader.c (copy_comment2): New function, same as former
24711 `copy_comment', but outputs into two FILE *.
24712 (copy_comment): Use it.
24713 (parse_union_decl): Use it.
24714 (get_type, parse_start_decl): Use the same `invalid' message.
24715 (parse_start_decl, parse_union_decl): Use the same `multiple'
24716 message.
24717 (parse_union_decl, copy_guard, copy_action): Use the same
24718 `unmatched' message.
24719 * m4/Makefile.am (EXTRA_DIST): Add `warning.m4'.
24720
24721 2000-03-31 Akim Demaille <akim@epita.fr>
24722
24723 * src/files.c (tryopen, tryclose): Move to the top.
24724 Be static.
24725
24726 2000-03-31 Akim Demaille <akim@epita.fr>
24727
24728 * src/main.c (main): Don't call `done', exit does it.
24729
24730 2000-03-31 Akim Demaille <akim@epita.fr>
24731
24732 * allocate.c: s/return (foo)/return foo/.
24733 * lalr.c: Likewise.
24734 * LR0.c: Likewise.
24735 * output.c: Likewise.
24736 * reader.c: Likewise.
24737 * symtab.c: Likewise.
24738 * vmsgetargs.c: Likewise.
24739
24740 2000-03-31 Akim Demaille <akim@epita.fr>
24741
24742 Clean up the error reporting functions.
24743
24744 * src/report.c: New file.
24745 * src/report.h: Likewise.
24746 * src/Makefile.am: Adjust.
24747 * m4/error.m4: New file.
24748 * m4/Makefile.am: Adjust.
24749 * configure.in (jm_PREREQ_ERROR): Call it.
24750 * src/main.c (int_to_string, banner, fatal_banner, warn_banner):
24751 Remove.
24752 (fatal, fatals): Remove. All callers use complain.c::fatal.
24753 (warn, warni, warns, warnss, warnss): Remove. All callers use
24754 complain.c::complain.
24755 (toomany): Remove, use fatal instead.
24756 * src/files.c (done): No argument, use complain_message_count.
24757 * src/main.c (main): Register `done' to `atexit'.
24758
24759 * src/getargs.c (usage): More `fputs', less `fprintf'.
24760
24761 2000-03-28 Akim Demaille <akim@epita.fr>
24762
24763 * lib/: New directory.
24764 * Makefile.am (SUBDIRS): Adjust.
24765 * configure.in: Adjust.
24766 (LIBOBJS): Although not used yet, AC_SUBST it, otherwise it's
24767 useless.
24768 * src/alloca.c: Moved to lib/.
24769 * src/getopt.c: Likewise.
24770 * src/getopt1.c: Likewise.
24771 * src/getopt.h: Likewise.
24772 * src/ansi2knr.c: Likewise.
24773 * src/ansi2knr.1: Likewise.
24774 * src/Makefile.am: Adjust.
24775 * lib/Makefile.am: New file.
24776
24777 2000-03-28 Akim Demaille <akim@epita.fr>
24778
24779 * src/getargs.c (usage): Refresh the help message.
24780
24781 2000-03-17 Akim Demaille <akim@epita.fr>
24782
24783 * src/getopt1.c: Updated from textutils 2.0e
24784 * src/getopt.c: Likewise.
24785 * src/getopt.h: Likewise.
24786
24787 2000-03-17 Akim Demaille <akim@epita.fr>
24788
24789 * src/Makefile.am (bison.simple): Fix the awk program: quote only
24790 the file name, not the whole `#line LINE FILE'.
24791
24792 2000-03-17 Akim Demaille <akim@epita.fr>
24793
24794 On syntax errors, report the token on which we choked.
24795
24796 * src/bison.s1 (yyparse): In the label yyerrlab, when
24797 YYERROR_VERBOSE, add yychar in msg.
24798
24799 2000-03-17 Akim Demaille <akim@epita.fr>
24800
24801 * src/reader.c (copy_at): New function.
24802 (copy_guard): Use it.
24803 (copy_action): Use it.
24804
24805 2000-03-17 Akim Demaille <akim@epita.fr>
24806
24807 Be kind to translators, save some useless translations.
24808
24809 * src/main.c (banner): New function.
24810 (fatal_banner): Use it.
24811 (warn_banner): Use it.
24812
24813 2000-03-17 Akim Demaille <akim@epita.fr>
24814
24815 * src/reader.c (copy_definition): Use copy_string and
24816 copy_comment. Removed now unused `match', `ended',
24817 `cplus_comment'.
24818 (copy_comment, copy_string): Moved, to be visible from
24819 copy_definition.
24820
24821 2000-03-17 Akim Demaille <akim@epita.fr>
24822
24823 * src/reader.c (copy_string): Declare `static inline'. No
24824 problems with inline, since it is checked by configure.
24825 (copy_comment): Likewise.
24826
24827 2000-03-17 Akim Demaille <akim@epita.fr>
24828
24829 * src/reader.c (packsymbols): Formatting changes.
24830
24831 2000-03-17 Akim Demaille <akim@epita.fr>
24832
24833 * src/reader.c (copy_comment): New function, factored out from:
24834 (copy_action): Use it. Removed now unused `match', `ended',
24835 `cplus_comment'.
24836 (copy_guard): Likewise.
24837
24838 2000-03-17 Akim Demaille <akim@epita.fr>
24839
24840 * src/reader.c (copy_string): New function, factored out from:
24841 (copy_action): Use it.
24842 (copy_guard): Likewise.
24843
24844 2000-03-17 Akim Demaille <akim@epita.fr>
24845
24846 Change the handling of @s so that they behave exactly like $s.
24847 There is now a pseudo variable @$ (readble and writable), location
24848 of the lhs of the rule (by default ranging from the location of
24849 the first symbol of the rhs, to the location of the last symbol,
24850 or, if the rhs is empty, YYLLOC).
24851
24852 * src/bison.s1 [YYLSP_NEEDED] (yyloc): New variable, twin of
24853 yyval.
24854 (yyparse): When providing a default semantic action, provide a
24855 default location action.
24856 (after the $): No longer change `*YYLSP', just stack YYLOC the
24857 same way you stack YYVAL.
24858 * src/reader.c (read_declarations): Use warns.
24859 (copy_guard, case '@'): Also recognize `@$', expanded as `YYLOC'.
24860 (copy_action, case '@'): Likewise.
24861 Use a standard error message, to save useless work from
24862 translators.
24863
24864 2000-03-17 Akim Demaille <akim@epita.fr>
24865
24866 * src/bison.s1: Formatting and cosmetics changes.
24867 * src/reader.c: Likewise.
24868 Update the Copyright notice.
24869
24870 2000-03-17 Akim Demaille <akim@epita.fr>
24871
24872 * src/bison.s1 (#line): All set to `#line' only, since the
24873 Makefile now handles them.
24874
24875 2000-03-16 Akim Demaille <akim@epita.fr>
24876
24877 * src/output.c (output_rule_data): Output the documentation of
24878 some of the tables.
24879 (Copyright notice): Update.
24880 Formatting changes.
24881
24882 2000-03-16 Akim Demaille <akim@epita.fr>
24883
24884 * src/bison.s1 [!YYDEBUG]: Define yydebug to 0. This allows to
24885 remove most `#if YYDEBUG != 0', since `if (yydebug)' is enough.
24886 One `#if YYDEBUG' remains, since it uses variables which are
24887 defined only if `YYDEBUG != 0'.
24888
24889 2000-03-16 Akim Demaille <akim@epita.fr>
24890
24891 * src/bison.s1 (yyparse): Reorganize the definitions of the stacks
24892 and related variables so that the similarities are highlighted.
24893
24894 2000-03-16 Akim Demaille <akim@epita.fr>
24895
24896 * src/bison.s1: Properly indent CPP directives.
24897
24898 2000-03-16 Akim Demaille <akim@epita.fr>
24899
24900 * src/bison.s1: Properly indent the `alloca' CPP section.
24901
24902 2000-03-16 Akim Demaille <akim@epita.fr>
24903
24904 Do not hard code values of directories in `configure.in'.
24905 Update the `configure' tool chain.
24906
24907 * configure.in (XPFILE, XPFILE1, LOCALEDIR): Remove, handled by
24908 src/makefile.am.
24909 (VERSION_STRING): Use the third arg of AC_DEFINE_UNQUOTED.
24910 (AC_OUTPUT): Add m4/Makefile.
24911 Bump to bison 1.28a, 1.29 has never been released.
24912 * acconfig.h (XPFILE, XPFILE1, LOCALEDIR): Remove, since they are
24913 handled via src/Makefile.am.
24914 (VERSION_STRING, PROTOTYPES, ENABLE_NLS, HAVE_CATGETS,
24915 HAVE_GETTEXT, HAVE_LC_MESSAGES, HAVE_STPCPY): Remove, handled by
24916 autoheader.
24917 * Makefile.am (SUBDIRS): Add m4.
24918 (ACLOCAL_AM_FLAGS): New variable.
24919 (AUTOMAKE_OPTIONS): Add check-news.
24920 * src/Makefile.am (bison.simple): Use awk to replace #line lines with
24921 the proper line number and file name.
24922 (DEFS): Propagate the location of bison library files and of the
24923 locale files.
24924 (INCLUDES): Added `-I ..' so that one can compile with srcdir !=
24925 builddir.
24926 * acinclude.m4: Remove, replaced by the directory m4.
24927 * m4/Makefile.am (EXTRA_DIST): New variable.
24928 * m4/gettext.m4: New file, from the fileutils.
24929 * m4/lcmessage.m4: Likewise
24930 * m4/progtest.m4: Likewise.
24931 * m4/bison-decl.m4: New file, extracted from former acinclude.m4.
24932
24933 2000-03-10 Akim Demaille <akim@epita.fr>
24934
24935 * src/closure.c:
24936 Formatting changes of various comments.
24937 Respect the GNU coding standards at various places.
24938 Don't use `_()' when no translation is needed.
24939
24940 1999-12-13 Jesse Thilo <jthilo@gnu.org>
24941
24942 * src/files.c:
24943 OS/2 honors TMPDIR environment variable.
24944
24945 1999-12-13 Jesse Thilo <jthilo@gnu.org>
24946
24947 * doc/bison.texinfo: Tweaked spelling and grammar.
24948 Updated ISBN.
24949 Removed reference to price of printed copy.
24950 Mention BISON_SIMPLE and BISON_HAIRY.
24951
24952 1999-12-13 Jesse Thilo <jthilo@gnu.org>
24953
24954 * configure.in, NEWS:
24955 Bison 1.29 released.
24956
24957 1999-10-27 Jesse Thilo <jthilo@gnu.org>
24958
24959 * doc/.cvsignore, doc/Makefile.am, doc/refcard.tex:
24960 Added reference card.
24961
24962 1999-07-26 Jesse Thilo <jthilo@gnu.org>
24963
24964 * po/ru.po: Added Russian translation.
24965
24966 1999-07-26 Jesse Thilo <jthilo@gnu.org>
24967
24968 * configure.in: Added Russian translation.
24969
24970 1999-07-06 Jesse Thilo <jthilo@gnu.org>
24971
24972 * configure.in, NEWS, README:
24973 Released version 1.28.
24974
24975 1999-06-14 Jesse Thilo <jthilo@gnu.org>
24976
24977 * src/system.h:
24978 Squashed redefinition warning on some systems.
24979
24980 * src/getargs.c, src/Makefile.am, src/reader.c, src/version.c:
24981 Have configure build version string instead of relying on ANSI string
24982 concatentation.
24983
24984 1999-06-14 Jesse Thilo <jthilo@gnu.org>
24985
24986 * po/POTFILES.in: Got rid of version.c.
24987
24988 1999-06-14 Jesse Thilo <jthilo@gnu.org>
24989
24990 * acconfig.h, configure.in:
24991 Have configure build version string instead of relying on ANSI string
24992 concatentation.
24993
24994 1999-06-08 Jesse Thilo <jthilo@gnu.org>
24995
24996 * doc/bison.1:
24997 Dropped mention of `+' for long-named options.
24998
24999 1999-05-30 Jesse Thilo <jthilo@gnu.org>
25000
25001 * src/files.c: Added <unistd.h> for unlink().
25002
25003 * src/Makefile.am, src/system.h:
25004 I18n fixes.
25005
25006 1999-05-30 Jesse Thilo <jthilo@gnu.org>
25007
25008 * README: Added a FAQ list.
25009
25010 * configure.in, acconfig.h:
25011 I18n fixes.
25012
25013 1999-05-30 Jesse Thilo <jthilo@gnu.org>
25014
25015 * doc/FAQ, doc/Makefile.am:
25016 Added a FAQ list.
25017
25018 1999-05-19 Jesse Thilo <jthilo@gnu.org>
25019
25020 * src/alloc.h, src/symtab.h, src/version.c:
25021 Protected inclusion of "config.h" with HAVE_CONFIG_H.
25022
25023 1999-04-18 Jesse Thilo <jthilo@gnu.org>
25024
25025 * src/.cvsignore, src/Makefile.am:
25026 Reorganized: sources in `src', documentation in `doc'.
25027
25028 * src/lex.c (literalchar):
25029 fixed the code for escaping double quotes (thanks
25030 Jonathan Czisny.)
25031
25032 1999-04-18 Jesse Thilo <jthilo@gnu.org>
25033
25034 * po/de.po, po/es.po, po/fr.po, po/nl.po, po/POTFILES.in:
25035 Adjusted paths to reflect directory reorganization.
25036
25037 1999-04-18 Jesse Thilo <jthilo@gnu.org>
25038
25039 * doc/.cvsignore, doc/Makefile.am:
25040 Reorganized: sources in `src', documentation in `doc'.
25041
25042 1999-04-18 Jesse Thilo <jthilo@gnu.org>
25043
25044 * configure.in:
25045 Updated AC_INIT file to reflect directory reorganization.
25046
25047 * configure.in, .cvsignore, Makefile.am, POTFILES.in:
25048 Reorganized: sources in `src', documentation in `doc'.
25049
25050 1999-04-13 Jesse Thilo <jthilo@gnu.org>
25051
25052 * src/allocate.c:
25053 Don't declare calloc() and realloc() if not necessary.
25054
25055 1999-04-13 Jesse Thilo <jthilo@gnu.org>
25056
25057 * configure.in, acconfig.h, acinclude.m4:
25058 Don't declare calloc() and realloc() if not necessary.
25059
25060 1999-03-23 Jesse Thilo <jthilo@gnu.org>
25061
25062 * po/.cvsignore: Added i18n support.
25063
25064 1999-03-23 Jesse Thilo <jthilo@gnu.org>
25065
25066 * acconfig.h, configure.in, Makefile.am:
25067 Added i18n support.
25068
25069 1999-03-22 Jesse Thilo <jthilo@gnu.org>
25070
25071 * src/bison.s1: Fixed #line numbers.
25072
25073 1999-03-15 Jesse Thilo <jthilo@gnu.org>
25074
25075 * po/es.po, po/fr.po, po/nl.po, po/de.po:
25076 Added PO files from Translation Project.
25077
25078 1999-03-03 Jesse Thilo <jthilo@gnu.org>
25079
25080 * Makefile.am:
25081 Added support for non-ANSI compilers (ansi2knr).
25082
25083 1999-02-16 Jesse Thilo <jthilo@gnu.org>
25084
25085 * configure.in: Bumped version number to 1.27.
25086
25087 * Makefile.am:
25088 Added `bison.simple' to list of files removed by `make distclean'.
25089
25090 1999-02-12 Jesse Thilo <jthilo@gnu.org>
25091
25092 * src/files.c, src/files.h:
25093 Defined locations of parser files in config.h instead of Makefile.
25094
25095 1999-02-12 Jesse Thilo <jthilo@gnu.org>
25096
25097 * acconfig.h, acinclude.m4, configure.in, Makefile.am:
25098 Defined locations of parser files in config.h instead of Makefile.
25099
25100 1999-02-09 Jesse Thilo <jthilo@gnu.org>
25101
25102 * Makefile.am:
25103 Removed inappropriate use of $< macro.
25104
25105 1999-02-05 Jesse Thilo <jthilo@gnu.org>
25106
25107 * po/Makefile.in.in, po/POTFILES.in:
25108 Add `po' directory skeleton.
25109
25110 1999-01-27 Jesse Thilo <jthilo@gnu.org>
25111
25112 * README: Document help-bison list.
25113
25114 * configure.in: Add check for mkstemp().
25115
25116 1999-01-20 Jesse Thilo <jthilo@gnu.org>
25117
25118 * src/conflicts.c, src/LR0.c, src/output.c, src/reader.c:
25119 Hush a few compiler warnings.
25120
25121 * src/files.c:
25122 Add tryclose(), which verifies that fclose was successful.
25123 Hush a couple of compiler warnings.
25124
25125 1999-01-20 Jesse Thilo <jthilo@gnu.org>
25126
25127 * Makefile.am, OChangeLog:
25128 ChangeLog is now automatically generated. Include the old version as
25129 OChangeLog.
25130
25131 1999-01-14 Jesse Thilo <jthilo@gnu.org>
25132
25133 * 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:
25134 Update FSF address.
25135
25136 1999-01-14 Jesse Thilo <jthilo@gnu.org>
25137
25138 * doc/bison.texinfo: Fix formatting glitch.
25139
25140 * doc/bison.texinfo: Update FSF address.
25141
25142 1999-01-14 Jesse Thilo <jthilo@gnu.org>
25143
25144 * acconfig.h: Update FSF address.
25145
25146 1999-01-08 Jesse Thilo <jthilo@gnu.org>
25147
25148 * src/system.h:
25149 Don't define PACKAGE here, since config.h defines it.
25150
25151 1998-12-30 Jesse Thilo <jthilo@gnu.org>
25152
25153 * src/reader.c: Update copyright date.
25154
25155 * src/main.c:
25156 Ditch sprintf to statically-sized buffers in fatal/warn functions in
25157 favor of output directly to stderr (avoids buffer overruns).
25158
25159 * src/reader.c: Some checks for premature EOF.
25160
25161 * 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:
25162 Use prototypes if the compiler understands them.
25163
25164 * src/files.c: Honor TMPDIR on Unix hosts.
25165 Use prototypes if the compiler understands them.
25166
25167 * src/reader.c:
25168 Fix a couple of buffer overrun bugs.
25169 Use prototypes if the compiler understands them.
25170
25171 * src/system.h: Include unistd.h and ctype.h.
25172 Use #ifdef instead of #if for NLS symbols.
25173
25174 1998-12-30 Jesse Thilo <jthilo@gnu.org>
25175
25176 * doc/bison.texinfo:
25177 Delete comment "consider using @set for edition number, etc..." since
25178 we now are doing so.
25179
25180 1998-12-30 Jesse Thilo <jthilo@gnu.org>
25181
25182 * configure.in:
25183 Use prototypes if the compiler understands them.
25184
25185 * NEWS: Document 1.26 highlights.
25186
25187 * Makefile.am: Require Automake 1.3 or later.
25188
25189 * acconfig.h:
25190 Use prototypes if the compiler understands them.
25191
25192 1998-12-29 Jesse Thilo <jthilo@gnu.org>
25193
25194 * src/version.c:
25195 Use VERSION symbol from automake for version number.
25196
25197 1998-12-29 Jesse Thilo <jthilo@gnu.org>
25198
25199 * acconfig.h, configure.in, version.cin:
25200 Use VERSION symbol from automake for version number.
25201
25202 1998-11-28 Jesse Thilo <jthilo@gnu.org>
25203
25204 * Makefile.am:
25205 Distribute original version of simple parser (bison.s1), not built
25206 version (bison.simple).
25207
25208 1998-11-28 Jesse Thilo <jthilo@gnu.org>
25209
25210 * doc/bison.texinfo: Add info dir entry.
25211
25212 * doc/bison.texinfo:
25213 Let automake put version number into documentation.
25214
25215 1998-11-26 Jesse Thilo <jthilo@gnu.org>
25216
25217 * src/bison.cld, src/build.com, src/vmshlp.mar:
25218 Add non-RCS files from /gd/gnu/bison.
25219
25220 1998-11-26 Jesse Thilo <jthilo@gnu.org>
25221
25222 * doc/bison.1:
25223 Document the BISON_HAIRY and BISON_SIMPLE variables.
25224
25225 1998-11-25 Jesse Thilo <jthilo@gnu.org>
25226
25227 * src/version.c: Build version.c automatically.
25228
25229 * src/reader.c:
25230 Fix token numbering (used to start at 258, not 257).
25231
25232 * src/system.h: Include config.h.
25233
25234 * src/getargs.c: Update bug report address.
25235
25236 * src/alloca.c, src/getopt1.c, src/getopt.c, src/getopt.h:
25237 Get latest copies of alloca.c, getopt.c, getopt.h, getopt1.c from gnu.org.
25238
25239 1998-11-25 Jesse Thilo <jthilo@gnu.org>
25240
25241 * Makefile.am:
25242 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
25243
25244 * configure.in, version.cin:
25245 Build version.c automatically.
25246
25247 * AUTHORS: Add AUTHORS file.
25248
25249 * README: Update bug report address.
25250
25251 * bison.simple:
25252 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
25253
25254 * configure.in, Makefile.am, Makefile.in, stamp-h.in:
25255 Add automake stuff.
25256
25257 1998-11-25 Jesse Thilo <jthilo@gnu.org>
25258
25259 * doc/bison.texinfo: Clean up some formatting.
25260
25261 1998-05-05 Richard Stallman <rms@gnu.org>
25262
25263 * doc/bison.texinfo:
25264 Explain better why to make a pure parser.
25265
25266 1998-01-05 Richard Stallman <rms@gnu.org>
25267
25268 * src/files.c (openfiles):
25269 [_WIN32 && !__CYGWIN32__] Use TEMP or Temp to
25270 find a temporary directory, if possible. Do not unlink files while
25271 they are open.
25272
25273 1997-08-25 Richard Stallman <rms@gnu.org>
25274
25275 * src/reader.c (stack_offset;):
25276 Change some warni to warns.
25277
25278 * src/lex.c (literalchar): Use warns, not warni.
25279
25280 1997-06-28 Richard Stallman <rms@gnu.org>
25281
25282 * src/bison.s1: Add a Bison version comment.
25283
25284 * src/main.c (fatal, warn, berror):
25285 Use program_name.
25286
25287 1997-06-28 Richard Stallman <rms@gnu.org>
25288
25289 * Makefile.in (bison_version): New variable.
25290 (dist): Use that variable.
25291 (bison.s1): Substitute the Bison version into bison.simple.
25292
25293 * bison.simple: Add a Bison version comment.
25294
25295 1997-06-18 Richard Stallman <rms@gnu.org>
25296
25297 * src/main.c (fatal, warn, berror):
25298 Make error messages standard.
25299 (toomany): Improve error message text.
25300
25301 * 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:
25302 new.h renamed to alloc.h.
25303
25304 1997-06-18 Richard Stallman <rms@gnu.org>
25305
25306 * Makefile.in: new.h renamed to alloc.h.
25307
25308 1997-05-24 Richard Stallman <rms@gnu.org>
25309
25310 * src/lex.c (literalchar):
25311 Fix the code for escaping \, " and '.
25312
25313 (lex): Avoid trouble when there are many chars
25314 to discard in a char literal with just several chars in it.
25315
25316 1997-05-17 Richard Stallman <rms@gnu.org>
25317
25318 * src/bison.s1:
25319 Use malloc, if using alloca is troublesome.
25320 (YYSTACK_USE_ALLOCA): New flag macro.
25321 Define it for some systems and compilers.
25322 (YYSTACK_ALLOC): New macro.
25323 (yyparse): Use YYSTACK_ALLOC to allocate stack.
25324 If it was malloc'd, free it.
25325
25326 1997-05-17 Richard Stallman <rms@gnu.org>
25327
25328 * bison.simple:
25329 Use malloc, if using alloca is troublesome.
25330 (YYSTACK_USE_ALLOCA): New flag macro.
25331 Define it for some systems and compilers.
25332 (YYSTACK_ALLOC): New macro.
25333 (yyparse): Use YYSTACK_ALLOC to allocate stack.
25334 If it was malloc'd, free it.
25335
25336 1997-04-23 Richard Stallman <rms@gnu.org>
25337
25338 * src/bison.s1:
25339 (alloca) [__hpux]: Always define as __builtin_alloca.
25340
25341 1997-04-23 Richard Stallman <rms@gnu.org>
25342
25343 * bison.simple:
25344 (alloca) [__hpux]: Always define as __builtin_alloca.
25345
25346 1997-04-22 Richard Stallman <rms@gnu.org>
25347
25348 * src/bison.s1:
25349 [__hpux]: Include alloca.h (right for HPUX 10)
25350 instead of declaring alloca (right for HPUX 9).
25351
25352 * src/bison.s1 (__yy_memcpy):
25353 Declare arg `count' as unsigned int.
25354 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
25355
25356 1997-04-22 Richard Stallman <rms@gnu.org>
25357
25358 * bison.simple:
25359 [__hpux]: Include alloca.h (right for HPUX 10)
25360 instead of declaring alloca (right for HPUX 9).
25361
25362 * bison.simple (__yy_memcpy):
25363 Declare arg `count' as unsigned int.
25364 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
25365
25366 1997-01-03 Richard Stallman <rms@gnu.org>
25367
25368 * src/allocate.c: [__STDC__ or _MSC_VER]:
25369 Declare calloc and realloc to return void *.
25370
25371 1997-01-02 Richard Stallman <rms@gnu.org>
25372
25373 * src/system.h:
25374 [_MSC_VER]: Include stdlib.h and process.h.
25375 [_MSC_VER] (getpid): Define as macro--translate it to _getpid.
25376
25377 * src/main.c (main): Return FAILURE as a value.
25378 (printable_version): Declare arg as int, not char.
25379
25380 1997-01-02 Richard Stallman <rms@gnu.org>
25381
25382 * Makefile.in (dist):
25383 Explicitly check for symlinks, and copy them.
25384
25385 1996-12-19 Richard Stallman <rms@gnu.org>
25386
25387 * src/files.c:
25388 [_MSC_VER] (XPFILE, XPFILE1): Define, if not already defined.
25389
25390 1996-12-18 Paul Eggert <eggert@gnu.org>
25391
25392 * src/bison.s1 (yyparse):
25393 If __GNUC__ and YYPARSE_PARAM are both defined,
25394 declare yyparse to have a void * argument.
25395
25396 1996-12-18 Paul Eggert <eggert@gnu.org>
25397
25398 * bison.simple (yyparse):
25399 If __GNUC__ and YYPARSE_PARAM are both defined,
25400 declare yyparse to have a void * argument.
25401
25402 1996-12-17 Richard Stallman <rms@gnu.org>
25403
25404 * src/reduce.c (nbits): Add some casts.
25405
25406 1996-08-12 Richard Stallman <rms@gnu.org>
25407
25408 * src/bison.s1: Test _MSDOS as well as _MSDOS_.
25409
25410 1996-08-12 Richard Stallman <rms@gnu.org>
25411
25412 * bison.simple: Test _MSDOS as well as _MSDOS_.
25413
25414 1996-07-31 Richard Stallman <rms@gnu.org>
25415
25416 * src/bison.s1:
25417 [__sun && __i386]: Include alloca.h.
25418
25419 1996-07-31 Richard Stallman <rms@gnu.org>
25420
25421 * bison.simple:
25422 [__sun && __i386]: Include alloca.h.
25423
25424 1996-07-30 Richard Stallman <rms@gnu.org>
25425
25426 * src/bison.s1: Comment change.
25427
25428 * src/bison.s1: Test _MSDOS_, not MSDOS.
25429
25430 1996-07-30 Richard Stallman <rms@gnu.org>
25431
25432 * bison.simple: Comment change.
25433
25434 * bison.simple: Test _MSDOS_, not MSDOS.
25435
25436 1996-06-01 Richard Stallman <rms@gnu.org>
25437
25438 * 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:
25439 Insert `_' macro around many string constants.
25440
25441 * src/main.c:
25442 Insert `_' macro around many string constants.
25443
25444 (main): Call setlocale, bindtextdomain and textdomain.
25445
25446 * src/system.h: [HAVE_LOCALE_H]: Include locale.h.
25447 [! HAVE_LOCALE_H] (setlocale): Define as no-op.
25448 [ENABLE_NLS]: Include libintl.h.
25449 [ENABLE_NLS] (gettext): Define.
25450 [! ENABLE_NLS] (bintextdomain, textdomain, _): Consolation definitions.
25451 (N_, PACKAGE, LOCALEDIR): New macros.
25452
25453 1996-06-01 Richard Stallman <rms@gnu.org>
25454
25455 * POTFILES.in: New file.
25456
25457 * Makefile.in (allocate.o):
25458 Define target explicitly.
25459
25460 * Makefile.in (CFLAGS): Set to @CFLAGS@.
25461 (LDFLAGS): Set to @LDFLAGS@.
25462 (configure): Run autoconf only if preceding `cd' succeeds.
25463 (bison.s1): Redirect output to temporary file then move the
25464 temporary to the target, rather than redirecting directly to bison.s1.
25465 (clean): Remove config.status and config.log.
25466 (distclean): Don't remove config.status here.
25467
25468 1996-05-12 Richard Stallman <rms@gnu.org>
25469
25470 * src/bison.s1:
25471 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
25472
25473 1996-05-12 Richard Stallman <rms@gnu.org>
25474
25475 * bison.simple:
25476 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
25477
25478 1996-05-11 Richard Stallman <rms@gnu.org>
25479
25480 * src/bison.s1 (__yy_memcpy):
25481 Really reorder the args, as was supposedly done on Feb 14 1995.
25482 (yyparse): Calls changed accordingly.
25483
25484 1996-05-11 Richard Stallman <rms@gnu.org>
25485
25486 * Makefile.in (dist): Don't use $(srcdir).
25487
25488 * bison.simple (__yy_memcpy):
25489 Really reorder the args, as was supposedly done on Feb 14 1995.
25490 (yyparse): Calls changed accordingly.
25491
25492 1996-01-27 Richard Stallman <rms@gnu.org>
25493
25494 * src/output.c (output_rule_data):
25495 Test YYERROR_VERBOSE in the conditional
25496 around the definition of ttyname.
25497
25498 1995-12-29 Richard Stallman <rms@gnu.org>
25499
25500 * src/bison.s1:
25501 Fix line numbers in #line commands.
25502
25503 1995-12-29 Richard Stallman <rms@gnu.org>
25504
25505 * bison.simple:
25506 Fix line numbers in #line commands.
25507
25508 1995-12-27 Richard Stallman <rms@gnu.org>
25509
25510 * src/bison.s1 (YYPARSE_PARAM_DECL):
25511 In C++, make it always null.
25512 (YYPARSE_PARAM_ARG): New macro.
25513 (yyparse): Use YYPARSE_PARAM_ARG.
25514
25515 1995-12-27 Richard Stallman <rms@gnu.org>
25516
25517 * bison.simple (YYPARSE_PARAM_DECL):
25518 In C++, make it always null.
25519 (YYPARSE_PARAM_ARG): New macro.
25520 (yyparse): Use YYPARSE_PARAM_ARG.
25521
25522 1995-11-29 Richard Stallman <rms@gnu.org>
25523
25524 * doc/bison.texinfo:
25525 Describe literal string tokens, %raw, %no_lines, %token_table.
25526
25527 1995-11-29 Daniel Hagerty <hag@gnu.org>
25528
25529 * doc/bison.texinfo: Fixed update date
25530
25531 1995-10-16 Richard Stallman <rms@gnu.org>
25532
25533 * src/version.c: Version 1.25.
25534
25535 1995-10-16 Richard Stallman <rms@gnu.org>
25536
25537 * NEWS: *** empty log message ***
25538
25539 1995-10-16 Richard Stallman <rms@gnu.org>
25540
25541 * doc/bison.1, doc/bison.rnh:
25542 Add new options.
25543
25544 1995-10-15 Richard Stallman <rms@gnu.org>
25545
25546 * src/vmsgetargs.c, src/getargs.c:
25547 Added -n, -k, and -raw switches.
25548 (noparserflag, toknumflag, rawtoknumflag): New variables.
25549
25550 * src/symtab.h (SALIAS):
25551 New #define for adding aliases to %token.
25552 (struct bucket): Added `alias' field.
25553
25554 * src/reduce.c (reduce_grammar):
25555 Revise error message.
25556 (print_notices): Remove final `.' from error message.
25557
25558 * src/reader.c (reader_output_yylsp):
25559 New function.
25560 (readgram): Use `#if 0' around code that accepted %command
25561 inside grammar rules: The documentation doesn't allow it,
25562 and it will fail since the %command processors scan for the next %.
25563 (parse_token_decl): Extended the %token
25564 declaration to allow a multi-character symbol as an alias.
25565 (parse_thong_decl): New function.
25566 (read_declarations): Added %thong declarations.
25567 (read_declarations): Handle NOOP to deal with allowing
25568 % declarations as another means to specify the flags.
25569 (readgram): Allow %prec prior to semantics embedded in a rule.
25570 (skip_to_char, read_declarations, copy_definition)
25571 (parse_token_decl, parse_start_decl, parse_type_decl)
25572 (parse_assoc_decl, parse_union_decl, parse_expect_decl)
25573 (get_type_name, copy_guard, copy_action, readgram)
25574 (get_type, packsymbols): Revised most error messages.
25575 Changed `fatal' to `warnxxx' to avoid aborting for error.
25576 Revised and use multiple warnxxx functions to avoid using VARARGS1.
25577 (read_declarations): Improve the error message for
25578 an invalid character. Do not abort.
25579 (read_declarations, copy_guard, copy_action): Use
25580 printable_version to avoid unprintable characters in printed output.
25581 (parse_expect_decl): Error if argument to %expect exceeds 10 digits.
25582 (parse_token_decl, parse_assoc_decl, parse_type_decl, get_type):
25583 Allow the type of a non-terminal can be given
25584 more than once, as long as all specifications give the same type.
25585
25586 * src/output.c:
25587 (output_headers, output_trailers, output, output_gram)
25588 (output_rule_data): Implement noparserflag variable.
25589 Implement toknumflag variable.
25590 (output): Call reader_output_yylsp to output LTYPESTR.
25591
25592 * src/main.c (main):
25593 If reader sees an error, don't process the grammar.
25594 (fatals): Updated to not use VARARGS1.
25595 (printable_version, int_to_string, warn, warni, warns, warnss)
25596 (warnsss): New error reporting functions. Avoid abort for error.
25597
25598 * src/lex.h:
25599 Added THONG and NOOP for alias processing.
25600 Added SETOPT for the new code that allows setting options with %flags.
25601
25602 * src/lex.c:
25603 Include getopt.h. Add some extern decls.
25604 (safegetc): New function to deal with EOF gracefully.
25605 (literalchar); new function to deal with reading \ escapes.
25606 (lex): Use literalchar.
25607 (lex): Implemented "..." tokens.
25608 (literalchar, lex, parse_percent_token): Made tokenbuffer
25609 always contain the token. This includes growing the token
25610 buffer while reading an integer.
25611 (parse_percent_token): Replaced if-else statement with percent_table.
25612 (parse_percent_token): Added % declarations as another
25613 way to specify the flags -n, -l, and -r. Also added hooks for
25614 -d, -k, -y, -v, -t, -p, -b, -o, but implementation requires
25615 major changes to files.c.
25616 (lex) Retain in the incoming stream a character following
25617 an incorrect '/'.
25618 (skip_white_space, lex): Revised most error messages
25619 and changed fatal to warn to avoid aborting.
25620 (percent_table): Added %thong declarations.
25621
25622 * src/gram.h: Comment changes.
25623
25624 * src/files.c (openfiles, open_extra_files, done):
25625 Add faction flag
25626 and actfile file. Handle noparserflag. Both for -n switch.
25627
25628 * src/conflicts.c (resolve_sr_conflict):
25629 Remove use of alloca.
25630
25631 1995-06-01 Jim Meyering <meyering@gnu.org>
25632
25633 * doc/bison.texinfo: *** empty log message ***
25634
25635 1995-05-06 Richard Stallman <rms@gnu.org>
25636
25637 * src/bison.s1: Comment change.
25638
25639 1995-05-06 Richard Stallman <rms@gnu.org>
25640
25641 * bison.simple: Comment change.
25642
25643 1995-05-03 Richard Stallman <rms@gnu.org>
25644
25645 * src/version.c: Version now 1.24.
25646
25647 * src/bison.s1: Change distribution terms.
25648
25649 * src/version.c: Version now 1.23.
25650
25651 1995-05-03 Richard Stallman <rms@gnu.org>
25652
25653 * doc/bison.texinfo:
25654 Rewrite "Conditions for Using Bison".
25655 Update version to 1.24.
25656
25657 1995-05-03 Richard Stallman <rms@gnu.org>
25658
25659 * bison.simple: Change distribution terms.
25660
25661 1995-02-23 Richard Stallman <rms@gnu.org>
25662
25663 * src/files.c: Test __VMS_POSIX as well as VMS.
25664
25665 1995-02-14 Jim Meyering <meyering@gnu.org>
25666
25667 * src/bison.s1 (__yy_memcpy):
25668 Renamed from __yy_bcopy to avoid
25669 confusion. Reverse FROM and TO arguments to be consistent with
25670 those of memcpy.
25671
25672 1995-02-14 Jim Meyering <meyering@gnu.org>
25673
25674 * bison.simple (__yy_memcpy):
25675 Renamed from __yy_bcopy to avoid
25676 confusion. Reverse FROM and TO arguments to be consistent with
25677 those of memcpy.
25678
25679 1994-11-10 David J. MacKenzie <djm@gnu.org>
25680
25681 * NEWS: reformat
25682
25683 * NEWS: New file.
25684
25685 * Makefile.in (DISTFILES): Include NEWS.
25686
25687 * Makefile.in (DISTFILES):
25688 Include install-sh, not install.sh.
25689
25690 * configure.in: Update to Autoconf v2 macro names.
25691
25692 1994-10-05 David J. MacKenzie <djm@gnu.org>
25693
25694 * Makefile.in: fix typo
25695
25696 * Makefile.in (prefix, exec_prefix):
25697 Let configure set them.
25698
25699 1994-09-28 David J. MacKenzie <djm@gnu.org>
25700
25701 * Makefile.in: Set datadir to $(prefix)/share.
25702
25703 1994-09-15 Richard Stallman <rms@gnu.org>
25704
25705 * src/bison.s1:
25706 Update copyright notice and GPL version.
25707
25708 1994-09-15 Richard Stallman <rms@gnu.org>
25709
25710 * bison.simple:
25711 Update copyright notice and GPL version.
25712
25713 1994-07-12 Richard Stallman <rms@gnu.org>
25714
25715 * src/reduce.c, src/reader.c:
25716 entered into RCS
25717
25718 1994-05-05 David J. MacKenzie <djm@gnu.org>
25719
25720 * Makefile.in: entered into RCS
25721
25722 1994-03-26 Richard Stallman <rms@gnu.org>
25723
25724 * src/bison.s1: entered into RCS
25725
25726 1994-03-26 Richard Stallman <rms@gnu.org>
25727
25728 * bison.simple: entered into RCS
25729
25730 1994-03-25 Richard Stallman <rms@gnu.org>
25731
25732 * src/main.c: entered into RCS
25733
25734 1994-03-24 Richard Stallman <rms@gnu.org>
25735
25736 * src/conflicts.c: entered into RCS
25737
25738 1994-01-02 Richard Stallman <rms@gnu.org>
25739
25740 * Makefile.in: *** empty log message ***
25741
25742 1993-11-21 Richard Stallman <rms@gnu.org>
25743
25744 * src/bison.s1: *** empty log message ***
25745
25746 1993-11-21 Richard Stallman <rms@gnu.org>
25747
25748 * doc/bison.texinfo: entered into RCS
25749
25750 * doc/bison.texinfo: *** empty log message ***
25751
25752 1993-11-21 Richard Stallman <rms@gnu.org>
25753
25754 * bison.simple: *** empty log message ***
25755
25756 1993-10-25 David J. MacKenzie <djm@gnu.org>
25757
25758 * doc/bison.texinfo: *** empty log message ***
25759
25760 1993-10-19 Richard Stallman <rms@gnu.org>
25761
25762 * src/bison.s1: *** empty log message ***
25763
25764 1993-10-19 Richard Stallman <rms@gnu.org>
25765
25766 * bison.simple: *** empty log message ***
25767
25768 1993-10-14 Richard Stallman <rms@gnu.org>
25769
25770 * src/bison.s1: *** empty log message ***
25771
25772 1993-10-14 Richard Stallman <rms@gnu.org>
25773
25774 * bison.simple: *** empty log message ***
25775
25776 1993-09-14 David J. MacKenzie <djm@gnu.org>
25777
25778 * doc/bison.texinfo: *** empty log message ***
25779
25780 1993-09-13 Noah Friedman <friedman@gnu.org>
25781
25782 * Makefile.in: *** empty log message ***
25783
25784 1993-09-10 Richard Stallman <rms@gnu.org>
25785
25786 * src/conflicts.c: *** empty log message ***
25787
25788 * src/system.h: entered into RCS
25789
25790 1993-09-10 Richard Stallman <rms@gnu.org>
25791
25792 * doc/bison.1: entered into RCS
25793
25794 1993-09-06 Noah Friedman <friedman@gnu.org>
25795
25796 * src/version.c: entered into RCS
25797
25798 1993-09-06 Noah Friedman <friedman@gnu.org>
25799
25800 * Makefile.in: *** empty log message ***
25801
25802 1993-07-30 David J. MacKenzie <djm@gnu.org>
25803
25804 * Makefile.in: *** empty log message ***
25805
25806 1993-07-24 Richard Stallman <rms@gnu.org>
25807
25808 * src/bison.s1: *** empty log message ***
25809
25810 1993-07-24 Richard Stallman <rms@gnu.org>
25811
25812 * bison.simple: *** empty log message ***
25813
25814 1993-07-08 David J. MacKenzie <djm@gnu.org>
25815
25816 * Makefile.in: *** empty log message ***
25817
25818 1993-07-04 Richard Stallman <rms@gnu.org>
25819
25820 * src/bison.s1: *** empty log message ***
25821
25822 1993-07-04 Richard Stallman <rms@gnu.org>
25823
25824 * bison.simple: *** empty log message ***
25825
25826 1993-06-26 David J. MacKenzie <djm@gnu.org>
25827
25828 * src/getargs.c: entered into RCS
25829
25830 1993-06-26 David J. MacKenzie <djm@gnu.org>
25831
25832 * doc/bison.texinfo: *** empty log message ***
25833
25834 * doc/bison.1: New file.
25835
25836 1993-06-25 Richard Stallman <rms@gnu.org>
25837
25838 * src/getargs.c: New file.
25839
25840 1993-06-16 Richard Stallman <rms@gnu.org>
25841
25842 * src/bison.s1: *** empty log message ***
25843
25844 1993-06-16 Richard Stallman <rms@gnu.org>
25845
25846 * bison.simple: *** empty log message ***
25847
25848 1993-06-03 Richard Stallman <rms@gnu.org>
25849
25850 * src/bison.s1: New file.
25851
25852 1993-06-03 Richard Stallman <rms@gnu.org>
25853
25854 * doc/bison.texinfo: *** empty log message ***
25855
25856 1993-06-03 Richard Stallman <rms@gnu.org>
25857
25858 * bison.simple: New file.
25859
25860 1993-05-19 Richard Stallman <rms@gnu.org>
25861
25862 * doc/bison.texinfo: New file.
25863
25864 1993-05-07 Noah Friedman <friedman@gnu.org>
25865
25866 * Makefile.in: *** empty log message ***
25867
25868 1993-04-28 Noah Friedman <friedman@gnu.org>
25869
25870 * src/reader.c: *** empty log message ***
25871
25872 1993-04-23 Noah Friedman <friedman@gnu.org>
25873
25874 * src/alloc.h: entered into RCS
25875
25876 1993-04-20 David J. MacKenzie <djm@gnu.org>
25877
25878 * src/version.c: *** empty log message ***
25879
25880 * src/files.c, src/allocate.c:
25881 entered into RCS
25882
25883 * src/reader.c: *** empty log message ***
25884
25885 * src/lex.c: entered into RCS
25886
25887 * src/conflicts.c: New file.
25888
25889 * src/symtab.c: entered into RCS
25890
25891 * src/alloc.h: New file.
25892
25893 * src/LR0.c: entered into RCS
25894
25895 1993-04-18 Noah Friedman <friedman@gnu.org>
25896
25897 * src/reader.c: New file.
25898
25899 * src/version.c: *** empty log message ***
25900
25901 1993-04-18 Noah Friedman <friedman@gnu.org>
25902
25903 * Makefile.in: *** empty log message ***
25904
25905 1993-04-17 Noah Friedman <friedman@gnu.org>
25906
25907 * Makefile.in: *** empty log message ***
25908
25909 1993-04-15 Richard Stallman <rms@gnu.org>
25910
25911 * src/main.c, src/files.c:
25912 New file.
25913
25914 1993-04-15 Noah Friedman <friedman@gnu.org>
25915
25916 * configure.in: entered into RCS
25917
25918 * configure.in: *** empty log message ***
25919
25920 * configure.in: New file.
25921
25922 1993-04-14 Richard Stallman <rms@gnu.org>
25923
25924 * Makefile.in: New file.
25925
25926 1993-04-13 Richard Stallman <rms@gnu.org>
25927
25928 * src/version.c: New file.
25929
25930 1993-03-25 Richard Stallman <rms@gnu.org>
25931
25932 * src/output.c: entered into RCS
25933
25934 1992-09-25 Richard Stallman <rms@gnu.org>
25935
25936 * configure.bat: entered into RCS
25937
25938 1992-06-22 Richard Stallman <rms@gnu.org>
25939
25940 * src/vmsgetargs.c: entered into RCS
25941
25942 1992-06-22 Richard Stallman <rms@gnu.org>
25943
25944 * doc/bison.rnh: entered into RCS
25945
25946 1992-04-20 David J. MacKenzie <djm@gnu.org>
25947
25948 * README: entered into RCS
25949
25950 1992-01-22 Richard Stallman <rms@gnu.org>
25951
25952 * src/machine.h: entered into RCS
25953
25954 1991-12-21 Richard Stallman <rms@gnu.org>
25955
25956 * src/lalr.c, src/closure.c:
25957 entered into RCS
25958
25959 1991-12-20 Richard Stallman <rms@gnu.org>
25960
25961 * src/state.h: entered into RCS
25962
25963 1991-12-18 Richard Stallman <rms@gnu.org>
25964
25965 * src/print.c, src/nullable.c, src/derives.c:
25966 entered into RCS
25967
25968 1991-11-03 David J. MacKenzie <djm@gnu.org>
25969
25970 * src/warshall.c, src/types.h, src/symtab.h, src/lex.h, src/gram.c, src/gram.h, src/files.h:
25971 entered into RCS
25972
25973 1988-09-09 Richard Stallman <rms@gnu.org>
25974
25975 * src/bison.hairy: entered into RCS
25976
25977 1987-12-16 Richard Stallman <rms@gnu.org>
25978
25979 * REFERENCES: entered into RCS
25980
25981
25982 -----
25983
25984 Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996,
25985 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
25986 2008, 2009, 2010 Free Software Foundation, Inc.
25987
25988 Copying and distribution of this file, with or without
25989 modification, are permitted provided the copyright notice and this
25990 notice are preserved.