]> git.saurik.com Git - bison.git/blame - ChangeLog
Make xml2dot.xsl and --graph produce the same output.
[bison.git] / ChangeLog
CommitLineData
21f1b063
JD
12007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
2
3 Make xml2dot.xsl and --graph produce the same output.
4 * data/xslt/xml2dot.xsl (xsl:template match="rule"): Use a `&#10;'
5 instead of a `\n'. That is, don't add escapes yet or they'll be doubly
6 escaped later.
7 (xsl:template name="output-node"): Use the new escape template instead
8 of the string-replace template directly.
9 (xsl:template name="output-edge"): Likewise.
10 (xsl:template name="escape"): New, escapes backslashes and newlines in
11 addition to quotation marks.
12 * src/graphviz.c (start_graph, output_node, output_edge): Add
13 whitespace to output for legibility.
14
15 Make xml2text.xsl and --report produce the same output, and remove the
16 XML "conflicts" element since a conflict summary is easily extracted
17 from the automaton.
18 * data/xslt/bison.xsl: New.
19 (xsl:template match="state" mode="bison:count-conflicts): New.
20 * data/xslt/xml2text.xsl: Import bison.xsl.
21 (xsl:template match="bison-xml-report"): Instead of styling the
22 "conflicts" element, style the "automaton" element with mode
23 "conflicts". Unlike the former, the latter lists S/R and R/R
24 conflicts for a state on the same line.
25 (xsl:template match="conflicts"): Remove.
26 (xsl:template match="conflict"): Remove.
27 (xsl:template match="terminal"): Line-wrap the list of rules in which
28 the terminal is used.
29 (xsl:template match="nonterminal"): Likewise for nonterminals.
30 (xsl:template match="automaton" mode="conflicts"): New.
31 (xsl:template match="state" mode="conflicts"): New.
32 (xsl:template name="line-wrap"): New.
33 (xsl:template name="ws-search"): New.
34 * data/xslt/xml2xhtml.xsl: Import bison.xsl.
35 (xsl:template match="bison-xml-report"): Instead of styling the
36 "conflicts" element, style the "automaton" element with mode
37 "conflicts."
38 (xsl:template match="conflicts"): Remove.
39 (xsl:template match="conflict"): Remove.
40 (xsl:template match="automaton" mode="conflicts"): New.
41 (xsl:template match="state" mode="conflicts): New.
42 * src/conflicts.c (conflicts_output_xml): Remove.
43 * src/conflicts.h (conflicts_output_xml): Remove prototype.
44 * src/print-xml.c (print_xml): Don't invoke conflicts_output_xml.
45 * src/print.c (print_grammar): Consistently wrap at the 66th column so
46 the corresponding XSLT is easier. Also, never wrap between a word and
47 the comma that follows it.
48
793fbca5
JD
492007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
50
51 Improve C++ namespace support. Discussed starting at
52 <http://lists.gnu.org/archive/html/help-bison/2007-09/msg00016.html>.
53 * data/c++.m4: (b4_namespace_ref, b4_namespace_open,
54 b4_namespace_close): New macros that interpret the %define variable
55 "namespace" so its value can contain "::" to indicate nested
56 namespaces.
57 * data/glr.cc (b4_namespace): Don't define, and replace all uses with
58 the above macros.
59 * data/lalr1.cc (b4_namespace): Likewise.
60 * data/location.cc (b4_namespace): Likewise.
61 * doc/bison.texinfo (Decl Summary): Move `%define push_pull' entry
62 inside a new table in the general %define entry. Document `%define
63 namespace' there as well. Point the %name-prefix entry to it since it
64 explains it more completely in the case of C++.
65 (C++ Bison Interface): Mention `%define namespace' instead of
66 %name-prefix.
67 (Table of Symbols): Remove the `%define push_pull' entry. The %define
68 entry suffices.
69 * tests/c++.at (Relative namespace references): New test case.
70 (Absolute namespace references): New test case.
71 (Syntactically invalid namespace references): New test case.
72 * tests/input.at (C++ namespace reference errors): New test case.
73
35b8730d
JD
742007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
75
76 Add syncline support and location accessor to internal %define
77 interfaces.
78 * data/bison.m4 (b4_percent_define_get_loc): New.
79 (b4_percent_define_get_syncline): New.
80 (b4_percent_define_flag_if): Use b4_percent_define_get_loc.
81 (b4_percent_define_default): Record defining location as line 1 rather
82 than 0 for the sake of synchronizing #line's, and define
83 b4_percent_define_syncline(VARIABLE).
84 (b4_percent_define_check_values): Use b4_percent_define_get_loc.
85 * src/muscle_tab.c (muscle_syncline_grow): New.
86 (muscle_code_grow): Use muscle_syncline_grow.
87 (muscle_percent_define_insert): Use muscle_percent_define_get_loc, and
88 define b4_percent_define_syncline(VARIABLE).
89 (muscle_percent_define_get_loc): New.
90 (muscle_percent_define_get_syncline): New.
91 (muscle_percent_define_flag_if): Use muscle_percent_define_get_loc, and
92 remove some unused variables.
93 (muscle_percent_define_default): Record defining location as line 1
94 rather than 0 for the sake of synchronizing #line's, and define
95 b4_percent_define_syncline(VARIABLE).
96 (muscle_percent_define_check_values): Use
97 muscle_percent_define_get_loc.
98 * src/muscle_tab.h (muscle_percent_define_get_loc): Prototype.
99 (muscle_percent_define_get_syncline): Prototype.
100 * tests/skeletons.at (%define Boolean variables: invalid skeleton
101 defaults): Update output for location change.
102 (Complaining during macro argument expansion): Extend to test
103 b4_percent_define_get_loc and b4_percent_define_get_syncline errors.
104
7dc4a694
JD
1052007-10-07 Joel E. Denny <jdenny@ces.clemson.edu>
106
107 Fix some error-reporting macro bugs.
108 * data/bison.m4 (b4_cat): New.
109 (b4_error, b4_error_at): Use b4_cat to send error directives directly
110 to stdout so they don't become arguments to other macros. Update
111 comments and add examples.
112 (b4_warn, b4_warn_at, b4_complain, b4_complain_at): Update comments and
113 add examples.
114 (b4_fatal, b4_fatal_at): Likewise, and invoke m4_exit(1) immediately
115 after printing the error directive so that M4 doesn't report subsequent
116 problems that are induced by this problem.
117 * src/scan-skel.l: Recognize @` digraph outside of directive arguments
118 instead of just in them. Recognize @\n in both places. Both expand to
119 the empty string. Needed by b4_cat.
120 * tests/skeletons.at (Complaining during macro argument expansion):
121 New test case.
122 (Fatal errors make M4 exit immediately): New test case.
123
d4bd2295
JD
1242007-10-04 Joel E. Denny <jdenny@ces.clemson.edu>
125
126 Implement --print-datadir.
127 * src/getargs.c (usage): Mention.
128 (PRINT_DATADIR_OPTION): New anonymous enum member.
129 (long_options): Add entry for it.
130 (getargs): Add case for it calling compute_pkgdatadir.
131 * src/output.c (output_skeleton): Encapsulate data directory
132 computation from here...
133 (prepare): ... and from here...
134 (compute_pkgdatadir): ... into this new function.
135 * src/output.h (compute_pkgdatadir): Prototype.
136
34cdeddf
JD
1372007-09-29 Joel E. Denny <jdenny@ces.clemson.edu>
138
139 * src/print-xml.c (escape_bufs): New static global variable
140 replacing...
141 (xml_escape_n): ... the static local variable buf here.
142 (print_xml): Free memory for escape_bufs.
143 * src/reduce.c (reduce_xml): XML-escape terminal symbol tags.
144
d782395d
JD
1452007-09-25 Joel E. Denny <jdenny@ces.clemson.edu>
146
147 Replace `%push-parser' and `%push-pull-parser' with
148 `%define push_pull "push"' and `%define push_pull "both"'.
149 `%define push_pull "pull"' is the default.
150 * doc/bison.texinfo (Push Decl, Push Parser Function,
151 Pull Parser Function, Parser Create Function, Parser Delete Function):
152 Update declarations.
153 (Decl Summary, Table of Symbols): Replace %push-parser and
154 %push-pull-parser entries with a %define push_pull entry.
155 * data/bison.m4 (b4_percent_define_check_values): New macro.
156 (b4_pull_if, b4_push_if, b4_use_push_for_pull_if): Move these
157 definitions...
158 * data/c.m4 (b4_identification): ... and the YYPUSH and YYPULL cpp
159 definitions...
160 * data/push.c: ... to here and compute them from the value of the
161 %define variable push_pull.
162 * data/c-skel.m4: Instead of choosing the push.c skeleton for push
163 parsing requests here...
164 * data/yacc.c: ... hack this to switch to push.c any time
165 b4_use_push_pull_flag or the %define variable push_pull is set. This
166 will go away when we mv push.c yacc.c.
167 * data/c++-skel.m4, data/glr.c, data/java-skel.m4: Don't report that
168 push parsing is not supported since unused %define variables are
169 reported anyway.
170 * src/getargs.c, src/getargs.h (pull_parser, push_parser): Remove.
171 * src/muscle_tab.h (muscle_percent_define_check_values): Update
172 comments for consistency with b4_percent_define_check_values.
173 * src/output.c (prepare): Don't insert b4_pull_flag and b4_push_flag
174 muscles.
175 * src/parse-gram.y (PERCENT_PUSH_PARSER, PERCENT_PUSH_PULL_PARSER):
176 Remove.
177 (prologue_declaration): Remove %push-parser and %push-pull-parser
178 rules.
179 * src/scan-gram.l (%push-parser, %push-pull-parser): Remove rules.
180 * tests/calc.at: Update declarations.
181 * tests/input.at (%define enum variables): New test case.
182 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update
183 declaration.
184 (Push Parsing: Multiple impure instances): Update declaration.
185 (Push Parsing: Unsupported Skeletons): New test case.
186 * tests/torture.at (Exploding the Stack Size with Alloca): Update
187 declaration.
188 (Exploding the Stack Size with Malloc): Update declaration.
189
3f999f78
WP
1902007-09-24 Wojciech Polak <polak@gnu.org>
191
192 Add XSLT transformations.
193
194 * data/xslt/xml2dot.xsl: Transform XML into DOT.
195 * data/xslt/xml2text.xsl: Transform XML into plain text.
196 * data/xslt/xml2xhtml.xsl: Transform XML into XHTML.
197 * data/Makefile.am (xsltdir): New variable.
198 (dist_xslt_DATA): Add xslt/*.xsl files.
199
a4f75309
PE
2002007-09-23 Paul Eggert <eggert@cs.ucla.edu>
201
202 * src/conflicts.c (log_resolution): Fix indenting bugs I introduced.
203 Problem reported by Wojciech Polak.
204 * src/print-xml.c (xml_puts): Work even if LEVEL exceeds INT_MAX/2.
205 (xml_printf): Undo change I made on 21 September; that is,
206 indent 2 spaces, not 1.
207
ad5feac4
JD
2082007-09-23 Joel E. Denny <jdenny@ces.clemson.edu>
209
210 Pacify ./configure --enable-gcc-warnings.
211 * src/print-xml.c, src/print-xml.h (xml_puts): Make third argument
212 `char const *' instead of `char *'.
213 * src/state.c (state_rule_lookahead_tokens_print_xml): Remove unused
214 local variable `sep'.
215
41d7a5f2
PE
2162007-09-21 Paul Eggert <eggert@cs.ucla.edu>
217
218 * src/gram.c (rule_rhs_print_xml): Now static, since it isn't used
219 elsewhere.
220 * src/print-xml.c: Prefer "const" after types; that's more consistent.
221 (xml_printf): Indent just 1 space for level.
222 (e_char, xlate_char): Remove.
223 (xml_escape_string): Rewrite to avoid undefined behavior (used
224 storage that was freed from the stack).
225 (xml_escape_n): Don't bother checking for subscript error.
226
3f999f78
WP
2272007-09-21 Wojciech Polak <polak@gnu.org>
228
229 Add Bison XML Automaton Report.
41d7a5f2
PE
230
231 Add support for an -x option to generate an XML report.
232 It is not documented yet.
233 * src/print-xml.c: New file.
234 * src/print-xml.h: Likewise.
235 * lib/timevar.def (TV_XML): New var.
236 * src/Makefile.am (bison_SOURCES): Add print-xml.c, print-xml.h.
237 * src/conflicts.c: Include print-xml.h.
238 (solved_conflicts_xml_obstack): New var.
239 (log_resolution, conflicts_solve, conflicts_free):
240 Add support for XML report.
241 (conflicts_output_val): New function.
242 * src/conflicts.h (conflicts_output_val): New decl.
243 * src/files.c (spec_xml_file): New var.
244 (compute_output_file_names, output_file_names_free): Add XML support.
245 * src/files.h (spec_xml_file): New decl.
246 * src/getargs.c (xml_flag): New var.
247 (usage, short_options, long_options, getargs): Add XML support.
248 * src/getargs.h (xml_flag): New decl.
249 * src/gram.c: Include print-xml.h.
250 (rule_lhs_print_xml, rule_rhs_print_xml):
251 (grammar_rules_partial_print_xml, grammar_rules_print_xml):
252 New functions.
253 * src/gram.h: Declare external ones.
254 * src/main.c: Include print-xml.h.
255 (main): Add XML support.
256 * src/reduce.c: Include print-xml.h.
257 (reduce_xml): New function.
258 * src/reduce.h: Declare it.
259 * src/state.c: Include print-xml.h.
260 (state_new): Add XML support.
261 (state_rule_lookahead_tokens_print_xml): New function.
262 * src/state.h: Declare it.
263 (struct state): New member solved_conflicts_xml.
264 * src/symtab.c (symbol_class_get_string): New function.
265 * src/symtab.h: Declare it.
266
6d8e724d
PE
2672007-09-21 Paul Eggert <eggert@cs.ucla.edu>
268
269 * GNUmakefile: Switch to coreutils's version.
270 * bootstrap: Likewise.
271 * Makefile.cfg: Adjust to new GNUmakefile.
272 * README-hacking: Likewise.
273
274 Import from gnulib:
275
276 2006-08-18 Paul Eggert <eggert@cs.ucla.edu>
277 Bruno Haible <bruno@clisp.org>
278
279 * m4/bison-i18n.m4 (BISON_I18N): Also handle the case where yacc exists
280 and is a script that invokes bison. Tighten the code. Add comments.
281
922bdd7f
JD
2822007-08-28 Joel E. Denny <jdenny@ces.clemson.edu>
283
284 Spell "boolean" as "Boolean". Reported by Akim Demaille.
285 * data/bison.m4 (b4_percent_define_flag_if): Fix complaint.
286 * doc/bison.texinfo (Decl Summary): Fix.
287 * src/muscle_tab.c (muscle_percent_define_flag_if): Fix complaint.
288 * tests/input.at (Boolean %define variables): Update output.
289 * tests/skeletons.at (%define boolean variables: invalid skeleton
290 defaults): Rename to...
291 (%define Boolean variables: invalid skeleton defaults): ... this and
292 update output.
293
1b17b01d
JD
2942007-08-17 Joel E. Denny <jdenny@ces.clemson.edu>
295
296 In impure push mode, don't allow more than one yypstate to be allocated
297 since multiple impure parsers would corrupt yynerrs.
298 * data/push.c (yypstate_allocated): New static global variable
299 initialized to 0.
300 (yypull_parse): If yypstate_new returns 0, don't report it as memory
301 exhaustion if yypstate_allocated is 1, but still return 2.
302 (yypstate_new): Invoke yyerror and return 0 if yypstate_allocated is
303 already 1. Otherwise, set it to 1.
304 (yypstate_delete): Set it to 0.
305 * tests/push.at (Push Parsing: Multiple impure instances): New test
306 case.
307
9987d1b3
JD
3082007-08-17 Bob Rossi <bob@brasko.net>
309
310 * doc/bison.texinfo (Push Decl): Document the push parser.
311 (Table of Symbols): Ditto.
312 (Pure Decl): Ditto.
313 (Decl Summary): Ditto.
314 (Multiple Parsers, Push Parser Function, Pull Parser Function,
315 Parser Create Function, Parser Delete Function):
316 Add new push parser symbols.
317 (Table of Symbols): Document push-parser, push-pull-parser,
318 yypush_parse, yypull_parse, yypstate_new and yypstate_delete.
319
f16b0819
PE
3202007-08-15 Paul Eggert <eggert@cs.ucla.edu>
321
322 Update to GPLv3.
323 * doc/gpl-3.0.texi: New file.
324 * doc/gpl.texi: Remove.
325 * COPYING, GNUmakefile, HACKING, Makefile.am, Makefile.cfg:
326 * Makefile.maint, NEWS, PACKAGING, README, README-alpha:
327 * README-hacking, TODO, bootstrap, bootstrap.conf:
328 * configure.ac, data/Makefile.am, data/README, data/bison.m4:
329 * data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4:
330 * data/glr.c, data/glr.cc, data/java-skel.m4, data/java.m4:
331 * data/lalr1.cc, data/lalr1.java, data/location.cc:
332 * data/push.c, data/yacc.c, data/m4sugar/m4sugar.m4:
333 * djgpp/Makefile.maint, djgpp/README.in, djgpp/config.bat:
334 * djgpp/config.sed, djgpp/config.site, djgpp/config_h.sed:
335 * djgpp/djunpack.bat, djgpp/subpipe.c, djgpp/subpipe.h:
336 * djgpp/testsuite.sed, doc/Makefile.am, doc/bison.texinfo:
337 * doc/fdl.texi, doc/refcard.tex, etc/Makefile.am, etc/README:
338 * etc/bench.pl.in, examples/Makefile.am, examples/extexi:
339 * examples/calc++/Makefile.am, lib/Makefile.am, lib/abitset.c:
340 * lib/abitset.h, lib/bbitset.h, lib/bitset.c, lib/bitset.h:
341 * lib/bitset_stats.c, lib/bitset_stats.h, lib/bitsetv-print.c:
342 * lib/bitsetv-print.h, lib/bitsetv.c, lib/bitsetv.h:
343 * lib/ebitset.c, lib/ebitset.h, lib/get-errno.c:
344 * lib/get-errno.h, lib/lbitset.c, lib/lbitset.h:
345 * lib/libiberty.h, lib/main.c, lib/subpipe.c, lib/subpipe.h:
346 * lib/timevar.c, lib/timevar.def, lib/timevar.h:
347 * lib/vbitset.c, lib/vbitset.h, lib/yyerror.c:
348 * m4/c-working.m4, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4:
349 * m4/timevar.m4, src/LR0.c, src/LR0.h, src/Makefile.am:
350 * src/assoc.c, src/assoc.h, src/closure.c, src/closure.h:
351 * src/complain.c, src/complain.h, src/conflicts.c:
352 * src/conflicts.h, src/derives.c, src/derives.h, src/files.c:
353 * src/files.h, src/flex-scanner.h, src/getargs.c:
354 * src/getargs.h, src/gram.c, src/gram.h, src/graphviz.c:
355 * src/lalr.c, src/lalr.h, src/location.c, src/location.h:
356 * src/main.c, src/muscle_tab.c, src/muscle_tab.h:
357 * src/nullable.c, src/nullable.h, src/output.c, src/output.h:
358 * src/parse-gram.c, src/parse-gram.h, src/parse-gram.y:
359 * src/print.c, src/print.h, src/print_graph.c:
360 * src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c:
361 * src/reduce.h, src/relation.c, src/relation.h:
362 * src/revision.h, src/scan-code.h, src/scan-code.l:
363 * src/scan-gram.h, src/scan-gram.l, src/scan-skel.h:
364 * src/scan-skel.l, src/state.c, src/state.h, src/symlist.c:
365 * src/symlist.h, src/symtab.c, src/symtab.h, src/system.h:
366 * src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h:
367 * tests/Makefile.am, tests/actions.at, tests/c++.at:
368 * tests/calc.at, tests/conflicts.at, tests/cxx-type.at:
369 * tests/existing.at, tests/glr-regression.at:
370 * tests/headers.at, tests/input.at, tests/java.at:
371 * tests/local.at, tests/output.at, tests/push.at:
372 * tests/reduce.at, tests/regression.at, tests/sets.at:
373 * tests/skeletons.at, tests/synclines.at, tests/testsuite.at:
374 * tests/torture.at:
375 Update to GPLv3.
376
728c4be2
JD
3772007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
378
379 Get rid of broken %no-parser, -n, and --no-parser implementation and
380 documentation.
381 * TODO: Don't mention them.
382 * doc/bison.1: Likewise.
383 * doc/bison.texinfo (Decl Summary): Likewise.
384 (Bison Options): Likewise.
385 (Option Cross Key): Likewise.
386 * src/getargs.c (no_parser_flag): Remove global variable.
387 (usage): Don't print description of -n and --no-parser.
388 (long_options): Remove --no-parser entry here.
389 (getargs): Remove -n case in the switch here.
390 * src/getargs.h (no_parser_flag): Remove extern.
391 * tests/regression.at (Web2c Actions): Remove comment that mentions
392 --no-parser.
393
5d31a216
JD
3942007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
395
396 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Do not
397 name user variables starting with `yy'. Just pass NULL instead of a
398 dummy local &yylval to yypush_parse.
399 * tests/torture.at (AT_DATA_STACK_TORTURE): Do not name user variables
400 starting with `yy'.
401
a2ea208d
JD
4022007-08-03 Joel E. Denny <jdenny@ces.clemson.edu>
403
404 * data/yacc.c (yyexhaustedlab): Define it when YYERROR_VERBOSE is
405 true since it's then always used regardless of whether yyoverflow is
406 defined. Reported by Christian Burger at
407 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00031.html>.
408 * THANKS: Add Christian Burger.
409
91661ebb
JD
410 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
411 node names: say "Decl Summary" not "Bison Declaration Summary".
412
cbd50549
JD
4132007-07-28 Joel E. Denny <jdenny@ces.clemson.edu>
414
415 * src/muscle_tab.c (muscle_percent_define_flag_if): In order to
416 determine whether this function has already complained about an invalid
417 value for a %define boolean variable, don't check whether Bison has
418 ever examined the value. As written, the check was a tautology.
419 Instead, record and check for this complaint using a separate muscle.
420
eb1b0740
JD
4212007-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
422
423 Fix push parsing memory leak reported by Brandon Lucia at
424 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00032.html>.
425 * THANKS: Add Brandon Lucia.
426 * data/push.c (yypstate_delete): Free the stack if it was reallocated
427 but the parse never completed and thus freed it.
428 * tests/Makefile.am (TESTSUITE_AT): Add push.at.
429 * tests/testsuite.at: Include push.at.
430 * test/push.at: New.
431 (Push Parsing: Memory Leak for Early Deletion): New test case.
432
9d774aff
JD
4332007-07-17 Joel E. Denny <jdenny@ces.clemson.edu>
434
435 Improve handling of multiple S/R conflicts in the same state and of S/R
436 conflicts involving multiple reductions.
437 * src/conflicts.c (resolve_sr_conflict): Don't assign the error action
438 set for a state here or Bison will abort if it is reassigned on a
439 later conflicted reduction in the same state.
440 Similarly, don't finalize and assign the solved conflicts report here
441 or it will be lost if it is reassigned on a later conflicted reduction
442 in the same state.
443 (set_conflicts): Instead, assign them both here after all S/R conflicts
444 in the state have been fully examined.
445 * src/print.c (shift_set): Rename to...
446 (no_reduce_set): ... this.
447 (print_reductions): Update for rename, and add %nonassoc error action
448 tokens to no_reduce_set so that, when printing the first remaining
449 reduction on an error action token, the reduction is enclosed in
450 brackets.
451 (print_results): Update for rename.
452 * tests/conflicts.at (Solved conflicts report for multiple reductions
453 in a state): New test case.
454 (%nonassoc error actions for multiple reductions in a state): New test
455 case.
456
457 * src/main.c (main): Don't depend on C99 features.
458
10159d2a
JD
4592007-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
460
461 * build-aux/.cvsignore: Add compile.
b541ffdf
JD
462 * lib/.cvsignore: Add charset.alias, ref-add.sed, ref-del.sed, and
463 uniwidth.
10159d2a 464
953b3935
JD
4652007-07-10 Joel E. Denny <jdenny@ces.clemson.edu>
466
467 * bootstrap (slurp): Create target directories that don't exist.
468 Specifically, we need lib/uniwidth/ because of recent Gnulib changes.
469
6ce2d93a
JD
4702007-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
471
472 * LR0.c (new_itemsets): Fix wording in comments: say item index rather
473 than item number.
474 * closure.c (closure): Likewise.
475 * state.h (reductions): Comment sorting of rules.
476 (state): Comment sorting of items.
477
ce3448d5
JD
4782007-07-02 Joel E. Denny <jdenny@ces.clemson.edu>
479
480 Fix C++ test cases after recent Gnulib changes. Discussed starting at
481 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00000.html>.
482 * examples/calc++/Makefile.am (DEFAULT_INCLUDES): Override Automake's
483 definition in order to avoid Gnulib headers since we don't use config.h
484 here.
485 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Use AT_DATA_GRAMMAR
486 rather than AT_DATA so that config.h is included.
487
8a86eef0
JD
4882007-07-01 Joel E. Denny <jdenny@ces.clemson.edu>
489
490 * data/glr.c (yy_yypstack, yypstates, yypdumpstack): Use YYFPRINTF
491 instead of fprintf. Guard these functions with #if YYDEBUG instead of
492 #ifdef YYDEBUG for consistency with all other uses of YYDEBUG in Bison
493 and so that YYFPRINTF is guaranteed to be defined here.
494
b1a81613
JD
4952007-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
496
497 * src/muscle_tab.c (muscle_percent_define_invalid_value): Replace
498 with...
499 (muscle_percent_define_check_values): ... this more helpful function.
500 Again, it's not used yet, but it will be.
501 * src/muscle_tab.h: Likewise.
502
71b61d4d
JD
503 Improve some comments in parser table construction.
504 * src/LR0.c (new_itemsets): Explain sorting of itemset and kernel_base.
505 (generate_states): Don't mention ruleset, which is internal to closure.
506 * src/closure.c (closure): Explain sorting of core and itemset, which
507 is required for this function to behave correctly.
508 * src/closure.h (closure): Mention sorting.
509
2a6b783d
JD
5102007-05-28 Joel E. Denny <jdenny@ces.clemson.edu>
511
512 * src/lalr.c (state_lookahead_tokens_count): For code readability,
513 move the check for disabled transitions to an aver since conflict
514 resolution hasn't happened yet.
515
516 * src/lalr.c (state_lookahead_tokens_count): Remove the check that
517 labels a state as inconsistent just because it has error transitions.
518 The original form of this check appeared in revision 1.1 of lalr.c,
519 which was committed on 1991-12-21. Now (at least), changing the
520 consistency label on such a state appears to have no useful effect in
521 any of the places it is examined, which I enumerate below. The key
522 point to understanding each item in this enumeration is that a state
523 with an error transition is labelled consistent in the first place only
524 if it has no rules, so the check cannot matter for states that have
525 rules. (1) Labelling a state as inconsistent will cause set_conflicts
526 to try to identify its conflicts, and a state must have *rules* to have
527 conflicts. (2) Labelling a state as inconsistent will affect how
528 action_row sets the default *rule* for the state. (3) Labelling a
529 state as inconsistent will cause build_relations to add lookback edges
530 to *rules* in that state.
531 * src/state.h (struct state): Word the comment for member consistent
532 more carefully.
533
14462c2b
JD
5342007-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
535
536 Don't depend on C99 features.
537 * src/conflicts.c (conflicts_update_state_numbers): Fix for-loop.
538 * src/lalr.c (lalr_update_state_numbers): Fix for-loop.
539 * src/reader.c (check_and_convert_grammar): Fix for-loop.
540 * src/state.c (state_mark_reachable_states): Fix for-loop.
541 (state_remove_unreachable_states): Fix for-loop.
542
543 Don't widen struct state with member reachable just to temporarily
544 record reachability. Instead, use a local bitset.
545 * src/state.h (struct state): Remove member.
546 * src/state.c (state_new): Don't initialize it.
547 (state_mark_reachable_states): Rename to...
548 (state_record_reachable_states): ... this, and use bitset.
549 (state_remove_unreachable_states): Use bitset.
550
5a43d418
JD
5512007-05-26 Joel E. Denny <jdenny@ces.clemson.edu>
552
553 * src/Makefile.am (yacc): Quote target action commands properly so
554 that the yacc script isn't corrupt. Reported by Hans Aberg at
555 <http://lists.gnu.org/archive/html/bug-bison/2007-05/msg00003.html>.
556
0c650a20
JD
557 * data/glr.c (yylval): As in yacc.c, don't extern in the header for
558 the case of pure parsers. Reported by Frans Englich at
559 <http://lists.gnu.org/archive/html/help-bison/2007-05/msg00018.html>.
560 * THANKS: Add Frans Englich.
561
61fee93e
JD
562 * NEWS (2.3a+): In the %code entry, reference section `Bison
563 Declaration Summary' from the manual now since the %code summary has
564 moved there.
565 * doc/bison.texinfo (Prologue Alternatives): Mention that directives
566 in the rules section must be terminated by semicolons.
567
f124d423
JD
5682007-05-20 Joel E. Denny <jdenny@ces.clemson.edu>
569
570 Extend the front-end API for %define variables to more completely
571 mirror the back-end. This will be useful in the future.
572 * data/bison.m4 (b4_percent_define_get, b4_percent_define_ifdef):
573 Update comments to mention the new front-end counterparts of these
574 macros.
575 * src/muscle_tab.c (MUSCLE_COMMON_DECODE): New macro with common code
576 for muscle_string_decode and muscle_location_decode.
577 (muscle_string_decode): New static function.
578 (muscle_location_decode): Use MUSCLE_COMMON_DECODE.
579 (muscle_percent_define_get, muscle_percent_define_ifdef): New
580 functions.
581 (muscle_percent_define_flag_if): Use muscle_percent_define_ifdef and
582 muscle_percent_define_get to mimic the b4_percent_define_flag_if
583 implementation more closely.
584 (muscle_percent_define_invalid_value): New function.
585 * src/muscle_tab.h (muscle_percent_define_get,
586 muscle_percent_define_ifdef, muscle_percent_define_invalid_value):
587 Prototype.
588
75ad86ee
JD
5892007-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
590
591 * NEWS (2.3a+): Mention yesterday's state-removal change.
592 (2.3a): Remove the %language entry, which was added after 2.3a.
593 * src/LR0.c, src/closure.c, src/closure.h, src/conflicts.c,
594 src/conflicts.h, src/lalr.c, src/lalr.h, src/print.c,
595 src/print_graph.c, src/state.c, src/state.h, tests/conflicts.at,
596 tests/existing.at: Update copyright date.
597
5967f0cf
JD
5982007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
599
600 If conflict resolution makes states unreachable, remove those states,
601 report rules that are then unused, and don't report conflicts in those
602 states.
603 * src/conflicts.c, src/conflicts.h (conflicts_update_state_numbers):
604 New global function.
605 * src/lalr.c, src/lalr.h (lalr_update_state_numbers): New global
606 function.
607 * src/main.c (main): After conflict resolution, remove the unreachable
608 states and update all data structures that reference states by number.
609 * src/state.c (state_new): Initialize each state's reachable member to
610 false.
611 (state_mark_reachable_states): New static function.
612 (state_remove_unreachable_states): New global function.
613 * src/state.h (struct state): Add member bool reachable.
614 (state_remove_unreachable_states): Prototype.
615 * tests/conflicts.at (Unreachable States After Conflict Resolution):
616 New test case.
617 * tests/existing.at (GNU pic Grammar): Update test case output now that
618 an unused rule is discovered.
619
b09f4f48
JD
6202007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
621
622 Minor code cleanup in parser table construction.
623 * src/LR0.c (new_itemsets): Use item_number_is_symbol_number.
624 (new_itemsets, save_reductions): Update for rename to nitemset.
625 * src/closure.c (nritemset): Rename to...
626 (nitemset): ... this since the "r" appears to meaningless and isn't
627 used in the comments.
628 (closure): Update for rename.
629 * src/closure.h (nritemset): Update extern to...
630 (nitemset): ... this.
631 * src/lalr.c (LA): Fix a typo in comments.
632 * src/print.c (print_core): Update for rename to nitemset.
633 * src/print_graph.c (print_graph): Likewise.
634 * src/state.h: Fix some typos in header comments.
635
bbb44d83
PE
6362007-04-04 Paul Eggert <eggert@cs.ucla.edu>
637
9b33de72
PE
638 * THANKS: Use ASCII for Sebastien Fricker's name. Bison source
639 still sticks to ASCII. Sorry!
640
bbb44d83
PE
641 * README-hacking: New file, taken mostly from coreutils, with changes
642 for Bison. Contains much of the contents of:
643 * README-cvs: Remove.
644 * bootstrap: Sync from gnulib.
645 * build-aux/.cvsignore: Remove *.t, mkinstalldirs.
646 * lib/.cvsignore: Add wchar.h, wctype.h. Remove exit.h.
647
29553547
JD
6482007-03-10 Joel E. Denny <jdenny@ces.clemson.edu>
649
650 * doc/bison.texinfo (Destructor Decl): Fix typo reported by Sebastian
651 Setzer.
652 (Java Differences): Fix some typos.
653 * THANKS: Add Sebastian Setzer.
654
01b477c6
PB
6552007-03-07 Paolo Bonzini <bonzini@gnu.org>
656
657 * data/java.m4 (b4_single_class_if): Remove.
658 (b4_abstract_if): Look at "%define abstract".
659 (b4_lexer_if): New.
660 (b4_union_name): Rename...
661 (b4_yystype): ... to this. Map to "%define stype".
662 (b4_rhs_value, b4_parse_param_decl, b4_lex_param_decl,
663 b4_maybe_throws): Fix quoting.
664 (b4_lex_param_call): Move below to keep b4_*_param_decl close.
665 * data/lalr1.java (Lexer interface): Always define.
666 (Lexer interface within parser class): Remove.
667 (YYLexer class): New, used when "%code lexer" is present.
668 (constructor): When "%code lexer" is used, pass %lex-param
669 to the lexer constructor.
670 (yylex, yyparse): Remove %lex-param from method invocations
671 (YYStack, yyaction, yyparse): Rename b4_union_name to b4_yystype.
672
673 * doc/bison.texinfo (Java Bison Interface): Mention "%define
674 abstract". Rename "%define union_name" to "%define stype".
675 Rename method names according to previous patch.
676 (Java Scanner Interface): Describe "%code lexer" instead of
677 "%pure-parser" and "%define single_class".
678 (Java Differences): Mention "%code lexer".
679
680 * tests/java.at (_AT_DATA_JAVA_CALC_Y): Remove final argument.
681 Include scanner here, using macros from tests/local.at.
682 (AT_DATA_CALC_Y): Remove final argument.
683 (_AT_CHECK_JAVA_CALC): Likewise.
684 (AT_CHECK_JAVA_CALC): Likewise. Test all four combinations
685 of %locations and %error-verbose.
686 (main): Test with and without %lex-param.
687 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_LEXPARAM_IF.
688 (AT_BISON_OPTION_POPDEFS): Pop it.
689
122bea3a
JMG
6902007-03-07 Juan Manuel Guerrero <juan.guerrero@gmx.de>
691
692 DJGPP spefic issue. Inhibit the use of disallowed characters for
693 file name genertion on Win98, WinXP, etc. These are |<>":?*\
694 and concern testsuite case 46.
695 * Makefile.am: djgpp/testsuite.sed added to EXTRA_DIST
696 * djgpp/testsuite.sed: Inhibit the use of disallowed characters.
697 * djgpp/config.bat: Inhibit the use of disallowed characters.
698
9611cfa2
JD
6992007-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
700
701 Miscellaneous %define and %code cleanup.
702 * data/bison.m4 (b4_percent_define_flag_if): Correct comments on how
703 values are interpreted.
704 * doc/bison.texinfo (Decl Summary): Clean up and extend %define
705 documentation a little more.
706 * src/muscle_tab.c (MUSCLE_USER_NAME_CONVERT,
707 muscle_percent_define_insert, muscle_percent_code_grow): New
708 functions/macros.
709 * src/muscle_tab.h (muscle_percent_define_insert,
710 muscle_percent_code_grow): Prototype.
711 * src/parse-gram.y (prologue_declaration): Use
712 muscle_percent_define_insert and muscle_percent_code_grow when parsing
713 %define and %code directives.
714
715 Make it easy to share %define boolean variables between the front-end
716 and back-end. Though not used yet, this will be useful in the future.
717 * data/bison.m4 (b4_check_user_names): Rewrite comments to talk about
718 Bison uses of names rather than just skeleton uses of names.
719 (b4_percent_define_get, b4_percent_define_ifdef): Rename
720 b4_percent_define_skeleton_variables(VARIABLE) to
721 b4_percent_define_bison_variables(VARIABLE).
722 (b4_percent_code_get, b4_percent_code_ifdef): Rename
723 b4_percent_code_skeleton_qualifiers(QUALIFIER) to
724 b4_percent_code_bison_qualifiers(QUALIFIER).
725 (b4_check_user_names_wrap): Update for renames.
726 * src/muscle_tab.c, src/muscle_tab.h (muscle_percent_define_flag_if,
727 muscle_percent_define_default): New functions mimicking
728 b4_percent_define_flag_if and b4_percent_define_default.
729
730 For %define variables, report locations for invalid values and
bbb44d83 731 redefinitions.
9611cfa2
JD
732 * data/bison.m4 (b4_percent_define_flag_if): Read
733 b4_percent_define_loc(VARIABLE) to report the location of an invalid
734 value for VARIABLE.
735 (b4_percent_define_default): Save a special location in
736 b4_percent_define_loc(VARIABLE) in case the default value for VARIABLE
737 must later be reported as invalid.
738 * src/muscle_tab.c (muscle_location_grow, muscle_location_decode): New
739 functions.
740 (muscle_percent_define_insert): Record the location of VARIABLE in
741 muscle percent_define_loc(VARIABLE), and use it to report the previous
742 location for a redefinition.
743 (muscle_percent_define_flag_if): Update like b4_percent_define_flag_if.
744 (muscle_percent_define_default): Update like b4_percent_define_default.
745 (muscle_grow_user_name_list): Rename to...
746 (muscle_user_name_list_grow): ... this for consistency and use
747 muscle_location_grow.
748 * src/muscle_tab.h (muscle_location_grow): Prototype.
749 * tests/input.at (%define errors): Update expected output.
750 * tests/skeletons.at (%define boolean variables: invalid skeleton
751 defaults): New test case.
752
0bf92491
JD
7532007-02-28 Joel E. Denny <jdenny@ces.clemson.edu>
754
755 * src/print.c (lookahead_set, state_default_rule): Remove.
756 (print_reductions): Replace state_default_rule invocation with
757 equivalent use of yydefact, which was computed in token_actions in
758 tables.c.
759 (print_results): Don't allocate lookahead_set.
760
d3b12988
PB
7612007-02-27 Paolo Bonzini <bonzini@gnu.org>
762
763 * data/lalr1.java: Prefix all private members with yy.
764
f57a7536
JD
7652007-02-24 Joel E. Denny <jdenny@ces.clemson.edu>
766
767 Use YYFPRINTF instead of fprintf where appropriate. Reported by
9b33de72 768 Sebastien Fricker at
f57a7536 769 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00035.html>.
9b33de72 770 * THANKS: Add Sebastien Fricker.
f57a7536
JD
771 * data/glr.c, data/push.c, data/yacc.c (yy_reduce_print): Implement.
772 * doc/bison.texinfo (Tracing): Make it clearer that YYFPRINTF must
773 accept a variable number of arguments.
774
6404a5bf
JD
7752007-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
776
777 * bootstrap: Remove occurrences of .#bootmp from lib/Makefile.
778
e4e09639
JMG
7792007-02-13 Juan Manuel Guerrero <juan.guerrero@gmx.de>
780
781 * djgpp/config.bat: Adjustments concerning the use of autoconf 2.61.
782 * djgpp/config.sed: Adjustments concerning the use of autoconf 2.61.
783 * djgpp/config.site: Adjustments concerning the use of autoconf 2.61.
784
d7e0a1a7
PE
7852007-02-11 Paul Eggert <eggert@cs.ucla.edu>
786
787 Undo my 2007-02-07 change, switching back to the c-strcase module
788 introduced in the 2007-02-03 change. Bruno Haible reported that
789 the 2007-02-07 change would be dangerous in Turkish if we add a
790 language whose name contains "i", since "i" is not lowercase "I"
791 in Turkish.
792 * bootstrap.conf (gnulib_modules): Add c-strcase. Remove strcase.
793 * lib/.cvsignore: Add c-ctype.c, c-ctype.h, c-strcase.h,
794 c-strcasecomp.c, c-strncasecmp.c. Remove strcasecmp.c, strncasecmp.c.
795 * m4/.cvsignore: Remove strcase.m4.
796 * src/getargs.c: Revert 2007-02-07 change, as follows.
797 Include c-strcase.h.
798 (language_argmatch): Use c_strcasecmp rather than strcasecmp.
799
deee93a1
JD
8002007-02-11 Bruno Haible <bruno@clisp.org>
801
802 Enable the Java related testsuite tests when the only Java compiler
803 found is a gcj < 4.3. Discussed at
804 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00016.html>.
805 * configure.ac (gt_JAVACOMP): Don't specify a target_version.
806
574add85
JD
8072007-02-11 Joel E. Denny <jdenny@ces.clemson.edu>
808
809 * data/Makefile.am: Update copyright date.
810 * data/push.c (yypull_parse): Report memory exhaustion and return 2 if
811 yypstate_new returns NULL.
812 (yypstate_new): Return NULL if malloc does.
813 * src/reader.c (packgram): Move translation of rule actions from the
814 beginning of packgram to...
815 (check_and_convert_grammar): ... here right before packgram is invoked
816 so it's easier to write more complete comments, and remove redundant
817 code.
818
e785ccf7
JD
8192007-02-10 Joel E. Denny <jdenny@ces.clemson.edu>
820
821 As in semantic actions, make @$ in %initial-action, %destructor, and
822 %printer imply %locations.
823 * src/scan-code.l (SC_SYMBOL_ACTION): Set locations_flag = true when
824 scanning @$.
825 * tests/actions.at (AT_CHECK_ACTION_LOCATIONS): New macro supporting...
826 (@$ in %initial-action implies %locations,
827 @$ in %destructor implies %locations,
828 @$ in %printer implies %locations): ... these new test cases.
829
1cfe1ed7
PE
8302007-02-07 Paul Eggert <eggert@cs.ucla.edu>
831
832 Undo most of the 2007-02-03 change, switching to the strcase module
833 now that gnulib strcase has been fixed.
834 * bootstrap.conf (gnulib_modules): Remove c-strcase. Add strcase.
835 * lib/.cvsignore: Remove c-ctype.c, c-ctype.h, c-strcase.h,
836 c-strcasecomp.c, c-strncasecmp.c. Add strcasecmp.c, strncasecmp.c
837 * m4/.cvsignore: Add strcase.m4.
838 * src/getargs.c: Revert 2007-02-03 change, as follows.
839 Don't include c-strcase.h.
840 (language_argmatch): Use strcasecmp rather than c_strcasecmp.
841 strcasecmp has "unspecified behavior" outside the POSIX locale,
842 but it works fine in practice if at least one argument is ASCII,
843 as is the case in Bison.
844
0049ec86
PB
8452007-02-07 Paolo Bonzini <bonzini@gnu.org>
846
847 * tests/java.at: Skip tests if only one of javac/java is present.
848 Reported by Joel E. Denny.
849 * tests/atlocal.in: Adjust copyright years.
850
8512007-02-05 Paolo Bonzini <bonzini@gnu.org>
852
853 * data/lalr1.java (Stack): Work around old verifiers that disallow
854 access to the private fields of an inner class, from the outer class.
855 We can make Stack's fields public because user code doesn't have access
856 to the instance of Stack used by parse(). Reported by Paul Eggert.
857
2c2b7220
PE
8582007-02-03 Paul Eggert <eggert@cs.ucla.edu>
859
860 * .cvsignore: Add javacomp.sh, javaexec.sh. Is this really
861 the right spot for these files?
862 * bootstrap.conf (gnulib_modules): Add c-strcase.
863 * lib/.cvsignore: Add c-ctype.c c-ctype.h, c-strcasecomp.c,
864 c-strncasecmp.c.
865 * src/getargs.c: Include c-strcase.h.
866 (language_argmatch): Use c_strcasecmp rather than strcasecmp,
867 to avoid unspecified behavior.
868
b2b81dae
JD
8692007-02-01 Joel E. Denny <jdenny@ces.clemson.edu>
870
871 * doc/bison.texinfo (Decl Summary): Correct typo.
872
c1d19e10
PB
8732007-01-30 Paolo Bonzini <bonzini@gnu.org>
874
875 * data/bison.m4 (b4_percent_define_flag_if): Don't treat 0 as false.
876 Complain if the value does not match empty, "true" or "false".
877 * data/c++.m4: Adjust default definitions of %define variables.
878 * data/java.m4: Adjust default definitions of %define variables.
879 * doc/bison.texinfo (Decl Summary): Adjust the %define entry according
880 to above behavior.
881 * tests/input.at (Boolean %define variables): Test new behavior.
882
8405b70c
PB
8832007-01-29 Paolo Bonzini <bonzini@gnu.org>
884
885 * NEWS: Mention java.
886 * TODO: Remove things that are done.
887 * bootstrap.conf: Add javacomp-script and javaexec-script.
888 * configure.ac: Invoke gt_JAVACOMP and gt_JAVAEXEC.
889
890 * data/Makefile.am: Add new files.
891 * data/java-skel.m4: New.
892 * data/java.m4: New.
893 * data/lalr1.java: New.
894
895 * doc/bison.texinfo: Put "A Complete C++ Example" under
896 C++ Parsers. Add Java Parsers. Put C++ Parsers and Java Parsers
897 under Other Languages.
898
899 * src/getargs.c (valid_languages): Add Java.
900 * src/getargs.h (struct bison_language): Update size of string fields.
901
902 * tests/Makefile.am: Add java.at.
903 * tests/atlocal.in: Add CONF_JAVA and CONF_JAVAC.
904 * tests/java.at: New.
905 * tests/testsuite.at: Include it.
906
3eb82471
JD
9072007-01-28 Joel E. Denny <jdenny@ces.clemson.edu>
908
909 Clean up.
910 * src/scan-skel.l (at_directive_perform): Add at_directive_argc and
911 at_directive_argv arguments so these no longer have to be global
912 variables. Also, update the implementation for the following changes.
913 (fail_for_at_directive_too_many_args,
914 fail_for_at_directive_too_few_args): Add at_directive_name argument.
915 (at_directive_name): Remove as at_directive_argv[0] will be used for
916 this now.
917 (AT_DIRECTIVE_ARGC_MAX): Increment to make space in at_directive_argv
918 for the directive name.
919 (at_directive_argc, at_directive_argv): Make these local within
920 skel_lex instead of global.
921 (INITIAL): Update directive start action for above changes.
922 (SC_AT_DIRECTIVE_ARG): Rename to...
923 (SC_AT_DIRECTIVE_ARGS): ... this, and update for above changes.
924 (SC_AT_DIRECTIVE_SKIP_WS): Update.
925 (scan_skel): Move yylex_destroy to...
926 (skel_scanner_free): ... here.
927 * tests/skeletons.at (installed skeleton file name): Rename to...
928 (installed skeleton file names): ... this.
929
148d66d8
JD
9302007-01-27 Joel E. Denny <jdenny@ces.clemson.edu>
931
932 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
933 node names: say "Table of Symbols" not "Bison Symbols", and say "Decl
934 Summary" not "Directives".
935 * doc/bison.texinfo (Decl Summary, Calc++ Parser): Cross-reference the
936 %code entry in "Decl Summary" rather than the one in "Table of Symbols"
937 since the former is now the more complete one.
938 (Prologue Alternatives): Likewise and do the same for %defines.
939 (Table of Symbols): Add summary of %code, add summary of %define, and
940 move full %code documentation to...
941 (Decl Summary): ... here for consistency with other entries in these
942 sections.
943 Move %define entry in order to keep this list alphabetized.
944 Reword %define entry a little to put less emphasis on the skeleton
945 concept, which most users shouldn't have to think about.
946
665f0c24
PE
9472007-01-26 Paul Eggert <eggert@cs.ucla.edu>
948
949 Adjust to recent gnulib changes.
950 * lib/.cvsignore: Remove stpcpy.h, strndup.h, strnlen.h.
951 Add string.h, string_.h, unistd_.h, wchar_.h.
952 * m4/.cvsignore: Add gnulib-common.m4, string_h.m4, wchar.m4.
953 * src/system.h: Don't include <stpcpy.h>; this is now done by
954 <string.h>.
955
592d0b1e
PB
9562007-01-23 Paolo Bonzini <bonzini@gnu.org>
957
958 Simplify implementation of unqualified %code, implement macros for
959 uniform treatment of boolean %define flags. Document %define.
960 * data/bison.m4 (b4_percent_define_ifdef, b4_percent_define_flag_if,
961 b4_percent_code_ifdef): New.
962 (b4_percent_code_get): Map unqualified %code to b4_percent_code().
963 * data/c++.m4: Define default value for global_tokens_and_yystype.
964 * data/glr.cc: Likewise.
965 * data/location.cc: Use b4_percent_define_flag_if.
966
148d66d8 967 * doc/bison.texinfo (Decl Summary): Document %define.
592d0b1e
PB
968
969 * src/parse-gram.y (Unqualified %code): Change muscle name to
970 b4_percent_code().
971 (content.opt): Default to empty.
972
a7867f53
JD
9732007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
974
975 Implement support for relative and absolute skeleton file names.
976 Discussed starting at
977 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00071.html>.
978 * doc/bison.texinfo (Decl Summary): Document in %skeleton entry.
979 (Bison Options): Document in --skeleton entry.
980 * src/output.c (output_skeleton): Use strncpy rather than strcpy since
981 full_skeleton can't necessarily hold all of pkgdatadir.
982 If the specified skeleton file name contains a `/', don't prepend
983 pkgdatadir.
984 * src/parse-gram.y (prologue_declaration): If the specified skeleton
985 file name contains a `/', prepend the grammar file directory.
986 * tests/Makefile.am (TESTSUITE_AT): Add skeletons.at.
987 * skeletons.at: New file.
988 (relative skeleton file names): New test case.
989 (installed skeleton file names): New test case.
990 * tests/testsuite.at: Include skeletons.at.
991
992 * bootstrap: Update copyright to 2007.
993
830c9b18
PB
9942007-01-17 Paolo Bonzini <bonzini@gnu.org>
995
996 * bootstrap: Remove occurrences of .#bootmp from the files.
997
a8c2e813
AD
9982007-01-17 Akim Demaille <akim@epita.fr>
999
1000 * doc/bison.texinfo (Calc++ Parser): Don't try to alias
1001 nonterminals.
1002 Use per-type %printer.
1003
279cabb6
JD
10042007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
1005
1006 * NEWS, data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4,
1007 data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
1008 djgpp/config.site, src/files.c, src/files.h, src/main.c,
1009 src/muscle_tab.c, src/muscle_tab.h, src/parse-gram.y, src/reader.h,
1010 src/scan-skel.h, src/scan-skel.l, tests/actions.at, tests/calc.at,
1011 tests/glr-regression.at, tests/input.at, tests/local.at,
1012 tests/output.at, tests/torture.at: Update copyright to 2007.
1013
bb32f4f2
AD
10142007-01-16 Akim Demaille <akim@epita.fr>
1015
1016 * doc/bison.texinfo (Calc++ Parsing Driver): Let "parse" return an
1017 error code.
1018 (Calc++ Scanner): Exit with failure if we can't open the input
1019 file.
1020 Accept "-" standing for stdin.
1021 (Calc++ Top Level): Print the result only if the parsing was
1022 successful.
1023
7cff04b5
AD
10242007-01-16 Akim Demaille <akim@epita.fr>
1025
1026 * data/lalr1.cc (yy_reduce_print_): Add a missing end-of-line.
1027
a4e25e1d
JD
10282007-01-15 Paolo Bonzini <bonzini@gnu.org>
1029 and Joel E. Denny <jdenny@ces.clemson.edu>
1030
1031 Clean up %define and %code implementation in M4 some. Most
1032 importantly, rename all related macros to be in the b4_percent_define
1033 and b4_percent_code namespaces. Also, complete support for `.' in
1034 %define variable names and %code qualifiers.
1035 * data/bison.m4 (b4_check_user_names): Check for special
1036 "SKELETON-NAMESPACE(name)" macros instead of using two nested
1037 m4_foreach loops.
1038 (b4_get_percent_define, b4_get_percent_code): Rename to...
1039 (b4_percent_define_get, b4_percent_code_get): ... these.
1040 Extend documentation with examples.
1041 For SKELETON-NAMESPACE (as documented for b4_check_user_names), use
1042 b4_percent_define_skeleton_variables and
1043 b4_percent_code_skeleton_qualifiers.
1044 Expect any value for the %define variable `foo' to be stored in the
1045 macro named `b4_percent_define(foo)'; expect any %code blocks for the
1046 qualifier `foo' to be stored in a macro named `b4_percent_code(foo)';
1047 expect any unqualified %code blocks to be stored in a macro named
1048 `b4_percent_code_unqualified'.
1049 Use m4_indir so that %define variable names and %code qualifiers can
1050 contain `.', which is allowed by the grammar parser.
1051 (b4_percent_define_default): New macro to set a default value for a
1052 %define variable.
1053 (m4_wrap): Update wrapped code, and fix some underquoting.
1054 (b4_check_user_names_wrap): Update and define outside the m4_wrap.
1055 Expect grammar uses of %define variables and %code qualifiers to be
1056 defined in b4_percent_define_user_variables and
1057 b4_percent_code_user_qualifiers.
1058 * data/c++.m4: Use b4_percent_define_default rather than
1059 m4_define_default. Fix some underquoting. Skeleton usage of %define
1060 variable define_location_comparison now implies skeleton usage of
1061 %define variable filename_type.
1062 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
1063 data/push.c, data/yacc.c: Update macro names.
1064 * src/parse-gram.y (prologue_declaration, grammar_declaration): Update
1065 muscle names.
1066
e37c665c
JMG
10672007-01-14 Juan Manuel Guerrero <juan.guerrero@gmx.de>
1068
1069 DJGPP specific issues.
1070
1071 * djgpp/config.site: Set ac_cv_path_mkdir to a sane DJGPP specific
1072 default. Set gl_cv_absolute_wctype_h to a sane DJGPP specific default.
1073
7d2d521f
JD
10742007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
1075
1076 * tests/glr-regression.at: Use AT_PARSER_CHECK rather than AT_CHECK to
1077 run parsers in all tests so that Valgrind is invoked during
1078 maintainer-check-valgrind.
1079 (Duplicate representation of merged trees): Free all semantic values.
1080 (Duplicated user destructor for lookahead): Likewise.
1081
e0ac9b4b
JD
10822007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
1083
1084 * tests/local.at (AT_PARSER_CHECK): Add a PRE argument to specify a
1085 command-line prefix.
1086 * tests/torture.at (Exploding the Stack Size with Alloca): Stderr is
1087 ignored, so use that PRE to set --log-fd=1 in VALGRIND_OPTS so we don't
1088 miss Valgrind messages.
1089 (Exploding the Stack Size with Malloc): Likewise.
1090
78143faa
JD
10912007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
1092
1093 Ignore YYSTACK_USE_ALLOCA for push parsers since the stacks can't be
1094 locals. Reported by Juan Manuel Guerrero at
1095 <http://lists.gnu.org/archive/html/bug-bison/2007-01/msg00000.html>.
1096 * data/push.c: Enclose the #ifdef YYSTACK_USE_ALLOCA in b4_push_if.
1097 Fix some indentation also.
1098 * tests/torture.at (Exploding the Stack Size with Alloca): Add comment
1099 explaining this issue.
1100
7ecec4dd
JD
11012007-01-09 Paolo Bonzini <bonzini@gnu.org>
1102 and Joel E. Denny <jdenny@ces.clemson.edu>
1103
1104 Simplify union and prologue handling, and escape union and lex/parse
1105 params with digraphs.
1106 * data/bison.m4 (b4_pre_prologue, b4_post_prologue): Set their default
1107 values to the empty string since these are no longer guaranteed
1108 initialized by the front-end.
1109 * data/glr.c, data/glr.cc, data/lalr1.cc, data/push.c, data/yacc.c: Add
1110 braces around b4_user_stype since this is no longer done by the
1111 front-end.
1112 * src/files.c, src/files.h (pre_prologue_obstack,
1113 post_prologue_obstack): Remove.
1114 * src/muscle_tab.c (muscle_pair_list_grow): Don't duplicate header
1115 comments here. Use MUSCLE_OBSTACK_SGROW so that values are escaped
1116 with digraphs. This fixes lex params and parse params.
1117 * src/muscle_tab.h (muscle_pair_list_grow): Update comments.
1118 * src/output.c (prepare): Remove muscle insertion of the prologues.
1119 (output): Remove freeing of pre_prologue_obstack and
1120 post_prologue_obstack.
1121 * src/parse-gram.y (prologue_declaration): Use muscle_code_grow rather
1122 than prologue_augment for prologue parsing so you don't need prologue
1123 obstacks.
5c80250c
JD
1124 (grammar_declaration): For %union RHS, use `braceless' instead of
1125 "{...}" so that braces are already stripped and code is escaped with
1126 digraphs.
7ecec4dd
JD
1127 * src/reader.c (prologue_augment): Remove.
1128 (reader): Remove initialization of pre_prologue_obstack and
1129 post_prologue_obstack.
1130 * src/reader.h (prologue_augment): Remove.
1131
1132 * data/c.m4: Remove stray parenthesis.
1133
16dc6a9e
JD
11342007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
1135
1136 Remove quotes from variables names in %define directives and from
1137 qualifiers in %code directives, and restrict the characters that are
1138 allowed in them to M4-friendly ones. For %define, continue to support
1139 the quoted form as a deprecated feature. Discussed starting at
1140 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00023.html>.
1141 * NEWS (2.3a+): Add entry for the change to %define. Update entry for
1142 %code.
1143 * doc/bison.texinfo (Prologue Alternatives): Update.
91661ebb
JD
1144 (Decl Summary): In %defines entry, update mention of `%code requires'
1145 and `%code provides'.
16dc6a9e
JD
1146 (C++ Location Values): Update %define uses.
1147 (Calc++ Parser Interface): Likewise.
1148 (Calc++ Parser): Likewise, and update `%code requires' uses.
148d66d8 1149 (Table of Symbols): Update %code documentation.
16dc6a9e
JD
1150 * src/parse-gram.y (prologue_declaration): For %define variables, use
1151 `variable' instead of `STRING'.
1152 (grammar_declaration): For %code qualifiers, use `ID' instead of
1153 `STRING'.
1154 (variable): New nonterminal that takes an `ID' or a `STRING'.
1155 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update %code
1156 and %define uses.
1157 * tests/calc.at (_AT_DATA_CALC_Y): Update %define use.
1158 * tests/input.at (Reject unused %code qualifiers): Update %code uses.
1159 (%define errors): Update %define uses.
1160
e9813cd4
JD
11612007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
1162
1163 * src/parse-gram.y (prologue_declaration): Use MUSCLE_INSERT_STRING
1164 instead of muscle_insert for %define values so that M4-special
1165 characters are replaced with digraphs.
1166 * tests/input.at (%define errors): Extend to check weird values.
1167
6afc30cc
JD
11682007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
1169
1170 Instead of having skeletons declare all valid %define variables and
1171 %code qualifiers, provide macros that retrieve the associated values
1172 and build these lists automatically. Thus Bison will now warn when a
1173 variable or qualifier is not used by the skeleton in the current
1174 invocation regardless of whether it might sometimes be used by that
1175 skeleton in other invocations. Also, move all %define value macros to
1176 the b4_percent_define_ namespace, and remove the %define "NAME" {CODE}
1177 form, which is replaced by %code.
1178 * data/bison.m4 (b4_check_for_unrecognized_names): Rename to...
1179 (b4_check_user_names): ... this, and change the series of valid name
1180 arguments to a single list argument for names used in the skeleton
1181 similar to the existing list argument for names used in the grammar.
1182 Warn instead of complaining.
1183 (b4_get_percent_define, b4_get_percent_code): New to retrieve %define
1184 values and %code code, to format %code code properly, and to build
1185 lists of all %define variables and %code qualifiers used in the
1186 skeleton: b4_skeleton_percent_define_variables and
1187 b4_skeleton_percent_code_qualifiers.
1188 (b4_check_percent_define_variables, b4_check_percent_code_qualifiers):
1189 Remove, and...
1190 (m4_wrap): ... m4_wrap b4_check_user_names invocations instead so that
1191 the skeleton names lists can finish building first. In place of
1192 b4_used_percent_define_variables and b4_used_percent_code_qualifiers,
1193 expect the lists b4_user_percent_define_variables and
1194 b4_user_percent_code_qualifiers.
1195 * data/c++.m4: Where setting default values for b4_parser_class_name,
1196 b4_location_type, b4_filename_type, b4_namespace, and
1197 b4_define_location_comparison, update their names to the
1198 b4_percent_define_ namespace.
1199 * data/glr.c: Don't use b4_check_percent_define_variables and
1200 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
1201 * data/glr.cc, data/lalr1.cc: Likewise, and use b4_get_percent_define.
1202 (b4_parser_class_name, b4_namespace): Define these using
a4e25e1d 1203 b4_get_percent_define for parser_class_name and namespace.
6afc30cc
JD
1204 * data/location.cc: Use b4_get_percent_define.
1205 * data/push.c: Don't use b4_check_percent_define_variables and
1206 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
1207 * data/yacc.c: Likewise, and don't call m4_exit in
1208 b4_use_push_for_pull_if or m4_wrap code will never execute.
1209 * src/muscle_tab.c, src/muscle_tab.h (muscle_grow_used_name_list):
1210 Rename to...
1211 (muscle_grow_user_name_list): ... this for consistency with the
1212 terminology used in bison.m4.
1213 * src/parse-gram.y (prologue_declaration): Prepend "percent_define_" to
1214 %define variable names, and rename muscle used_percent_define_variables
1215 to user_percent_define_variables.
1216 (grammar_declaration): Rename muscle used_percent_code_qualifiers to
1217 user_percent_code_qualifiers.
1218 (content): Remove.
1219 (content.opt): Replace content RHS with STRING RHS so %define "NAME"
1220 {CODE} form is no longer accepted.
1221 * tests/input.at (Reject bad %code qualifiers): Rename to...
1222 (Reject unused %code qualifiers): ... this, and update test output.
1223 (%define error): Update test output.
1224
7eb8a0bc
JD
12252007-01-07 Joel E. Denny <jdenny@ces.clemson.edu>
1226
1227 Check for unrecognized %define variables similar to checking for
1228 unrecognized %code qualifiers. Check for redefined %define variables.
1229 * data/bison.m4 (b4_check_for_unrecognized_names): New macro that
1230 generalizes...
1231 (b4_check_percent_code_qualifiers): ... this, which now wraps it.
1232 (b4_check_percent_define_variables): New, also wraps it.
1233 * data/glr.c: Unless glr.cc is wrapping glr.c, declare no valid %define
1234 variables using b4_check_percent_define_variables.
1235 * data/glr.cc, data/lalr1.cc: Declare the valid %define variables as
1236 all those exercised in the test suite and all those listed in the
1237 `Default values' section of c++.m4. Are there others?
1238 * data/push.c, data/yacc.c: Declare no valid %define variables.
1239 * src/muscle_tab.c, src/muscle_tab.h (muscle_find_const): New function,
1240 similar to muscle_find, but it works even when the muscle stores a
1241 const value.
1242 (muscle_grow_used_name_list): New function for constructing the used
1243 name list muscles that b4_check_for_unrecognized_names requires.
1244 * src/parse-gram.y (prologue_declaration): Warn if a variable is
1245 %define'd more than once. Define the b4_used_percent_define_variables
1246 muscle with muscle_grow_used_name_list.
1247 (grammar_declaration): Abbreviate %code code with
1248 muscle_grow_used_name_list.
1249 * tests/input.at (%define errors): New.
1250
3fc65ead
JD
12512007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
1252
1253 Provide warn_at, complain_at, and fatal_at function callbacks to the
1254 skeletons, and use this for %code qualifier complaints.
1255 * data/bison.m4 (b4_error_at): New, invoked by...
1256 (b4_warn_at, b4_complain_at, b4_fatal_at): ... these new macros to wrap
1257 the skeleton scanner's new @warn_at(...@), @complain_at(...@), and
1258 @fatal_at(...@) directives.
1259 (b4_check_percent_code_qualifiers): Rewrite to expect locations for
1260 qualifiers in b4_used_percent_code_qualifiers and to use
1261 b4_complain_at.
1262 * src/location.c, src/location.h (boundary_set_from_string): New global
1263 function.
1264 * src/muscle_tab.c, src/muscle_tab.h (muscle_boundary_grow): New global
1265 function.
1266 * src/parse-gram.y (grammar_declaration): Add locations for qualifiers
1267 to b4_used_percent_code_qualifiers.
1268 * src/scan-skel.l (fail_for_at_directive_too_few_args): New static
1269 function.
1270 (AT_DIRECTIVE_ARGC_MAX): Increase for boundary arguments.
1271 (lineno): Rename to...
1272 (out_lineno): ... this so I don't misunderstand it again.
1273 (SC_AT_DIRECTIVE_SKIP_WS): Don't increment out_lineno for newlines
1274 here; these newlines are in the input but not the output file.
1275 (SC_AT_DIRECTIVE_ARG): Likewise. Extract directive execution to...
1276 (at_directive_perform): ... this new static function, and add handling
1277 of new @warn_at(...@), @complain_at(...@), and @fatal_at(...@)
1278 directives.
1279 * tests/input.at (Reject bad %code qualifiers): Update test output with
1280 locations and extend.
1281
1282 * tests/output.at (Output file name: [, Output file name: ]): Remove
1283 bogus comment about these tests failing.
1284
1c7b7e1d
JD
12852007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
1286
1287 Clean up b4_check_percent_code_qualifiers a little.
1288 * data/bison.m4 (b4_check_percent_code_qualifiers): Expect qualifiers
1289 in b4_used_percent_code_qualifiers to be double-M4-quoted. Rewrite
1290 documentation and add examples.
1291 * src/parse-gram.y (grammar_declaration): Double-M4-quote those
1292 qualifiers here.
1293
08af01c2
JD
12942007-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
1295
1296 Don't use m4_divert since it makes m4_divert_push and m4_divert_pop
1297 unreliable -- especially when they're hidden inside another macro.
1298 * data/bison.m4, data/c++-skel.m4, data/c++.m4, data/c-skel.m4,
1299 data/c.m4: Remove m4_divert(-1).
1300 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
1301 data/push.c, data/yacc.c: Likewise, and replace m4_divert(0) with
1302 m4_divert_push(0) and m4_divert_pop(0).
279cabb6 1303 * src/output.c (output_skeleton): Don't add an m4_divert_push(0) and
08af01c2
JD
1304 an m4_wrap([m4_divert_pop(0)]) to the M4. Diversion -1, which is
1305 pushed and popped by m4sugar, should be first on the stack.
1306
1307 Provide warn, complain, and fatal function callbacks to the skeletons.
1308 This provides more flexibility than m4_fatal, improves the error
1309 message format, and captures messages for translation. Discussed
1310 starting at
1311 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00063.html>.
1312 * data/bison.m4 (b4_error): New, invoked by...
1313 (b4_warn, b4_complain, b4_fatal): ... these new macros to wrap the
1314 skeleton scanner's new @warn(...@), @complain(...@), and @fatal(...@)
1315 directives. Because these M4 macros might be called when the current
1316 diversion is -1 or 0, m4_divert_push and m4_divert_pop is used; thus
1317 the previous removal of uses of m4_divert, which caused trouble.
1318 (b4_check_percent_code_qualifiers): Use b4_complain instead of
1319 m4_fatal to report unrecognized %code qualifiers.
1320 * data/c++-skel.m4: Use b4_complain instead of m4_fatal to report C++
1321 push parser requests.
1322 * data/glr.c: Use b4_complain instead of m4_fatal to report
1323 non-deterministic push parser requests.
1324 Update @output usage to @output(...@) form.
1325 * data/glr.cc, data/lalr1.cc: Use b4_fatal instead of m4_fatal to
1326 report missing %defines. Update @output usage to @output(...@) form.
1327 * data/location.cc, data/push.c, data/yacc.c: Update @output usage to
1328 @output(...@) form.
1329 * src/main.c (main): Invoke skel_scanner_free.
1330 * src/scan-skel.h (skel_scanner_free): Prototype new function.
1331 * src/scan-skel.l (FLEX_NO_OBSTACK): Don't define; we now need the
1332 obstack_for_string from flex-scanner.h.
1333 (YY_DECL): Use to declare skel_lex static.
1334 (decode_at_digraphs): Remove; now handled in the new
1335 SC_AT_DIRECTIVE_ARG start condition.
1336 (fail_for_at_directive_too_many_args, fail_for_invalid_at): New static
1337 functions.
1338 (at_directive_name, AT_DIRECTIVE_ARGC_MAX, at_directive_argc,
1339 at_directive_argv): New static globals.
1340 (INITIAL): Use fail_for_invalid_at.
1341 Don't parse `@output file_name\n' or `@basename(...@)'. Instead,
1342 recognize the start of a generalized `@directive(...@)' form and
1343 start...
1344 (SC_AT_DIRECTIVE_ARG): ... this new start condition to parse the
1345 directive args (using the new obstack_for_string), to decode the
1346 contained @ diagraphs, and to perform the directive. It recognizes
1347 @basename(...@), @warn(...@), @complain(...@), @fatal(...@), and
1348 @output(...@).
1349 (SC_AT_DIRECTIVE_SKIP_WS): New start condition started by
1350 SC_AT_DIRECTIVE_ARG to skip whitespace after the argument delimiter,
1351 `@,'.
1352 (scan_skel): Initialize obstack_for_string on the first call.
1353 (skel_scanner_free): New function to free obstack_for_string.
1354 * tests/input.at (Reject bad %code qualifiers): Update test output.
1355
8e0a5e9e
JD
13562007-01-04 Joel E. Denny <jdenny@ces.clemson.edu>
1357
1358 Consolidate the 4 prologue alternative directives (%code, %requires,
1359 %provides, and %code-top) into a single %code directive with an
1360 optional qualifier field. Discussed at
1361 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00012.html>.
1362 * NEWS (2.3a+): Rewrite the existing entry for the prologue
1363 alternatives.
1364 * doc/bison.texinfo (Prologue Alternatives): Update.
1365 (Decl Summary): Update to %code "requires" and %code "provides".
1366 (Calc++ Parser): Update to %code "requires".
148d66d8 1367 (Table of Symbols): Remove entries for %requires, %provides, and
8e0a5e9e
JD
1368 %code-top. Rewrite %code entry, and add a %code "QUALIFIER" entry.
1369 * data/bison.m4 (b4_user_provides, b4_user_requires): Remove as these
1370 are replaced by b4_percent_code_provides and b4_percent_code_requires,
1371 which are skeleton-specific.
1372 (b4_check_percent_code_qualifiers): New. A skeleton can use this to
1373 declare what %code qualifiers it supports and to complain if any other
1374 qualifiers were used in the grammar.
1375 * data/glr.cc: Update to use b4_user_code([b4_percent_code_requires])
1376 and b4_user_code([b4_percent_code_provides]) in place of
1377 b4_user_requires and b4_user_provides.
1378 * data/glr.c, data/lalr1.cc, data/push.c, data/yacc.c: Likewise.
1379 Add b4_user_code([b4_percent_code_top]) and
1380 b4_user_code([b4_percent_code]).
1381 Invoke b4_check_percent_code_qualifiers.
1382 * src/parse-gram.y (PERCENT_CODE_TOP, PERCENT_PROVIDES,
1383 PERCENT_REQUIRES): Remove.
1384 (grammar_declaration): Remove RHS's for %code-top, %provides, and
1385 %requires. Rewrite the %code RHS as the unqualified form defining the
1386 muscle b4_percent_code. Add another RHS for the qualified %code form,
1387 which defines muscles of the form b4_percent_code_QUALIFIER and the
1388 b4_used_percent_code_qualifiers muscle.
1389 * src/scan-gram.l (PERCENT_CODE_TOP, PERCENT_PROVIDES,
1390 PERCENT_REQUIRES): Remove.
1391 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update to use
1392 %code "requires" and %code "provides".
1393 * tests/input.at (Reject bad %code qualifiers): New.
1394
95021767
JD
13952007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
1396
1397 Use the new code_props interface for destructors and printers.
1398 * src/symtab.h (symbol, semantic_type): Remove destructor_location and
1399 printer_location members, and change the type of the destructor and
1400 printer members to code_props.
1401 (symbol_destructor_set, symbol_destructor_get, symbol_printer_set,
1402 symbol_printer_get, semantic_type_destructor_set,
1403 semantic_type_printer_set, default_tagged_destructor_set,
1404 default_tagless_destructor_set, default_tagged_printer_set,
1405 default_tagless_printer_set): Use code_props in arguments and return
1406 types in place of char const * and location.
1407 (symbol_destructor_location_get, symbol_printer_location_get): Remove
1408 since the locations are now contained in the return of
1409 symbol_destructor_get and symbol_printer_get.
1410 * src/output.c (symbol_destructors_output, symbol_printers_output):
1411 Replace with...
1412 (symbol_code_props_output): ... this to eliminate duplicate code.
1413 (output_skeleton): Update to use symbol_code_props_output.
1414 * src/reader.c (symbol_should_be_used): Update use of
1415 symbol_destructor_get.
1416 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
1417 Update uses of the various _destructor_set and _printer_set functions.
1418 * src/symtab.c: (default_tagged_destructor_location,
1419 default_tagless_destructor_location, default_tagged_printer_location,
1420 default_tagless_printer_location): Remove since we...
1421 (default_tagged_destructor, default_tagless_destructor,
1422 default_tagged_printer, default_tagless_printer): ... change the type
1423 of these to code_props.
1424 (symbol_new, semantic_type_new, symbol_destructor_set,
1425 semantic_type_destructor_set, symbol_destructor_get,
1426 symbol_printer_set, semantic_type_printer_set, symbol_printer_get,
1427 symbol_check_alias_consistency, default_tagged_destructor_set,
1428 default_tagless_destructor_set, default_tagged_printer_set,
1429 default_tagless_printer_set): Update.
1430 (symbol_destructor_location_get, symbol_printer_location_get): Remove.
1431 (SYMBOL_CODE_PRINT): New similar to SYMBOL_ATTR_PRINT but for
1432 code_props members.
1433 (symbol_print): Use SYMBOL_CODE_PRINT.
1434
f6857bbf
JD
14352007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
1436
1437 Use the new code_props interface for rule actions.
1438 * src/symlist.h (symbol_list): Replace action, action_location, and
1439 used members with a code_props action_props member.
1440 * src/reader.c (symbol_should_be_used, grammar_rule_check,
1441 grammar_midrule_action, grammar_current_rule_merge_set,
1442 grammar_current_rule_symbol_append, packgram): Update.
1443 * src/scan-code.h (translate_rule_action): Remove, no longer used.
1444 * src/scan-code.l (handle_action_dollar): Update.
1445 (translate_rule_action): Remove, no longer used.
1446 * src/symlist.c (symbol_list_sym_new, symbol_list_syms_print): Update.
1447
7c0c6181
JD
14482007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
1449
1450 Use the new code_props interface in parse-gram.y.
1451 * src/parse-gram.y (prologue_declaration, braceless, epilogue.opt):
1452 Update all uses of translate_* functions to use the new code_props
1453 interface and to use gram_scanner_last_string_free and
1454 code_scanner_last_string_free where possible.
1455 (grammar_declaration): symbol_list_destructor_set and
1456 symbol_list_printer_set now perform the translation, so don't do it
1457 here. Use gram_scanner_last_string_free where possible.
1458 * src/scan-code.h, src/scan-code.l (translate_symbol_action,
1459 translate_code): Remove, no longer used.
1460 * src/symlist.h, src/symlist.c (symbol_list_destructor_set,
1461 symbol_list_printer_set): Perform code translation here rather than
1462 depending on the caller to do so.
1463
1464 * src/symlist.h (struct symbol_list): Correct some documentation typos.
1465 * src/scan-gram.h (gram_last_string): Remove declaration.
1466 * src/scan-gram.l (last_string): Declare it static.
1467
28e52c0d
JD
14682007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
1469
1470 Encapsulate code properties and related functionality for the various
1471 destructors, printers, and actions into a code_props structure and
1472 interface. This patch merely implements code_props in scan-code.h and
1473 scan-code.l. Future patches will rewrite other modules to use it.
1474 Discussed starting at
1475 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00020.html>.
1476 * src/location.h (EMPTY_LOCATION_INIT): Define so that it's easier to
1477 consistently initialize const structs that have an empty location
1478 field.
1479 * src/location.c (empty_location): Initialize with EMPTY_LOCATION_INIT
1480 to ensure consistency.
1481 * src/scan-code.h (code_props): New structure.
1482 (code_props_none_init, CODE_PROPS_NONE_INIT, code_props_none): New
1483 function, macro, and const global variable for initializing a
1484 code_props with no code.
1485 (code_props_plain_init, code_props_symbol_action_init,
1486 code_props_rule_action_init, code_props_translate_code): The rest of
1487 the new code_props functional interface. Among other things, the init
1488 functions set the code_props kind field so that
1489 code_props_translate_code will know whether to behave like
1490 translate_symbol_action, translate_rule_action, or translate_code.
1491 These old translate functions must remain until all other modules are
1492 updated to use the new code_props interface.
1493 (code_scanner_last_string_free): New function similar to
1494 gram_scanner_last_string_free.
1495 (code_scanner_free): Add documentation.
1496 * src/scan-code.l: Implement the new interface.
1497 (code_lex): Make it static, add a code_props* argument, and remove the
1498 rule argument.
1499 (last_string): New static global similar to the one in scan-gram.l.
1500 (SC_RULE_ACTION): Update to use the code_props* argument to code_lex
1501 instead of rule.
1502 (SC_SYMBOL_ACTION): For $$, set the is_value_used member of the
1503 code_props since Bison may one day use this information for destructors
1504 and printers.
1505 (<*><<EOF>>): Use STRING_FINISH so that last_string is set.
1506 (handle_action_dollar): Use symbol_list_n_get and set used flag
1507 directly since symbol_list_n_used_set is removed.
1508 (translate_action): Add a code_props* argument and remove the rule,
1509 action, and location arguments. Pass the code_props* on to code_lex.
1510 (translate_rule_action, translate_symbol_action, translate_code):
1511 Rewrite as wrappers around the new code_props interface.
1512 * src/symlist.h, src/symlist.c (symbol_list_n_used_set): Remove since
1513 it would eventually need to break the encapsulation of code_props.
1514
96034983
JD
15152007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
1516
1517 * etc/.cvsignore: New.
1518
945e396c
JD
15192007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
1520
1521 Add maintainer-push-check to run maintainer-check using push parsing in
1522 place of pull parsing where available.
1523 * Makefile.am (maintainer-push-check): New.
1524 * data/bison.m4 (b4_use_push_for_pull_if): New.
1525 * data/push.c: Redefine b4_push_if and b4_use_push_for_pull_if
1526 appropriately based on their existing values.
1527 (yypush_parse): Don't print push-parser-specific diagnostics if push
1528 parsing is being used in place of pull parsing.
1529 * data/yacc.c: If push parsing should replace pull parsing, redirect to
1530 push.c.
1531 * src/output.c (prepare): Check BISON_USE_PUSH_FOR_PULL environment
1532 variable, and insert b4_use_push_for_pull_flag into muscles.
1533 * tests/Makefile.am (maintainer-push-check): New.
1534
7d596384
JD
15352006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
1536
1537 * data/push.c (yypush_parse): Set yynew = 1 at the end of a parse
1538 (whether successful or failed) so that yypush_parse can be invoked
1539 again to start a new parse using the same yypstate.
1540 * tests/torture.at (AT_DATA_STACK_TORTURE): For push mode, extend to
1541 check multiple yypull_parse invocations on the same yypstate. For pull
1542 mode, extend to check multiple yyparse invocations.
1543 (Exploding the Stack Size with Alloca): Extend to try with
1544 %push-pull-parser.
1545 (Exploding the Stack Size with Malloc): Likewise.
1546
1547 * tests/calc.at (Simple LALR Calculator): Don't specify
1548 %skeleton "push.c" since %push-pull-parser implies that now.
1549 * tests/headers.at (export YYLTYPE): Don't check for the push
1550 declarations. Otherwise, this test case can't be used to see if push
1551 mode can truly emulate pull mode.
1552 * tests/input.at (Torturing the Scanner): Likewise.
1553 * tests/local.at (AT_YACC_OR_PUSH_IF, AT_PUSH_IF): Remove.
1554 (AT_YYERROR_SEES_LOC_IF): Rather than AT_YACC_OR_PUSH_IF, use
1555 AT_YACC_IF, which now includes the case of push mode since %skeleton
1556 need not be used for push mode. This will be more intuitive once
1557 push.c is renamed to yacc.c.
1558
7172e23e
JD
15592006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
1560
1561 For push mode, convert yyparse from a macro to a function, invoke yylex
1562 instead of passing a yylexp argument to yypull_parse, and don't
1563 generate yypull_parse or yyparse unless %push-pull-parser is declared.
1564 Discussed starting at
1565 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00163.html>.
1566 * data/bison.m4 (b4_pull_if): New.
1567 * data/c.m4 (b4_identification): Define YYPULL similar to YYPUSH.
1568 * data/push.c: Improve M4 quoting a little.
1569 (b4_generate_macro_args, b4_parenthesize): Remove.
1570 (yyparse): If there's a b4_prefix, #define this to b4_prefix[parse]
1571 any time a pull parser is requested.
1572 Don't #define this as a wrapper around yypull_parse. Instead, when
1573 both push and pull are requested, make it a function that does that
1574 same thing.
1575 (yypull_parse): If there's a b4_prefix, #define this to
1576 b4_prefix[pull_parse] when both push and pull are requested.
1577 Don't define this as a function unless both push and pull are
1578 requested.
1579 Remove the yylexp argument and hard-code yylex invocation instead.
1580 * etc/bench.pl.in (bench_grammar): Use %push-pull-parser instead of
1581 %push-parser.
1582 * src/getargs.c (pull_parser): New global initialized to true.
1583 * getargs.h (pull_parser): extern it.
1584 * src/output.c (prepare): Insert pull_flag muscle.
1585 * src/parse-gram.y (PERCENT_PUSH_PULL_PARSER): New token.
1586 (prologue_declaration): Set both push_parser and pull_parser = true for
1587 %push-pull-parser. Set push_parser = true and pull_parser = false for
1588 %push-parser.
1589 * src/scan-gram.l: Don't accept %push_parser as an alternative to
1590 %push-parser since there's no backward-compatibility concern here.
1591 Scan %push-pull-parser.
1592 * tests/calc.at (Simple LALR(1) Calculator): Use %push-pull-parser
1593 instead of %push-parser.
1594 * tests/headers.at (export YYLTYPE): Make yylex static, and don't
1595 prototype it in the module that calls yyparse.
1596 * tests/input.at (Torturing the Scanner): Likewise.
1597 * tests/local.at (AT_PUSH_IF): Check for %push-pull-parser as well.
1598
2e7944cb
JD
15992006-12-26 Joel E. Denny <jdenny@ces.clemson.edu>
1600
1601 Update etc/bench.pl. Optimize push mode a little (the yyn change
1602 deserves most of the credit).
1603 * Makefile.am (SUBDIRS): Add etc subdirectory.
1604 * configure.ac (AC_CONFIG_FILES): Add etc/bench.pl and etc/Makefile.
1605 * data/push.c (b4_declare_parser_state_variables): Move yyn, yyresult,
1606 yytoken, yyval, and yyloc declarations to...
1607 (yyparse or yypush_parse): ... here to improve performance. For
1608 yypush_parse invocations after the first, be sure to assign yyn its old
1609 value again.
1610 (yypstate_new): Don't bother initializing the yyresult field since the
1611 initial value isn't used.
1612 (yyn, yyresult, yytoken, yyval, yyloc): For each NAME in this list,
1613 remove the #define that, in push mode, set it to yyps->NAME.
1614 * etc/Makefile.am: New.
1615 * etc/bench.pl: Remove and build it instead from...
1616 * etc/bench.pl.in: ... this new file. Use @abs_top_builddir@ to invoke
1617 "tests/bison" from the build directory by default rather than just
1618 invoking "bison" from $PATH.
1619 (calc_grammar): Update push parser code: don't declare yylval globally,
1620 don't define yyparse_wrapper, and don't #define yyparse.
1621 (bench_grammar): Update to check all working combinations of yacc.c,
1622 push.c, impure, pure, pull, and push.
1623
c3d50342
JD
16242006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
1625
1626 For push mode, add pull wrappers around yypush_parse.
1627 * data/push.c: (b4_generate_macro_args, b4_parenthesize): New macros.
1628 (yypull_parse): New function wrapping yypush_parse.
1629 (yyparse): New #define wrapping yypull_parse.
1630 * tests/calc.at (_AT_DATA_CALC_Y): Call yyparse even when %push-parser
1631 is declared.
1632 * tests/headers.at (export YYLTYPE): Make yylex global. For push mode,
1633 prototype yylex in the module that calls yyparse, and don't prototype
1634 yyparse there. Otherwise, the yyparse expansion won't compile.
1635 * tests/input.at (Torturing the Scanner): Likewise.
1636
94ebeba5
JD
16372006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
1638
1639 Enable push parsers to operate in impure mode. Thus, %push-parser no
1640 longer implies %pure-parser. The point of this change is to move
1641 towards being able to test the push parser code by running the entire
1642 test suite as if %push-parser had been declared.
1643 * data/push.c (yypush_parse): For impure mode, remove the
1644 yypushed_char, yypushed_val, and yypushed_loc arguments.
1645 Instead, declare these as local variables initialized to the global
1646 yychar, yylval, and yylloc.
1647 For the first yypush_parse invocation only, restore the initial values
1648 of these global variables when it's time to read a token since they
1649 have been overwritten.
1650 * src/parse-gram.y (prologue_declaration): Don't set pure_parser for
1651 %push-parser.
1652 * tests/calc.at (Simple LALR(1) Calculator): Always declare
1653 %pure-parser along with %push-parser since this test case was designed
1654 for pure push parsers.
1655 * tests/local.at (AT_PURE_OR_PUSH_IF): Remove unused.
1656 (AT_YACC_OR_PUSH_IF): New.
1657 (AT_YYERROR_SEES_LOC_IF): Fix enough that the test suite passes, but
1658 add a note that it's still wrong for some cases (as it has been for a
1659 while).
1660 (AT_PURE_LEX_IF): Use AT_PURE_IF instead of AT_PURE_OR_PUSH_IF since
1661 %push-parser no longer implies %pure-parser.
1662
a0633178
JD
16632006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
1664
1665 Remove some unnecessary differences between the pull parser code and
1666 the push parser code. This patch enables yynerrs in push mode.
1667 * data/push.c: Reformat M4 a little.
1668 (b4_yyerror_range): Remove and convert all uses to just yyerror_range.
1669 (b4_declare_scanner_communication_variables): Don't omit yynerrs just
1670 because push mode is on. Instead, if pure mode is on, move yynerrs
1671 to...
1672 (b4_declare_parser_state_variables): ... here.
1673 (yynerrs, yyerror_range): For push mode, #define each NAME in this list
1674 to yyps->NAME so it can be used in yypush_parse.
1675 (yypush_parse): Don't omit uses of yynerrs in push mode.
1676
8646b6a3
JD
16772006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
1678
1679 Fix bug such that the first pushed token's value and location are
1680 sometimes overwritten (sometimes by %initial-action) before being used.
1681 * data/push.c (yypush_parse): Rename arguments yynchar, yynlval, and
1682 yynlloc to yypushed_char, yypushed_val, and yypushed_loc for clarity.
1683 For the first yypush_parse invocation, initialize yychar to YYEMPTY to
1684 more closely mimic the pull parser logic.
1685 Don't copy the pushed token to yychar, yylval, and yylloc until it's
1686 time to read a token, which is after any initialization of yylval and
1687 yylloc.
1688 (gottoken): Rename label to...
1689 (yyread_pushed_token): ... for clarity and to avoid infringing on the
1690 user namespace.
1691
9baf4d74
JD
16922006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
1693
1694 Rearrange initialization of the parser state variables so that the
1695 skeleton doesn't have to have a copy for pull mode and another for push
1696 mode. This patch also fixes at least a bug such that yylloc was not
1697 initialized (with b4_location_initial_line and
1698 b4_location_initial_column) upon calling yypush_parse. However, that
1699 initialization now overwrites the first token's location;
1700 %initial-action assigning @$ already did the same thing, and both bugs
1701 will be fixed in a later patch.
1702 * data/push.c (b4_yyssa): Remove and convert all uses to just yyssa.
1703 (b4_declare_parser_state_variables): Remove initialization of yytoken,
1704 yyss, yyvs, yyls, and yystacksize.
1705 (yypstate_new): Remove initialization of some yypstate fields: yystate,
1706 yyerrstatus, yytoken, yyss, yyvs, yyls, yystacksize, yyssp, yyvsp, and
1707 yylsp.
1708 (yyssa, yyvsa, yylsa): For push mode, #define each NAME in this list to
1709 yyps->NAME so it can be used in yypush_parse.
1710 (yyparse or yypush_parse): For yypush_parse, don't print the
1711 "Starting parse" diagnostic for invocations after the first.
1712 Add initialization of yytoken, yyss, yyvs, yyls, and yystacksize; for
1713 yypush_parse, only do it for the first invocation.
1714 Allow yystate, yyerrstatus, yyssp, yyvsp, yylsp, and yylloc
1715 initialization to occur in yypush_parse but only on the first
1716 invocation.
1717
23522164
JD
17182006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
1719
1720 * data/push.c: Add CPP guards around push parser declarations in both
1721 the header and the code file.
1722 In the code file, move the push parser declarations to the same place
1723 they appear in the header file.
1724 Clean up the M4 some, especially the inconsistent underquoting in
1725 some b4_c_function_def and b4_c_function_decl uses.
1726
bb010fe5
JD
17272006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
1728
1729 Encapsulate the push parser state variables into an M4 macro so the
1730 push skeleton doesn't have to list them again for pull mode's yyparse.
1731 For push mode, remove yypush_parse's local equivalents of these
1732 variables to eliminate unnecessary copying between the two sets at
1733 run-time. This patch also fixes at least a bug related to multiple
1734 %initial-action invocations in push mode.
1735 * data/push.c (b4_declare_parser_variables): Rename to...
1736 (b4_declare_scanner_communication_variables): ... this for clarity and
1737 update both uses.
1738 (b4_declare_yyparse_variables): Remove and move its contents to the one
1739 spot where it was invoked.
1740 (b4_declare_parser_state_variables): New macro containing the parser
1741 state variables required by push mode.
1742 (struct yypstate): Replace all fields but yynew with
1743 b4_declare_parser_state_variables.
1744 (yystate, yyn, yyresult, yyerrstatus, yytoken, yyss, yyssp, yyvs,
1745 yyvsp, yyls, yylsp, yystacksize, yyval, yyloc): For push mode, #define
1746 each NAME in this list to yyps->NAME so it can be used in yypush_parse.
1747 (yyparse or yypush_parse): For yyparse in pull mode, replace local
1748 parser state variable declarations with
1749 b4_declare_parser_state_variables.
1750 Don't initialize parser state variables when calling yypush_parse since
1751 yypstate_new already does that.
1752 Invoke the user's initial action only upon the first yypush_parse
1753 invocation.
1754 Remove all code that copies between the local parser state variables
1755 and the yypstate.
1756
2d212f8c
JD
17572006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
1758
1759 * data/push.c (union yyalloc): Rename yyss, yyvs, and yyls fields to
1760 prevent a name collision in a future patch where these names will
1761 sometimes be #define'd.
1762 (YYSTACK_RELOCATE): Add an argument to select a union yyalloc field
1763 since it no longer has the same name as the existing argument.
1764 (yyparse or yypush_parse): Update all uses of YYSTACK_RELOCATE.
1765
e6e704dc
JD
17662006-12-19 Paolo Bonzini <bonzini@gnu.org>
1767 and Joel E. Denny <jdenny@ces.clemson.edu>
1768
1769 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
1770 that the argument is case-insensitive, and there's no `=' here.
1771 For the %skeleton entry, mention that %language is better.
1772 (Bison Options): Likewise for --language and --skeleton. Move the
1773 --skeleton entry so that the `Tuning the parser' section is sorted
1774 alphabetically on long options.
1775 (C++ Bison Interface): Don't use the word skeleton. Don't explain the
1776 %language directive in detail here; cross-reference the %language
1777 documentation instead.
1778 (Calc++ Parser): Use `%require "@value{VERSION}"' rather than
1779 `%require "2.3b"' so that the example is always up-to-date.
148d66d8 1780 (Table of Symbols): Add entries for %language and %skeleton.
e6e704dc
JD
1781 * examples/extexi (normalize): Instead of replacing every %require
1782 argument with the current Bison version, just substitute for
1783 `@value{VERSION}'. This guarantees that we're testing what actually
1784 appears in the documentation.
1785 * examples/calc++/Makefile.am ($(calc_extracted)): Use `$(VERSION)'
1786 rather than `@VERSION@'.
1787
0e021770
PE
17882006-12-18 Paul Eggert <eggert@cs.ucla.edu>
1789
fd575f05
PE
1790 * NEWS: Reword the %language news a bit, and put it earlier.
1791
0e021770
PE
1792 * src/getargs.c (skeleton_arg): Last arg is now location const *.
1793 Rewrite to simplify the logic.
1794 (language_argmatch): Likewise.
fd575f05
PE
1795 (program_name): We now own this var.
1796 * src/getargs.h (struct bison_language): Use char[] rather than
1797 const char *.
0e021770
PE
1798
1799 * doc/bison.texinfo (Decl Summary, Bison Options): Don't claim
1800 Java is supported.
1801 * src/complain.c (program_name): Remove decl; no longer needed.
1802 * src/main.c (program_name): Remove; now belongs to getargs.
1803
18042006-12-18 Paolo Bonzini <bonzini@gnu.org>
1805
1806 * NEWS: Document %language.
1807
1808 * data/Makefile.am (dist_pkgdata_DATA): Add c-skel.m4, c++-skel.m4.
1809
1810 * data/c-skel.m4, data/c++-skel.m4: New files.
1811 * data/glr.c: Complain on push parsers.
1812
1813 * doc/bison.texinfo (C++ Parser Interface): Prefer %language
1814 over %skeleton.
148d66d8 1815 (Decl Summary): Document %language and %skeleton.
0e021770
PE
1816 (Command line): Document -L.
1817
1818 * examples/extexi: Rewrite %require directive.
1819 * examples/calc++/Makefile.am: Pass VERSION to extexi.
1820
1821 * src/files.c (compute_exts_from_gc): Look in language structure
1822 for .y extension.
1823 (compute_file_name_parts): Check whether .tab should be added.
1824 * src/getargs.c (valid_languages, skeleton_prio, language_prio):
1825 (language, skeleton_arg, language_argmatch): New.
1826 (long_options): Add --language.
1827 (getargs): Use skeleton_arg, add -L/--language.
1828 * src/getargs.h: Include location.h.
1829 (struct bison_language, language, skeleton_arg, language_argmatch): New.
1830 * src/output.c (prepare): Pick default skeleton from struct language.
1831 Don't dispatch C skeletons here.
1832 * src/parse-gram.y (PERCENT_LANGUAGE): New.
1833 (prologue_declaration): Add "%language" rule, use skeleton_arg.
1834 * src/scan-gram.l ("%language"): New rule.
1835
1836 * tests/calc.at: Test %skeleton and %language.
1837 * tests/local.at (AT_SKEL_CC_IF): Look for %language.
1838 (AT_GLR_IF): Look for %skeleton "glr.cc".
1839 (AT_LALR1_CC_IF, AT_GLR_CC_IF): Rewrite.
1840 (AT_YACC_IF): Reject %language.
1841
5691bf57
PE
18422006-12-18 Paul Eggert <eggert@cs.ucla.edu>
1843
db06f0ce
PE
1844 * src/symtab.h (struct semantic_type): Remove the tag 'semantic_type',
1845 since it wasn't used; only the typedef name 'semantic_type' is needed.
1846 Also, omit trailing white space.
1847
5691bf57
PE
1848 * bootstrap: Sync from coreutils.
1849 (gnulib_extra_files): Add build-aux/announce.gen.
1850 (slurp): Adjust .gitignore files like .cvsignore files.
1851 * build-aux/announce-gen: Remove from CVS, since bootstrap
1852 now creates this.
1853
791934e4
JD
18542006-12-16 Joel E. Denny <jdenny@ces.clemson.edu>
1855
1856 Make %push-parser imply %pure-parser. This fixes several bugs; see
1857 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00148.html>.
1858 * src/parse-gram.y (prologue_declaration): For %push-parser, also set
1859 pure_parser = true.
1860 * data/push.c: Don't bother testing b4_push_if when deciding whether
1861 to expand b4_declare_parser_variables globally.
1862 (yypush_parse): Likewise in here.
1863
1864 * data/push.c (yypush_parse): Add b4_parse_param to arguments.
1865 (yy_reduce_print): Reformat M4 for readability.
1866
ee5abb37
JD
18672006-12-15 Bob Rossi <bob@brasko.net>
1868 and Joel Denny <jdenny@ces.clemson.edu>
1869
1870 * data/push.c (yypstate): Add typedef, and update all uses of
1871 struct yypstate to just yypstate.
1872 * tests/calc.at (_AT_DATA_CALC_Y): Update here as well.
1873
16ca01f9
JD
18742006-12-14 Bob Rossi <bob@brasko.net>
1875
1876 * data/push.c (yypush_parse): Declare prototype regardless of
1877 %locations option.
1878
ab8e7e1a
JD
18792006-12-14 Bob Rossi <bob@brasko.net>
1880
1881 * data/push.c (yyparse): Remove the prototype and the #define when in
1882 push-parser mode.
1883
9bf32be3
JD
18842006-12-13 Bob Rossi <bob@brasko.net>
1885
1886 * data/push.c (yypstate_init): Rename to...
1887 (yypstate_new): ... this and use b4_c_function_def.
1888 (yypstate_delete): New.
1889 (yypush_parse): Change parameters yynval and yynlloc to be const.
1890 * tests/calc.at (_AT_DATA_CALC_Y): Use new yypstate_new and
1891 yypstate_delete functions.
1892
f02e2948
JD
18932006-12-13 Joel E. Denny <jdenny@ces.clemson.edu>
1894
1895 * configure.ac (AC_PREREQ): Require Autoconf 2.61 because of our
1896 strange test case titles. Reported by Bob Rossi.
1897
38eb7751
PE
18982006-12-13 Paul Eggert <eggert@cs.ucla.edu>
1899
1900 * TODO: Add pointer to Sylvain Schmitz's work on static detection
1901 of potential ambiguities in GLR grammers.
1902
bd9d212b
JD
19032006-12-12 Joel E. Denny <jdenny@ces.clemson.edu>
1904
1905 * tests/testsuite.at (AT_CHECK): When checking if $1 starts with
1906 `bison ', use m4_index instead of m4_substr since chopping up a string
1907 containing M4-special characters causes problems here.
1908
1909 Fix a couple of bugs related to special characters in user-specified
1910 file names, and make it easier for skeletons to compute output file
1911 names with the same file name prefix as Bison-computed output file
1912 names.
1913 * data/glr.cc, data/push.c, data/yacc.c: In @output, use
1914 b4_parser_file_name and b4_spec_defines_file instead of
1915 @output_parser_name@ and @output_header_name@, which are now redundant.
1916 * data/glr.c, data/lalr1.cc: Likewise. Also, in header #include's, use
1917 b4_parser_file_name, b4_spec_defines_file, and the new
1918 @basename(FILENAME@) instead of @output_parser_name@ and
1919 @output_header_name@, which inappropriately escaped the file names as
1920 C string literals.
1921 * src/files.c (all_but_ext): Remove static qualifier.
1922 (compute_output_file_names): Move `free (all_but_ext)' to...
1923 (output_file_names_free): ... here since all_but_ext is needed later.
1924 * src/files.h (all_but_ext): Extern.
1925 * src/muscle_tab.h (MUSCLE_INSERT_STRING_RAW): New macro that does
1926 exactly what MUSCLE_INSERT_STRING used to do.
1927 (MUSCLE_INSERT_STRING): Use MUSCLE_OBSTACK_SGROW so that M4-special
1928 characters are escaped properly.
1929 * src/output.c (prepare): Define muscle file_name_all_but_ext as
1930 all_but_ext.
1931 For pkgdatadir muscle, maintain previous functionality by using
1932 MUSCLE_INSERT_STRING_RAW instead of MUSCLE_INSERT_STRING. The problem
1933 is that b4_pkgdatadir is used inside m4_include in the skeletons, so
1934 digraphs would never be expanded. Hopefully no one has M4-special
1935 characters in his Bison installation path.
1936 * src/scan-skel.l: Don't parse @output_header_name@ and
1937 @output_parser_name@ anymore since they're now redundant.
1938 In @output, use decode_at_digraphs.
1939 Parse a new @basename command that invokes last_component.
1940 (decode_at_digraphs): New.
1941 (BASE_QPUTS): Remove unused.
1942 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): New macro.
1943 (Output file name): New tests.
1944
3f7ca628
JD
19452006-12-09 Joel E. Denny <jdenny@ces.clemson.edu>
1946
1947 Warn about output files that are generated by the skeletons and that
1948 conflict with other output files.
1949 * data/glr.c: Don't generate the header file here when glr.cc does.
1950 * src/files.c (file_names, file_names_count): New static globals.
1951 (compute_output_file_names): Invoke output_file_name_check for files
1952 not generated by the skeletons and remove existing checks.
1953 (output_file_name_check): New function that warns about conflicting
1954 output file names.
1955 (output_file_names_free): Free file_names.
1956 * src/files.h (output_file_name_check): Declare.
1957 * src/scan-skel.l: Invoke output_file_name_check for files generated by
1958 the skeletons.
1959 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): New.
1960 (Conflicting output files): New tests.
1961
178e123e
PE
19622006-12-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1963
1964 * doc/bison.texinfo: Fix a couple of typos.
1965
19662006-12-08 Bob Rossi <bob@brasko.net>
8def5cd0
JD
1967
1968 * data/push.c: (yypvarsinit, yypvars, struct yypvars, yypushparse):
1969 Rename to...
1970 (yypstate_init, yypstate, struct yypstate, yypush_parse): ... these and
1971 update all uses.
1972 (b4_yyssa, b4_yyerror_range, yypstate_init): Rename pv to yyps.
1973 (yypush_parse): Rename yypvars argument to yyps and remove redundant
1974 local pv.
1975 (yypstate_init, yypush_parse): Declare in Bison-generated header file.
1976 * tests/calc.at (_AT_DATA_CALC_Y): Use newly named functions.
1977
ea17f233
JD
19782006-12-07 Bob Rossi <bob@brasko.net>
1979 and Joel Denny <jdenny@ces.clemson.edu>
1980
1981 * data/push.c (yypvarsinit): Change return type from void* to struct
1982 yypvars*. No longer cast to void* on return.
1983 (struct yypvars): Remove yylen since it need not be remembered between
1984 yypushparse invocations.
1985 (yypushparse): Don't copy between yylen and pv->yylen.
1986
55a30bda
JD
19872006-12-05 Bob Rossi <bob@brasko.net>
1988
1989 * data/push.c (yychar_set, yylval_set, yylloc_set): Delete.
1990 (yypushparse): Add yynchar, yynlval, yynlloc parameters.
1991 (b4_declare_parser_variables): Do not declare yynerrs for push mode.
1992 (struct yypvars): Remove b4_declare_parser_variables.
1993 (yypvarsinit): Remove init code for removed variables.
1994 (global scope): Do not declare b4_declare_parser_variables if
1995 push or pure mode.
1996 (yypushparse): Add b4_declare_parser_variables.
1997 Init new local variables, and remove init code for removed
1998 yypvars variables.
1999 (yyparse): Delete.
2000 * tests/calc.at (_AT_DATA_CALC_Y): Call yypushparse for push mode
2001 and yyparse for other modes.
2002 (AT_CHECK_CALC_LALR): Added '%skeleton "push.c"' for push tests.
2003 * tests/local.at (AT_PUSH_IF, AT_PURE_OR_PUSH_IF): Added.
2004 (AT_YYERROR_SEES_LOC_IF): push-parser makes this false.
2005 (AT_PURE_LEX_IF): True if pure or push parser.
2006
85894313
JD
20072006-12-05 Joel E. Denny <jdenny@ces.clemson.edu>
2008
2009 Document Yacc prologue alternatives and default %destructor's and
2010 %printer's as experimental. Don't mention Java yet. Discussed at
2011 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00002.html>.
2012 * NEWS (2.3a+): Say they're experimental. Remove any mention of Java.
2013 (2.3a): Annotate this entry to say the old forms of these features were
2014 also experimental.
2015 * doc/bison.texinfo (Prologue Alternatives, Freeing Discarded Symbols,
148d66d8 2016 Table of Symbols): Say they're experimental. Comment out any mention
85894313
JD
2017 of Java (we'll want this back eventually).
2018
02975b9a
JD
20192006-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
2020
2021 Support a file name argument to %defines. Deprecate `=' in
2022 %file-prefix, %name-prefix, and %output. Discussed at
2023 <http://lists.gnu.org/archive/html/help-bison/2006-09/msg00001.html>.
2024 * NEWS (2.3a+): Mention.
148d66d8 2025 * doc/bison.texinfo (Decl Summary, Table of Symbols): Add entry for new
02975b9a
JD
2026 form of %defines, and remove `=' from entries for %file-prefix,
2027 %name-prefix, and %output.
2028 * src/parse-gram.y (prologue_declaration): Implement.
2029 * tests/calc.at (Simple LALR Calculator, Simple GLR Calculator, Simple
2030 LALR1 C++ Calculator, Simple GLR C++ Calculator): Remove the `=' from
2031 all but one occurrence of %name-prefix.
2032 * tests/headers.at (export YYLTYPE): Remove the `=' from %name-prefix.
2033 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Likewise.
2034 * tests/output.at (AT_CHECK_OUTPUT): Remove the `=' from all but one
2035 occurrence of each of %file-prefix and %output. Add check for %defines
2036 with argument.
2037 * tests/reduce.at (Useless Terminals, Useless Nonterminals,
2038 Useless Rules, Reduced Automaton, Underivable Rules, Empty Language):
2039 Remove the `=' from %output.
2040
287b314e
JD
20412006-11-21 Joel E. Denny <jdenny@ces.clemson.edu>
2042
2043 Don't escape $ in test case titles since Autoconf 2.61 now does that
2044 correctly.
2045 * tests/actions.at (Default %printer and %destructor are not for error
2046 or $undefined): Here.
2047 (Default %printer and %destructor are not for $accept): Here.
2048 * tests/input.at (Invalid $n and @n): Here.
2049
3ebecc24
JD
20502006-11-20 Joel E. Denny <jdenny@ces.clemson.edu>
2051
2052 Rename <!> to <>. Discussed starting at
2053 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00039.html>.
2054 * NEWS (2.3a+): Update.
148d66d8 2055 * doc/bison.texinfo (Freeing Discarded Symbols, Table of Symbols):
3ebecc24
JD
2056 Update.
2057 * src/parse-gram.y (TYPE_TAG_NONE, generic_symlist_item): Implement.
2058 * src/scan-gram.l (INITIAL): Implement.
2059 * src/symlist.c (symbol_list_default_tagless_new): Update comment.
2060 * src/symlist.h (symbol_list, symbol_list_default_tagless_new): Update
2061 comment.
2062 * tests/actions.at (Default tagless %printer and %destructor,
2063 Default tagged and per-type %printer and %destructor,
2064 Default %printer and %destructor are not for error or $undefined,
2065 Default %printer and %destructor are not for $accept,
2066 Default %printer and %destructor for mid-rule values): Update.
2067 * tests/input.at (Default %printer and %destructor redeclared,
2068 Unused values with default %destructor): Update.
2069
26b8a438
JD
20702006-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
2071
2072 Don't let %prec take a nonterminal.
2073 * src/reader.c (grammar_current_rule_prec_set): Make the %prec symbol a
2074 token.
2075 * tests/input.at (%prec takes a token): New test checking that %prec
2076 won't take a nonterminal.
2077
07c39ae9
JD
20782006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
2079
405d53b7
JD
2080 * tests/testsuite.at (AT_CHECK): Don't miss an exit value of 0 because
2081 it was double-quoted.
07c39ae9
JD
2082 * src/Makefile.am (YACC): Use --warnings=all,error so that Bison's own
2083 grammar is maintained with Bison's highest standards.
2084 * src/getargs.c: Fix some typos in Doxygen comments.
2085
580b8926
JD
20862006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
2087
2088 Fix memory leaks in scanners generated by at least Flex 2.5.9 and
2089 later. Reported by Paul Eggert in
2090 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00014.html>.
2091 * src/flex-scanner.h (yylex_destroy): Define for Flex before 2.5.9.
2092 * src/scan-code.l (translate_action): Don't bother invoking
2093 yy_delete_buffer (YY_CURRENT_BUFFER) before creating the first buffer.
2094 (code_scanner_free): Instead of invoking
2095 yy_delete_buffer (YY_CURRENT_BUFFER) directly, invoke yylex_destroy,
2096 which frees more.
2097 * src/scan-gram.l (gram_scanner_free): Likewise.
2098 * src/scan-skel.l (scan_skel): Likewise.
2099
4502eadc
JD
21002006-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
2101
2102 * src/files.c (tr): Change return type to void.
2103 * src/muscle_tab.c (muscle_insert): Free storage in case muscle_grow
2104 has been called previously for the same key.
2105 (muscle_find): Return storage instead of value so that
2106 --enable-gcc-warnings doesn't produce warnings that the return discards
2107 const. aver that the value and storage are the same since storage
2108 could potentially be NULL when value is not.
2109 * tests/testsuite.at (AT_CHECK): Treat an unspecified exit value the
2110 same as 0.
2111
7746c8f6
PE
21122006-11-08 Paul Eggert <eggert@cs.ucla.edu>
2113
2114 * bootstrap.conf (excluded_files): Exclude m4/codeset.m4 (undoing
2115 the earlier change today), m4/intl.m4, m4/intldir.m4. This gives
2116 us a slightly cleaner distribution, and also works.
2117 * m4/.cvsignore: Add inline.m4, wint_t.m4 to accommodate recent
2118 gnulib changes.
2119
eb095650
PE
21202006-11-08 Joel E. Denny <jdenny@ces.clemson.edu>
2121 and Paul Eggert <eggert@cs.ucla.edu>
2122
2123 Don't let Bison leak memory except when it complains.
2124 * src/files.h (parser_file_name, spec_verbose_file, spec_graph_file):
2125 (spec_defines_file, dir_prefix): Now char *, not const char *,
2126 since they are freed.
2127 * src/files.c: Likewise.
2128 (all_but_ext, all_but_tab_ext, src_extension, header_extension):
2129 Likewise.
2130 (tr): Now operates in-place. All uses changed.
2131 (compute_exts_from_gf, compute_exts_from_src): Don't leak temporary
2132 values.
2133 (compute_file_name_parts, compute_output_file_names): Don't store
2134 read-only data in variables that will be freed.
2135 (compute_output_file_names): Free all_but_ext, all_but_tab_ext,
2136 src_extension, and header_extension.
2137 (output_file_names_free): New public function to free
2138 spec_verbose_file, spec_graph_file, spec_defines_file,
2139 parser_file_name, and dir_prefix.
2140 * src/getargs.c (getargs): Don't store read-only data in variables that
2141 will be freed.
2142 * src/main.c (main): Invoke output_file_names_free, code_scanner_free
2143 (which previously existed but was unused), and quotearg_free.
2144 * src/muscle_tab.h (muscle_insert): value arg is now a `char const *'.
2145 * src/muscle_tab.c: Likewise.
2146 (muscle_entry): Make the value char const *,
2147 and add a new storage member that is char * and can be freed.
2148 (muscle_entry_free): New private function.
2149 (muscle_init): Use it instead of free.
2150 (muscle_insert, muscle_grow): Update and use new storage member.
2151 (muscle_code_grow): Free the string passed to muscle_grow
2152 since it's not needed anymore.
2153 * src/parse-gram.y (%union): Make `chars' member a `char const *', and
2154 add a new `char *code' member.
2155 ("{...}"): Declare semantic type as code.
2156 * src/scan-code.h (translate_rule_action):
2157 (translate_symbol_action, translate_code, translate_action): Return
2158 `char const *' rather than `char *' since external code should not free
2159 these strings.
2160 * src/scan-code.l: Likewise.
2161 * src/scan-gram.l (<SC_BRACED_CODE>): Use val->code for BRACED_CODE,
2162 which is "{...}" in the parser.
2163 * tests/Makefile.am (maintainer-check-valgrind): Set
2164 VALGRIND_OPTS='--leak-check=full --show-reacheable=yes' before invoking
2165 Valgrind.
2166 * tests/calc.at (_AT_DATA_CALC_Y): fclose the FILE* so Valgrind doesn't
2167 complain.
2168 * tests/testsuite.at (AT_CHECK): Redefine so that running Bison and
2169 expecting a non-zero exit status sets --leak-check=summary and
2170 --show-reachable=no for Valgrind. Bison unabashedly leaks memory in
2171 this case, and we don't want to hear about it.
2172
ac564be4
PE
21732006-11-08 Paul Eggert <eggert@cs.ucla.edu>
2174
2175 * bootstrap (runtime-po/Makevars): Derive from po/Makevars
2176 instead of from the template, to simplify configuration a bit.
2177 * bootstrap.conf (excluded_files): Don't exclude m4/codeset.m4
2178 and m4/wint_t.m4, as they are needed with the latest gnulib.
2179
17bd8a73
JD
21802006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
2181
2182 Disable unset/unused mid-rule value warnings by default, and recognize
2183 --warnings=midrule-values to enable them. Discussed starting at
2184 <http://lists.gnu.org/archive/html/help-bison/2006-10/msg00030.html>.
2185 * NEWS (2.3a+): Mention.
2186 * src/getargs.c, src/getargs.h (warnings_args, warnings_types, enum
2187 warnings): Add entry for midrule-values subargument.
2188 * src/reader.c (symbol_should_be_used): Don't return true just because
2189 the value is a set/used mid-rule value unless
2190 --warnings=midrule-values was specified.
2191 * tests/input.at (Unused values, Unused values before symbol
2192 declarations): Run tests with and without --warnings=midrule-values.
2193
2194 * src/reader.c (check_and_convert_grammar): Use symbol_list_free rather
2195 than LIST_FREE directly.
2196
89eb3c76
JD
21972006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
2198
2199 Finish implementing --warnings=error, which should not be implied by
2200 --warnings=all (or by its synonyms -W and --warnings without
2201 subarguments).
2202 * src/complain.c (set_warning_issued): New function to report that
2203 warnings are being treated as errors and to record an error if so.
2204 Invoke...
2205 (warn_at, warn): ... here.
2206 * src/getargs.c (warnings_args, warnings_types): Reorder so that
2207 "error - warnings are errors" does not appear above "all - all of the
2208 above".
2209 (getargs): For -W and --warnings without subarguments, don't let
2210 FLAGS_ARGMATCH set warnings_error in warnings_flag.
2211 * src/getargs.h (enum warnings): Unset warnings_error in warnings_all.
2212
ba7560e2
JD
22132006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
2214
2215 * src/getargs.c (flags_argmatch): Don't cause segmentation fault for
2216 empty subargument list. For example: `bison --warnings= parser.y'.
2217
31283fc3
JD
22182006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
2219
2220 * data/push.c, data/yacc.c: Make sure there's a newline at the end of
2221 the parser header file so that gcc doesn't warn.
2222
12e35840
JD
22232006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
2224
2225 Split the default %destructor/%printer into two kinds: <*> and <!>.
2226 Discussed starting at
2227 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00060.html>.
2228 * NEWS (2.3a+): Mention.
2229 * doc/bison.texinfo (Freeing Discarded Symbols): Document this and the
2230 previous change today related to mid-rules.
148d66d8 2231 (Table of Symbols): Remove %symbol-default and add <*> and <!>.
3ebecc24 2232 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): Remove.
12e35840
JD
2233 (TYPE_TAG_ANY): Add as <*>.
2234 (TYPE_TAG_NONE): Add as <!>.
2235 (generic_symlist_item): Remove RHS for %symbol-default and add RHS's
2236 for <*> and <!>.
2237 * src/scan-gram.l (PERCENT_SYMBOL_DEFAULT): Remove.
2238 (TYPE_TAG_ANY, TYPE_TAG_NONE): Add.
2239 * src/symlist.c (symbol_list_default_new): Split into tagged and
2240 tagless versions.
2241 (symbol_list_destructor_set, symbol_list_printer_set): Split
2242 SYMLIST_DEFAULT case into SYMLIST_DEFAULT_TAGGED and
2243 SYMLIST_DEFAULT_TAGLESS.
2244 * src/symlist.h: Update symbol_list_default*_new prototypes.
2245 (symbol_list.content_type): Split enum value SYMLIST_DEFAULT into
2246 SYMLIST_DEFAULT_TAGGED and SYMLIST_DEFAULT_TAGLESS.
2247 * src/symtab.c (default_destructor, default_destructor_location,
2248 default_printer, default_printer_location): Split each into tagged and
2249 tagless versions.
2250 (symbol_destructor_get, symbol_destructor_location_get,
2251 symbol_printer_get, symbol_printer_location_get): Implement tagged
2252 default and tagless default cases.
2253 (default_destructor_set, default_printer_set): Split each into tagged
2254 and tagless versions.
2255 * src/symtab.h: Update prototypes.
2256 * tests/actions.at (Default %printer and %destructor): Rename to...
2257 (Default tagless %printer and %destructor): ... this, and extend.
2258 (Per-type %printer and %destructor): Rename to...
2259 (Default tagged and per-type %printer and %destructor): ... this, and
2260 extend.
2261 (Default %printer and %destructor for user-defined end token): Extend.
2262 (Default %printer and %destructor are not for error or $undefined):
2263 Update.
2264 (Default %printer and %destructor are not for $accept): Update.
2265 (Default %printer and %destructor for mid-rule values): Extend.
2266 * tests/input.at (Default %printer and %destructor redeclared): Extend.
2267 (Unused values with default %destructor): Extend.
2268
f91b1629
JD
22692006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
2270
2271 Don't apply the default %destructor/%printer to an unreferenced midrule
2272 value. Mentioned at
2273 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00104.html>.
2274 * src/symtab.c (dummy_symbol_get): Name all dummy symbols initially
2275 like $@n instead of just @n so that the default %destructor/%printer
2276 logic doesn't see them as user-defined symbols.
2277 (symbol_is_dummy): Check for both forms of the name.
2278 * src/reader.c (packgram): Remove the `$' from each midrule symbol
2279 name for which the midrule value is referenced in any action.
2280 * tests/actions.at (Default %printer and %destructor for mid-rule
2281 values): New test.
2282 * tests/regression.at (Rule Line Numbers, Web2c Report): Update output
2283 for change to dummy symbol names.
2284
519d0004
JD
22852006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
2286
2287 Warn about unset midrule $$ if the corresponding $n is used.
2288 * src/reader.c (symbol_should_be_used): Check midrule parent rule for
2289 $n usage.
2290 (packgram): Before invoking grammar_rule_check on any rule, make sure
2291 all actions have already been scanned in order to set `used' flags.
2292 Otherwise, checking that a midrule's $$ is set will not always work
2293 properly because the midrule check must forward-reference the midrule's
2294 parent rule.
2295 * tests/input.at (AT_CHECK_UNUSED_VALUES): Extend to check the new
2296 warning.
2297
a501eca9
JD
22982006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
2299
2300 More improvements to the documentation of the prologue alternatives:
2301 * NEWS (2.3a+): Mention the new `Prologue Alternatives' section in the
2302 Bison manual.
2303 * doc/bison.texinfo (Prologue Alternatives): Correct some errors. Add
2304 some text to clarify the relative importance of the new directives and
2305 to show how these directives may be viewed as code labels.
2306
2cbe6b7f
JD
23072006-10-16 Joel E. Denny <jdenny@ces.clemson.edu>
2308
2309 Similar to the recently removed %before-header, add %code-top as the
2310 alternative to the pre-prologue. Mentioned at
2311 <http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00063.html>.
2312 Also, let the prologue alternatives appear in the grammar section.
2313 * src/parse-gram.y (PERCENT_CODE_TOP): New token.
2314 (prologue_declaration): Move the existing prologue alternatives to...
2315 (grammar_declaration): ... here and add %code-top.
2316 * src/scan-gram.l (PERCENT_CODE_TOP): New token.
2317
2318 Clean up and extend documentation for the prologue alternatives.
2319 * NEWS (2.3a+): Describe prologue alternatives.
2320 * doc/bison.texinfo (Prologue): Move discussion of prologue
2321 alternatives to...
2322 (Prologue Alternatives): ... this new section, and extend it to discuss
2323 all 4 directives in detail.
148d66d8
JD
2324 (Table of Symbols): Clean up discussion of prologue alternatives and
2325 add %code-top.
2cbe6b7f 2326
e557d3ea
JMG
23272006-10-16 Juan Manuel Guerrero <juan.guerrero@gmx.de>
2328
2329 DJGPP specific issues.
2330
2331 * djgpp/config.bat: config.hin has been moved to lib. Adjust
2332 config.bat accordingly.
2333 * djgpp/config.sed: Adjust config.sed for the use of autoconf 2.60.
2334 * djgpp/config.site: Likewise.
2335
136a0f76
PB
23362006-10-16 Paolo Bonzini <bonzini@gnu.org>
2337
27bd5d67
PB
2338 Replace %*-header with %provides, %requires, %code. See discussion at
2339 http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00002.html
2340
136a0f76
PB
2341 * data/bison.m4 (b4_user_requires, b4_user_provides): New.
2342 (b4_user_start_header): Remove.
2343 * data/glr.c: Use new macros instead of b4_*start_header
2344 and b4_*end_header.
2345 * data/glr.cc: Likewise.
2346 * data/lalr1.cc: Likewise.
2347 * data/push.c: Likewise.
2348 * data/yacc.c: Likewise.
2349
2350 * doc/bison.texinfo: Remove %before-header, rename
2351 %{start,end,after}-header to %requires, %provides, %code.
2352
2353 * src/parse-gram.y: Likewise (also rename token names accordingly).
2354 * src/scan-gram.l: Likewise.
2355 * tests/actions.at: Likewise.
2356
10f429ef
PE
23572006-10-14 Paul Eggert <eggert@cs.ucla.edu>
2358
2359 * lib/Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS).
2360 Problem reported by Joel E. Denny.
2361
23622006-10-14 Jim Meyering <jim@meyering.net>
2363
2364 (Sync from coreutils.)
2365 Work also when the working directory (with e.g. coreutils sources)
2366 is version controlled with git, rather than CVS.
2367 * bootstrap (CVS_only_file): Test for the existence of README-cvs,
2368 rather than CVS.
2369 In messages and comments, say e.g., "checked-out sources",
2370 rather than "CVS sources".
2371 (version_controlled_file): New function. Work for git as well as
2372 for CVS. Don't use grep's -q option.
2373 (slurp): Call it here, in place of CVS-specific code.
2374
c4bd5bf7
JD
23752006-10-14 Joel E. Denny <jdenny@ces.clemson.edu>
2376
2377 Fix testsuite for ./configure --enable-gcc-warnings:
2378 * configure.ac (gcc-warnings): Move -Wall before -Wno-sign-compare.
2379 Otherwise, gcc 4.1.0 (at least) warns about sign comparisons in
2380 __AT_CHECK_PRINTER_AND_DESTRUCTOR in tests/actions.at.
2381 * test/input.at (Torturing the Scanner): #include <stdlib.h> for abort.
2382 * test/regression.at (Diagnostic that expects two alternatives):
2383 Likewise.
2384
46356ea4
PE
23852006-10-12 Paul Eggert <eggert@cs.ucla.edu>
2386
231ed89a
PE
2387 * bootstrap.conf (gnulib_modules): Add config-h.
2388 * djgpp/subpipe.c: Include <config.h> unconditionally; don't
2389 worry about HAVE_CONFIG_H.
2390 * lib/abitset.c: Likewise.
2391 * lib/bitset.c: Likewise.
2392 * lib/bitset_stats.c: Likewise.
2393 * lib/bitsetv-print.c: Likewise.
2394 * lib/bitsetv.c: Likewise.
2395 * lib/ebitset.c: Likewise.
2396 * lib/get-errno.c: Likewise.
2397 * lib/lbitset.c: Likewise.
2398 * lib/subpipe.c: Likewise.
2399 * lib/timevar.c: Likewise.
2400 * lib/vbitset.c: Likewise.
2401 * lib/bitset.c: Include "bitset.h" first, to test interface.
2402 * lib/bitset_stats.c: Include "bitset_stats.h" first.
2403 * lib/bitsetv-print.c: Include "bitsetv-print.h" first.
2404 * lib/bitsetv.c: Include "bitsetv.h" first.
2405 * lib/get-errno.c: Include "get-errno.h" first.
2406 * m4/.cvsignore: Add config-h.m4.
2407 * tests/actions.at (Default %printer and %destructor for ...):
2408 Adjust expected line numbers in output to reflect removal of #if
2409 HAVE_CONFIG_H lines.
2410 * tests/glr-regression.at (Missed %merge type warnings when ...):
2411 Likewise.
2412 * tests/regression.at (Braced code in declaration in rules section):
2413 Likewise.
2414 * tests/atlocal.in (CPPFLAGS): Don't define HAVE_CONFIG_H.
2415 * tests/local.at (AT_DATA_GRAMMAR_PROLOGUE):
2416 Include <config.h> unconditionally.
2417
46356ea4
PE
2418 * bootstrap: Sync from coreutils, as follows:
2419
2420 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
2421
2422 * bootstrap (symlink_to_gnulib): Fix bug: the dot_dots shell
2423 variable was sometimes used without being initialized. This
2424 messed up the installation of the INSTALL file in some cases.
2425
2426 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
2427
2428 * bootstrap (usage, main program, symlink_to_gnulib): Add option
2429 --copy. Inspired by a suggestion from Bruno Haible.
2430
2431 2006-10-03 Jim Meyering <jim@meyering.net>
2432
2433 * bootstrap: Undo last change to this file, since now gnulib-tool
2434 sticks with the automake default in generating dependencies.
2435
dd4bf078
PE
24362006-10-12 Paul Eggert <eggert@cs.ucla.edu>
2437
cf2a5f7c
PE
2438 * configure.ac: Use AC_PROG_CC_STDC; this is more modern than
2439 the old AC_PROG_CC / AM_PROG_CC_STDC combination.
2440
2441 * doc/bison.1: Add copyright notice.
2442
2443 * data/glr.c: Don't include <stdarg.h>; not used.
2444
35fe0834
PE
2445 * NEWS: The -g and --graph options now output graphs in Graphviz
2446 DOT format, not VCG format.
2447 * doc/bison.1: Likewise.
2448 * doc/bison.texinfo (Understanding, Bison Options): Likewise.
fcab4a2e
PE
2449 * THANKS: Add Satya Kiran Popuri, who proposed the initial version
2450 of this change in
2451 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00158.html>.
35fe0834
PE
2452 * TODO: Remove Graphviz entry.
2453 * src/Makefile.am (bison_SOURCES): Add graphviz.c and graphviz.h;
2454 remove vcg.c, vcg.h, vcg_defaults.h.
2455 * src/vcg.c, src/vcg.h, src/vcg_defaults.h: Remove.
2456 * src/graphviz.c, src/graphviz.h: New files.
2457 * src/files.c (compute_output_file_names): Output .dot, not .vcg.
2458 * src/files.h: Make comment more generic.
2459 * src/main.c (main): Likewise.
2460 * src/print_graph.h: Likewise.
2461 * src/getargs.c (usage): Make usage description more generic.
2462 * src/print_graph.c: Include graphviz.h rather than vcg.h.
2463 (static_graph, fgraph): Remove. All uses changed to pass
2464 arguments instead of sharing a static var.
2465 (print_core, print_actions, print_state, print_graph):
2466 Output graphviz format rather than VCG format.
2467 * tests/.cvsignore: Remove *.vcg; add *.dot.
2468 * tests/output.at: Expect *.dot files, not *.vcg files.
2469
dd4bf078
PE
2470 * data/Makefile.am (dist_pkgdata_DATA): Add bison.m4; this
2471 accommodates the 2006-10-08 change.
2472
efdd7421
PE
24732006-10-11 Bob Rossi <bob@brasko.net>
2474
2475 * data/push.c (yypushparse, yypvarsinit, yypvars): Wrap in b4_push_if.
2476 (b4_yyssa, b4_yyerror_range): New macros.
2477 (struct yypvars): Remove yyssa_ptr and yyerror_range_ptr fields.
2478 (yypvarsinit): Remove init of removed fields.
2479 (yypushparse): Remove use of removed fields; use new macros instead.
2480
96a1981a
PE
24812006-10-11 Paul Eggert <eggert@cs.ucla.edu>
2482
2483 * data/push.c (yypushparse): Fix memory leak if yymsg is malloced
2484 in a push parser. Reindent slightly to match yacc.c better.
2485
24862006-10-11 Bob Rossi <bob@brasko.net>
2487
46356ea4
PE
2488 * data/push.c (struct yypvars): Remove yymsgbuf, yymsgbuf_ptr, yymsg,
2489 yymsg_alloc fields.
2490 (yypvarsinit, yypushparse): Remove init of removed fields.
2491 (yypushparse): Use yymsgbuf instead of yymsgbuf_ptr.
96a1981a 2492
c1630a8b
PE
24932006-10-09 Paul Eggert <eggert@cs.ucla.edu>
2494
2495 * THANKS: Add Paolo Bonzini and Bob Rossi.
2496
90b9908d
PB
24972006-10-08 Paolo Bonzini <bonzini@gnu.org>
2498
2499 * data/c.m4 (b4_copyright, b4_epilogue, b4_location_initial_column,
2500 b4_location_initial_line, p4_parse_param, b4_ints_in, b4_flag_if,
2501 b4_define_flag_if and uses, b4_basename, b4_syncline, b4_user_code,
2502 b4_define_user_cde and uses): Remove.
2503 (b4_comment, b4_prefix, b4_sync_start): New.
2504 * data/bison.m4: New file, with most of the content removed from c.m4.
2505 * src/muscle_tab.h: Use "do {...} while(0)" throughout.
2506 * src/output.c (output_skeleton): Pass bison.m4.
2507 (prepare): Pass glr_flag and nondeterministic_flag. Pass prefix
2508 only if specified.
2509
cf806753
PE
25102006-10-05 Paul Eggert <eggert@cs.ucla.edu>
2511
2512 Fix test failure reported by Tom Lane in
2513 <http://lists.gnu.org/archive/html/bug-bison/2006-10/msg00000.html>
2514 and try to make such failures easier to catch in the future.
2515 * data/glr.c (YYTRANSLATE): Don't check for nonpositive arg;
2516 that's now the caller's responsibility.
2517 (yyprocessOneStack, yyrecoverSyntaxError, yyparse):
2518 Set yychar = YYEOF if it's negative.
2519 * tests/actions.at (yylex): Abort if asked to read past EOF.
2520 * tests/conflicts.at (yylex): Likewise.
2521 * tests/cxx-type.at (yylex): Likewise.
2522 * tests/glr-regression.at (yylex): Likewise.
2523 * tests/input.at (yylex): Likewise.
2524 * tests/regression.at (yylex): Likewise.
2525 * tests/torture.at (yylex): Likewise.
2526
0e2f006a
PE
25272006-10-01 Paul Eggert <eggert@cs.ucla.edu>
2528
2529 Fix problems with translating English-language diagnostics.
2530 * bootstrap: Fix bug introduced in recent bootstrap changes, with
2531 respect to bison-runtime pot generation. The YY_ stuff
2532 wasn't being captured.
2533 * bootstrap.conf (XGETTEXT_OPTIONS_RUNTIME): New var.
2534 * po/POTFILES.in: Add src/location.c, src/scan-code.l.
2535 * runtime-po/POTFILES.in: Add data/push.c.
2536
e3ddc1e3
PE
25372006-09-29 Paul Eggert <eggert@cs.ucla.edu>
2538
2539 Merge bootstrap changes from coreutils.
2540
2541 2006-09-28 Jim Meyering <jim@meyering.net>
2542
2543 Automatically generated dependencies are important even
2544 when all of the sources in a directory come from gnulib.
2545 * bootstrap (gnulib_tool): Remove the "no-dependencies" automake
2546 option that gnulib-tool adds to what becomes our lib/gnulib.mk.
2547
2548 2006-09-23 Jim Meyering <jim@meyering.net>
2549
2550 * bootstrap (gnulib_tool_options): Add "--local-dir gl".
2551
2552 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
2553
2554 * bootstrap: Add support for --force.
2555 (usage): New function. Describe usage less tersely.
2556 (CVS_only_file): New var.
2557
01e972b3
PE
25582006-09-21 Paul Eggert <eggert@cs.ucla.edu>
2559
2560 * data/push.c (YYPUSH_MORE): Make it an enum instead.
2561 (yypushparse): Use YYPUSH_MORE instead of the mystery constant.
2562 Adjust white space and comments to match GNU style better.
2563
c63d3e90
PE
25642006-09-20 Bob Rossi <bob@brasko.net>
2565
2566 * data/push.c (yyresult_get): Remove function.
2567 (YYPUSH_MORE): Add #define.
2568 (yypushparse): Modify return value.
2569
e70f46d1
PE
25702006-09-20 Paul Eggert <eggert@cs.ucla.edu>
2571
2572 * stamp-h.in: Remove; no longer needed.
2573 * .cvsignore: Replace autom4te.cache and config.cache with *.cache.
2574 Remove config.h, config.hin, intl (no longer created).
2575 * lib/.cvsignore: Add config.h, config.hin, configmake.h, inttypes.h,
2576 stamp-h1.
2577
2578 Sync bootstrap from coreutils, as follows:
2579
2580 2006-09-18 Paul Eggert <eggert@cs.ucla.edu>
2581
2582 * bootstrap (symlink_to_gnulib): New function.
2583 (cp_mark_as_generated): Use it, to prefer symlinks-to-gnulib
2584 to copies-of-gnulib.
2585 (cp_mark_as_generated, slurp, gnulib_files):
2586 Avoid making a copy if it's the same as the old version.
2587 (gnulib_files): Add support for this variable (used by Bison).
2588
a92be413
PE
25892006-09-20 Paul Eggert <eggert@cs.ucla.edu>
2590
2591 * src/getargs.c (usage): Rework to use conventions similar to
2592 coreutils, to make translation a bit easier and the code a bit
2593 smaller. Problem reported by Tim Van Holder.
2594
4f82b42a
PE
25952006-09-15 Paul Eggert <eggert@cs.ucla.edu>
2596
3b2942e6
PE
2597 Use some of gnulib's new modules, taken from coreutils.
2598
2599 * bootstrap: Sync from coreutils, except add support for gnulib_files.
2600 * bootstrap.conf: New file.
2601 (gnulib_modules): Add configmake, inttypes, unistd.
2602 (XGETTEXT_OPTIONS): Add complain, complain_at,
2603 fatal, fatal_at, warn, warn_at, unexpected_end.
2604 * configure.ac (AC_CONFIG_HEADERS): config.h is now in lib, not here.
2605 (gl_USE_SYSTEM_EXTENSIONS): Remove; gl_EARLY now does this.
2606 (gl_EARLY): Add.
2607 (AM_STDBOOL_H): Remove; gl_INIT now dows this.
2608 (gl_INIT): Add
2609 (GNULIB_AUTOCONF_SNIPPET): Remove.
2610 (AM_GNU_GETTEXT): Add; require formatstring macros since that's
2611 the pickiest.
2612 * lib/.cvsignore: Add inttypes_.h.
2613 * lib/Makefile.am: Include gnulib.mk first so we can append to it.
2614 (AM_CFLAGS): Add WERROR_CFLAGS, to be more like coreutils.
2615 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES): Remove
2616 no-longer-necessary initializations.
2617 (lib_SOURCES): Remove, replacing by libbison_a_SOURCES.
2618 * lib/subpipe.c: Include <unistd.h> unconditionally, now that we
2619 use the unistd module.
2620 * src/system.h: Likewise.
2621 * m4/.cvsignore: Remove *_gl.m4, gnulib.m4, inttypes_h.m4, uintmax_t.m4,
2622 ulonglong.m4. Add gettext.m4, gnulib-cache.m4, gnulib-comp.m4,
2623 gnulib-tool.m4, inttypes-h.m4, inttypes-pri.m4, inttypes.m4.
2624 * src/Makefile.am (DEFS): Remove, since configmake does this for us.
2625 (AM_CPPFLAGS): Remove -I../lib, since Automake does that for us.
2626 * src/system.h: Include inttypes.h unconditionally, now that we
2627 use the inttypes module. Don't bother to include stdint.h, since
2628 inttypes.h now does that for us.
2629 (LOCALEDIR): Remove, now that we use the configmake module.
2630 * src/getargs.c: Include configmake.h.
2631 * src/main.c: Likewise.
2632 * src/output.c: Likewise.
2633 * tests/atlocal.in (CPPFLAGS): Include from $abs_top_builddir/lib,
2634 not from $abs_top_builddir, since config.h moved.
2635
2636
4f82b42a
PE
2637 Port to GCC 2.95. First two problems reported by Michael Deutschmann in
2638 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00018.html>.
2639
2640 * src/parse-gram.y (symbol_declaration): Don't put statements
2641 before declarations; it's not portable to C89.
2642 * src/scan-code.l (handle_action_at): Likewise.
2643
2644 * src/scan-code.l: Always initialize braces_level; the old code
2645 left it uninitialized and therefore had undefined behavior.
2646
2647 Don't attempt to redefine 'assert', since it runs afoul of
2648 systems where standard headers (mistakenly) include <assert.h>.
2649 Instead, define and use our own alternative, called 'aver'.
2650 * src/reader.c: Don't include assert.h, since we no longer
2651 use assert.
2652 * src/scan-code.l: Likewise.
2653 * src/system.h (assert): Remove, replacing with....
2654 (aver): New function, taking a bool arg. All uses changed.
2655 * src/tables.c (pack_vector): Ensure that aver arg is bool,
2656 not merely an integer.
2657
31c10e38
PE
26582006-09-15 Bob Rossi <bob@brasko.net>
2659
2660 * data/Makefile.am (dist_pkgdata_DATA): Add push.c.
2661 * data/c.m4 (YYPUSH): New.
2662 (b4_push_if): New macro. Use it instead of #ifdef YYPUSH.
2663 * src/getargs.c (push_parser): New var.
2664 * src/getargs.h (push_parser): New declaration.
2665 * src/output.c (prepare): Add macro insertion of `push_flag'.
2666 * src/parse-gram.y (PERCENT_PUSH_PARSER): New token.
2667 (prologue_declaration): Parse %push-parser.
2668 * src/scan-gram.l: Scan new PERCENT_PUSH_PARSER token.
2669 * tests/calc.at (_AT_CHECK_CALC_ERROR): Add "Return" and "Now" to
2670 list of removed lines from the traces observed.
2671 (AT_CHECK_CALC_LALR): Added push parser tests.
2672
fa7b79c0
PE
26732006-09-13 Paul Eggert <eggert@cs.ucla.edu>
2674
21fe08ca
PE
2675 * NEWS: Version 2.3a.
2676 * configure.ac (AC_INIT): Likewise.
2677
e8ec4d9b
PE
2678 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Remove
2679 "#define YYSTYPE int" that caused "make maintainer-check" to fail
2680 due to header ordering dependencies. I don't know why the #define
2681 was there.
2682
fa7b79c0
PE
2683 Fix glr.cc and lalr1.cc's use of YYDEBUG so that there's zero
2684 runtime cost when YYDEBUG is not defined, and so that some tests
2685 that used to fail now work. Problem and initial suggestion by
2686 Paolo Bonzini.
2687 * data/c++.m4 (b4_parse_param_cons): Omit leading ','.
2688 * data/glr.cc (b4_parser_class_name):
2689 Initialize yycdebug_ only if YYDEBUG. Also, initialize yydebug_.
2690 (debug_level, set_debug_level): Affect yydebug_, not ::yydebug.
2691 (yydebug_) [YYDEBUG]: New member.
2692 (yycdebug_): Now defined only if YYDEBUG.
2693 * data/lalr1.cc (yydebug_, yycdebug_): Now defined only if YYDEBUG.
2694 (YYCDEBUG) [!YYDEBUG]: Don't use yydebug_ and yycdebug_.
2695 (b4_parser_class_name): Initialize yydebug_ and yycdebug_ only
2696 if YYYDEBUG.
2697 (debug_stream, set_debug_stream, debug_level, set_debug_level):
2698 Define only if YYDEBUG.
2699 * tests/calc.at (_AT_DATA_CALC_Y) [!YYDEBUG]: Omit call to
2700 set_debug_level.
2701 * tests/regression.at (_AT_DATA_DANCER_Y) [!YYDEBUG]: Likewise.
2702 * tests/calc.at (AT_CHECK_CALC_GLR_CC): Uncomment calls to
2703 AT_CHECK_CALC_GLR_CC that are working now.
2704
4ec13d60
PE
27052006-09-12 Paul Eggert <eggert@cs.ucla.edu>
2706
2707 * data/glr.cc (YYERROR_VERBOSE, YYTOKEN_TABLE): Remove.
2708 We don't need them in glr.cc, and glr.c defines them.
2709 Defining YYERROR_VERBOSE to 0 here breaks glr.c, since glr.c
2710 assumes that defining it to anything is the same as defining
2711 it to 1. Problem reported by Paolo Bonzini.
2712
8e1687ae
PE
27132006-09-12 Paolo Bonzini <bonzini@gnu.org> (tiny change)
2714
2715 * data/c.m4 (b4_null, b4_case): Define.
2716 * src/output.c (prepare_symbols): Use b4_null.
2717 (user_actions_output): Use b4_case.
2718
3dc5e96b
PE
27192006-09-11 Paul Eggert <eggert@cs.ucla.edu>
2720
aef3da86
PE
2721 * data/glr.c (b4_shared_declarations): Put start-header first,
2722 before any #includes that we generate, so that feature-test
2723 macros work. Problem reported by Michael Deutschmann in
2724 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00004.html>.
2725 * data/lalr1.cc: Likewise.
2726 * doc/bison.texinfo (Prologue): Document that feature-test macros
2727 should be defined before any Bison declarations.
2728 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Put defns
2729 that depend on location.hh after, not before, Bison decls, since
2730 we now include location.hh after the first user prologue.
2731
3dc5e96b
PE
2732 * doc/bison.texinfo (Calc++ Parser): Fix memory leak reported by
2733 Sander Brandenburg in
2734 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00002.html>.
2735 Also, fix minor white space and comment issues.
aef3da86
PE
2736 (Prologue): Mention that it's better to define feature-test macros
2737 before Bison declarations. Problem reported by Michael Deutschmann.
2738
2739 * README-cvs: Fix typo: "&" should be "&&". Problem reported
2740 by Jim Meyering.
2741 * m4/.cvsignore: Add argmatch.m4. Remove obstack.m4, strerror_r.m4.
2742 This adjusts to recent gnulib changes.
3dc5e96b 2743
b2a0b7ca
JD
27442006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
2745
2746 Finish implementation of per-type %destructor/%printer. Discussed
2747 starting at
2748 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>
2749 and
2750 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>.
2751 * NEWS (2.3+): Add a description of this feature to the default
2752 %destructor/%printer description.
2753 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise.
2754 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
2755 Invoke semantic_type_destructor_set or semantic_type_printer_set when a
2756 list node contains a semantic type.
2757 * src/symtab.c, src/symtab.h: Extend with a table that associates
2758 semantic types with their %destructor's and %printer's.
2759 (semantic_type_from_uniqstr, semantic_type_get,
2760 semantic_type_destructor_set, semantic_type_printer_set): New functions
2761 composing the public interface of that table.
2762 (symbol_destructor_get, symbol_destructor_location_get,
2763 symbol_printer_get, symbol_printer_location_get): If there's no
2764 per-symbol %destructor/%printer, look up the per-type before trying
2765 the default.
2766 * tests/actions.at (Per-type %printer and %destructor): New test case.
2767 * tests/input.at (Default %printer and %destructor redeclared):
2768 Extend to check that multiple occurrences of %symbol-default in a
2769 single %destructor/%printer declaration is an error.
2770 (Per-type %printer and %destructor redeclared, Unused values with
2771 per-type %destructor): New test cases.
2772
3be03b13
JD
27732006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
2774
2775 Require default %destructor/%printer to be declared using
2776 %symbol-default instead of an empty symbol list, and start working on
2777 new per-type %destructor/%printer. Discussed at
2778 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00007.html>.
2779 * NEWS (2.3+): Add %symbol-default to example.
2780 * bison.texinfo (Freeing Discarded Symbols): Likewise.
148d66d8 2781 (Table of Symbols): Add entry for %symbol-default.
3be03b13
JD
2782 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): New token.
2783 (generic_symlist, generic_symlist_item): New nonterminals for creating
2784 a list in which each item is a symbol, semantic type, or
2785 %symbol-default.
2786 (grammar_declaration): Use generic_symlist in %destructor and %printer
2787 declarations instead of symbols.1 or an empty list.
2788 (symbol_declaration, precedence_declaration, symbols.1): Update actions
2789 for changes to symbol_list.
2790 * src/reader.c: Update for changes to symbol_list.
2791 * src/scan-code.l: Likewise.
2792 * src/scan-gram.l: Scan new PERCENT_SYMBOL_DEFAULT token.
2793 * src/symlist.c, src/symlist.h: Extend such that a list node may
2794 represent a semantic type or a %symbol-default in addition to just an
2795 ordinary symbol. Add switched functions for setting %destructor's and
2796 %printer's.
2797 * tests/actions.at, tests/input.at: Add %symbol-default to all default
2798 %destructor/%printer declarations.
2799
3508ce36
JD
28002006-08-23 Joel E. Denny <jdenny@ces.clemson.edu>
2801
2802 Whether the default %destructor/%printer applies to a particular symbol
2803 isn't a question of whether the user *declares* that symbol (in %token,
2804 for example). It's a question of whether the user by any means
2805 *defines* the symbol at all (by simply using a char token, for
2806 example). $end is defined by Bison whereas any other token with token
2807 number 0 is defined by the user. The error token is always defined by
2808 Bison regardless of whether the user declares it with %token, but we
2809 may one day let the user define error as a nonterminal instead.
2810 * NEWS (2.3+): Say "user-defined" instead of "user-declared".
2811 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise, and document
2812 the meaning of "user-defined".
2813 * tests/actions.at (Default %printer and %destructor for user-declared
2814 end token): Rename to...
2815 (Default %printer and %destructor for user-defined end token): ...
2816 this.
2817
2818 * src/symtab.c (symbol_destructor_get, symbol_printer_get): In the
2819 computation of whether to apply the default, don't maintain a list of
2820 every Bison-defined symbol. Instead, just check for a first character
2821 of '$', which a user symbol cannot have, and check for the error token.
2822
9350499c
JD
28232006-08-21 Joel E. Denny <jdenny@ces.clemson.edu>
2824
2825 Don't apply the default %destructor or %printer to the error token,
2826 $undefined, or $accept. This change fits the general rule that the
2827 default %destructor and %printer are only for user-declared symbols,
2828 and it solves several difficulties that are described in the new test
2829 cases listed below.
2830 * src/symtab.c (symbol_destructor_get, symbol_printer_get): Implement.
2831 * tests/actions.at (Default %printer and %destructor are not for error
2832 or $undefined, Default %printer and %destructor are not for $accept):
2833 New test cases.
2834
4d7370cb
JD
28352006-08-19 Joel E. Denny <jdenny@ces.clemson.edu>
2836
2837 Allow %start after the first rule.
2838 * src/reader.c (grammar_current_rule_begin): Don't set the start symbol
2839 when parsing the first rule.
2840 (check_and_convert_grammar): Search for it here after all grammar
2841 declarations have been parsed. Skip midrules, which have dummy LHS
2842 nonterminals.
2843 * src/symtab.c (symbol_is_dummy): New function.
2844 * src/symtab.h (symbol_is_dummy): Declare it.
2845 * tests/input.at (%start after first rule): New test.
2846
6d0ef4ec
JD
28472006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
2848
2849 Redo some of the previous commit: add back the ability to use
2850 non-aliased/undeclared string literals since it might be useful to
2851 those declaring %token-table.
2852 * src/reader.c (check_and_convert_grammar): Undo changes in previous
2853 commit: don't worry about complaints from symbols_pack.
2854 * src/symtab.c (symbol_new, symbol_class_set,
2855 symbol_check_alias_consistency): Undo changes in previous commit: count
2856 each string literal as a new symbol and token, assign it a symbol
2857 number, and don't complain about non-aliased string literals.
2858 (symbols_pack): Since symbol_make_alias still does not decrement symbol
2859 and token counts but does still set aliased tokens to the same number,
2860 symbol_pack_processor now leaves empty slots in the symbols array.
2861 Remove those slots.
2862 * tests/regression.at (Undeclared string literal): Remove test case
2863 added in previous commit since non-aliased string literals are allowed
2864 again.
2865 (Characters Escapes, Web2c Actions): Undo changes in previous commit:
2866 remove unnecessary string literal declarations.
2867 * tests/sets.at (Firsts): Likewise.
2868
965537bc
JD
28692006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
2870
2871 Don't allow an undeclared string literal, but allow a string literal to
2872 be used before its declaration.
2873 * src/reader.c (check_and_convert_grammar): Don't invoke packgram if
2874 symbols_pack complained.
2875 * src/symtab.c (symbol_new): Don't count a string literal as a new
2876 symbol.
2877 (symbol_class_set): Don't count a string literal as a new token, and
2878 don't assign it a symbol number since symbol_make_alias does that.
2879 (symbol_make_alias): It's not necessary to decrement the symbol and
2880 token counts anymore. Don't assume that an alias declaration occurs
2881 before any uses of the identifier or string, and thus don't assert that
2882 one of them has the highest symbol number so far.
2883 (symbol_check_alias_consistency): Complain if there's a string literal
2884 that wasn't declared as an alias.
2885 (symbols_pack): Bail if symbol_check_alias_consistency failed since
2886 symbol_pack asserts that every token has been assigned a symbol number
2887 although undeclared string literals have not.
2888 * tests/regression.at (String alias declared after use, Undeclared
6d0ef4ec 2889 string literal): New test cases.
965537bc
JD
2890 (Characters Escapes, Web2c Actions): Declare string literals as
2891 aliases.
2892 * tests/sets.at (Firsts): Likewise.
2893
47aee066
JD
28942006-08-14 Joel E. Denny <jdenny@ces.clemson.edu>
2895
2896 In the grammar scanner, STRING_FINISH unclosed constructs and return
2897 them to the parser in order to improve error messages.
2898 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER,
2899 SC_BRACED_CODE, SC_PROLOGUE): Implement.
2900 * tests/input.at (Unclosed constructs): New test case.
2901 * tests/regression.at (Invalid inputs): Update now that unclosed %{ is
2902 seen.
2903
2904 * src/scan-gram.h, src/scan-gram.l (gram_last_braced_code_loc): Remove
2905 unused global.
2906
1f6b3679
JD
29072006-08-13 Joel E. Denny <jdenny@ces.clemson.edu>
2908
2909 Handle string aliases for character tokens correctly.
2910 * src/symtab.c (symbol_user_token_number_set): If the token has an
2911 alias, check and set its alias's user token number instead of its own,
2912 which is set to indicate the alias. Previously, every occurrence of
2913 the character token in the grammar overwrote that alias indicator with
2914 the character code.
2915 * tests/input.at (String aliases for character tokens): New test.
2916
219741d8
JD
29172006-08-12 Joel E. Denny <jdenny@ces.clemson.edu>
2918
2919 * src/parse-gram.y: Add `%expect 0' so we don't overlook conflicts.
2920
11daa4e7
PE
29212006-08-11 Paul Eggert <eggert@cs.ucla.edu>
2922
2923 * bootstrap: Put in need-ngettext argument to AM_GNU_GETTEXT,
2924 to prevent failures when building on older platforms.
2925 Check for autopoint failure.
2926 Set XGETTEXT_OPTIONS to values that check for C format strings,
2927 so that translators are warned about them (this also helps
2928 prevent core dumps).
2929
2930 * lib/subpipe.c (create_subpipe): Use new gnulib pipe_safer
2931 function, since it simplifies our code a bit.
2932
2933 * configure.ac (AC_ARG_ENABLE): Use -Wextra -Wno-sign-compare
2934 rather than -W, so we don't get bogus warnings about sign comparisons.
2935 Add -Wpointer-arith, since that warning is useful (it reports code
2936 that does not conform to C89 and that some compilers reject).
2937 * data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c: Undo latest change,
2938 since it's no longer needed.
2939
f9bfc42a
JD
29402006-08-10 Joel E. Denny <jdenny@ces.clemson.edu>
2941
2942 Clean up scanners a bit.
2943 * src/flex-scanner.h (FLEX_NO_OBSTACK): New macro that blocks obstack
2944 definitions so gcc won't warn when obstack_for_string is unused.
2945 * src/scan-code.l: config.h and system.h are already #include'd by
2946 scan-code-c.c, so get rid of them here.
2947 * src/scan-gram.l: Likewise.
2948 * src/scan-skel.l: Likewise, and use flex-scanner.h without obstack
2949 definitions rather than duplicating the rest of it.
2950 * src/scan-gram-c.c, scan-skel-c.c: #include "system.h".
2951
06e8700a
JD
29522006-08-09 Joel E. Denny <jdenny@ces.clemson.edu>
2953
2954 Suppress signed/unsigned comparison warnings for yycheck.
2955 * data/c.m4 (b4_safest_int_type): New macro.
2956 * data/glr.c, data/lalr1.cc: Wherever you compare yycheck[i] against
2957 a signed int type, cast it to b4_safest_int_type first.
2958 * data/yacc.c: Likewise.
2959 (b4_safest_int_type): Overwrite the one from c.m4 since b4_int_type is
2960 also overwritten.
2961
9c437126
PE
29622006-08-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
2963
2964 * doc/bison.texinfo: Fix some typos.
2965
284d8a13
PE
29662006-08-02 Paul Eggert <eggert@cs.ucla.edu>
2967
2968 * m4/.cvsignore: Add inttypes_h.m4,lib-ld.m4, lib-prefix.m4,
2969 po.m4, stdint_h.m4, uintmax_t.m4, ulonglong.m4, warning.m4.
2970
2971 * bootstrap (gnulib_tool): Stop using --assume-autoconf;
2972 the latest gnulib does this a different way.
2973 (get_translations): Sharuzzaman Ahmat Raslan reported that the ms
2974 translation was patched, so stop omitting it.
2975
ec5479ce
JD
29762006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
2977
2978 Enable declaration of default %printer/%destructor. Make the parser
2979 use these for all user-declared grammar symbols for which the user does
2980 not declare a specific %printer/%destructor. Thus, the parser uses it
2981 for token 0 if the user declares it but not if Bison generates it as
2982 $end. Discussed starting at
2983 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>,
2984 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>,
2985 and
2986 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>.
2987 * NEWS (2.3+): Mention.
2988 * doc/bison.texinfo (Actions in Mid-Rule): It's no longer impossible to
2989 declare a %destructor for a mid-rule's semantic value. It's just
2990 impossible to declare one specific to it.
2991 (Freeing Discarded Symbols): Mention that @$ can be used in %destructor
2992 code. Describe default %destructor form.
2993 * src/parse-gram.y (grammar_declaration): Parse default
2994 %printer/%destructor declarations.
2995 * src/output.c (symbol_destructors_output): Use symbol_destructor_get
2996 and symbol_destructor_location_get rather than accessing the destructor
2997 and destructor_location members of struct symbol.
2998 (symbol_printers_output): Likewise but for %printer's.
2999 * src/reader.c (symbol_should_be_used): Likewise but for %destructor's
3000 again.
3001 * src/symtab.c (default_destructor, default_destructor_location,
3002 default_printer, default_printer_location): New static global
3003 variables to record the default %destructor and %printer.
3004 (symbol_destructor_get, symbol_destructor_location_get,
3005 symbol_printer_get, symbol_printer_location_get): New functions to
3006 compute the appropriate %destructor and %printer for a symbol.
3007 (default_destructor_set, default_printer_set): New functions to set the
3008 default %destructor and %printer.
3009 * src/symtab.h: Prototype all those new functions.
3010 * tests/actions.at (Default %printer and %destructor): New test to
3011 check that the right %printer and %destructor are called, that they're
3012 not called for $end, and that $$ and @$ work correctly.
3013 (Default %printer and %destructor for user-declared end token): New
3014 test to check that the default %printer and %destructor are called for
3015 a user-declared end token.
3016 * tests/input.at (Default %printer and %destructor redeclared, Unused
3017 values with default %destructor): New tests to check related grammar
3018 warnings and errors.
3019
868d2d96
JD
30202006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
3021
3022 Clean up handling of %destructor for the end token (token 0).
3023 Discussed starting at
3024 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>
3025 and
3026 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00013.html>.
3027
3028 Make the skeletons consistent in how they pop the end token and invoke
3029 its %destructor.
3030 * data/glr.c (yyrecoverSyntaxError, yyparse): Don't pop the start
3031 state, which has token number 0, since this would invoke the
3032 %destructor for the end token.
3033 * data/lalr1.cc (yy::parser::parse): Don't check for the final state
3034 until after shifting the end token, or else it won't be popped.
3035 * data/yacc.c (yyparse): Likewise.
3036
3037 * data/glr.c (yyparse): Clear the lookahead after shifting it even when
3038 it's the end token. Upon termination, destroy an unshifted lookahead
3039 even when it's the end token.
3040 * data/lalr1.cc (yy::parser::parse): Likewise.
3041 * data/yacc.c (yyparse): Likewise.
3042
3043 * src/reader.c (packgram): Don't check rule 0. This suppresses unused
3044 value warnings for the end token when the user gives the end token a
3045 %destructor.
3046
3047 * tests/actions.at (Printers and Destructors): Test all the above.
3048
62a9592d
PE
30492006-07-24 Paul Eggert <eggert@cs.ucla.edu>
3050
3051 Update to latest gnulib and gettext versions.
3052 * bootstrap (gnulib-modules): Remove hard-locale, stdio-safer.
3053 Add fopen-safer.
3054 (gnulib_files): Add m4/warning.m4. Don't worry about files
3055 overwritten by autopoint.
3056 Replace gt_INTL_SUBDIR_CORE with an empty body in m4/gettext_gl.m4.
3057 Suppress "id", "ms", "tr" translations for now, since gettext 0.15
3058 rejects them.
3059 Don't use autoreconf; instead, invoke autopoint etc. by hand,
3060 so that we can remove the intl files at a better time.
3061 (intl_files_to_remove): Remove aclocal.m4, since it gets
3062 rebuilt anyway. Remove m4/inttypes_h.m4, m4/inttypes.m4,
3063 m4/isc-posix.m4, m4/lib-ld.m4, m4/lib-prefix.m4, m4/po.m4,
3064 m4/stdint_h.m4, m4/uintmax_t.m4, m4/ulonglong.m4.
3065 Add m4/inttypes-h.m4, m4/lock.m4, m4/visibility.m4.
3066 Remove datarootdir hack; no longer needed.
3067 * configure.ac: Use gl_WARNING_CFLAGS rather than BISON_WARNING.
3068 (AM_GNU_GETTEXT_VERSION): Bump from 0.12 to 0.15.
3069 * lib/.cvsignore: Remove hard-locale.c, hard-locale.h, strdup.c,
3070 strdup.h.
3071 * m4/.cvsignore: Remove hard-locale.m4, strdup.m4.
3072 * m4/warning.m4: Remove from CVS, since we now use gnulib's version.
3073
10d6970f
PE
30742006-07-20 Paul Eggert <eggert@cs.ucla.edu>
3075
3076 * bootstrap: Adjust to today's change to gnulib-tool by invoking
3077 it with --assume-autoconf='latest-stable'.
3078
50a33993
JD
30792006-07-13 Joel E. Denny <jdenny@ces.clemson.edu>
3080
3081 * src/parse-gram.y (grammar_declaration): Don't confuse Doxygen (at
3082 least 1.4.7 and 1.4.4) by putting a #line between `typedef union
3083 YYSTYPE' and `{'.
3084 * src/muscle_tab.h (muscle_grow): Replace the header comments with
3085 those from muscle_tab.c since the old ones are misleading.
3086
2ce4ed68
AD
30872006-07-13 Akim Demaille <akim@epita.fr>
3088
3089 Support %define "KEY" {VALUE}.
3090 * src/scan-code.h, src/scan-code.l (translate_action)
3091 (translate_rule_action, translate_symbol_action, translate_code):
3092 Return char *, not const char *.
3093 * src/parse-gram.y (declaration): Rename as...
3094 (prologue_declaration): this.
3095 (string_content): Remove this nonterminal, use STRING.
3096 (braceless, content, content.opt): New nonterminal.
3097 Use them.
3098 (%define): Now accept content.opt, i.e., accept also BRACED_CODE
3099 as value.
3100 * src/scan-gram.l (getargs.h): Don't include it.
3101
db7e5eb5
PE
31022006-07-12 Paul Eggert <eggert@cs.ucla.edu>
3103
3104 * data/lalr1.cc (YYCDEBUG): Use 'if (yydebug_) (*yycdebug_)'
3105 rather than a for-loop that declares a local bool variable. This
3106 should work around a compatibility problem with a Cray x1e C++
3107 compiler reported by Hung Nguyen in
3108 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00022.html>.
3109 The for-loop was introduced in the 2004-11-17 change but I don't
3110 know why it was needed.
3111
a5d80ba5
AD
31122006-07-12 Akim Demaille <akim@epita.fr>
3113
3114 * data/c.m4: Comment changes.
3115
23eb2a69
AD
31162006-07-10 Akim Demaille <akim@lrde.epita.fr>
3117
3118 * src/complain.c (error_message, ERROR_MESSAGE): New.
3119 To factor...
3120 (fatal_at, fatal, warn_at, warn, complain_at, complain): these.
3121 * src/complain.h, src/complain.c (warning_issued): Remove, unused.
3122
ddc8ede1
PE
31232006-07-09 Paul Eggert <eggert@cs.ucla.edu>
3124
3125 * NEWS: Instead of %union, you can define and use your own union type
3126 YYSTYPE if your grammar contains at least one <type> tag.
3127 Your YYSTYPE need not be a macro; it can be a typedef.
3128 * doc/bison.texinfo (Value Type, Multiple Types, Location Type):
3129 (Union Decl, Decl Summary): Document this.
3130 * data/glr.c (YYSTYPE): Implement this.
3131 * data/glr.cc (YYSTYPE): Likewise.
3132 * data/lalr1.cc (YYSTYPE): Likewise.
3133 * data/yacc.c (YYSTYPE): Likewise.
3134 * src/output.c (prepare): Output tag_seen_flag.
3135 * src/parse-gram.y (declaration, grammar_declaration):
3136 Use 'union_seen' rather than 'typed' to determine whether
3137 %union has been seen, since grammars can now be typed without
3138 %union.
3139 (symbol_declaration, type.opt, symbol_def):
3140 Keep track of whether a tag has been seen.
3141 * src/reader.c (union_seen, tag_seen): New vars.
3142 (typed): remove.
3143 * src/reader.h (union_seen, tag_seen, typed): Likewise.
3144 * src/scan-code.l (untyped_var_seen): New variable.
3145 (handle_action_dollar): Adjust to above changes.
3146 (handle_action_dollar, handle_action_at):
3147 Improve overflow checking for outlandish numbers.
3148 * tests/input.at (AT_CHECK_UNUSED_VALUES): Redo test to
3149 avoid new diagnostics generated by above changes.
3150 * tests/regression.at (YYSTYPE typedef): Add test to check
3151 for type tags without %union.
3152
3153 * src/symlist.c (symbol_list_length): Return int, not unsigned
3154 int, since callers expect int. This may need to get revisited
3155 once we have proper integer overflow checking.
3156
3157 * src/scan-gram.h (gram_scanner_cursor): Remove decl, since this
3158 object is now static.
3159
3160 * src/getargs.c (flags_argmatch): Return void, not int,
3161 to pacify ./configure --enable-gcc-warnings.
3162
3163 * src/flex-scanner.h (STRING_FREE): Don't use FLEX_PREFIX (last_string)
3164 since last_string is already defined to FLEX_PREFIX (last_string).
3165
7b42569e
AD
31662006-07-09 Akim Demaille <akim@lrde.epita.fr>
3167
3168 Implement --warnings/-W.
3169 * src/getargs.c (report_argmatch, trace_argmatch): Remove,
3170 replaced by...
3171 (flags_argmatch, FLAGS_ARGMATCH): this new function and macro.
3172 Adjust callers.
3173 * src/getargs.h, src/getargs.c (warnings, warnings_flags)
3174 (warnings_args, warnings_types): New.
3175 (getargs, short_options, long_options): Accept -W/--warnings.
3176 Sort the options by alphabetical order, upper case letter right
3177 before its lower case.
3178
3b452f4e
JD
31792006-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
3180
3181 Change %merge result type clash warnings to errors. Discussed at
3182 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00026.html>.
3183 * src/reader.c (record_merge_function_type): Use complain_at.
3184 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
3185 declared later): Update test case results.
3186
b8a41559
AD
31872006-07-09 Akim Demaille <akim@lrde.epita.fr>
3188
3189 * src/getargs.h, src/getargs.c: Swap --report and --trace handling
3190 to be in alphabetical order.
3191 (trace_args): Spelling fixes.
3192
cd9e1ba2
PE
31932006-07-09 Paul Eggert <eggert@cs.ucla.edu>
3194
3195 * data/yacc.c (YYID, yy_stack_print): Prefix local vars with "yy"
3196 so they don't collide with user-defined macros.
3197 (yy_stack_print): Don't assume that yytype_int16 promotes to int;
3198 this was never guaranteed, and now that we're using gnulib stdint,
3199 which defines int_fast16_t to long int, the problem is exposed.
3200
cb48f191
PE
32012006-07-08 Paul Eggert <eggert@cs.ucla.edu>
3202
b8445a15
PE
3203 * data/c.m4 (b4_basename): Simplify a bit, since we don't
3204 need the full POSIX semantics (and weren't implementing them
3205 anyway).
3206
cb48f191
PE
3207 Adjust to Autoconf 2.60 and today's gnulib.
3208 * bootstrap (gnulib_modules): Add stdint.
3209 Remove special case for m4/onceonly_2_57.m4, since gnulib-tool
3210 no longer copies it.
3211 (intl_files_to_remove): Remove m4/longlong.m4 and m4/wchar_t.m4,
3212 since stdint needs the former and wcwidth (which is now required
3213 by mbswidth) needs the latter.
3214 Append 'datarootdir = @datarootdir@' to po/Makefile.in.in, to
3215 work around a compatibility glitch between gettext 0.14.6 and
3216 Autoconf 2.60.
3217 * configure.ac (AC_PREREQ): Require Autoconf 2.60.
3218 Do not check for uintptr_t, since new stdint module does the right
3219 thing.
3220 * lib/.cvsignore: Remove alloca.c, alloca.h, alloca_.h.
3221 Add stdint.h, stdint_.h, wcwidth.h.
3222 * m4/.cvsignore: Remove alloca.m4, onceonly.m4.
3223 Add absolute-header.m4, double-slash-root.m4, longlong.m4,
3224 stdint.m4, wchar_t.m4, wcwidth.m4.
3225 * src/files.c: Include <dirname.h> and <stdio-safer.h> in the
3226 usual order for ../lib/*.h files.
3227 (file_name_split): Use last_component, not base_name, to adjust
3228 to gnulib changes.
3229 * src/parse-gram.h: Include <strverscmp.h> in the usual order
3230 for ../lib/*.h files.
3231 (YYTYPE_INT16, YYTYPE_INT8, YYTYPE_UINT16, YYTYPE_UINT8):
3232 Define unconditionally, since we now assume the stdint module.
3233 * src/scan-skel.l: Include <dirname.h>.
3234 (BASE_QPUTS): Use last_component, not base_name.
3235 * src/system.h: Include <unlocked-io.h> in the usual order
3236 for ../lib/*.h files. Include <stdint.h> unconditionally,
3237 since we now use the stdint module.
3238 (uintptr_t): Declare if UINTPTR_MAX is not defined, not
3239 HAVE_UINTPTR_T, since we now use the stdint module.
3240 (base_name): Remove decl, since files now include <dirname.h>
3241 to get the decl.
3242
cd48d21d
AD
32432006-07-08 Akim Demaille <akim@lrde.epita.fr>
3244
3245 * data/c.m4 (b4_location_initial_column, b4_location_initial_line):
3246 New, default to 1.
3247 * data/yacc.c, data/glr.c, data/location.cc: Use them.
3248 * NEWS, doc/bison.texinfo: The initial column and line are 1 by
3249 default.
3250 * tests/calc.at: Adjust.
3251
8ec0a172
AD
32522006-07-08 Akim Demaille <akim@lrde.epita.fr>
3253
b8445a15 3254 * data/c.m4 (b4_basename): New.
8ec0a172
AD
3255 (b4_syncline): Also output the location of its invocation (from
3256 the skeleton).
3257 (b4_user_action, b4_define_user_action, b4_user_actions)
3258 (b4_user_initial_action, b4_user_post_prologue, b4_user_start_header)
3259 (b4_user_stype): New.
3260 * data/yacc.c, data/glr.c, data/lalr1.cc, data/glr.cc: Use them.
3261
4a678af8
JD
32622006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
3263
3264 In the grammar file, the first column is 1 not 0 on the first line as
3265 on every other line.
3266 * src/parse-gram.y (%initial-action): Initialize @$ correctly.
3267 * tests/input.at (Torturing the Scanner): Update output.
3268
3269 * src/scan-gram.l (scanner_cursor): Declare it static.
3270
dd60572a
JD
32712006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
3272
3273 In warnings, say "previous declaration" rather than "first
3274 declaration".
3275 * src/symtab.c (redeclaration): Do that here.
3276 * src/reader.c (record_merge_function_type): In the case of a result
3277 type clash, report the previous declaration rather than the very first
3278 one in the grammar file.
3279 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
3280 declared later): Add a third declaration to check this behavior.
3281 * tests/input.at (Incompatible Aliases): Update output.
3282
2073e1b6
AD
32832006-06-27 Akim Demaille <akim@epita.fr>
3284
3285 * doc/Doxyfile.in: New.
3286 * doc/Makefile.am: Use it.
3287 * src/lalr.h, src/symtab.h: Initial doxygenation.
3288
8ee5b538
JD
32892006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
3290
3291 Don't miss %merge result type warnings just because the LHS types are
fab044e6
JD
3292 declared after the %merge. This continues the effort of the previous
3293 patch.
8ee5b538
JD
3294 * src/reader.c (get_merge_function): Don't set the merger type yet.
3295 (record_merge_function_type): New function for setting the merger type
3296 and checking for clashes.
3297 (grammar_current_rule_merge_set): Set the location of the %merge for
3298 the current rule.
3299 (packgram): Invoke record_merge_function_type for each rule now that
3300 all symbol type declarations have been parsed.
3301 * src/reader.h (merger_list.type_declaration_location): New member
3302 storing the location of the first %merge from which the type for this
3303 merging function was derived.
3304 * src/symlist.h (symbol_list.merger_declaration_location): New member
3305 storing the location of a rule's %merge, if any.
3306 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
3307 declared later): New test to catch the error fixed by the above patch.
3308
ffa4ba3a
JD
33092006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
3310
3311 Get action warnings (grammar_rule_check) right even when symbol
fab044e6
JD
3312 declarations appear after the rules. Discussed at
3313 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00108.html>
3314 and
3315 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00151.html>.
3316 Don't mistake the type of $$ in a midrule to be that of its parent
3317 rule's $$.
ffa4ba3a
JD
3318 * src/reader.c (grammar_current_rule_end): Don't invoke
3319 grammar_rule_check yet since not all symbol declarations may have been
3320 parsed yet.
3321 (grammar_midrule_action): Likewise.
3322 Don't record whether the midrule's $$ has been used yet since actions
3323 haven't been translated yet.
3324 Record the midrule's parent rule and its RHS index within the parent
3325 rule.
3326 (grammar_current_rule_action_append): Don't translate the action yet
3327 since not all symbol declarations may have been parsed yet and, thus,
3328 warnings about types for $$, $n, @$, and @n can't be reported yet.
3329 (packgram): Translate the action and invoke grammar_rule_check now that
3330 all symbol declarations have been parsed.
3331 * src/scan-code.l (handle_action_dollar): Now that this is invoked
3332 after parsing the entire grammar file, the symbol list here in the case
3333 of a midrule is actually the midrule's empty RHS, so reference its
3334 parent rule's RHS where necessary.
3335 On the other hand, now that you can already know it's a midrule, you
3336 aren't forced to think $$ has the same type as its parent rule's $$.
3337 (handle_action_at): In the case of a midrule, reference the parent rule
3338 where necessary.
3339 * src/symlist.c (symbol_list_new): Initialize new midrule-related
3340 members.
3341 (symbol_list_length): Now that this is invoked after all rules have
3342 been parsed, a NULL symbol (rather than a NULL symbol list node)
3343 terminates a rule. symbol_list_print already does this correctly.
3344 * src/symlist.h (symbol_list.midrule_parent_rule,
3345 symbol_list.midrule_parent_rhs_index): New members so that midrules can
3346 remember their relationships with their parents.
3347 * tests/input.at (Type Clashes): Extend to catch the midrule $$ error
3348 fixed by the above patch.
3349 (_AT_UNUSED_VALUES_DECLARATIONS, AT_CHECK_UNUSED_VALUES): New m4 macros
3350 implementing...
3351 (Unused values): ... this old test case and...
3352 (Unused values before symbol declarations): ... this new test case.
3353 This one is the same as `Unused values' except that all symbol
3354 declarations appear after the rules in order to catch the rest of the
3355 errors fixed by the above patch.
3356
e256e17f
JD
33572006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
3358
300a1930
JD
3359 More cleanup.
3360 * src/reader.c (current_rule): Declare it static since it's no longer
3361 used outside this file.
3362 (grammar_current_rule_action_append): Remove redundant arguments from
3363 translate_rule_action invocation.
3364 * src/reader.h (current_rule): Remove this unused extern.
3365 * src/scan-code.h (translate_rule_action): Remove redundant arguments.
3366 * src/scan-code.l (translate_rule_action): Likewise.
e256e17f 3367
381ecb06
JD
33682006-06-25 Joel E. Denny <jdenny@ces.clemson.edu>
3369
3370 Clean up yesterday's patch.
3371 * parse-gram.y (rhs): Move grammar_midrule_action invocation from here
3372 to...
3373 * src/reader.c (grammar_current_rule_action_append): ... here for
3374 consistency with grammar_current_rule_symbol_append.
3375 * tests/regression.at (Braced code in declaration in rules section):
3376 Make yyerror and yylex static as usual.
3377
4210cd0b
JD
33782006-06-24 Joel E. Denny <jdenny@ces.clemson.edu>
3379
3380 Fix bug that mistakes braced code in a declaration in the rules section
3381 to be a rule action. Mentioned at
3382 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00105.html>.
3383 * src/scan-gram.l: Move midrule action detection from the start of the
3384 scanning of any braced code to...
3385 * src/parse-gram.y (rhs): ... the parsing of braced code as a rule
3386 action. For readability, use $2 and @2 rather than the equivalent
3387 global variables.
3388 * tests/regression.at (Braced code in declaration in rules section):
3389 New test to catch the error fixed by the above patch.
3390
3391 Work on code readability some.
3392 * src/scan-code.l (current_rule): Get rid of this misleading and
3393 redundant declaration: it's actually extern'ed in reader.h.
3394 (YY_DECL, code_lex, handle_action_dollar, handle_action_at,
3395 translate_action): Add a rule argument and use it instead of the global
3396 current_rule.
3397 (translate_rule_action): This already receives current_rule through an
3398 argument, so pass it on to translate_action instead of assigning
3399 current_rule to current_rule.
3400 (translate_symbol_action, translate_code): Pass rule = NULL to
3401 translate_action.
3402
34f98f46
JD
34032006-06-23 Joel E. Denny <jdenny@ces.clemson.edu>
3404
3405 Rename %before-definitions to %start-header and %after-definitions to
3406 %end-header. Don't use these declarations to separate pre-prologue
3407 blocks from post-prologue blocks. Add new order-independent
3408 declarations %before-header and %after-header as alternatives to the
3409 traditional Yacc pre-prologue and post-prologue blocks. Discussed at
3410 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00110.html>.
3411 * NEWS (2.3+): Update for these changes.
3412 * data/glr.c (b4_before_definitions): Update to...
3413 (b4_start_header): ... this.
3414 (b4_after_definitions): Update to...
3415 (b4_end_header): ... this.
3416 * data/glr.cc: Likewise.
3417 * data/lalr1.cc: Likewise.
3418 * data/yacc.c: Likewise.
3419 * doc/bison.texinfo (The prologue): Update names, and replace remaining
3420 prologue blocks with %*-header declarations.
3421 (Calc++ Parser): Likewise.
91661ebb 3422 (Decl Summary): Update names.
148d66d8 3423 (Table of Symbols): Update description.
34f98f46
JD
3424 * src/parse-gram.y (PERCENT_AFTER_DEFINITIONS): Update to...
3425 (PERCENT_END_HEADER): ... this.
3426 (PERCENT_BEFORE_DEFINITIONS): Update to...
3427 (PERCENT_START_HEADER): ... this.
3428 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
3429 (declaration): Update token names and m4 macro names.
3430 When parsing %end-header and %start-header, invoke translate_code
3431 before muscle_code_grow, and no longer set global booleans to remember
3432 whether these declarations have been seen.
3433 Parse new %after-header and %before-header.
3434 * src/reader.c (before_definitions, after_definitions): Remove.
3435 (prologue_augment): Accept a new bool argument to specify whether to
3436 augment the pre-prologue or post-prologue.
3437 * src/reader.h (before_definitions, after_definitions): Remove these
3438 extern's.
3439 (prologue_augment): Add new bool argument.
3440 * src/scan-gram.l (PERCENT_AFTER_DEFINITIONS): Update to...
3441 (PERCENT_END_HEADER): ... this.
3442 (PERCENT_BEFORE_DEFINITIONS): Update to...
3443 (PERCENT_START_HEADER): ... this.
3444 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
3445 * tests/actions.at (Printers and Destructors): Update names.
3446
31b2b07e
JD
34472006-06-22 Joel E. Denny <jdenny@ces.clemson.edu>
3448
3449 Add comparison operators for C++ location classes. Discussed at
3450 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00092.html>.
3451 * data/c++.m4 (b4_define_location_comparison): New boolean %define
3452 declaration indicating whether filename_type has an operator==. If
3453 filename_type is `std::string', it defaults to `1', `0' otherwise.
3454 * data/location.cc: Iff b4_define_location_comparison is `1', add
3455 operator== and operator!= for class position and for class location.
3456
3457 Some minor fixes.
3458 * src/scan-action.l: Remove unused file.
3459 * src/symtab.c (symbol_printer_set): Use printer_location not
3460 destructor_location.
3461 * src/symtab.h (struct symbol): Replace incorrect source comment for
3462 printer members.
3463 * tests/input.at (Incompatible Aliases): Update output with correct
3464 printer location.
3465
9bc0dd67
JD
34662006-06-20 Joel E. Denny <jdenny@ces.clemson.edu>
3467
3468 Don't put the pre-prologue in the header file. For the yacc.c code
3469 file and the glr.c header and code files, move the pre-prologue before
3470 the token definitions. Add new %before-definitions and
3471 %after-definitions to declare code that will go in both the header file
3472 and code file. Discussed at
3473 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00000.html>,
3474 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00016.html>,
3475 and
3476 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00055.html>.
3477 * NEWS (2.3+): Describe these changes.
3478 * data/glr.c (b4_pre_prologue): Move from within to before...
3479 (b4_shared_declarations): ... this.
3480 Add new b4_before_definitions before b4_token_enums.
3481 Add new b4_after_definitions at the end.
3482 * data/glr.cc (b4_pre_prologue): Replace with...
3483 (b4_before_definitions): ... this in the header file.
3484 (b4_after_definitions): New near the end of the header file.
3485 * data/lalr1.cc (b4_pre_prologue): Move from the header file to the
3486 code file right before including the header file.
3487 (b4_before_definitions): New in the previous position of
3488 b4_pre_prologue in the header file.
3489 (b4_after_definitions): New near the end of the header file.
3490 * data/yacc.c: Clean up some m4 quoting especially in the header file.
3491 (b4_token_enums_defines): In the code file, move to right before
3492 YYSTYPE for consistency with the header file.
3493 (b4_before_definitions): New right before b4_token_enums_defines in
3494 both the header and code file.
3495 (b4_after_definitions): New right after YYLTYPE and yylloc in both the
3496 header and code file.
3497 * doc/bison.texinfo (Prologue): Show use of %before-definitions instead
3498 of prologues for %union dependencies.
91661ebb
JD
3499 (Decl Summary): In %defines description, mention the effect of
3500 %before-definitions and %after-definitions on the header file.
9bc0dd67
JD
3501 (Calc++ Parser): Forward declare driver in a %before-definitions rather
3502 than in the pre-prologue so that make check succeeds.
148d66d8 3503 (Table of Symbols): Add entries for %before-definitions and
9bc0dd67
JD
3504 %after-definitions.
3505 * src/parse-gram.y (PERCENT_BEFORE_DEFINITIONS): New token for
3506 %before-definitions.
3507 (PERCENT_AFTER_DEFINITIONS): New token for %after-definitions.
3508 (declaration): Parse those declarations and append to
3509 b4_before_definitions and b4_after_definitions, respectively.
3510 * src/reader.c (before_definitions, after_definitions): New bools to
3511 track whether those declarations have been seen.
3512 (prologue_augment): Add to the post-prologue if %union,
3513 %before-definitions, or %after-definitions has been seen.
3514 * src/reader.h (before_definitions, after_definitions): New extern's.
3515 * src/scan-gram.l: Scan the new declarations.
3516 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Place the second
3517 prologue block in a %before-definitions or a %after-definitions based
3518 on whether the %union is declared.
3519 * tests/regression.at (Early token definitions with --yacc, Early token
3520 definitions without --yacc): Move tests for token definitions into the
3521 post-prologue since token names are no longer defined in the
3522 pre-prologue.
3523
203b9274
AD
35242006-06-20 Akim Demaille <akim@epita.fr>
3525
3526 * src/symtab.h, src/symtab.c (symbol_from_uniqstr): New.
3527 (symbol_get): Use it.
3528 * src/parse-gram.y: Use it.
3529
a7ee59cf
JD
35302006-06-19 Joel E. Denny <jdenny@ces.clemson.edu>
3531
3532 * src/scan-gram.l: Remove unused declaration of last_string_1 so the
3533 build succeeds when configured with --enable-gcc-warnings.
3534
5a2baae7
PE
35352006-06-19 Paul Eggert <eggert@cs.ucla.edu>
3536
33ad1a9c
PE
3537 * src/parse-gram.y (char_name): New function.
3538 (CHAR, STRING, string_content): For %printer, properly escape.
3539 (ID): Prefer fputs to fprintf.
3540 (id): Reindent to be consistent with other rules.
3541 Properly quote char.
3542
5a2baae7
PE
3543 The Translation Project changed its way of publishing translations
3544 to maintainers. I haven't received any responses to my request
3545 for supporting the old way, or for documenting the new way. I
3546 have modified 'bootstrap' to use screen scraping
3547 (in this case, HTML scraping). This is unreliable and inelegant,
3548 but I don't see any better way. Yuck.
3549 * bootstrap (TP_URL, WGET_COMMAND): New vars.
3550 (get_translations): New function, which uses HTML scraping to
3551 deduce locations of latest translations.
3552 Use this function to grab both bison and bison-runtime .po files.
3553 Don't bother priming the pump for the runtime-po domain any more,
3554 as it's now translated better than bison is.
3555
58d7a1a1
AD
35562006-06-19 Akim Demaille <akim@epita.fr>
3557
3558 * src/scan-gram.l: No longer "parse" things after `%union' until
3559 `{'. Rather, return a single "%union" token.
3560 No longer make symbols: return strings, and leave the conversion
3561 to symbols to the parser.
3562 (SC_PRE_CODE, token_type): Remove.
3563 * src/parse-gram.y (%union): New field `character'.
3564 Sort tokens.
3565 (CHAR): New token.
3566 (ID, ID_COLON): Now that the scanner no longer makes them
3567 identifiers, adjust all uses to invoke symbol_get.
3568 (id_colon): New, wraps the conversion from string to symbol.
3569 (%union): Accept a possible union_name.
3570 (symbol): Now can be a char.
3571 * data/c.m4 (b4_union_name): Leave a default value.
3572 * data/glr.c, data/yacc.c: Use it.
3573
b931235e
JD
35742006-06-11 Joel E. Denny <jdenny@ces.clemson.edu>
3575
3576 For associating token numbers with token names for "yacc.c", don't use
3577 #define statements unless `--yacc' is specified; always use enum
3578 yytokentype. Most important discussions start at:
3579 <http://lists.gnu.org/archive/html/bison-patches/2005-09/msg00053.html>,
3580 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00052.html>,
3581 and
3582 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00043.html>.
3583 * NEWS (2.3+): Mention.
3584 * data/c.m4 (b4_yacc_if): New.
3585 (b4_token_enums_defines): Use b4_yacc_if to decide whether to add the
3586 token #define's.
3587 * doc/bison.texinfo (Bison Options): Describe the effect of `--yacc'
3588 on token name definitions.
3589 * src/getargs.c (usage): Capitalize `Yacc' in English.
3590 * src/output.c (prepare): Define b4_yacc_flag.
3591 * tests/regression.at (Early token definitions): Test that tokens names
3592 are defined before the pre-prologue not just before the post-prologue.
3593 Remove this test case and copy to...
3594 (Early token definitions with --yacc): ... this to test #define's.
3595 (Early token definitions without --yacc): ... and this to test enums.
3596
9e6e7ed2
PE
35972006-06-11 Paul Eggert <eggert@cs.ucla.edu>
3598
3599 * NEWS: Reword the post-2.3 change to not be so optimistic about
3600 removing the old "look-ahead" spelling.
3601 Update previous look-ahead/lookahead change reports.
3602 * REFERENCES: look-ahead -> lookahead (since that's
3603 what he actually wrote).
3604 * doc/refcard.tex: look ahead -> lookahead,
3605 look-ahead -> lookahead
3606
742e4900
JD
36072006-06-09 Joel E. Denny <jdenny@ces.clemson.edu>
3608
3609 For consistency, use `lookahead' instead of `look-ahead' or
3610 `look_ahead'. Discussed starting at
3611 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00049.html>
3612 and then at
3613 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00017.html>.
3614 * NEWS: For the next release, note the change to `--report'.
3615 * TODO, doc/bison.1: Update English.
3616 * doc/bison.texinfo: Update English.
3617 (Understanding Your Parser, Bison Options): Document as
3618 `--report=lookahead' rather than `--report=look-ahead'.
3619 * src/conflicts.c: Update English in comments.
3620 (lookahead_set): Rename from look_ahead_set.
3621 (flush_reduce): Rename argument look_ahead_tokens to lookahead_tokens.
3622 (resolve_sr_conflict): Rename local look_ahead_tokens to
3623 lookahead_tokens, and update other uses.
3624 (flush_shift, set_conflicts, conflicts_solve, count_sr_conflicts,
3625 count_rr_conflicts, conflicts_free): Update uses.
3626 * src/getargs.c (report_args): Move "lookahead" before alternate
3627 spellings.
3628 (report_types): Update uses.
3629 (usage): For `--report' usage description, state `lookahead' spelling
3630 rather than `look-ahead'.
3631 * src/getargs.h (report.report_lookahead_tokens): Rename from
3632 report_look_ahead_tokens.
3633 * src/lalr.c: Update English in comments.
3634 (compute_lookahead_tokens): Rename from compute_look_ahead_tokens.
3635 (state_lookahead_tokens_count): Rename from
3636 state_look_ahead_tokens_count.
3637 Rename local n_look_ahead_tokens to n_lookahead_tokens.
3638 (lookahead_tokens_print): Rename from look_ahead_tokens_print.
3639 Rename local n_look_ahead_tokens to n_lookahead_tokens.
3640 Update other uses.
3641 Update English in output.
3642 (add_lookback_edge, initialize_LA, lalr, lalr_free): Update uses.
3643 * src/print.c: Update English in comments.
3644 (lookahead_set): Rename from look_ahead_set.
3645 (print_reduction): Rename argument lookahead_token from
3646 look_ahead_token.
3647 (print_core, state_default_rule, print_reductions, print_results):
3648 Update uses.
3649 * src/print_graph.c: Update English in comments.
3650 (print_core): Update uses.
3651 * src/state.c: Update English in comments.
3652 (reductions_new): Update uses.
3653 (state_rule_lookahead_tokens_print): Rename from
3654 state_rule_look_ahead_tokens_print, and update other uses.
3655 * src/state.h: Update English in comments.
3656 (reductions.lookahead_tokens): Rename from look_ahead_tokens.
3657 (state_rule_lookahead_tokens_print): Rename from
3658 state_rule_look_ahead_tokens_print.
3659 * src/tables.c: Update English in comments.
3660 (conflict_row, action_row): Update uses.
3661 * tests/glr-regression.at
3662 (Incorrect lookahead during deterministic GLR,
3663 Incorrect lookahead during nondeterministic GLR): Rename
3664 print_look_ahead to print_lookahead.
3665 * tests/torture.at: Update English in comments.
3666 (AT_DATA_LOOKAHEAD_TOKENS_GRAMMAR): Rename from
3667 AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR.
3668 (Many lookahead tokens): Update uses.
3669 * data/glr.c: Update English in comments.
3670 * lalr1.cc: Likewise.
3671 * yacc.c: Likewise.
3672 * src/conflicts.h: Likewise.
3673 * src/lalr.h: Likewise.
3674 * src/main.c: Likewise.
3675 * src/output.c: Likewise.
3676 * src/parse-gram.c: Likewise.
3677 * src/tables.h: Likewise.
3678 * tests/calc.at: Likewise.
3679
3c40d0b5
JD
36802006-06-08 Joel E. Denny <jdenny@ces.clemson.edu>
3681
3682 * src/flex-scanner.h (yytext): Remove stray `*/' in #define.
3683
5d278082
PE
36842006-06-07 Paul Eggert <eggert@cs.ucla.edu>
3685
3686 * TODO: Add request from Nelson H. F. Beebe to be able to install
3687 Bison without installing the yacc script.
3688
9e668899
JD
36892006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
3690
3691 * src/flex-scanner.h: For the sake of Flex 2.5.4, don't #define yyleng
3692 and yytext if they're already #define'd.
3693 * src/flex-scanner.h, src/location.h: Move #include "system.h" to...
3694 * src/scan-code-c.c: ... here.
3695 * src/scan-code.l, src/scan-gram.l: ... and here. Also #include
3696 <config.h>.
3697
0c8e079f
JD
36982006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
3699
3700 Get Bison to build again when configured with --enable-gcc-warnings.
3701 * src/location.c, src/location.h, src/main.c, src/scan-code.l: Add some
3702 missing #include's.
3703 * src/scan-code.l (handle_action_dollar, handle_action_at): Rename
3704 loc argument as it shadows a global.
3705 * src/scan-gram.l: Remove stray comma that prevents boundary_set
3706 invocation.
3707
3708 * src/.cvsignore: Add scan-code.c.
3709
2346344a
AD
37102006-06-07 Akim Demaille <akim@epita.fr>
3711
3712 * src/scan-gram.l: Move the "add a trailing ; to actions" code
3713 to...
3714 * src/scan-code.l: here.
3715 * tests/input.at (Torturing the Scanner): Fix another location
3716 error.
3717
4862bdfd
AD
37182006-06-07 Akim Demaille <akim@epita.fr>
3719
3720 * src/Makefile.am (BUILT_SOURCES): Fix the trailing backslash.
3721
e9071366
AD
37222006-06-06 Akim Demaille <akim@epita.fr>
3723
3724 Extract the parsing of user actions from the grammar scanner.
3725 As a consequence, the relation between the grammar scanner and
3726 parser is much simpler. We can also split "composite tokens" back
3727 into simple tokens.
3728 * src/gram.h (ITEM_NUMBER_MAX, RULE_NUMBER_MAX): New.
3729 * src/scan-gram.l (add_column_width, adjust_location): Move to and
3730 rename as...
3731 * src/location.h, src/location.c (add_column_width)
3732 (location_compute): these.
3733 Fix the column count: the initial column is 0.
3734 (location_print): Be robust to ending column being 0.
3735 * src/location.h (boundary_set): New.
3736 * src/main.c: Adjust to scanner_free being renamed as
3737 gram_scanner_free.
3738 * src/output.c: Include scan-code.h.
3739 * src/parse-gram.y: Include scan-gram.h and scan-code.h.
3740 Use boundary_set.
3741 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_INITIAL_ACTION)
3742 (PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Remove the {...} part,
3743 which is now, again, a separate token.
3744 Adjust all dependencies.
3745 Whereever actions with $ and @ are used, use translate_code.
3746 (action): Remove this nonterminal which is now useless.
3747 * src/reader.c: Include assert.h, scan-gram.h and scan-code.h.
3748 (grammar_current_rule_action_append): Use translate_code.
3749 (packgram): Bound check ruleno, itemno, and rule_length.
3750 * src/reader.h (gram_in, gram__flex_debug, scanner_cursor)
3751 (last_string, last_braced_code_loc, max_left_semantic_context)
3752 (scanner_initialize, scanner_free, scanner_last_string_free)
3753 (gram_out, gram_lineno, YY_DECL_): Move to...
3754 * src/scan-gram.h: this new file.
3755 (YY_DECL): Rename as...
3756 (GRAM_DECL): this.
3757 * src/scan-code.h, src/scan-code.l, src/scan-code-c.c: New.
3758 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
3759 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
3760 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
3761 Move these declarations, and...
3762 (obstack_for_string, STRING_GROW, STRING_FINISH, STRING_FREE):
3763 these to...
3764 * src/flex-scanner.h: this new file.
3765 * src/scan-gram.l (rule_length, rule_length_overflow)
3766 (increment_rule_length): Remove.
3767 (last_braced_code_loc): Rename as...
3768 (gram_last_braced_code_loc): this.
3769 Adjust to the changes of the parser.
3770 Move all the handling of $ and @ into...
3771 * src/scan-code.l: here.
3772 * src/scan-gram.l (handle_dollar, handle_at): Remove.
3773 (handle_action_dollar, handle_action_at): Move to...
3774 * src/scan-code.l: here.
3775 * src/Makefile.am (bison_SOURCES): Add flex-scanner.h,
3776 scan-code.h, scan-code-c.c, scan-gram.h.
3777 (EXTRA_bison_SOURCES): Add scan-code.l.
3778 (BUILT_SOURCES): Add scan-code.c.
3779 (yacc): Be robust to white spaces.
3780
3781 * tests/conflicts.at, tests/input.at, tests/reduce.at,
3782 * tests/regression.at: Adjust the column numbers.
3783 * tests/regression.at: Adjust the error message.
7891a7c4 3784
184e42f0
JD
37852006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
3786
3787 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
3788 Use Akim's wording from
3789 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00056.html>.
3790
7891a7c4
JD
37912006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
3792
3793 Between Bison releases, manually append `+' to the previous Bison
3794 release number, and use that as a signal to automatically print the
3795 ChangeLog's CVS Id keyword from --version. Discussed starting at
3796 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00028.html>.
3797 * ChangeLog: Add Id header.
3798 * configure.ac (AC_INIT): Append `+' to `2.3'.
3799 * src/.cvsignore: Add revision.c.
3800 * src/Makefile.am (bison_SOURCES): Add revision.c and revision.h.
3801 (BUILT_SOURCES): Add revision.c.
3802 (revision.c): New target rule. This file defines a new global variable
3803 named revision. It initializes it with either the Id from ChangeLog
3804 or, if VERSION doesn't contain `+', with the empty string.
3805 * src/getargs.c (version): Print the value of revision.
3806 * src/revision.h: Extern revision.
3807
4ad3ed84
PE
38082006-06-05 Paul Eggert <eggert@cs.ucla.edu>
3809
3810 * NEWS: Version 2.3.
3811 * configure.ac (AC_INIT): Likewise.
3812
02103984
PE
38132006-05-30 Paul Eggert <eggert@cs.ucla.edu>
3814
3815 * data/glr.c (YYRECOVERING): Define to be a function-like macro
3816 with no arguments, not as an object-like macro. This is for
3817 compatibility with data/yacc.c. Problem reported by John P. Hartmann in
3818 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00059.html>.
3819 * doc/bison.texinfo (Action Features, Error Recovery, Table of Symbols):
3820 Document this.
3821
2c08afa5
JD
38222006-05-30 Joel E. Denny <jdenny@ces.clemson.edu>
3823
3824 * src/getargs.c (usage): Back out yesterday's modification of the
3825 --help output so that we don't have to wait for translation before
3826 releasing 2.3.
3827
6077da58
PE
38282006-05-29 Paul Eggert <eggert@cs.ucla.edu>
3829
3830 * doc/bison.texinfo (Introduction): Don't say "GLR grammar".
3831 Problem reported by Akim Demaille.
3832
2a26b6c2
JD
38332006-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
3834
3835 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
3836
aefef0d6
PE
38372006-05-26 Paul Eggert <eggert@cs.ucla.edu>
3838
3839 * data/yacc.c (yy_reduce_print): Omit trailing white space in
3840 generated source code. Problem reported by Frans Englich in
3841 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00049.html>.
3842
fcd8e201
PE
38432006-05-22 Paul Eggert <eggert@cs.ucla.edu>
3844
3845 * Makefile.maint (gzip_rsyncable, GZIP_ENV): Compute within the
3846 shell, not within 'make', so that 'make' by an ordinary builder
3847 (using GNU make) does not worry about configuring gzip. This also
3848 works around a bug reported independently by Keith Thompson and by
3849 Georg Schwarz, whereby gzip 1.2.4 --help would output usage on
3850 stderr rather than stdout, messing up the build logs.
3851
7b5cdcbd
JD
38522006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
3853
3854 * data/yacc.c (yyparse): Wrap the final return from yyparse inside YYID
3855 to make sure that YYID will never be unused. This fixes a 'make
3856 maintainer-check' failure caused by the recent changes to the 'Trivial
3857 grammars' test case, which caused g++ 4.1.0 to complain that YYID was
3858 not used.
3859 * data/glr.c (yyparse): Wrap yyparse's return inside YYID just in case.
3860
5ad0a449
JD
38612006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
3862
3863 * data/glr.c (yyresolveLocations): Remove bogus YYASSERT that the
3864 state before an empty RHS is always resolved here. Only the location
3865 of that state is guaranteed to be resolved, and that's enough. This
3866 fixes the remaining bug reported by Derek M. Jones in
3867 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
3868 * tests/glr-regression.at (Uninitialized location when reporting
3869 ambiguity): Test the above case.
3870 Also, the embedded comments in this test case claim it checks the case
3871 of an empty RHS that has inherited the initial location. However, the
3872 corresponding LHS was already resolved, so yyresolveLocations didn't
3873 actually have reason to modify it. Fix this by forcing
3874 nondeterministic operation at the beginning of the parse.
3875
50cce58e
PE
38762006-05-20 Paul Eggert <eggert@cs.ucla.edu>
3877
3878 * data/c.m4 (b4_yy_symbol_print_generate):
3879 (b4_yy_symbol_print_generate): Use 'YYSTYPE const' rather than
3880 'const YYSTYPE', and similarly for YYLTYPE. This fixes one
3881 of the bugs reported today by Derek M Jones in
3882 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
3883 * doc/bison.texinfo (Value Type): Document that YYSTYPE must be
3884 defined to be a type name without parens or brackets.
3885 (Location Type): Similarly for YYLTYPE.
3886 * tests/regression.at (Trivial grammars): Put in a test for this
3887 bug that will be caught by 'make maintainer-check' (though not,
3888 alas, by 'make check' unless your compiler is picky).
3889
ab8d9dc5
PE
38902006-05-19 Paul Eggert <eggert@cs.ucla.edu>
3891
0d2c8934 3892 * NEWS: Version 2.2.
ab8d9dc5
PE
3893 * configure.ac (AC_INIT): Likewise.
3894
9138c575
JD
38952006-05-17 Joel E. Denny <jdenny@ces.clemson.edu>
3896
3897 * data/glr.c (yyreportTree): Make room in yystates for the state
3898 preceding the RHS. This fixes the segmentation fault reported by Derek
3899 M. Jones in
3900 <http://lists.gnu.org/archive/html/help-bison/2006-05/msg00035.html>.
3901 (yyreportTree, yypdumpstack): Subtract 1 from yyrule before printing
3902 to the user. Reported for yyreportTree by Derek M. Jones later in the
3903 same thread.
3904 * THANKS: Add Derek M. Jones.
3905 Update my email address.
3906 Fix typo in Steve Murphy's name.
3907
276f48df
PE
39082006-05-14 Paul Eggert <eggert@cs.ucla.edu>
3909
d6645148
PE
3910 * data/glr.c (yyreportSyntaxError): Fix off-by-one error in
3911 checking against YYLAST that caused the parser to miss a potential
3912 alternative in its diagnostic.
3913 Problem reported by Maria Jose Moron Fernandez in
3914 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00024.html>.
3915 * data/lalr1.cc (yysyntax_error_): Likewise.
3916 * data/yacc.c (yysyntax_error): Likewise.
3917 * tests/regression.at (_AT_DATA_DANCER_Y): Use static array for
3918 tokens, in case we run into an older C compiler.
3919 (_AT_DATA_EXPECT2_Y, AT_CHECK_EXPECT2): New macros.
3920 Use them to check for the off-by-one error fixed above.
3921
276f48df
PE
3922 * data/yacc.c (yytnamerr): Fix typo: local var should be of type
3923 YYSIZE_T, not size_t.
3924 * tests/regression.at (Trivial grammars): New test, to catch
3925 the error fixed by the above patch.
3926
cd8b5791
AD
39272006-05-14 Akim Demaille <akim@lrde.epita.fr>
3928
3929 * doc/bison.texinfo (C++ Bison Interface): Clarify the naming
3930 scheme.
3931 Reported by Steve Murphy.
3932
34376418
AD
39332006-05-14 Akim Demaille <akim@lrde.epita.fr>
3934
3935 * data/glr.cc, data/lalr1.cc: Using %defines is mandatory.
3936 * data/glr.cc: b4_location_flag is now b4_locations_flag.
3937
327afc7c
AD
39382006-05-14 Akim Demaille <akim@lrde.epita.fr>
3939
3940 Implement --trace=m4.
3941 * src/getargs.c (trace_types, trace_args): Accept trace_m4.
3942 * src/output.c (output_skeleton): When set, pass -dV to m4.
3943
3944 Factor the handling of flags in m4.
3945 * src/output.c (prepare): Rename the muscle names debug, defines,
3946 error_verbose to debug_flag, defines_flag, error_verbose_flag.
3947 * data/c.m4: Adjust.
3948 (_b4_define_flag_if, b4_define_flag_if, b4_defines_if): New.
3949 Use b4_define_flag_if to define other b4_FLAG_if macros.
3950 (b4_location_if): As a consequence, rename as...
3951 (b4_locations_if): this, for consistency.
3952 Adjust all the skeletons.
3953
ba9ecd19
AD
39542006-05-14 Akim Demaille <akim@lrde.epita.fr>
3955
3956 * etc/bench.pm: Shorten bench names.
3957
4e83ea15
AD
39582006-05-14 Akim Demaille <akim@lrde.epita.fr>
3959
3960 * src/output.h, src/output.c (error_verbose): Move to...
3961 * src/getargs.h, src/getargs.c: here.
3962 Sort the flags.
3963 Adjust dependencies.
3964
6e93d810
PE
39652006-05-13 Paul Eggert <eggert@cs.ucla.edu>
3966
3967 * data/c.m4 (b4_copyright): Put the special exception for Bison
3968 skeletons here, so we don't have to put it in each skeleton. All
b15296ff
PE
3969 uses changed. Suggested by Akim Demaille. Also, wrap the
3970 copyright notice, in case it is longer than 80 columns. Replace
3971 comma by newline after title.
6e93d810 3972
eaea13f5
PE
39732006-05-11 Paul Eggert <eggert@cs.ucla.edu>
3974
3975 * doc/bison.texinfo (Calc++ Scanner): The flex behavior is an
3976 incompatibility, not a bug. Mention that it wasn't fixed as of
3977 flex 2.5.33.
3978
3cf084ec
AD
39792006-05-11 Akim Demaille <akim@lrde.epita.fr>
3980
3981 * examples/extexi: Enforce the precedence of concatenation over
3982 >>.
0a9f1c7d 3983 Reported by Tommy Nordgren.
3cf084ec 3984
32c96bd7
AD
39852006-05-11 Akim Demaille <akim@lrde.epita.fr>
3986
3987 * data/lalr1.cc (yytranslate_): Rename token as t to avoid clashes
3988 with the member "token".
f94705b2 3989 Reported by Martin Nylin.
32c96bd7 3990
eaea13f5
PE
39912006-05-08 Paul Eggert <eggert@cs.ucla.edu>
3992
3993 * data/glr.c: Switch to Bison 2.2 special-exception language in
3994 the copyright notice. Use more-regular format for titles and
3995 copyright notices.
3996 * data/glr.cc: Likewise.
3997 * data/location.cc: Likewise.
3998 * data/yacc.cc: Likewise.
3999 * doc/bison.texinfo (Conditions): Document this.
4000 * NEWS: likewise. Upgrade version to 2.2.
4001
6e2d1146
AD
40022006-04-27 Akim Demaille <akim@lrde.epita.fr>
4003
4004 * data/glr.cc: Remove dead code.
4005
47671055
PE
40062006-04-25 Paul Eggert <eggert@cs.ucla.edu>
4007
4008 * bootstrap: Comment out the AM_CPPFLAGS line, since we don't use
4009 that variable and the line breaks the bootstrap. Problem reported
4010 by Juan M. Guerrero.
4011
ed2e6384
AD
40122006-04-24 Akim Demaille <akim@lrde.epita.fr>
4013
4014 * doc/bison.texinfo (Multiple start-symbols): New.
4015
3cedc2dc
AD
40162006-04-24 Akim Demaille <akim@lrde.epita.fr>
4017
4018 * etc/README, etc/bench.pl: New.
4019
b2ddc3f3
AD
40202006-04-03 Akim Demaille <akim@lrde.epita.fr>
4021
4022 * src/scan-gram.l: Be robust to BRACED_CODE appearing before any
4023 rule.
4024 Reported by Mickael Labau.
4025 * tests/input.at (Torturing the Scanner): Test it.
4026
91e3ac9a
PE
40272006-03-16 Paul Eggert <eggert@cs.ucla.edu>
4028
4029 * doc/bison.texinfo (Decl Summary): Don't mention yylloc twice.
4030 Problem reported by Bob Rossi.
4031
40322006-03-13 Paul Eggert <eggert@cs.ucla.edu>
4033
4034 * doc/bison.texinfo: Remove @shorttitlepage stuff; it wasn't used
4035 and didn't really work.
4036 For the index, use @ifnotinfo, not @iftex.
4037 Minor cleanups of spacing and terminology.
4038
5cf61e93
AD
40392006-03-12 Akim Demaille <akim@lrde.epita.fr>
4040
4041 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Fix the definition
4042 of AT_NAME_PREFIX when %name-prefix is not used.
4043
aa08666d
AD
40442006-03-12 Akim Demaille <akim@lrde.epita.fr>
4045
4046 Apply --prefix to C++ skeletons too: they change the namespace.
4047 The test suite already exercize these cases.
4048 * data/c++.m4 (b4_namespace): New.
4049 * data/lalr1.cc, data/glr.cc, data/location.cc: Use it instead of `yy'.
4050 * data/lalr1.cc (yytnameerr_): Move its definition into the namespace.
4051 * data/yacc.c, data/glr.c: Remove a useless `[]'.
4052 * doc/bison.texinfo: Document it.
4053 (Option Cross Key): Use @multitable in all formats. It looks
4054 nicer, even in TeX outputs.
4055 (Rules): Use the same code whatever the output type is.
4056 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS)
4057 (_AT_BISON_OPTION_POPDEFS): Support AT_NAME_PREFIX.
4058 * tests/calc.at: Use it, instead of hard coding `yy'.
91e3ac9a 4059
45567173
AD
40602006-03-10 Akim Demaille <akim@lrde.epita.fr>
4061
4062 * TODO: Remove dead items.
4063
e9d8f881 40642006-03-10 Akim Demaille <akim@lrde.epita.fr>
55ba27be
AD
4065
4066 * doc/FAQ: Remove, merged into...
4067 * doc/bison.texinfo (FAQ): this.
4068 * doc/Makefile.am (EXTRA_DIST): Adjust.
4069
c095d689
AD
40702006-03-10 Akim Demaille <akim@lrde.epita.fr>
4071
4072 * data/c.m4 (b4_token_enum): Always define the enum of tokens,
4073 even if empty.
4074 * data/lalrl1.cc, data/glr.cc (parser::token_type): New.
4075 * doc/bison.texinfo (Calc++ Scanner): Use it.
4076
6e0f8287
PE
40772006-03-09 Paul Eggert <eggert@cs.ucla.edu>
4078
4079 Fix two nits reported by twlevo, plus one more that I discovered.
4080
4081 * src/assoc.h (assoc_to_string): Give a name to the arg, as
4082 this is the usual Bison style.
4083 * src/location.h (location_print): Likewise.
4084
4085 * src/reader.h (token_name): Likewise.
4086
d6b771c3
PE
40872006-03-08 Paul Eggert <eggert@cs.ucla.edu>
4088
4089 Fix some nits reported by twlevo.
4090 * doc/FAQ: Remove ancient Y2K FAQ, replacing it with "secure"
4091 and "POSIX". Use more-modern syntax for URLs. Mention C++
4092 and ask for Java. Don't hardwire OS version numbers. Add
4093 copyright notice.
4094 * m4/.cvsignore: Add unistd_h.m4, for latest gnulib.
4095 * src/conflicts.c (solved_conflicts_obstack): Now static.
4096
1e137b71
JD
40972006-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
4098
4099 * doc/bison.texinfo (Introduction): Mention GLR and C++ as on the web
4100 page. Say "you can use it" not "you may use it" as on the web page;
4101 we're describing capabilities not granting permission.
4102
73f2e47e
PE
41032006-03-06 Paul Eggert <eggert@cs.ucla.edu>
4104
6d05403d
PE
4105 * data/glr.c (yyresolveLocations): Rename local variables to avoid
4106 shadowing warnings. Use usual patter for iterating through RHS.
4107 * tests/glr-regression.at
4108 (Uninitialized location when reporting ambiguity):
4109 Modify yylex so that it uses its argument, rather than trying
4110 to rely on ARGSUSED (which doesn't work for gcc with warnings).
4111 const char -> char const.
4112
73f2e47e
PE
4113 * tests/Makefile.am ($(srcdir)/package.m4, maintainer-check-valgrind):
4114 Don't use tabs inside commands; it messes up 'ps'.
4115 Problem reported by twlevo.
4116
8710fc41
JD
41172006-03-06 Joel E. Denny <jdenny@ces.clemson.edu>
4118
4119 * tests/glr-regression.at (Uninitialized location when reporting
4120 ambiguity): New test case.
4121 * data/glr.c (yyresolveLocations): New function, which uses
4122 YYLLOC_DEFAULT.
4123 (yyresolveValue): Invoke yyresolveLocations before reporting an
4124 ambiguity.
4125 * doc/bison.texinfo (Default Action for Locations): Note
4126 YYLLOC_DEFAULT's usage for ambiguity locations.
4127 (GLR Semantic Actions): Cross-reference those notes.
4128
ae952af2
JD
41292006-03-04 Joel E. Denny <jdenny@ces.clemson.edu>
4130
4131 * tests/glr-regression.at (Leaked semantic values when reporting
4132 ambiguity): Remove unnecessary union and type declarations.
4133 (Leaked lookahead after nondeterministic parse syntax error): New test
4134 case.
4135 * data/glr.c (yyparse): Check for zero stacks remaining before
4136 attempting to shift the lookahead so that you don't lose it.
4137
35ee866a
JD
41382006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
4139
4140 Avoid memory leaks by not invoking longjmp in yyreportAmbiguity.
4141 * tests/glr-regression.at (Leaked semantic values when reporting
4142 ambiguity): New test case.
4143 * data/glr.c (yyreportAmbiguity): Invoke yyyerror directly and return
4144 yyabort rather than invoking yyFail, which invokes longjmp. Remove the
4145 now unnecessary yystackp parameter.
4146 (yyresolveValue): Return yyreportAmbiguity's result. Now the necessary
4147 destructors can be called.
4148
4149 * tests/glr-regression.at: Don't invoke bison with `-t' unnecessarily
4150 in existing testcases.
4151
520181ab
JD
41522006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
4153
4154 Don't leak semantic values for parent RHS when a user action cuts the
4155 parser, and clean up related code a bit.
4156 * tests/glr-regression.at (Leaked merged semantic value if user action
35ee866a
JD
4157 cuts parse): Rename to...
4158 (Leaked semantic values if user action cuts parse): ... this. Add check
520181ab
JD
4159 for leaked parent RHS values.
4160 * data/glr.c (yydestroyGLRState): In debugging output, distinguish
4161 between an unresolved state (non-empty chain of semantic options) and
4162 an incomplete one (signaled by an empty chain).
ae952af2 4163 (yyresolveStates): Document the interface. Move all manipulation of a
520181ab
JD
4164 successfully or unsuccessfully resolved yyGLRState to...
4165 (yyresolveValue): ... here so that yyresolveValue always leaves a
4166 yyGLRState with consistent data and thus is easier to understand.
4167 Remove the yyvalp and yylocp parameters since they are always just
4168 taken from the yys parameter. When reporting a discarded merged value
4169 in debugging output, note that it is incompletely merged. Document the
4170 interface.
4171 (yyresolveAction): If resolving any of the RHS states fails, destroy
4172 them all rather than leaking them. Thus, as long as user actions are
4173 written to clean up the RHS correctly, yyresolveAction always cleans up
4174 the RHS of a semantic option. Document the interface.
4175
18d9185c
PE
41762006-02-27 Paul Eggert <eggert@cs.ucla.edu>
4177
4178 * data/glr.c (yyexpandGLRStack): Catch an off-by-one error that
4179 led to a segmentation fault in GNU Pascal. Problem reported
4180 by Waldek Hebisch.
4181
841a7737
JD
41822006-02-21 Joel E. Denny <jdenny@ces.clemson.edu>
4183
4184 * doc/bison.texinfo (Mid-Rule Actions): Explain how to bury a
4185 mid-rule action inside a nonterminal symbol in order to declare a
4186 destructor for its semantic value.
4187
fc3f467f
PE
41882006-02-16 Paul Eggert <eggert@cs.ucla.edu>
4189
4190 * data/yacc.c [(! defined yyoverflow || YYERROR_VERBOSE) && !
4191 YYSTACK_USE_ALLOCA && ! defined YYSTACK_ALLOC && defined
4192 __cplusplus && ! defined _STDLIB_H && !
4193 ((defined YYMALLOC || defined malloc) && (defined YYFREE ||
4194 defined free))]: Include <stdlib.h> rather than rolling our own
4195 declarations of malloc and free, to avoid problems with
4196 incompatible declarations (using 'throw') C++'s stdlib.h. This
4197 should fix Debian bug 340012
4198 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=340012>,
4199 reported by Guillaume Melquiond.
4200
a3af26dd
PE
42012006-02-13 Paul Eggert <eggert@cs.ucla.edu>
4202
4d7bc38c
PE
4203 * NEWS: Clarify symbols versus types in unused-value warnings.
4204
a3af26dd
PE
4205 * configure.ac (AC_INIT): Bump version number.
4206
4e26c69e
PE
42072006-02-13 Paul Eggert <eggert@cs.ucla.edu>
4208
4209 * NEWS: Version 2.1a.
4210 * tests/headers.at (AT_TEST_CPP_GUARD_H): Declare yyerror and yylex,
4211 since C99 requires this.
4212
498e897c
PE
42132006-02-11 Paul Eggert <eggert@cs.ucla.edu>
4214
4215 * m4/c-working.m4: New file.
4216 * configure.ac (BISON_TEST_FOR_WORKING_C_COMPILER): Use it.
4217
57bb17ca
PE
42182006-02-10 Paul Eggert <eggert@cs.ucla.edu>
4219
4220 * Makefile.maint: Merge from coreutils.
4221
0be105dc
PE
42222006-02-09 Paul Eggert <eggert@cs.ucla.edu>
4223
4224 More portability fixes for problems summarized by Nelson H. F. Beebe.
4225
4226 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Catch a
4227 configuration screwup "./configure CC=/opt/SUNWspro/bin/c89
4228 CFLAGS="-xarch=generic64" CXX=/opt/SUNWspro/bin/CC
4229 LDFLAGS="-xarch=generic64" with Sun C 5.7 on Solaris 10; this
4230 messes up because C++ code is compiled in 32-bit mode but linked
4231 in 64-bit mode.
4232
6fc0c024
PE
42332006-02-08 Paul Eggert <eggert@cs.ucla.edu>
4234
4235 More portability fixes for problems summarized by Nelson H. F. Beebe.
4236
7870f699
PE
4237 * doc/bison.texinfo (Calc++ Scanner): Work around a bug in flex
4238 2.5.31. This resembles the 2005-10-10 patch to src/scan-skel.l.
4239
6fc0c024
PE
4240 * examples/calc++/Makefile.am (check_PROGRAMS): Renamed from
4241 nodist_PROGRAMS, since we don't need to actually compile the
4242 example if we're just doing a plain 'make'. This avoids bothering
4243 the installer unnecessarily about problems due to weird C++
4244 compilers.
4245
fe6c2fde
PE
42462006-02-06 Paul Eggert <eggert@cs.ucla.edu>
4247
4248 More portability fixes for problems summarized by Nelson H. F. Beebe.
4249
4250 * tests/headers.at (AT_TEST_CPP_GUARD_H): Use #include <...> rather
4251 than #include "...", and compile with -I'.'. The old method was
4252 not portable, according to Posix and the C standard, and it does
4253 not work with Sun C 5.7, where previous #line directives affect
4254 the working directory used in later #include "..." directives.
4255
927b425b
JMG
42562006-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
4257
4258 Various DJGGP specific issues in /djgpp
4259
d9735e9e
PE
42602006-02-02 Paul Eggert <eggert@cs.ucla.edu>
4261
4262 More portability fixes for problems summarized by Nelson H. F. Beebe.
4263
4264 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check that
4265 '#include <map>' works and that you can apply ++ to iterators.
4266
5a6755af
PE
42672006-02-01 Paul Eggert <eggert@cs.ucla.edu>
4268
67a0dc4f
PE
4269 Work around portability problems summarized by Nelson H. F. Beebe in
4270 <http://lists.gnu.org/archive/html/bug-bison/2005-09/msg00021.html>.
4271
8c86f0ef
PE
4272 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
4273 that '#include <string>' works.
4274
de35dd59
PE
4275 * data/lalr1.cc (yytranslate_): No longer inline, to work around a
4276 porting problem to g++ 3.4.3 on Darwin 7.9.0, where g++ complained
4277 "warning: sorry: semantics of inline function static data `const
4278 unsigned char translate_table[262]' are wrong (you'll wind up with
4279 multiple copies)".
4280
67a0dc4f
PE
4281 * lib/bbitset.h (struct bitset_vtable): Rename members not, and,
4282 or, xor to not_, and_, or_, and xor_, respectively. This works
4283 around a bug in GCC 3.4.3 on Irix 6.5, which apparently has a
4284 random system header somewhere that includes the equivalent of
4285 <iso646.h>.
4286
5a6755af
PE
4287 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that "$CC
4288 -E" works; it apparently doesn't work with PathScale EKO Compiler
67a0dc4f 4289 Suite Version 2.0.
5a6755af 4290
3f001415
JD
42912006-01-30 Joel E. Denny <jdenny@ces.clemson.edu>
4292
4293 During deterministic GLR operation, user actions should be able to
4294 influence the parse by changing yychar. To make this easier to fix and
4295 to make glr.c easier to evolve in general, don't maintain yytoken in
4296 parallel with yychar; just compute yytoken when needed.
4297 * tests/glr-regression.at (Incorrect lookahead during deterministic
4298 GLR): Check that setting yychar in a user action has the intended
4299 effect.
4300 * data/glr.c (yyGLRStack): Remove yytokenp member.
4301 (yyclearin): Don't set *yytokenp.
4302 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Examine
4303 yychar rather than *yytokenp to determine the current lookahead.
4304 Compute yytoken locally when needed.
4305 (yyparse): Likewise. Remove the local yytoken that yytokenp used to
4306 point to.
4307
4308 * doc/bison.texinfo (Bison Options): Remove stray sentence fragment
4309 after `--report' documentation.
4310
e2a8c0f5
PE
43112006-01-30 Paul Eggert <eggert@cs.ucla.edu>
4312
4313 * src/parse-gram.y (grammar_declaration): Location of printer
4314 symbol is @1, not list->location. Bug reported by twlevo.
4315 * tests/input.at (Incompatible Aliases): Adjust to above change.
4316
6b702268
PE
43172006-01-29 Paul Eggert <eggert@cs.ucla.edu>
4318
27622431
PE
4319 * tests/input.at (AT_CHECK_UNUSED_VALUES): Remove. Instead, do
4320 all the test at once. This makes the output easier to read in the
4321 normal case.
4322
6b702268
PE
4323 Fix a longstanding bug uncovered by bro-0.9a9/src/parse.y, which I
4324 got from <http://bro-ids.org/download.html>. The bug is that
4325 when two actions appeared in succession, the second one was
4326 scanned before the first one was added to the grammar rule
4327 as a midrule action. Bison then output the incorrect warning
4328 "parse.y:905.17-906.36: warning: unused value: $3".
4329 * src/parse-gram.y (BRACED_CODE, action): These are no longer
4330 associated with a value.
4331 (rhs): Don't invoke grammar_current_rule_action_append.
4332 (action): Invoke it here instead.
4333 * src/reader.c (grammar_midrule_action): Now extern.
4334 (grammar_current_rule_action_append): Don't invoke
4335 grammar_midrule_action; that is now the scanner's job.
4336 * src/reader.h (last_string, last_braced_code_loc):
4337 (grammar_midrule_action): New decls.
4338 * src/scan-gram.l (last_string): Now extern, sigh.
4339 (last_braced_code_loc): New extern variable.
4340 (<INITIAL>"{"): Invoke grammar_midrule_action if the current
4341 rule already has an action.
4342 (<SC_BRACED_CODE>"}"): Set last_braced_code_loc before returning.
4343 * tests/input.at (AT_CHECK_UNUSED_VALUES):
4344 Add some tests to check that the above changes fixed the bug.
4345
d40ba6c2
PE
43462006-01-27 Paul Eggert <eggert@cs.ucla.edu>
4347
4348 * src/reader.c (symbol_should_be_used): Renamed from symbol_typed_p.
4349 All used changed. Check whether the symbol has a destructor,
4350 not whether it is typed.
4351 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add a destructor, so
4352 that the values are still reported as unused. All line numbers
4353 adjusted.
4354
401aace6
PE
43552006-01-23 Paul Eggert <eggert@cs.ucla.edu>
4356
4357 Work around a bug in bro 0.8, which underparenthesizes its
4358 definition of YYLLOC_DEFAULT.
4359 * data/glr.c: Change all uses of YYLLOC_DEFAULT to parenthesize
4360 their arguments.
4361 * data/lalr1.cc: Likewise.
4362 * data/yacc.cc: Likewise.
4363
06f01bc4
PE
43642006-01-22 Paul Eggert <eggert@cs.ucla.edu>
4365
401aace6
PE
4366 Work around a bug in Pike 7.0, and give the Pike folks a
4367 better way to override the usual int widths.
4368 * data/yacc.c (b4_int_type): Use yytype_uint8, etc., so that the
4369 user can override the types.
4370 (short): #undef, to work around a bug in Pike 7.0.
4371 (yytype_uint8, yytype_int8, yytype_uint16, yytype_int16): New types.
4372 (union yyalloc.yyss): Use yytype_int16 rather than short.
4373 All uses changed.
4374 (yysigned_char): Remove.
4375 * src/parse-gram.y (YYTYPE_UINT8, YYTYPE_INT8, YYTYPE_UINT16):
4376 (YYTYPE_INT16): New macros, to test the new facility in yacc.c.
4377 * tests/regression.at (Web2c Actions): Adjust to above changes.
4378
4379 * src/reader.c (check_and_convert_grammar): New function.
4380 (reader): Close the input file even if something went wrong during
4381 parsing. Minor file descriptor leak reported by twlevo.
4382
06f01bc4
PE
4383 * src/assoc.c (assoc_to_string): Use a default: abort (); case
4384 to pacify gcc -Wswitch-default.
4385 * src/scan-gram.l (adjust_location): Use a default: break; case
4386 to pacify gcc -Wswitch-default.
4387 * src/scan-skel.h (skel_get_lineno, skel_get_in, skel_get_out):
4388 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
4389 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
4390 Move these decls to scan-skel.l, since they don't need to be
4391 visible elsewhere.
4392 * src/scan-skel.l: Accept the above decls.
4393 (skel_lex): New decl, to pacify GCC when unpatched flex 2.5.31
4394 is used.
4395
02650b7f
PE
43962006-01-21 Paul Eggert <eggert@cs.ucla.edu>
4397
4398 * Makefile.cfg (local-checks-to-skip): Add changelog-check,
4399 since we don't want to insist on a version number at the start
4400 of the changelog every time.
4401 * Makefile.maint: Sync from coreutils a bit better.
4402 (sc_trailing_blank): Renamed from sc_trailing_space.
4403 All uses changed.
4404 (sc_no_if_have_config_h, sc_require_config_h):
4405 (sc_prohibit_assert_without_use): New rules.
4406 (sc_obsolete_symbols): Don't catch Makefile.maint itself.
4407 (sc_dd_max_sym_length): Fix leading spaces in rule.
4408 (sc_system_h_headers): Prefix with @.
4409 (sc_useless_cpp_parens, m4-check): Output line numbers.
4410 (changelog-check): Allow version only in head.
4411 * data/c.m4: Use "defined FOO" instead of "defined (FOO)", to
4412 satisfy new Makefile.maint rule.
4413 * data/glr.c: Likewise.
4414 * data/glr.cc: Likewise.
4415 * data/lalr1.cc: Likewise.
4416 * data/yacc.c: Likewise.
4417 * lib/ebitsetv.c: Likewise.
4418 * lib/lbitset.c: Likewise.
4419 * lib/subpipe.c: Likewise.
4420 * lib/timevar.c: Likewise.
4421 * src/system.h: Likewise.
4422 * data/yacc.c (YYSTYPE): Don't generate trailing spaces in output.
4423 * djgpp/Makefile.maint: Add copyright notice.
4424 * djgpp/README.in: Likewise.
4425 * djgpp/config.bat: Likewise.
4426 * djgpp/config.site: Likewise.
4427 * djgpp/config_h.sed: Likewise.
4428 * djgpp/djunpack.bat: Likewise.
4429 * djgpp/config.sed: Fix copyright notice to match standard format.
4430 * djgpp/subpipe.h: Likewise.
4431 * lib/bitsetv-print.c: Likewise.
4432 * lib/bitsetv.c: Likewise.
4433 * lib/subpipe.h: Likewise.
4434 * lib/timevar.c: Likewise.
4435 * lib/timevar.h: Likewise.
4436 * djgpp/subpipe.c: Use standard recipe for config.h.
4437 * lib/abitset.c: Likewise.
4438 * lib/bitset.c: Likewise.
4439 * lib/bitset_stats.c: Likewise.
4440 * lib/bitsetv-print.c: Likewise.
4441 * lib/bitsetv.c: Likewise.
4442 * lib/ebitsetv.c: Likewise.
4443 * lib/get-errno.c: Likewise.
4444 * lib/lbitset.c: Likewise.
4445 * lib/subpipe.c: Likewise.
4446 * lib/timevar.c: Likewise.
4447 * lib/vbitset.c: Likewise.
4448 * tests/local.at: Likewise.
4449 * src/scan-gram.l: Don't include verify.h, since system.h does
4450 that for us.
4451 * .x-sc_require_config_h: New file.
4452 * .x-sc_unmarked_diagnostics: New file.
4453
287c78f6
PE
44542006-01-20 Paul Eggert <eggert@cs.ucla.edu>
4455
287c78f6
PE
4456 Be a bit more systematic about using 'abort'.
4457 * lib/abitset.c (abitset_test): Remove ATTRIBUTE_UNUSED; not needed.
4458 * lib/bitset.c (bitset_bytes, bitset_init, bitset_op4_cmp):
4459 Put 'default: abort ();' before some other case, to satisfy older
4460 pedantic compilers.
4461 * lib/bitset_stats.c (bitset_stats_init): Likewise.
4462 * lib/ebitset.c (ebitset_elt_find, ebitset_op3_cmp): Likewise.
4463 * lib/lbitset.c (lbitset_elt_find, lbitset_op3_cmp): Likewise.
4464 * src/conflicts.c (resolve_sr_conflict): Likewise.
68cae94e
PE
4465 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str):
4466 (get_decision_str, get_orientation_str, get_node_alignment_str):
4467 (get_arrow_mode_str, get_crossing_type_str, get_view_str):
4468 (get_linestyle_str, get_arrowstyle_str): Likewise.
4469 * src/conflicts.c (resolve_sr_conflict):
4470 Use a default case rather than one for the one remaining enum
4471 value, to catch invalid enum values as well.
4472 * src/lalr.c (set_goto_map, map_goto):
4473 Prefer "assert (FOO);" to "if (!FOO) abort ();".
4474 * src/nullable.c (nullable_compute, token_definitions_output):
4475 Likewise.
4476 * src/reader.c (packgram, reader): Likewise.
4477 * src/state.c (transitions_to, state_new, state_reduction_find):
4478 Likewise.
4479 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias):
4480 (symbol_pack): Likewise.
4481 * src/tables.c (conflict_row, pack_vector): Likewise.
287c78f6
PE
4482 * src/scan-skel.l (QPUTS): Remove unnecessary parens.
4483 (BASE_QPUTS, "@output ".*\n): Remove unnecessary asserts.
68cae94e
PE
4484 * src/system.h: Don't include <assert.h>.
4485 (assert): New macro.
4486
4487 * doc/bison.texinfo (Prologue, Rules, Actions, Union Decl, Action Decl):
4488 (Destructor Decl, Parser Function, Pure Calling):
4489 Describe rules for braces inside C code more carefully.
287c78f6 4490
c66dfadd
PE
44912006-01-19 Paul Eggert <eggert@cs.ucla.edu>
4492
c21493b8
PE
4493 Fix some porting glitches found by Nelson H. F. Beebe.
4494 * lib/abitset.c (abitset_resize): Rewrite to avoid warnings from
4495 compilers that don't understand that abort () does not return.
4496 * src/state.c (transitions_to): Likewise.
4497 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
4498 that '#include <cstdlib>' works.
4499 * src/system.h (INT8_MIN, INT16_MIN, INT32_MIN, INT8_MAX):
4500 (INT16_MAX, UINT8_MAX, INT32_MAX, UINT16_MAX, UINT32_MAX):
4501 #undef if ! defined __STDC_VERSION__ || __STDC_VERSION__ < 199901,
4502 for the benefit of some pre-C99 compilers.
4503
b6e3facf
PE
4504 * bootstrap: Undo changes to gnulib files that autoreconf made.
4505
c66dfadd
PE
4506 Minor fixups to get 'make maintainer-check' to work.
4507 * configure.ac: Don't use -Wnested-externs, as it's incompatible
4508 with the new verify.h implementation.
4509 * data/c.m4 (b4_yy_symbol_print_generate): YYUSE (yyoutput).
4510 * data/glr.c (YYUSE): Depend on __GNUC__ as well.
4511 * data/yacc.c (YYUSE): Likewise.
4512 * data/lalr1.cc (yysyntax_error_): YYUSE (yystate).
4513 * lib/subpipe.c (end_of_output_subpipe): The args are unused.
4514 * src/parse-gram.y (declaration): Don't pass a string constant
4515 to a function that expects char *, since GCC might complain
4516 about the constant value.
4517 * src/reader.c (symbol_typed_p): Add parens to pacify GCC.
4518 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): #undef yylloc and yylval
4519 before #defining them.
4520 * tests/glr-regression.at
4521 (Incorrectly initialized location for empty right-hand side in GLR):
4522 In yyerror, use the msg arg.
4523 (Corrupted semantic options if user action cuts parse):
4524 (Incorrect lookahead during deterministic GLR):
4525 (Incorrect lookahead during nondeterministic GLR):
4526 Don't name a local var 'index'; it shadows string.h's 'index'.
4527
ed94ef2a
AD
45282006-01-19 Akim Demaille <akim@epita.fr>
4529
4530 * tests/calc.at (_AT_DATA_CALC_Y): Initialize the whole initial
4531 location, not just parts of it.
4532
e9ad4aec
PE
45332006-01-18 Paul Eggert <eggert@cs.ucla.edu>
4534
d6ca7905
PE
4535 * NEWS: Document the fact that multiple %unions are now allowed.
4536 * doc/bison.texinfo (Union Decl): Likewise.
51cbef6f
PE
4537 * TODO: This feature is now implemented, so remove it from
4538 the wishlist.
d6ca7905 4539
ef1b70e0
PE
4540 * Makefile.maint: Merge with coreutils Makefile.maint.
4541 (CVS_LIST): Use build-aux version if available.
4542 (VERSION_REGEXP): New macro.
4543 (syntax-check-rules): Add sc_no_if_have_config_h,
4544 sc_prohibit_assert_without_use, sc_require_config_h,
4545 sc_useless_cpp_parens.
4546 (sc_obsolete_symbols): Check for O_NDELAY.
4547 (sc_dd_max_sym_length): Track coreutils.
4548 (sc_unmarked_diagnostics): Look in all files, not just *.c.
4549 (sc_useless_cpp_parens): New rule.
4550 (news-date-check): Look for version or today's date.
4551 (changelog-check): Don't require version number near head.
4552 (copyright-check): Use current year instead of hardwiring 2005.
4553 (my-distcheck): Depend on $(release_archive_dir)/$(prev-tgz).
4554 (announcement): Add --gpg-key-ID.
4555
4556 * djgpp/config.sed: Add copyright notice, and replace "filesystem"
4557 with "file system".
4558
2073ce56 4559 Avoid undefined behavior that addressed just before the start of an
e9ad4aec
PE
4560 array. Problem reported by twlevo.
4561 * src/reader.c (packgram): Prepend a new sentinel before ritem.
4562 * src/lalr.c (build_relations): Rely on new sentinel.
4563 * src/gram.c (gram_free): Adjust to new sentinel.
4564
b7691f15
JD
45652006-01-12 Joel E. Denny <jdenny@ces.clemson.edu>
4566
4567 * data/glr.c (yyGLRStateSet): Rename yylookaheadStatuses to
4568 yylookaheadNeeds. All uses updated.
4569 (yysplitStack): Rename local yynewLookaheadStatuses to
4570 yynewLookaheadNeeds.
4571 * data/glr-regression.at (Incorrect lookahead during nondeterministic
4572 GLR): In comments, change `lookahead status' to `lookahead need'.
4573
ddee1b06
PH
45742006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
4575
4576 * data/glr.c (yysplitStack): A little stylistic rewrite.
4577
12f4614d
PH
45782006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
4579
4580 * data/glr.c (yyaddDeferredAction): Flesh out the comment.
4581
32c29292
JD
45822006-01-11 Joel E. Denny <jdenny@ces.clemson.edu>
4583
4584 * doc/bison.texinfo: Fix some typos.
4585 (GLR Semantic Actions): New subsection discussing special
4586 considerations because GLR semantic actions might be deferred.
4587 (Actions): Mention look-ahead usage of yylval.
4588 (Actions and Locations): Mention look-ahead usage of yylloc.
4589 (Special Features for Use in Actions): Add YYEOF entry and mention it
4590 in the yychar entry.
4591 In the yychar entry, remove mention of the local yychar case (pure
4592 parser) since this is irrelevant information when writing semantic
148d66d8 4593 actions and since it's already discussed in `Table of Symbols' where
32c29292
JD
4594 yychar is otherwise described as an external variable.
4595 In the yychar entry, don't call it the `current' look-ahead since it
4596 isn't when semantic actions are deferred.
4597 In the yychar and yyclearin entries, add note about deferred semantic
4598 actions.
4599 Add yylloc and yylval entries discussing look-ahead usage.
4600 (Look-Ahead Tokens): When discussing yychar, don't call it the
4601 `current' look-ahead, and do mention yylval and yylloc.
4602 (Error Recovery): Cross-reference `Action Features' when mentioning
4603 yyclearin.
148d66d8 4604 (Table of Symbols): In the yychar entry, don't call it the `current'
32c29292
JD
4605 look-ahead.
4606 In the yylloc and yylval entries, mention look-ahead usage.
4607
de366a2f 46082006-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
2781dbd1
JD
4609
4610 * tests/glr-regression.at: Update copyright year to 2006.
4611
bf70fa87
JD
46122006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
4613
4614 * data/glr.c (yyGLRStateSet): Add yybool* yylookaheadStatuses member to
4615 use during nondeterministic operation to track which stacks have
4616 actually needed the current lookahead.
4617 (yyinitStateSet, yyfreeStateSet, yyremoveDeletes, yysplitStack):
4618 Allocate, deallocate, resize, and otherwise shuffle space for
4619 yylookaheadStatuses in parallel with yystates member of yyGLRStateSet.
4620 (yysplitStack, yyprocessOneStack, yyparse): Set lookahead status
4621 appropriately during nondeterministic operation.
4622 (yySemanticOption): Add int yyrawchar, YYSTYPE yyval, and YYLTYPE yyloc
4623 members to store the current lookahead to be used by the deferred
4624 user action.
4625 (yyaddDeferredAction): Add size_t yyk parameter specifying the stack
4626 from which the RHS is taken. Set the lookahead members of the new
4627 yySemanticOption according to the lookahead status for stack yyk.
4628 (yyglrShiftDefer, yyglrReduce): Pass yyk parameter on to
4629 yyaddDeferredAction.
4630 (yyresolveAction): Set yychar, yylval, and yylloc to the lookahead
4631 members of yySemanticOption before invoking yyuserAction, and then set
4632 them back to their current values afterward.
4633 (yyparse): Set yychar = YYEMPTY where yytoken = YYEMPTY.
4634 (yyreportAmbiguity): Add /*ARGSUSED*/ to pacify lint.
4635 * tests/glr-regression.at: Remove `.' from the ends of recent test case
4636 titles for consistency.
4637 (Leaked merged semantic value if user action cuts parse): In order to
4638 suppress lint warnings, use arguments in merge function, and assign
4639 char value < 128 in main.
4640 (Incorrect lookahead during deterministic GLR): New test case.
4641 (Incorrect lookahead during nondeterministic GLR): New test case.
4642
05449a2c
JD
46432006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
4644
de366a2f 4645 * data/c.m4 (b4_yy_symbol_print_generate): In yy_symbol_print, accept
05449a2c
JD
4646 !yyvaluep as signal that no semantic value is available to print.
4647 * data/glr.c (yydestroyGLRState): If state is not resolved, don't try
4648 to print a semantic value.
4649
4158e0a1 46502006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
fd2493f7 4651
4158e0a1
JD
4652 * tests/glr-regression.at: For consistency with my newer test cases,
4653 don't thank myself.
4654
d659304d
JD
46552006-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
4656
4657 * data/glr.c (yyresolveValue): When merging semantic options, if at
4658 least one user action succeeds but a later one cuts the parse, then
4659 destroy the semantic value before returning rather than leaking it.
4660 (yyresolveStates): If a user action cuts the parse and thus
4661 yyresolveValue fails, ignore the (unset) semantic value rather than
4662 corrupting the yyGLRState, and empty the semantic options list since
4663 the user actions should have called all necessary destructors.
4664 Simplify code with YYCHK.
4665 * tests/glr-regression.at (Corrupted semantic options if user action
4666 cuts parse): New test case.
4667 (Undesirable destructors if user action cuts parse): New test case.
4668 Before applying any of this patch, this test case never actually failed
4669 for me... but only because the corrupted semantic options usually
4670 masked this bug.
4671 (Leaked merged semantic value if user action cuts parse): New test
4672 case.
4673
6ec2c0f2
AD
46742006-01-05 Akim Demaille <akim@epita.fr>
4675
4676 * src/reader.c, src/symlist.h, src/symlist.c: s/mid_rule/midrule/.
4677
1b9c21fb
PE
46782006-01-04 Paul Eggert <eggert@cs.ucla.edu>
4679
4680 * data/c.m4 (b4_c_modern): New macro, with a new provision for
4681 _MSC_VER. Problem reported by Cenzato Marco.
4682 (b4_c_function_def): Use it.
4683 * data/yacc.c (YYMODERN_C): Remove. All uses replaced by
4684 b4_c_modern.
4685 (yystrlen, yystpcpy, yyparse): Use b4_c_function... macros rather
4686 than rolling our own.
4687
84866159
AD
46882006-01-04 Akim Demaille <akim@epita.fr>
4689
4690 Also warn about non-used mid-rule values.
4691 * src/symlist.h, src/symlist.c (symbol_list): Add a mid_rule
4692 member.
4693 (symbol_list_new): Adjust.
4694 * src/reader.c (symbol_typed_p): New.
4695 (grammar_rule_check): Use it.
4696 (grammar_midrule_action): Bind a mid-rule LHS to its rule.
4697 Check its rule.
4698 * tests/input.at (AT_CHECK_UNUSED_VALUES): New.
4699 Use it.
4700 * tests/actions.at (Exotic Dollars): Adjust.
4701
378f4bd8
AD
47022006-01-04 Akim Demaille <akim@epita.fr>
4703
4704 * src/reader.c (grammar_midrule_action): If $$ is set in a
4705 mid-rule, move the `used' bit to its lhs.
4706 * tests/input.at (Unused values): New.
4707 * tests/actions.at (Exotic Dollars): Adjust: exp is not typed.
4708
e2a21b6f
PE
47092006-01-03 Paul Eggert <eggert@cs.ucla.edu>
4710
54662697
PE
4711 * doc/bison.texinfo (Bison Options): Say more accurately what
4712 --yacc does.
4713 * src/parse-gram.y (rules_or_grammar_declaration): Don't complain
4714 about declarations in the grammar when in Yacc mode, as POSIX does
4715 not require a diagnostic when the grammar uses extensions.
4716
4717 * src/reduce.c (reduce_grammar): Remove unnecessary cast to bool.
4718
073f9288
PE
4719 Warn about dubious constructions like "%token T T".
4720 Reported by twlevo.
4721 * src/symtab.h (struct symbol.declared): New member.
4722 * src/symtab.c (symbol_new): Initialize it to false.
4723 (symbol_class_set): New arg DECLARING, specifying whether
4724 this is a declaration that we want to warn about, if there
4725 is more than one of them. All uses changed.
4726
1221b78a
PE
4727 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c:
4728 Allow multiple %union directives, whose contents concatenate.
4729 * src/parse-gram.y (grammar_declaration): Likewise.
4730 Use muscle_code_grow, so that we don't need stype_line any more.
4731 All uses changed.
4732
4733 * src/muscle_tab.c (muscle_grow): Fix comment.
4734
e2a21b6f
PE
4735 * ChangeLog, data/c.m4, data/glr.c, data/glr.cc, data/location.cc:
4736 * data/yacc.c, src/getargs.c, src/output.c, tests/cxx-type.at:
4737 Update copyright year to 2006.
4738
8f7e3cf9
AD
47392006-01-03 Akim Demaille <akim@epita.fr>
4740
4741 Have glr.cc pass (some of) the calc.at tests.
4742 * data/glr.cc (b4_parse_param_orig): New.
4743 (b4_parse_param): Improve its definition, and bound it more
4744 clearly in the skeleton.
4745 (b4_epilogue): Append, instead of prepending, in order to keep
4746 #line consistency.
4747 Simplify the generation of auxiliary functions: locations and
4748 purity are mandated.
4749 (b4_global_tokens_and_yystype): Honor it.
4750 * data/location.cc (c++.m4): Don't include it.
4751 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Define AT_GLR_CC_IF
4752 and AT_SKEL_CC_IF.
4753 * tests/calc.at (AT_CHECK_CALC): Rely on AT_SKEL_CC_IF instead of
4754 AT_LALR1_CC_IF.
4755 Be sure to initialize the first position's filename.
4756 (AT_CHECK_CALC_LALR1_CC): Add %location and %defines, they are
4757 mandated anyway.
4758 (AT_CHECK_CALC_GLR_CC): New.
4759 Use it to exercise glr.cc as a lalr1.cc drop-in replacement.
4760
3953ed88
AD
47612006-01-02 Akim Demaille <akim@epita.fr>
4762
4763 * src/output.c (output_skeleton): Don't hard wire the inclusion of
4764 c.m4.
0a96ba81 4765 * data/c++.m4, data/glr.c, data/yacc.c: Include c.m4.
3953ed88
AD
4766 * data/glr.cc: Do not include stack.hh.
4767
9ecafbbf
AD
47682006-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
4769
4770 * data/glr.c: Reformat whitespace with tabs.
4771 (b4_lpure_formals): Remove this unused m4 macro.
4772 * tests/cxx-type.at: Reformat whitespace with tabs.
4773 (_AT_TEST_GLR_CXXTYPES): In union Node, rename node_info to nodeInfo
4774 since it's a member. Rename type to isNterm for clarity.
4775
c4d497a0
AD
47762005-12-29 Akim <akim@sulaco.local>
4777
4778 Let glr.cc catch up with symbol_value_print.
4779 * data/glr.cc (b4_yysymprint_generate): Replace by...
4780 (b4_yy_symbol_print_generate): this.
4781 (yy_symbol_print, yy_symbol_value_print): Declare them.
4782
4517da37
PE
47832005-12-28 Paul Eggert <eggert@cs.ucla.edu>
4784
4785 * src/location.h (boundary): Note that a line or column equal
4786 to INT_MAX indicates an overflow.
4787 * src/scan-gram.l: Include verify.h. Don't include get-errno.h.
4788 (rule_length_overflow, increment_rule_length, add_column_width):
4789 New functions.
4790 (<INITIAL>{id}, <SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'"):
4791 (<SC_BRACED_CODE>"}"):
4792 Use increment_rule_length rather than incrementing it by hand.
4793 (adjust_location, handle_syncline): Diagnose overflow.
4794 (handle_action_dollar, handle_action_at):
4795 Fix bug with monstrosities like $-2147483648.
4796 Remove now-unnecessary checks.
4797 (scan_integer): Verify assumptions and remove now-unnecessary checks.
4798 (convert_ucn_to_byte): Verify assumptions.
4799 (handle_syncline): New arg LOC. All callers changed.
4800 Don't store through a value derived from char const * pointer.
4801
4802 * src/reader.c (grammar_rule_check): Rewrite slightly to avoid
4803 GCC warnings.
4804
e3233bf6
PE
48052005-12-27 Paul Eggert <eggert@cs.ucla.edu>
4806
4807 * src/reader.c (grammar_midrule_action, grammar_symbol_append):
4808 Remove unnecessary forward static decls.
4809
8f3596a6
AD
48102005-12-27 Akim Demaille <akim@epita.fr>
4811
4812 * src/reader.c (grammar_current_rule_check): Also check that $$
4813 is used.
4814 Take the rule to check as argument, hence rename as...
4815 (grammar_rule_check): this.
4816 * src/reader.h, src/reader.c (grammar_rule_begin, grammar_rule_end):
4817 Rename as...
4818 (grammar_rule_begin, grammar_rule_end): these, for consistency.
4819 (grammar_midrule_action, grammar_symbol_append): Now static.
4820 * tests/torture.at (input): Don't rely on the default action
4821 being always performed.
4822 * tests/calc.at: "Set" $$ even when the action is "cut" with
4823 YYERROR or other.
4824 * tests/actions.at (Exotic Dollars): Instead of using unused
4825 values, check that the warning is issued.
4826
721be13c
PE
48272005-12-22 Paul Eggert <eggert@cs.ucla.edu>
4828
4829 * NEWS: Improve wording for unused-value warnings.
4830
a0af42fc
AD
48312005-12-22 Akim Demaille <akim@epita.fr>
4832
4833 * data/lalr1.cc, data/yacc.c, data/glr.c, data/c.m4
4834 (b4_yysymprint_generate): Rename as...
4835 (b4_yy_symbol_print_generate): this.
4836 Generate yy_symbol_print instead of yysymprint.
4837 Generate also yy_symbol_value_print, and use it.
4838
affac613
AD
48392005-12-22 Akim Demaille <akim@epita.fr>
4840
721be13c 4841 * NEWS: Warn about unused values.
affac613
AD
4842 * src/symlist.h, src/symlist.c (symbol_list, symbol_list_new): Add
4843 a `used' member.
4844 (symbol_list_n_get, symbol_list_n_used_set): New.
4845 (symbol_list_n_type_name_get): Use symbol_list_n_get.
4846 * src/scan-gram.l (handle_action_dollar): Flag used symbols.
4847 * src/reader.c (grammar_current_rule_check): Check that values are
4848 used.
4849 * src/symtab.c (symbol_print): Accept 0.
4850 * tests/existing.at: Remove the type information.
4851 Empty the actions.
4852 Remove useless actions (beware of mid-rule actions: perl -000
4853 -pi -e 's/\s*\{\}(?=[\n\s]*[|;])//g').
4854 * tests/actions.at (Exotic Dollars): Use unused values.
4855 * tests/calc.at: Likewise.
4856 * tests/glr-regression.at (No users destructors if stack 0 deleted):
4857 Likewise.
4858
4859 * src/gram.c (rule_useful_p, rule_never_reduced_p): Use
4860 rule_useful_p.
4861
9d9b8b70
PE
48622005-12-21 Paul Eggert <eggert@cs.ucla.edu>
4863
8bb4c753
PE
4864 Undo 2005-12-01 tentative license wording change. The wording is
4865 still being reviewed by the lawyers, and we don't want to wait for
4866 them before publishing a test release. For now, revert to the
4867 previous wording.
4868 * NEWS: Undo 2005-12-01 change.
4869 * data/glr.c: Revert to previous license wording.
4870 * data/glr.cc: Likewise.
4871 * data/lalr1.cc: Likewise.
4872 * data/location.cc: Likewise.
4873 * data/yacc.c: Likewise.
4874
9d9b8b70
PE
4875 * NEWS: Reword %destructor vs YYABORT etc.
4876 * data/glr.c: Use American spacing, for consistency.
4877 * data/glr.cc: Likewise.
4878 * data/lalr1.cc: Likewise.
4879 * data/yacc.c: Likewise.
4880 * data/yacc.c: Reformat comments slightly.
4881 * doc/bison.texinfo: Replace "non-" with "non" when that makes sense,
4882 for consistency. Fix some spelling errors and reword recently-included
4883 text slightly.
4884 * tests/cxx-type.at: Cast results of malloc, for C++.
4885
2c3b392a
AD
48862005-12-21 Joel E. Denny <address@hidden>
4887
4888 * tests/cxx-type.at: Construct a tree, count the parents of shared
4889 nodes, and free each node once and only once. Previously, the memory
4890 for semantic values was leaked instead.
4891
d6cff4dc
AD
48922005-12-21 Joel E. Denny <address@hidden>
4893
4894 * data/glr.c (struct yyGLRStack): If pure, add yyval and yyloc members.
4895 (yylval, yylloc): If pure, #define to yystackp->yyval and
4896 yystackp->yyloc similar to yychar and yynerrs.
4897 (yyparse): If pure, remove local yylval and yylloc. Add local
4898 yystackp to accommodate pure definitions of yylval and yylloc.
4899 (b4_lex_param, b4_lyyerror_args, b4_lpure_args): If pure, change
4900 yylvalp and yyllocp to &yylval and &yylloc.
4901 (nerrs, char, lval, lloc): If pure, add #define's for b4_prefix[]
4902 namespace. Previously, nerrs and char were missing, but lval and lloc
4903 weren't necessary.
4904 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Remove
4905 yylvalp and yyllocp parameters since, if pure, these are now always
4906 accessible through yystackp. If not pure, they are still accessible
4907 globally.
4908 * data/glr.c, data/yacc.c (YYLLOC_DEFAULT): Change `if (N)' to
4909 `if (YYID (N))' to pacify lint.
4910
a85284cf
AD
49112005-12-21 Akim Demaille <akim@epita.fr>
4912
4913 YYACCEPT, YYERROR, and YYABORT, as user actions, should not
4914 destroy the RHS symbols of a rule.
4915 * data/yacc.c (yylen): Initialize to 0.
4916 Keep its value to the number of items to possibly shift.
4917 In particular, a regular successful parse that ends on YYFINAL by
4918 a (internal) YYACCEPT must not have yylen != 0.
4919 (yyerrorlab, yyreturn): Pop the RHS.
4920 Reorder a bit to emphasize the `shifting' bits of code.
4921 (YYPOPSTACK): Now accept a number of items to pop.
4922 * data/lalr1.cc: Likewise.
4923 * data/glr.c: Formatting changes.
4924 Use goto instead of fall through.
4925 * doc/bison.texinfo (Destructor Decl): Complete.
4926
d508c281
JMG
49272005-12-20 Juan Manuel Guerrero <juan.guerrero@gmx.de>
4928
4929 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
4930 * djgpp/Makefile.maint: Fix PACKAGE variable computation.
4931 * djgpp/config.bat: Replace every occurence of the file name
4932 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
4933 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
4934 * djgpp/config.sed: Replace every occurence of the file name
4935 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
4936 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
4937 * djgpp/djunpack.bat: DJGPP specific file.
4938 * djgpp/fnchange.lst: DJGPP specific file.
4939 * djgpp/README.in: Add new information about how to unpack the bison
4940 source on MSDOS and other systems which have 8.3 file name restrictions
4941 using djunpack.bat and fnchange.lst.
4942
3e7a2cd9
PE
49432005-12-12 Paul Eggert <eggert@cs.ucla.edu>
4944
4945 * bootstrap (build_cvs_prefix): Remove; unused.
4946 (CVS_PREFIX): Adjust to yesterday's Savannah reorganization
4947 when getting gnulib.
4948
49492005-12-12 "Joel E. Denny" <jdenny@ces.clemson.edu>
4950
4951 * data/glr.c: Reorder typedef declarations for structs to match order
4952 of struct declarations.
4953 Rename yystack everywhere to yystackp except in yyparse where it's not
4954 a pointer.
4955 (yyglrShift): Change parameter YYSTYPE yysval to YYSTYPE* yyvalp for
4956 consistency.
4957 (yyis_table_ninf): Change 0 to YYID (0) to pacify lint.
4958 (yyreportSyntaxError): Add /*ARGSUSED*/ to pacify lint.
4959 (yyparse): Change while (yytrue) to while ( YYID (yytrue)) to pacify
4960 lint.
4961
877519f8
PE
49622005-12-09 Paul Eggert <eggert@cs.ucla.edu>
4963
0eca5a39
PE
4964 * tests/sets.at (Accept): Fix typos in regular expression used to
4965 sed out the final state number.
4966
2cec9080
PE
4967 Work around portability problem on Solaris 10: flex-generated
4968 files include <stdio.h> before <config.h>, which messes up
4969 because the latter defines __EXTENSIONS__. Address the problem
4970 by creating two new little files that include <config.h> first,
4971 then include the flex-generated files. Rewrite everyone else
4972 to include <config.h> first, as well.
4973 * lib/timevar.c: Always include "config.h".
4974 * src/Makefile.am (bison_SOURCES): Replace scan-gram.l with
4975 scan-gram-c.c, and scan-skel.l with scan-skel-c.c.
4976 (EXTRA_bison_SOURCES): New macro.
4977 * src/scan-gram-c.c, src/scan-skel-c.c: New files.
4978 * src/system.h: Don't include config.h.
4979 * src/LR0.c: Include <config.h> first.
4980 * src/assoc.c: Likewise.
4981 * src/closure.c: Likewise.
4982 * src/complain.c: Likewise.
4983 * src/conflicts.c: Likewise.
4984 * src/derives.c: Likewise.
4985 * src/files.c: Likewise.
4986 * src/getargs.c: Likewise.
4987 * src/gram.c: Likewise.
4988 * src/lalr.c: Likewise.
4989 * src/location.c: Likewise.
4990 * src/main.c: Likewise.
4991 * src/muscle_tab.c: Likewise.
4992 * src/nullable.c: Likewise.
4993 * src/output.c: Likewise.
4994 * src/parse-gram.y: Likewise.
4995 * src/print.c: Likewise.
4996 * src/print_graph.c: Likewise.
4997 * src/reader.c: Likewise.
4998 * src/reduce.c: Likewise.
4999 * src/relation.c: Likewise.
5000 * src/state.c: Likewise.
5001 * src/symlist.c: Likewise.
5002 * src/symtab.c: Likewise.
5003 * src/tables.c: Likewise.
5004 * src/uniqstr.c: Likewise.
5005 * src/vcg.c: Likewise.
5006
877519f8
PE
5007 * src/parse-gram.y: Fix minor problems uncovered by lint.
5008 (current_lhs, current_lhs_location): Now static.
5009 (current_assoc): Remove unused variable.
5010
5011 Cleanups so that Bison-generated parsers have less lint.
5012 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate):
5013 Prepend /*ARGSUSED*/, for lint's sake.
5014 * data/glr.c (YYUSE): Properly parenthesize, and use an alternate
5015 definition if 'lint' is defined.
5016 (YYID): New macro (or function, if lint).
5017 All uses of /*CONSTCOND*/0 replaced by YYID(0).
5018 * data/yacc.c: Likewise.
5019 * data/glr.c (yyuserAction, yyuserMerge, yy_reduce_print):
5020 (yyrecoverSyntaxError): Prepend /*ARGSUSED*/.
5021 * data/glr.cc (YYLLOC_DEFAULT): Omit /*CONSTCOND*/ since this code
5022 is C++ only.
5023 * data/lalr1.cc (YYUSE): Just use a cast, since this code is C++ only.
5024 * data/yacc.c (YYSTACK_FREE) [defined YYSTACK_ALLOC]:
5025 Use YYID(0) rather than 0, for lint.
5026 (yystrlen): Rewrite to avoid lint warning about ptrdiff_t overflow.
5027 (yysyntax_error): Rewrite to avoid lint warnings about parenthesization.
5028
f5228370
PE
50292005-12-07 Paul Eggert <eggert@cs.ucla.edu>
5030
5031 * tests/glr-regression.at
5032 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
5033 Close memory leak reported by twlevo.
5034
69ce078b
PE
50352005-12-06 "Joel E. Denny" <jdenny@ces.clemson.edu>
5036
6ff99711
PE
5037 * data/glr.c (yyprocessOneStack, yyparse): Synchronize the shift for
5038 all stacks.
5039 (yyparse): Iterate another stack in order to call user destructors.
69ce078b
PE
5040 * tests/glr-regression.at (No users destructors if stack 0 deleted):
5041 New test case.
5042 (Duplicated user destructor for lookahead): This test now is expected
5043 to succeed.
5044
af3412cd
PE
50452005-12-01 Paul Eggert <eggert@cs.ucla.edu>
5046
32b5b719 5047 * NEWS: Document the following change.
af3412cd
PE
5048 * data/yacc.c: Say "parser skeleton" rather than "file", since
5049 it's no longer just a file.
5050 * data/glr.c: Grant a special exception for C GLR parsers, that
5051 reads like the already-existing exception for C LALR(1) parsers.
5052 * data/glr.cc: Likewise.
5053 * data/lalr1.cc: Likewise.
5054 * data/location.cc: Likewise.
5055 * data/yacc.c: Reword the "written by" statement to clarify that
5056 it was the parser skeleton, not the entire output file.
5057 * data/glr.c: Written by Paul Hilfinger.
5058 * data/glr.cc: Written by Akim Demaille.
5059 * data/lalr1.cc: Likewise.
5060
035aa4a0
PE
50612005-11-18 Paul Eggert <eggert@cs.ucla.edu>
5062
d9963c85
PE
5063 * data/yacc.c (yy_reduce_print, YY_REDUCE_PRINT):
5064 Fix typos in previous change that broke 'make check'.
5065 YY_REDUCE_PRINT cannot be a pseudo-varargs macro; that isn't
5066 supported in C.
5067 * tests/calc.at (_AT_CHECK_CALC,_AT_CHECK_CALC_ERROR):
5068 Don't check NUM-STDERR-LINES, since the output format is fluctuating.
5069 We can revert this once things settle down.
5070
035aa4a0
PE
5071 * src/conflicts.c (conflicts_print): Don't print file name twice
5072 when %expect fails because there were no conflicts.
5073 * doc/bison.texinfo (Expect Decl): Tighten up wording in previous
5074 change.
5075 * tests/conflicts.at (%expect not enough, %expect too much):
5076 (%expect with reduce conflicts): Adjust to new behavior.
5077
50782005-11-18 Akim Demaille <akim@epita.fr>
5079
5080 * src/conflicts.c (conflicts_print): Unsatisfied %expectation are
5081 errors.
5082 * NEWS: Document this.
5083 * doc/bison.texinfo (Expect Decl): Likewise.
5084
d1ff7a7c
AD
50852005-11-16 Akim Demaille <akim@epita.fr>
5086
5087 Generalize the display of semantic values and locations in traces.
5088 * data/glr.c (yy_reduce_print): Fix indices (again).
5089 * data/c++.m4 (b4_rhs_value, b4_rhs_location): Don't expect
5090 literal integers.
5091 * data/lalr1.cc (yyreduce_print): Rename as...
5092 (yy_reduce_print): this.
5093 Display values and locations.
5094 * data/yacc.c (yy_reduce_print): Likewise.
5095 (YY_REDUCE_PRINT): Adjust to pass the required arguments.
5096 (yysymprint): Move higher to be visible from yy_reduce_print).
5097 (yyparse): Adjust.
5098 * tests/calc.at: Adjust the expected length of the traces.
5099
6de5398d
AD
51002005-11-14 Akim Demaille <akim@epita.fr>
5101
5102 * data/glr.c (yy_reduce_print): The loop was quite wrong: type are
5103 from 1 to N, while values and location start at 0.
5104 (b4_rhs_location, b4_rhs_value): Add parens around $1 and $2.
5105
a1373f55
AD
51062005-11-14 Akim Demaille <akim@epita.fr>
5107
5108 * data/glr.c (yy_reduce_print): Fix the $ number.
5109
613d8952
AD
51102005-11-14 Akim Demaille <akim@epita.fr>
5111
5112 "Use" parse parameters.
5113 * data/c.m4 (b4_parse_param_for, b4_parse_param_use): New.
5114 * data/glr.c, data/glr.cc: Use them.
5115 * data/glr.c (YYUSE): Have a C++ definition that supports
5116 non-pointer types.
5117
b2741627
AD
51182005-11-14 Akim Demaille <akim@epita.fr>
5119
5120 * data/glr.c (yyexpandGLRStack): Declare only if defined.
5121
5059b5c8
AD
51222005-11-14 Akim Demaille <akim@epita.fr>
5123
42249483
AD
5124 * data/glr.cc: New.
5125 * data/m4sugar/m4sugar.m4 (m4_prepend): New.
5059b5c8 5126
4626a15d
AD
51272005-11-12 Akim Demaille <akim@epita.fr>
5128
5129 Let position and location be PODs.
5130 * data/location.cc (position::initialize, location::initialize): New.
5131 (position::position, location::location): Define only if
5132 b4_location_constructors is defined.
5133 * data/lalr1.cc (b4_location_constructors): Define it for backward
5134 compatibility.
5135 * doc/bison.texinfo (Initial Action Decl): Use initialize.
5136
51372005-11-12 Akim Demaille <akim@epita.fr>
98ae9643
AD
5138
5139 * data/lalr1.cc: Move the body of the ctor and dtor into the
5140 parser file (instead of the header).
5141 Wrap the implementations in a "namespace yy".
5142
51432005-11-12 Akim Demaille <akim@epita.fr>
5144
5145 Have glr.c include its header file when created.
5146 * data/glr.c (b4_shared_declarations): New.
5147 Output them verbatim in the parser if !%defines, otherwise
5148 output then in the header file, and include it instead.
5149
1989d947
AD
51502005-11-11 Akim Demaille <akim@epita.fr>
5151
5152 * data/glr.c: Comment changes.
5153
51542005-11-11 Akim Demaille <akim@epita.fr>
62b08cfc
AD
5155
5156 When yydebug, report semantic and location values for reductions.
5157 * data/glr.c (yy_reduce_print): Report the semantic values and the
5158 locations.
5159 (YY_REDUCE_PRINT): Adjust.
5160 (yyglrReduce): Use them.
5161 (b4_rhs_value, b4_rhs_location): Remove m4_eval invocations.
5162 * data/c.m4 (b4_yysymprint_generate): Specify the const arguments.
5163 * tests/calc.at (_AT_CHECK_CALC_ERROR): Remove the reduction
5164 traces.
5165
02998094
AD
51662005-11-10 Akim Demaille <akim@epita.fr>
5167
5168 * data/glr.c (yynewGLRStackItem, YY_RESERVE_GLRSTACK): New.
5169 (yyaddDeferredAction, yyglrShift, yyglrShiftDefer): Use them.
5170 (yyexpandGLRStack, YYRELOC): Define only when YYSTACKEXPANDABLE.
5171
5210672f
PE
51722005-11-09 Albert Chin-A-Young <china@thewrittenword.com>
5173
5174 * m4/cxx.m4, examples/Makefile.am: Don't build
5175 examples/calc++ if no C++ compiler is available. (trivial change)
5176
a8991a1d
AD
51772005-11-09 Akim Demaille <akim@epita.fr>
5178
5179 * src/scan-skel.l: Use a couple of asserts.
5180
36b5e963
AD
51812005-11-03 Akim Demaille <akim@epita.fr>
5182
5183 In some (weird) cases, the final state number is incorrect.
5184 Reported by Alexandre Duret-Lutz.
5185 * src/LR0.c (state_list_append): Remove the computation of
5186 final_state.
5187 (save_reductions): Do it here.
5188 (get_state): Alpha conversion.
5189 (generate_states): Use a for loop.
5190 * src/gram.h (item_number_is_rule_number)
5191 (item_number_is_symbol_number): New.
5192 * src/state.c: Use assert.
5193 * src/system.h: Include assert.h.
5194 * tests/sets.at (Accept): New.
5195
44e7ead1
PH
51962005-10-30 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
5197
5198 * data/glr.c (yyfill): Adjust comment.
36b5e963 5199 (yyresolveAction): Initialize default location properly
44e7ead1
PH
5200 for empty right-hand sides.
5201 (yydoAction): Ditto.
5202 Add comment explaining apparently dead code.
36b5e963
AD
5203 * tests/glr-regression.at
5204 (Incorrectly initialized location for empty right-hand side in GLR):
44e7ead1 5205 New test.
36b5e963 5206
e10a80ee
PE
52072005-10-30 Paul Eggert <eggert@cs.ucla.edu>
5208
5209 * bootstrap (cleanup_gnulib): New function. Use it to clean up
5210 gnulib when interrupted. This fixes some race conditions and
5211 works around some portability problems (one noted by Paul
5212 Hilfinger).
5213
067b32ee
AD
52142005-10-22 Akim <akim@epita.fr>
5215
5216 * Makefile.cfg: Adjust to config -> build-aux.
5217 Reported by twledo.
5218
4b367315
AD
52192005-10-21 Akim Demaille <akim@epita.fr>
5220
5221 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Pass
5222 the %parse-params.
5223 * data/glr.c (YY_SYMBOL_PRINT, yydestroyGLRState): Adjust.
5224 * data/yacc.c (b4_Pure_if): Rename as...
5225 (b4_yacc_pure_if): this.
5226 (YY_SYMBOL_PRINT, yyparse): Adjust.
5227 * doc/bison.texinfo: Formatting changes.
5228
24cc23d9
AD
52292005-10-21 Akim Demaille <akim@epita.fr>
5230
5231 Finish the transition config -> build-aux.
5232 * configure.ac, Makefile.am: Use build-aux.
5233 * config/prev-version, config/announce-gen, config/Makefile.am:
5234 Move to...
5235 * build-aux/prev-version, build-aux/announce-gen,
5236 * build-aux/Makefile.am: here.
5237
d4476375
AD
52382005-10-14 Akim Demaille <akim@epita.fr>
5239
5240 * examples/calc++/test: Use set -x only when VERBOSE.
5241
302c0aee
PE
52422005-10-13 Paul Eggert <eggert@cs.ucla.edu>
5243
5244 * NEWS: Bison now warns if it finds a stray `$' or `@' in an action.
5245 * src/scan-gram.l (<SC_BRACED_CODE>[$@]): Implement this.
5246
7625ec2c
AD
52472005-10-13 Akim Demaille <akim@epita.fr>
5248
5249 * src/scan-skel.l: Output the base name parts of the parser and
5250 header file names.
302c0aee 5251 * tests/output.at (AT_CHECK_OUTPUT): Support subdirectories, and
7625ec2c
AD
5252 additional checks.
5253 Use this to exercise C++ outputs in subdirs.
5254 Reported by Oleg Smolsky.
5255
ba0fe3c7
PE
52562005-10-12 Paul Eggert <eggert@cs.ucla.edu>
5257
5258 * data/c.m4 (b4_c_function_def): Look at __C99_FUNC__, not at
5259 __STDC_VERSION__, as IBM cc 7.0 doesn't define the latter either.
5260 Problem reported by John P. Hartmann.
5261 * data/yacc.c (YYMODERN_C): Likewise. Don't define if the user has
5262 already defined it.
5263
9b8a5ce0
AD
52642005-10-12 Akim Demaille <akim@epita.fr>
5265
5266 * src/parse-gram.y (version_check): Exit 63 to please missing
5267 (stands for "version mismatch).
5268 * tests/input.at, doc/bison.texinfo: Adjust.
5269
4f6e011e
PE
52702005-10-10 Paul Eggert <eggert@cs.ucla.edu>
5271
5272 Work around portability problems with Visual Age C compiler
5273 (xlc and xlC_r) reported by John P. Hartmann.
5274 * data/location.cc (initial_column, initial_line): Remove.
5275 All uses replaced by 0 and 1.
5276 * src/scan-gram.l (gram_wrap): Redefine to avoid bug in flex 2.5.31
5277 that xlc complains about.
5278 * src/scan-skel.l (skel_wrap): Likewise.
4d7aa45e 5279 * data/c.m4 (b4_c_function_def): Look at __STDC_VERSION__ as well
ba0fe3c7 5280 as __STDC__.
4d7aa45e
PE
5281 * data/yacc.c (YYMODERN_C): New macro, which also looks at
5282 __STDC_VERSION__. Use it everywhere instead of looking at
5283 __STDC__ and __cplusplus.
4f6e011e 5284
a1b3bf8c
AD
52852005-10-10 Akim Demaille <akim@epita.fr>
5286
5287 * examples/calc++/test: Be quiet unless VERBOSE.
5288
412e44aa
PE
52892005-10-05 Paul Eggert <eggert@cs.ucla.edu>
5290
2a4647a3
PE
5291 * data/c.m4 (yydestruct, yysymprint):
5292 Use YYUSE instead of casting to void.
5293 * data/glr.c (YYUSE): New macro.
5294 (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
5295 Use it instead of rolling our own.
5296 (YYLLOC_DEFAULT, YYCHK, YYDPRINTF, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
5297 (YYCHK1):
5298 Use /*CONSTCOND*/ to suppress lint warnings.
5299 * data/lalr1.cc (YYLLOC_DEFAULT, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
5300 (YY_STACK_PRINT): Use 'false' not '0'.
5301 (YYUSE): New macro.
5302 (yysymprint_, yydestruct_): Use it instead of rolling our own.
5303 * data/yacc.c (YYUSE): New macro.
5304 (YYCOPY, YYSTACK_RELOCATE, YYBACKUP, YYLLOC_DEFAULT):
5305 (YYDPRINTF, YY_SYMBOL_PRINT, YY_STACK_PRINT, YY_REDUCE_PRINT):
5306 (yyerrorlab): Use /*CONSTCOND*/ to suppress lint warnings.
5307
5308
412e44aa
PE
5309 * data/m4sugar/m4sugar.m4 (_m4_map): New macro.
5310 (m4_map, m4_map_sep): Use it. Handle the empty list correctly.
5311
88c6637f
PE
53122005-10-04 Paul Eggert <eggert@cs.ucla.edu>
5313
2f4f028d
PE
5314 Undo the parts of the unlocked-I/O change that substituted
5315 putc or puts for printf. This might hurt performance a bit,
5316 but some people prefer the printf style.
5317 * data/c.m4 (yysymprint): Prefer printf to puts and putc.
5318 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): Remove.
5319 All uses replaced by YYFPRINTF and YYDPRINTF.
5320 * data/yacc.c: Likewise.
5321 * lib/bitset.c (bitset_print): Likewise.
5322 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer printf to
5323 putc and puts.
5324 * lib/lbitset.c (debug_lbitset): Likewise.
5325 * src/closure.c (print_firsts, print_fderives): Likewise.
5326 * src/gram.c (grammar_dump): Likewise.
5327 * src/lalr.c (look_ahead_tokens_print): Likewise.
5328 * src/output.c (escaped_output): Likewise.
5329 (user_actions_output): Break apart two printfs.
5330 * src/parse-gram.y (%printer): Prefer printf to putc and puts.
5331 * src/reduce.c (reduce_print): Likewise.
5332 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
5333 * src/system.h: Include unlocked-io.h rathe than stdio.h.
5334
88c6637f
PE
5335 * data/glr.c (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
5336 Use assignments rather than casts-to-void to suppress
5337 unused-variable warnings. This pacifies 'lint'.
5338 * data/lalr1.cc (yysymprint_, yydestruct_): Use a call to suppress
5339 unused-variable warnings.
5340
fb32e373
JMG
53412005-10-03 Juan Manuel Guerrero <juan.guerrero@gmx.de>
5342
5343 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
5344
edb8f44f
PE
53452005-10-02 Paul Eggert <eggert@cs.ucla.edu>
5346
fb9c0b33
PE
5347 Use unlocked I/O for a minor performance improvement on hosts like
5348 GNU/Linux and Solaris that support unlocked I/O. The basic idea
5349 is to use the gnlib unlocked-io module, and to prefer putc and
5350 puts to printf when either will work (since the latter doesn't
5351 come in an unlocked flavor).
5352 * bootstrap (gnulib_modules): Add unlocked-io.
5353 * data/c.m4 (yysymprint): Prefer puts and putc to printf.
5354 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): New macros.
5355 Prefer them to YYFPRINTF and YYDPRINTF if either will do,
5356 and similarly for puts and putc and printf.
5357 * data/yacc.c: Likewise.
5358 * lib/bitset.c (bitset_print): Likewise.
5359 * lib/bitset.h [USE_UNLOCKED_IO]: Include unlocked-io.h.
5360 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer putc and puts
5361 to printf.
5362 * lib/lbitset.c (debug_lbitset): Likewise.
5363 * src/closure.c (print_firsts, print_fderives): Likewise.
5364 * src/gram.c (grammar_dump): Likewise.
5365 * src/lalr.c (look_ahead_tokens_print): Likewise.
5366 * src/output.c (escaped_output): Likewise.
5367 (user_actions_output): Coalesce two printfs.
2f4f028d 5368 * src/parse-gram.y (%printer): Prefer putc and puts to printf.
fb9c0b33
PE
5369 * src/reduce.c (reduce_print): Likewise.
5370 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
2f4f028d 5371 * src/system.h: Include unlocked-io.h rather than stdio.h.
fb9c0b33 5372
edb8f44f
PE
5373 * data/lalr1.cc: Don't put an unmatched ' in a dnl comment, as
5374 this confuses xgettext.
5375
b50d2359
AD
53762005-10-02 Akim Demaille <akim@epita.fr>
5377
5378 * bootstrap (gnulib_modules): Add strverscmp.
5379 * lib/.cvsignore: Add strverscmp.c, strverscmp.h.
5380 * m4/.cvsignore: Add strverscmp.m4.
5381 * src/parse-gram.y (%require): New token, new rule.
5382 (version_check): New.
5383 * src/scan-gram.l (%require): Adjust.
5384 * tests/input.at (AT_REQUIRE): New.
5385 Use it.
5386 * doc/bison.texinfo (Require Decl): New.
5387 (Calc++ Parser): Use %require.
5388
21667f64
AD
53892005-10-02 Akim Demaille <akim@epita.fr>
5390
5391 * data/location.cc: New.
5392
2b81e969
AD
53932005-10-02 Paul Eggert <eggert@cs.ucla.edu>,
5394 Akim Demaille <akim@epita.fr>
5395
5396 Make sure -odir/foo.cc creates dir/location.hh etc.
5397 * src/files.h (spec_outfile, parser_file_name, spec_name_prefix)
5398 (spec_file_prefix, spec_verbose_file, spec_graph_file)
5399 (spec_defines_file): Now const.
5400 (dir_prefix): New.
5401 (short_base_name): Remove.
5402 * src/files.c: Adjust.
5403 (dirname.h): Include.
5404 (base_name): Don't prototype it.
5405 (finput): Remove, duplicates gram_in.
5406 (full_base_name, short_base_name): Replace by...
5407 (all_but_ext, all_but_tab_ext): these.
5408 (compute_base_names): Rename as...
5409 (compute_file_name_parts): this.
5410 Update to compute the new variables, including dir_prefix.
5411 Adjust dependencies.
5412 * src/output.c (prepare): Output them.
5413 * src/reader.c: Adjust to use gram_in, not finput.
5414 * src/scan-skel.l (@dir_prefix@): New.
5415
ad6a9b97
JMG
54162005-10-02 Juan Manuel Guerrero <juan.guerrero@gmx.de>
5417
5418 * lib/subpipe.c: New function end_of_output_subpipe() added
5419 to allow support for non-posix systems. This is a no-op function
5420 for posix systems.
5421
5422 * lib/subpipe.h: New function end_of_output_subpipe() added
5423 to allow support for non-posix systems. This is a no-op function
5424 for posix systems.
5425
5426 * src/output.c (output_skeleton): Use end_of_output_subpipe() to
5427 handle the lack of pipe/fork functionality on non-posix systems.
5428
5429 * djgpp/Makefile.maint: DJGPP specific file.
5430
5431 * djgpp/README.in: DJGPP specific file.
5432
5433 * djgpp/config.bat: DJGPP specific configuration file.
5434
5435 * djgpp/config.sed: DJGPP specific configuration file.
5436
5437 * djgpp/config.site: DJGPP specific configuration file.
5438
5439 * djgpp/config_h.sed: DJGPP specific configuration file.
5440
5441 * djgpp/subpipe.c: DJGPP specific replacement file for lib/subpipe.c.
5442
5443 * djgpp/subpipe.h: DJGPP specific replacement file for lib/subpipe.h.
5444
fc695704
AD
54452005-10-02 Akim Demaille <akim@epita.fr>
5446
5447 * data/location.cc: New, extract from...
5448 * data/lalr1.cc: here.
5449 (location.hh): Include it after the user prologue, in case the
5450 filename type is defined by the user.
5451 Forward declation location and position before the pre-prologue.
5452 (yyresult_): Rename as...
5453 (yyresult): this, it's a local variable, not an attribute.
5454 * data/Makefile.am (dist_pkgdata_DATA): Adjust.
5455
54562005-10-01 Akim Demaille <akim@epita.fr>
5215c87f
AD
5457
5458 * examples/extexi: Restore the #line generation.
5459
fb9712a9
AD
54602005-09-30 Akim Demaille <akim@epita.fr>,
5461 Alexandre Duret-Lutz <adl@gnu.org>
5462
5463 Move the token type and YYSTYPE in the parser class.
5464 * data/lalr1.cc (stack.hh, location.hh): Include earlier.
5465 (parser::token): New, from the moved free definition of tokens.
5466 (parser::semantic_value): Now a full definition instead of an
5467 indirection to YYSTYPE.
5468 (b4_post_prologue): No longer included in the header file, but
5469 in the implementation file.
5470 * doc/bison.texi (C+ Language Interface): Update.
5471 * src/parse-gram.y: Support unary %define.
5472 * tests/actions.at: Define global_tokens_and_yystype for backward
5473 compatibility until we update the tests.
5474 * tests/calc.at: Idem.
5475 (first_line, first_column, last_line, last_column): Define for lalr1.cc
5476 to simplify the code.
5477
55f0c7b1
PE
54782005-09-29 Paul Eggert <eggert@cs.ucla.edu>
5479
5480 Port to SunOS 4.1.4, which lacks strtoul and strerror.
5481 Ah, the good old days! Problem reported by Peter Klein.
5482 * bootstrap (gnulib_modules): Add strerror, strtoul.
5483 * lib/.cvsignore: Add strerror.c, strtol.c, strtoul.c
5484 * m4/.cvsignore: Add strerror.m4, strtol.m4, strtoul.m4.
5485
fb9712a9 54862005-09-29 Akim Demaille <akim@epita.fr>
d4fb5e3c
AD
5487
5488 * data/c.m4 (b4_error_verbose_if): New.
5489 * data/lalr1.cc: Use it.
5490 (YYERROR_VERBOSE_IF): Remove.
5491 (yyn_, yylen_, yystate_, yynerrs_, yyerrstatus_): Remove as
5492 parser members, replaced by...
5493 (yyn, yylen, yystate, yynerss, yyerrstatus): these parser::parse
5494 local variables.
5495 (yysyntax_error_): Takes the state number as argument.
5496 (yyreduce_print_): Use the argument yyrule, not the former
5497 attribute yyn_.
5498
8a6f72f3
PE
54992005-09-26 Paul Eggert <eggert@cs.ucla.edu>
5500
5501 * bootstrap (gnulib_modules): Add verify.
5502 * lib/.cvsignore: Add verify.h.
5503 * src/getargs.c: Use ARGMATCH_VERIFY rather than verify.
5504 * src/system.h (verify): Remove.
5505 Include verify.h instead.
5506 * src/tables.c (tables_generate): Use new API for 'verify'.
5507
0d50976f
PE
55082005-09-21 Paul Eggert <eggert@cs.ucla.edu>
5509
ebc3737e
PE
5510 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Do not use
5511 local variables whose names begin with 'yy'.
5512 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
5513 Trivial changes from Joel E. Denny.
5514
0d50976f
PE
5515 * bootstrap (gnulib_modules): Remove alloca. Bison doesn't need
5516 it itself.
5517 * src/main.c (main) [C_ALLOCA]: Don't flush alloca'ed memory; we
5518 don't use alloca any more.
5519
5520 * data/yacc.c [YYSTACK_USE_ALLOCA && !defined __GNUC__ && ! defined
5521 __BUILTIN_VA_ARG_INCR && ! defined _AIX && ! defined _MSC_VER &&
62c4328e 5522 defined _ALLOCA_H]: Don't include <stdlib.h>; not needed in this case.
0d50976f
PE
5523 * tests/torture.at (Exploding the Stack Size with Alloca): Adjust
5524 to match yacc.c, to test more hosts.
5525
a05b79df
PE
55262005-09-20 Paul Eggert <eggert@cs.ucla.edu>
5527
55289366
PE
5528 * data/yacc.c (YYSIZE_T): Reindent to make it clearer. This
5529 doesn't affect behavior.
5530 (YYSTACK_ALLOC) [YYSTACK_USE_ALLOCA]: Improve support for
5531 Solaris, AIX, MSC.
5532 (_STDLIB_H): Renamed from YYINCLUDED_STDLIB_H. All uses changed.
5533 This works a bit better with glibc, if user code has already included
5534 stdlib.h.
5535 * doc/bison.texinfo (Bison Parser): Document that users can't
5536 arbitrarily use malloc and free for other purposes. Document
5537 that <alloca.h> and <malloc.h> might be included.
5538 (Table of Symbols): Under YYSTACK_USE_ALLOCA, Don't claim that the
5539 user must declare alloca.
5540
a05b79df
PE
5541 * HACKING (release): Forwarn the Translation Project about
5542 stable releses.
5543
3ab2ca22
AD
55442005-09-20 Akim Demaille <akim@epita.fr>
5545
5546 * data/glr.c: Use b4_token_enums, not b4_token_enums_defines.
5547
a9739e7c
PE
55482005-09-19 Paul Eggert <eggert@cs.ucla.edu>
5549
a702593e
PE
5550 * data/yacc.c (YYSIZE_MAXIMUM): New macro.
5551 (YYSTACK_ALLOC_MAXIMUM): Use it.
5552 (yysyntax_error): New function.
5553 (yyparse) [YYERROR_VERBOSE]: Don't leak memory indefinitely if
5554 multiple syntax errors are reported, and alloca is being used.
5555 Instead, reallocate buffers twice as big each time, so that
5556 we waste at most half the allocated memory. Start with a small
5557 (128-byte) buffer that will suffice in most cases anyway.
5558 Use yysyntax_error to do most of the work.
5559
5560 * doc/bison.texinfo (Error Reporting, Table of Symbols):
5561 yynerrs is the number of errors reported, not the number of
5562 errors encountered.
5563
a9739e7c
PE
5564 * tests/glr-regression.at (Duplicated user destructor for lookahead):
5565 Mark it as expected to fail.
5566 Cast result of malloc; problem reported by twlevo@xs4all.nl.
5567 * tests/actions.at, tests/calc.at, tests/glr-regression.at:
5568 Don't start user-code symbols with "yy", to avoid name space problems.
5569
f479c6c6
AD
55702005-09-19 Akim Demaille <akim@epita.fr>
5571
5572 Remove the traits, failed experiment.
5573 It never proved useful, and anyway because of the current
5574 definition, it was not possible to have several specialization of
5575 this traits, making it useless.
5576 * data/lalr1.cc (yy:traits): Remove.
5577 Inline its definitions in the parser class.
5578
e2586f82
AD
55792005-09-19 Akim Demaille <akim@epita.fr>
5580
5581 * tests/atlocal.in (LIBS): Pass INTLLIBS to address failures on at
5582 least Mac OSX with a /usr/local install of gettext.
5583
2e8cf949
AD
55842005-09-19 Akim Demaille <akim@epita.fr>
5585
5586 * data/lalr1.cc (yyparse): Rename yylooka and yyilooka as yychar
5587 and yytoken for similarity with the other skeletons.
5588
c7fb0b90
AD
55892005-09-19 Akim Demaille <akim@epita.fr>
5590
4e26c69e 5591 * NEWS, configure.ac: update version number to 2.1a.
c7fb0b90 5592
1bd0deda
PE
55932005-09-16 Paul Eggert <eggert@cs.ucla.edu>
5594
5595 * NEWS: Version 2.1.
5596
5597 * NEWS: Remove notice of yytname change, since it was never in an
5598 official release.
5599 * data/glr.c (yydestroyGLRState): Rename local var to avoid shadowing
5600 diagnostic.
5601 * src/output.c (prepare): Likewise.
5602 * data/lalr1.cc (YYERROR_VERBOSE_IF): New macro.
5603 (yysyntax_error_): Use it to avoid GCC warning when YYERROR_VERBOSE
5604 is not defined. This is an awful hack, but it's enough for now.
5605 All callers changed.
5606 * tests/glr-regression-at (make_value): Args are const pointers now,
5607 to avoid GCC warning.
5608 (Duplicated user destructor for lookahead): New test. Currently
5609 skipped. It fails on my host but I'm not sure it'll always fail.
5610
56112005-09-16 Akim Demaille <akim@epita.fr>
c1432f65
AD
5612
5613 * src/symtab.h (struct symbol): Declare the printer and destructor
5614 as const, to avoid accidental calls to free.
5615 (symbol_destructor_set, symbol_printer_set): Adjust.
5616 * src/symtab.c: Adjust.
5617
1bd0deda 56182005-09-16 Akim Demaille <akim@epita.fr>
cf147260
AD
5619
5620 * data/c.m4 (b4_token_enums): New.
5621 (b4_token_defines): Rename as...
5622 (b4_token_enums_defines): this.
5623 (b4_token_defines): New, output only the #defines.
5624 * data/yacc.c, data/glr.c: Adjust.
5625 * data/lalr1.cc: Use b4_token_enums instead of b4_token_enums_defines.
5626 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Define
5627 as default values.
5628
dbcdae2d
AD
56292005-09-16 Akim Demaille <akim@epita.fr>
5630
5631 * data/lalr1.cc (yylex_): Remove, inline its code.
5632 (yyreport_syntax_error_): Remove, replaced by...
5633 (yysyntax_error_): this which returns a string and leaves to the
5634 caller the call to the users' error function.
5635 (yylooka_, yyilooka_, yylval, yylloc, yyerror_range_, yyval, yyloc):
5636 Move from members of the parser object...
5637 (yylooka, yyilooka, yylval, yylloc, yyerror_range, yyval, yyloc):
5638 to local variables of the parse function.
5639
70d8f291
AD
56402005-09-16 Akim Demaille <akim@epita.fr>
5641
5642 * doc/bison.texinfo (Calc++ Parser): Don't promote defining YYEOF
5643 since it's in Bison's name space.
5644
b47dbebe
PE
56452005-09-15 Paul Eggert <eggert@cs.ucla.edu>
5646
ae199bf1
PE
5647 * data/glr.c (yyresolveValue): Add default case to pacify
5648 gcc -Wswitch-default. Problem reported by twlevo@xs4all.nl.
5649
b47dbebe
PE
5650 * NEWS: Document when yyparse started to return 2.
5651 * doc/bison.texinfo (Parser Function): Document when yyparse
5652 returns 2.
5653
5654 * data/lalr1.cc: Revert part of previous change, as it's incompatible.
5655 (b4_filename_type): Renamed back from b4_file_name_type. All uses
5656 changed.
5657 (class position): file_name -> filename (reverting). All uses changed.
5658
56592005-09-14 Paul Eggert <eggert@cs.ucla.edu>
5660
5661 * examples/calc++/Makefile.am ($(calc_sources_generated)): Don't
5662 do anything if $@ exists. This reverts part of the 2005-07-07
5663 patch.
5664
00292f66
PE
56652005-09-11 Paul Eggert <eggert@cs.ucla.edu>
5666
5667 * Makefile.am (EXTRA_DIST): Do not distribute REFERENCES; it
5668 contains obsolete information and isn't worth distributing as a
5669 separate file anyway.
5670 * data/glr.c [defined YYSETJMP]: Don't include <setjmp.h>.
5671 (YYJMP_BUF, YYSETJMP, YYLONGJMP) [!defined YYSETJMP]: New macros.
5672 All uses of jmp_buf, setjmp, longjmp changed to use these instead.
5673 (yyparse): Abort if user code uses longjmp to throw an unexpected
5674 value.
5675
a420f962
PE
56762005-09-09 Paul Eggert <eggert@cs.ucla.edu>
5677
00292f66
PE
5678 * data/c.m4 (b4_identification): Define YYBISON_VERSION.
5679 Suggested by twlevo@xs4all.nl.
5680
127287e9
PE
5681 * data/glr.c (YYCHK1): Do not assume YYE is in range.
5682 This avoids a diagnostic from gcc -Wswitch-enum.
5683 Problem reported by twlevo@xs4all.nl.
5684
a420f962
PE
5685 * doc/bison.texinfo: Don't use "filename", as per GNU coding
5686 standards. Use "file name" or "file" or "name", depending on
5687 the context.
5688 (Invocation): The output of "bison hack/foo.y" goes to foo.tab.c,
5689 not to hack/foo.tab.c.
5690 (Calc++ Top Level): 2nd arg of main is not const.
48b16bbc
PE
5691 * data/glr.c: b4_filename -> b4_file_name.
5692 * data/lalr1.cc: Likewise. Also, b4_filename_type -> b4_file_name_type.
5693 All uses changed.
5694 (class position): filename -> file_name. All uses changed.
5695 * data/yacc.c: b4_filename -> b4_file_name.
5696 * lib/bitset.h: filename -> file_name in local vars.
5697 * lib/bitset_stats.c: Likewise.
5698 * src/files.c: Likewise.
5699 * src/scan-skel.l ("@output ".*\n): Likewise.
5700 * src/files.c (file_name_split): Renamed from filename_split.
5701 * src/muscle_tab.c (muscle_init): Output b4_file_name, not b4_filename.
a420f962
PE
5702
57032005-09-08 Paul Eggert <eggert@cs.ucla.edu>
5704
5705 * lib/.cvsignore: Add pipe-safer.c, stdio--.h, unistd--.h,
5706 to accommodate latest gnulib.
5707
5708 * tests/glr-regression.at (Duplicate representation of merged trees):
5709 Add casts to pacify g++. Problem reported by twlevo@xs4all.nl.
5710
5711 * bootstrap: Add comment as to why the AM_LANGINFO_CODESET hack is
5712 needed.
5713
42a6501d
PE
57142005-08-26 Paul Eggert <eggert@cs.ucla.edu>
5715
5716 * data/glr.c (yydestroyGLRState): Renamed from yydestroyStackItem.
5717 All uses changed. Invoke user destructor after an error during a
5718 split parse (trivial change from Joel E. Denny).
5719
5720 * tests/glr-regression.at
5721 (User destructor after an error during a split parse): New test case.
5722 Problem reported by Joel E. Denny in:
5723 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00029.html
5724
ef9a1faf
PE
57252005-08-25 Paul Eggert <eggert@cs.ucla.edu>
5726
5b4aaf78
PE
5727 * README-cvs: Give URLs for recommended tools.
5728 Mention Gzip version problem, and bootstrapping issues.
5729 Remove troubleshooting section, as it's somewhat obsolete.
5730
b5240ba5
PE
5731 * bootstrap (no_cache): New var, to accommodate different wget
5732 variants. Use it instead of '-C off'. Problem reported by
5733 twlevo@xs4all.nl.
5734
ef9a1faf
PE
5735 * data/glr.c (yydestroyStackItem): New function.
5736 (yyrecoverSyntaxError, yyreturn): Use it to improve quality of
5737 debugging information. Problem reported by Joel E. Denny.
5738
e6efa9da
AD
57392005-08-25 Akim Demaille <akim@epita.fr>
5740
5741 * tests/local.at (AT_COMPILE_CXX): Pass $LINKS too.
5742
adc90f13
PE
57432005-08-24 Paul Eggert <eggert@cs.ucla.edu>
5744
5745 * data/glr.c (yyrecoverSyntaxError, yyreturn):
5746 Don't invoke destructor on unresolved entries.
5747 * tests/glr-regression.at
5748 (User destructor for unresolved GLR semantic value): New test case.
5749 Problem reported by Joel E. Denny in:
5750 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00016.html
5751
f9315de5
PE
57522005-08-21 Paul Eggert <eggert@cs.ucla.edu>
5753
15d29c1f
PE
5754 * lib/.cvsignore: Remove realloc.c, strncasecmp.c, xstrdup.c.
5755 Add strnlen.c.
5756 * m4/.cvsignore: Remove codeset.m4, gettext.m4, lib-ld.m4,
5757 lib-prefix.m4, po.m4.
5758
dd5f2af2
PE
5759 * data/glr.c (yyreturn): Use "Cleanup:" rather than "Error:"
5760 in yydestruct diagnostic, since it might not be an error.
5761 Problem reported by Joel Denny near end of
5762 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
6250acbd 5763 * data/lalr1.cc (yyerturn): Likewise.
dd5f2af2
PE
5764 * data/yacc.c (yyreturn): Likewise.
5765 * tests/calc.at (_AT_CHECK_CALC_ERROR): Adjust to the above change.
5766
5767 * src/files.c: Remove obsolete FIXME comment.
5768
5769 * data/glr.c (YY_SYMBOL_PRINT): Append a newline, for consistency
5770 with the other templates, and to fix bogus run-on messages such
5771 as the one reported at the end of
5772 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
5773 All callers changed to avoid the newline.
5774 (yyprocessOneStack): Output two lines rather than one, to accommodate
5775 the above change. This changes the debug output format slightly.
5776
f9315de5
PE
5777 * data/glr.c (yyresolveValue): Fix redundant parse tree problem
5778 reported by Joel E. Denny in
5779 <http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00004.html>
5780 (trivial change).
5781 * tests/glr-regression.at (Duplicate representation of merged trees):
5782 New test, from Joel E. Denny in:
5783 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00013.html>.
5784 * THANKS: Add Joel E. Denny.
5785
5786 * configure.ac (AC_INIT): Bump to 2.0c.
5787
04098407
PE
57882005-07-24 Paul Eggert <eggert@cs.ucla.edu>
5789
5790 * NEWS: Version 2.0b.
5791
ca5d2013
PE
5792 * Makefile.am (SUBDIRS): Put examples before tests, so that
5793 "make check" doesn't finish with "All 1 tests passed".
5794
3d54b576
PE
5795 * tests/regression.at (Token definitions): Don't rely on
5796 AT_PARSER_CHECK for data that contains backslashes. It currently
5797 uses 'echo', and 'echo' isn't portable if its argument contains
5798 backslashes. Problem found on OpenBSD 3.4. Also, do not assume
5799 that the byte '\0xff' is not printable in the C locale; it is,
5800 under OpenBSD 3.4 (!). Luckily, '\0x80' through '\0x9e' are
5801 not printable, so use '\0x81' to test.
5802
d53ae497
PE
5803 * data/glr.c (YYOPTIONAL_LOC): Define even if it's not a recent
5804 version of GCC, since the macro is used with non-GCC compilers.
5805
fc01665e
PE
5806 Fix core dump reported by Pablo De Napoli in
5807 <http://lists.gnu.org/archive/html/bug-bison/2005-07/msg00053.html>.
5808 * tests/regression.at (Invalid inputs with {}): New test.
5809 * src/parse-gram.y (token_name): Translate type before using
5810 it as an index.
5811
04098407
PE
5812 * data/glr.c (ATTRIBUTE_UNUSED): Remove, since it infringes on
5813 the user's name space. All uses changed to __attribute__
5814 ((__unused__)).
5815 (yyFail, yyMemoryExhausted, yyreportAmbiguity):
5816 Add __attribute__ ((__noreturn__)).
5817
5818 * etc/clcommit: Remove. We weren't using it, and it failed
5819 "make maintainer-distcheck".
5820 * Makefile.maint: Merge from coreutils.
5821 (CVS_LIST, CVS_LIST_EXCEPT): New macros.
5822 (syntax-check-rules): Change list of rules as described below.
5823 (sc_cast_of_alloca_return_value, sc_dd_max_sym_length):
5824 (sc_file_system, sc_obsolete_symbols, sc_prohibit_atoi_atof):
5825 (sc_prohibit_jm_in_m4, sc_root_tests, sc_tight_scope):
5826 (sc_trailing_space): New rules.
5827 (sc_xalloc_h_in_src): Remove.
5828 (sc_cast_of_argument_to_free, sc_cast_of_x_alloc_return_value):
5829 (sc_space_tab, sc_error_exit_success, sc_changelog):
5830 (sc_system_h_headers, sc_sun_os_names, sc_unmarked_diagnostics):
5831 (makefile-check, po-check, author_mark_check):
5832 (makefile_path_separator_check, copyright-check):
5833 Use grep -n, to make it easier to find violations.
5834 Use CVS_LIST and CVS_LIST_EXCEPT.
5835 (header_regexp, h_re): Remove.
5836 (dd_c): New macro.
5837 (sc_dd_max_sym_length, .re-list, news-date-check): New rules.
5838 (my-distcheck): Use more-modern GCC flags.
5839 (signatures, %.asc): Remove.
5840 (rel-files, announcement): Remove signatures.
5841 Restore old updating code, even though we don't use it, so
5842 that we're the same as coreutils.
5843 (alpha, beta, major): Depend on news-date-check.
5844 Make the upload commands.
5845
5846 * data/c.m4, data/lalr1.cc, data/yacc.c: Normalize white space.
5847 * lib/abitset.h, lib/bbitset.h, lib/bitset.h: Likewise.
5848 * lib/bitset_stats.c, lib/ebitset.h, lib/lbitset.c: Likewise.
5849 * lib/libitset.h, lib/timevar.c, lib/vbitset.h: Likewise.
5850 * src/Makefile.am, src/gram.c, src/muscle_tab.h: Likewise.
5851 * src/parse-gram.y, src/system.h, src/tables.c, src/vcg.c: Likewise.
5852 * src/vcg_defaults.h, tests/cxx-type.at, tests/existing.at: Likewise.
5853 * tests/sets.at: Likewise.
5854
5855 * data/m4sugar/m4sugar.m4: Sync from Autoconf, except that
5856 we comment out the Autoconf version number.
5857 * doc/bison.texinfo (Calc++ Scanner): Don't use atoi, as
5858 it's error-prone and "make maintainer-distcheck" rejects it.
5859
5860 * lib/subpipe.c: Include <fcntl.h> without checking for HAVE_FCNTL_H.
5861 Indent calls to "error" to pacify "make maintainer-distcheck",
5862 when the calls are not intended to be translated.
5863 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't check for fcntl.h.
5864
5865 * src/Makefile.am (DEFS): Use +=, to pacify
5866 "make maintainer-distcheck".
5867 (bison_SOURCES): Add scan-skel.h.
5868 (sc_tight_scope): New rule, from coreutils.
5869
5870 * src/files.c (src_extension, header_extension):
5871 Now static, not extern.
5872 * src/getargs.c (short_options): Likewise.
5873 * src/muscle_tab.c (muscle_table): Likewise.
5874 * src/parse-gram.y (current_class, current_type, current_prec):
5875 Likewise.
5876 * src/reader.c (grammar_end, previous_rule_end): Likewise.
5877 * src/getargs.h: Redo comments to pacify "make maintainer-distcheck".
5878 * src/main.c (main): Cast bindtextdomain and textdomain calls to
5879 void, to avoid warning when NLS is disabled.
5880 * src/output.c: Include scan-skel.h.
5881 (scan_skel): Remove decl, since scan-skel.h does this.
5882 (output_skeleton):
5883 Indent calls to "error" to pacify "make maintainer-distcheck".
5884 * src/print_graph.c: Don't include <obstack.h>, as system.h does this.
5885 * src/reader.h (gram_end, gram_lineno): New decls to pacify
5886 "make maintainer-distcheck".
5887 * src/scan-skel.l (skel_lex, skel_get_lineno, skel_get_in):
5888 (skel_get_out, skel_get_leng, skel_get_text, skel_set_lineno):
5889 (skel_set_in, skel_set_out, skel_get_debug, skel_set_debug):
5890 (skel_lex_destroy, scan_skel): Move these decls to...
5891 * src/scan-skel.h: New file.
5892 * src/uniqstr.c (uniqstr_assert):
5893 Indent calls to "error" to pacify "make maintainer-distcheck".
5894
5895 * tests/Makefile.am ($(srcdir)/package.m4): Use $(VAR),
5896 not @VAR@.
5897
5898 * tests/torture.at: Revamp to avoid misuse of atoi that
5899 "make maintainer-distcheck" complained about.
5900
5901 * examples/extexi (message): Don't print a message more than once,
5902 and omit line-number decoration that makes Emacs compile think
5903 that informative messages are worth worrying about.
5904
59052005-07-22 Paul Eggert <eggert@cs.ucla.edu>
5906
5907 * configure.ac: Update version number.
5908
5909 * Makefile.am (SUBDIRS): Add examples; somehow this got removed
5910 accidentally.
5911 * examples/calc++/calc++-parser.yy: Remove from CVS, as it's
5912 autogenerated by the maintainer.
5913 * examples/calc++/.cvsignore: Add *.yy.
5914
5915 * lib/bitset.c (bitset_alloc): Don't cast xcalloc result.
5916 * lib/bitset_stats.c (bitset_stats_init): Likewise.
5917 * lib/bitsetv.c (bitsetv_alloc): Likewise.
5918
5919 * po/POTFILES.in: Add lib/xalloc-die.c; remove lib/xmalloc.c.
5920
5921 * src/relation.c (relation_transpose): Rewrite to avoid bogus complaint
5922 from maintainer-distcheck about casting the argument of 'free'.
5923
5924 * NEWS: Mention recent yytname changes.
5925 * THANKS: Add Anthony Heading, twlevo@xs4all.nl.
5926
5927 * bootstrap: For translations that have not yet been upgraded to
5928 the new runtime-po domain, prime the pump by extracting the
5929 relevant strings from the obsolete translations. This code can be
5930 removed once the bison-runtime domain has been translated by each
5931 team.
5932
5933 * src/scan-gram.l (<SC_PRE_CODE>.): Don't double-quote token names,
5934 now that token names are already quoted.
5935
5936 Fix problem reported by Anthony Heading.
5937 * data/glr.c (YYTOKEN_TABLE): New macro.
5938 (yytname): Define if YYTOKEN_TABLE.
5939 * data/yacc.c (YYTOKEN_TABLE, yytname): Likewise.
5940 * data/lalr1.cc (YYTOKEN_TABLE, yytname_): Likewise.
5941 (YYERROR_VERBOSE): Define the same way the other skeletons do.
5942 * src/output.c (prepare_symbols): Output token_table_flag.
5943
0ffda363
PE
59442005-07-21 Paul Eggert <eggert@cs.ucla.edu>
5945
5946 * data/glr.c (yyinitGLRStack, yyreturn): Don't call malloc
5947 again if the first call fails.
5948
5949 * data/glr.c (yytnamerr): New function.
5950 (yyreportSyntaxError): Use it to dequote most string literals.
5951 * data/lalr1.c (yytname_): Renamed from yyname_, for compatibility
5952 with other skeletons. All uses changed.
5953 (yytnameerr_): New function.
5954 (yyreport_syntax_error): Use it to dequote most string literals.
5955 * data/yacc.c (yytnamerr): New function.
5956 (yyerrlab): Use it to decode most string literals.
5957 * doc/bison.texinfo (Decl Summary, Calling Convention):
5958 Clarify quoting convention of yytname.
5959 * src/output.c (prepare_symbols): Quote all names. This undoes
5960 the 2005-04-17 change, which is now accomplished (mostly) via
5961 changes in the parsers as described above.
5962 * tests/regression.at (Token definitions, Web2c Actions):
5963 Undo most 2005-04-17 change here, too.
5964
59652005-07-20 Paul Eggert <eggert@cs.ucla.edu>
5966
5967 Fix more problems reported by twlevo@xs4all.nl.
5968 * tests/cxx-type.at: Don't pipe output of ./types through sed to
5969 remove trailing spaces. This loses the exit status of ./types,
5970 and isn't needed since ./types shouldn't be emitting trailing
5971 spaces.
5972 * data/glr.c (yyreturn): Don't pop stack if yyinitStateSet failed,
5973 as the stack isn't valid in that case.
5974
5975 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
5976 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
5977 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
5978 Add declarations to pacify "gcc -Wmissing-prototypes" when flex 2.5.31
5979 is used.
5980 * src/scan-skel.l (skel_get_lineno, skel_get_in, skel_get_out):
5981 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
5982 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
5983 Likewise.
5984
5985 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Work even with
5986 overly-picky compilers that reject 'char *foo = "bar";'.
5987
5988 * src/symtab.c (SYMBOL_ATTR_PRINT, symbol_print): Direct output
5989 to FILE * parameter, not to stderr. This fixes a typo introduced
5990 in the 2005-07-12 change.
5991
5992 * lib/subpipe.c (create_subpipe): Rewrite slightly to avoid
5993 warnings from GCC 4.
5994
5995 * data/glr.c (yyexpandGLRStack, yyaddDeferredAction, yyexpandGLRStack):
5996 (yyglrShiftDefer, yysplitStack):
5997 Remove unused parameters b4_pure_formals. All uses changed.
5998 (yyglrShift): Remove unused parameters b4_user_formals.
5999 All uses changed.
6000 (yyglrReduce): Removed unused parameter yylocp. All uses changed.
6001
6100a9aa
PE
60022005-07-18 Paul Eggert <eggert@cs.ucla.edu>
6003
258b75ca
PE
6004 Destructor cleanups and regularization among the three skeletons.
6005 * NEWS: Document the behavior changes.
6006 * data/glr.c (yyrecoverSyntaxError): Don't bother to pop the
6007 stack before failing, as the cleanup code will do it for us now.
6008 * data/lalr1.cc (yyerrlab): Likewise.
6009 * data/glr.c (yyparse): Pop everything off the stack before
6010 freeing it, so that destructors get called properly.
6011 * data/lalr1.cc (yyreturn): Likewise.
6012 * data/yacc.c (yyreturn): Pop and destroy the start symbol, too.
6013 This is more consistent.
6014 * doc/bison.texinfo (Destructor Decl): Mention more reasons
6015 why destructors might be called. 1.875 -> 2.1.
6016 (Destructor Decl, Decl Summary, Table of Symbols):
6017 Some English-language cleanups for %destructor.
6018 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
6019 Add output line for destructor of start symbol.
6020 * tests/calc.at (AT_CHECK_CALC): Add one to line counts,
6021 because of that same extra output line.
6022
1a059451
PE
6023 * NEWS: Document minor wording changes in diagnostics of
6024 Bison-generated parsers.
6025 * data/glr.c (yyMemoryExhausted): Renamed from yyStackOverflow.
6026 Remove unused formals. All uses changed.
6027 (yyreportAmbiguity): "ambiguity detected" -> "syntax is ambiguous".
6028 (yyparse): Rename yyoverflowlab to yyexhaustedlab.
6029 * data/yacc.c (yyparse): "parser stack overflow" -> "memory exhausted".
6030 Rename yyoverflowab to yyexhaustedlab.
6031 When memory exhaustion occurs during syntax-error reporting,
6032 report it separately rather than in a single diagnostic; this
6033 eases translation.
6034 * doc/bison.texinfo (Memory Management): Renamed from Stack Overflow.
6035 (Memory Exhausted): Renamed from Parser Stack Overflow.
6036 Revamp wording slightly to prefer "memory exhaustion".
6037 * tests/actions.at: "parser stack overflow" -> "memory exhausted".
6038
97460c78
PE
6039 * data/c.m4 (b4_yysymprint_generate): Use YYFPRINTF, not fprintf.
6040
30757c8c
PE
6041 Add i18n support to the GLR skeleton. Partially fix the C++
6042 skeleton; a C++ expert needs to finish this. Remove debugging
6043 msgids; there's little point to having them translated, since they
6044 can be understood only by someone who can read the
6045 (English-language) source code.
6046
6047 Generate runtime-po/bison-runtime.pot automatically, so that we
6048 don't have to worry about garbage getting in that file. We'll
6049 make sure after the next official release that old msgids don't
6050 get lost. See
6051 <http://lists.gnu.org/archive/html/bison-patches/2005-07/msg00119.html>.
6052
6053 * runtime-po/Makefile.in.in, runtime-po/bison-runtime.pot: Remove.
6054 Now auto-generated.
6055 * PACKAGING: Don't claim that Gawk, GCC, Perl use this method yet.
6056 Fix typos in explanations of the runtime file.
6057 * bootstrap: Change gettext keyword from YYI18N to YY_.
6058 Use standard Makefile.in.in in runtime-po, since we'll arrange
6059 for backward-compatible bison-runtime.po files in a different way.
6060 * data/glr.c (YY_): New macro, from yacc.c.
6061 (yyuserAction, yyreportAmbiguity, yyreportSyntaxError, yyparse):
6062 Translate messages intended for users.
6063 (yyreportSyntaxError): Change "virtual memory" to "memory" to match
6064 the wording in the other skeletons. We don't know that the memory
6065 is virtual.
6066 * data/lalr1.cc (YY_): Renamed from _. All uses changed.
6067 Use same method that yacc.c uses.
6068 Don't translate debugging messages.
6069 (yy::yyreport_syntax_error): Put in a FIXME for the i18n stuff;
6070 it doesn't work (yet), and requires C++ expertise to fix.
6071 * data/yacc.c (YY_): Renamed from YY18N. All uses changed.
6072 Move defn to a more logical place, to be consistent with other
6073 skeletons.
6074 Don't translate debugging messages.
6075 Don't assume line numbers fit in unsigned int; use unsigned long fmts.
6076 * doc/bison.texinfo: Mention <libintl.h>. Change glibc cross reference
6077 to gettext cross reference. Add indexing terms. Mention YYENABLE_NLS.
6078 * runtime-po/POTFILES.in: Add data/glr.c, data/lalr1.cc.
6079
ac8c5689
PE
6080 Fix yyerror / yylex test glitches noted by twlevo@xs4all.nl.
6081 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Have yyerror return
6082 void, not int.
6083 * tests/glr-regression.at (Badly Collapsed GLR States):
6084 Likewise.
6085 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
6086 yylex should return 0 at EOF rather than aborting.
6087
6100a9aa
PE
6088 Improve tests for stack overflow in GLR parser.
6089 Problem reported by twlevo@xs4all.nl.
6090 * data/glr.c (struct yyGLRStack): Remove yyerrflag member.
6091 All uses removed.
6092 (yyStackOverflow): Just longjmp, but with value 2 so that caller
6093 can handle the problem.
6094 (YYCHK1): Use goto (a la yacc.c) rather than setting a flag.
6095 (yyparse): New local variable yyresult to record the result.
6096 Use result of setjmp to set it, rather than storing itinto
6097 struct.
6098 (yyDone): Remove label.
6099 (yyacceptlab, yyabortlab, yyoverflowlab, yyreturn): New labels,
6100 to mimic yacc.c. Do not discard lookahead if it's EOF (possible
6101 if YYABORT is used).
6102 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Exit with
6103 yyparse status; put status > 1 into diagnostic.
6104 Check that status==2 works.
6105 * tests/calc.at, tests/cxx-type.at, tests/glr-regression.at:
6106 Use exit status 3 for failure to open (which shouldn't happen).
6107
15f40952
PE
61082005-07-17 Paul Eggert <eggert@cs.ucla.edu>
6109
67fd79c4
PE
6110 * tests/conflicts.at (%nonassoc and eof): Don't exit with status
6111 1 on syntax error; just let yyparse do its thing.
6112 * tests/glr-regression.at (Badly Collapsed GLR States): Likewise.
6113 * tests/torture.at (AT_DATA_STACK_TORTURE): Likewise.
6114 (Exploding the Stack Size with Alloca):
6115 (Exploding the Stack Size with Malloc):
6116 Expect exit status 2, not 1, since the parser is supposed to blow
6117 its stack. Problem reported by twlevo@xs4all.nl.
6118
15f40952
PE
6119 * data/glr.c (yyparse): Don't assume that the initial calls
6120 to YYMALLOC succeed; in that case, yyparse incorrectly returned 0.
6121 Print a stack-overflow message and fail instead.
6122 Initialize the line-number information before creating the stack,
6123 so that the stack-overflow message can report line zero safely.
6124
f32c66b5
PE
61252005-07-14 Paul Eggert <eggert@cs.ucla.edu>
6126
a22ff96f 6127 Fix problems reported by twlevo@xs4all.nl.
e2688cd9
PE
6128 * data/glr.c (YYSTACKEXPANDABLE): Don't define if already defined.
6129 (yyuserMerge): Provide a default case if b4_mergers is empty.
6130 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Define YYSTACKEXPANDABLE.
6131 * tests/glr-regression.at
6132 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
c70fdfcd 6133 Add casts to pacify C++ compilers.
1beb0b24
PE
6134 * tests/glr-regression.at (Improper merging of GLR delayed action
6135 sets): Declare yylex before using it.
f32c66b5 6136 * tests/Makefile.am (maintainer-check-g++): Fix a stray
a22ff96f
PE
6137 $(GXX) that escaped the renaming of GXX to CXX. Remove bogus
6138 test for valgrind; valgrind is independent of g++.
6139 (maintainer-check-posix): Add _POSIX2_VERSION=200112, to check
6140 for compatibility with POSIX 1003.1-2001 (if running coreutils).
6141 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Port to stricter C++.
6142 Use a destructor, so that we can expand the stack. Change
6143 YYSTYPE to char * so that we can free it. Cast result of malloc.
f32c66b5 6144
d741bd1b
PE
61452005-07-13 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
6146
6147 * data/glr.c (yyuserAction): Fix uninitialized variable that caused
6148 a valgrind failure. Problem reported by twlevo@xs4all.nl.
6149
0410a6e0
PE
61502005-07-13 Paul Eggert <eggert@cs.ucla.edu>
6151
6152 * PACKAGING: New file, suggested by Bruno Haible and taken from
6153 similar wording in gettext's PACKAGING file.
6154 * NEWS: Mention PACKAGING.
6155 * Makefile.am (EXTRA_DIST): Add PACKAGING.
6156
f7ab6a50
PE
61572005-07-12 Paul Eggert <eggert@cs.ucla.edu>
6158
baf785db 6159 * NEWS: Document recent i18n improvements.
f7ab6a50
PE
6160 * bootstrap: Get runtime translations into runtime-po.
6161 Create runtime-po files automatically, if possible.
6162 * configure.ac: Invoke BISON_I18N, so that we eat our own dog food.
6163 * data/yacc.c: Rewrite inclusion of <libintl.h> so that ENABLE_NLS
6164 does not infringe on the user's name space.
6165 (YYENABLE_NLS): Renamed from ENABLE_BISON_NLS.
6166 * doc/bison.texinfo (Internationalization): Revamp the English
6167 and Texinfo syntax a bit, to try to make it clearer.
6168 (Bison Options, Option Cross Key): Mention --print-localedir.
6169 * m4/bison-i18n.m4 (BISON_I18N): Rename ENABLE_BISON_NLS to
6170 YYENABLE_NLS. Quote a bit more.
6171 * runtime-po/.cvsignore: New file.
6172 * runtime-po/Makefile.in.in (mostlyclean): Remove *.old.pot.
6173 * runtime-po/Rules-quot: Remove; now created by bootstrap.
6174 * runtime-po/quot.sed: Likewise.
6175 * runtime-po/boldquot.sed: Likewise.
6176 * runtime-po/en@quot.header: Likewise.
6177 * runtime-po/en@boldquot.header: Likewise.
6178 * runtime-po/insert-header.sin: Likewise.
6179 * runtime-po/remove-potcdate.sin: Likewise.
6180 * runtime-po/Makevars: Likewise.
6181 * runtime-po/LINGUAS: Likewise.
6182 * runtime-po/de.po: Likewise; we will rely on the translation project
6183 to maintain this, so "bootstrap" should get it.
0410a6e0 6184 * src/getarg.c (PRINT_LOCALEDIR_OPTION): Let the C compiler determine
f7ab6a50
PE
6185 its value.
6186 * src/main.c (main): Bind the bison-runtime domain, too.
6187
61882005-07-12 Bruno Haible <bruno@clisp.org>
6189
6190 * data/yacc.c: Include <libintl.h> when NLS is enabled.
6191 (YYI18N): Renamed from _. Use dgettext when NLS is enabled.
6192 * po/POTFILES.in: Remove autogenerated file src/parse-gram.c.
6193 * runtime-po: New directory.
6194 * runtime-po/Makefile.in.in: New file, copied from po/, with modified
6195 $(DOMAIN).pot-update rule, so that old messages are never dropped.
6196 * runtime-po/Rules-quot: New file, copied from po/.
6197 * runtime-po/quot.sed: Likewise.
6198 * runtime-po/boldquot.sed: Likewise.
6199 * runtime-po/en@quot.header: Likewise.
6200 * runtime-po/en@boldquot.header: Likewise.
6201 * runtime-po/insert-header.sin: Likewise.
6202 * runtime-po/remove-potcdate.sin: Likewise.
6203 * runtime-po/Makevars: New file.
6204 * runtime-po/POTFILES.in: New file.
6205 * runtime-po/LINGUAS: New file.
6206 * runtime-po/bison-runtime.pot: New file.
6207 * runtime-po/de.po: New file.
6208 * m4/bison.m4: New file.
6209 * Makefile.am (SUBDIRS): Add runtime-po.
6210 (aclocaldir, aclocal_DATA): New variables.
6211 * configure.ac: Add AC_CONFIG_FILES of runtime-po/Makefile.in.
6212 Define aclocaldir.
6213 * src/getargs.c (usage): Document --print-localedir option.
6214 (PRINT_LOCALEDIR_OPTION): New enum item.
6215 (long_options): Add --print-localedir option.
6216 (getargs): Handle --print-localedir option.
6217 * doc/bison.texinfo (Bison Parser): Remove paragraph about _().
6218 (Internationalization): New section.
6219
22dda0f0
AD
62202005-07-12 Akim Demaille <akim@epita.fr>
6221
6222 * src/symtab.h, src/symtab.c (symbol_print): Swap the arguments,
6223 for consistency with the rest of the code.
6224 * src/symlist.h, src/symlist.c (symbol_list_print): Ditto.
6225 Add separators.
6226
82b248ad
AD
62272005-07-12 Akim Demaille <akim@epita.fr>
6228
6229 * src/parse-gram.y: Use %printer instead of YYPRINT.
6230
fa0e9314
AD
62312005-07-12 Akim Demaille <akim@epita.fr>
6232
867a3e00
AD
6233 * src/symtab.h, src/symtab.c (symbol_print): New.
6234 * src/symlist.h, src/symlist.c (symbol_list_print): New.
6235 * src/symlist.c (symbol_list_n_type_name_get): Report the culprit.
6236
62372005-07-12 Akim Demaille <akim@epita.fr>
6238
6239 * data/glr.c (b4_syncline): Fix (swap) the definitions of
fa0e9314
AD
6240 b4_at_dollar and b4_dollar_dollar.
6241
e054b190
PE
62422005-07-11 Paul Eggert <eggert@cs.ucla.edu>
6243
6244 * doc/bison.texinfo (Mystery Conflicts): Add reference to DeRemer
6245 and Pennello's paper.
6246
34160ec4
PE
62472005-07-09 Paul Eggert <eggert@cs.ucla.edu>
6248
407d4a75
PE
6249 * data/yacc.c (yyparse): Undo previous patch. Instead,
6250 set yylsp[0] and yyvsp[0] only if the initial action
6251 sets yylloc and yylval, respectively.
6252
34160ec4
PE
6253 * data/yacc.c (yyparse): In the initial action, set
6254 yylsp[0] and yyvsp[0] rather than yylloc and yylval.
6255 This avoids the use of undefined variables if the initial
6256 action does not set yylloc and/or yylval.
6257
c3d5a4a7
PE
62582005-07-07 Paul Eggert <eggert@cs.ucla.edu>
6259
b34d96c1
PE
6260 * examples/calc++/calc++-driver.cc, examples/calc++/calc++-driver.hh:
6261 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc:
6262 Remove from CVS. These files are automatically generated.
6263 * examples/extexi: Clarify that this file is now part of Bison,
6264 not GNU M4, and that it works with any POSIX-compatible Awk.
6265 * examples/calc++/Makefile.am (run_extexi): Remove; not used.
6266 ($(calc_extracted)): Renamed from $(calc_sources_extracted),
6267 so that we also get calc++-parser.yy. Geneate it.
6268 Use $(AWK), not gawk, since any conforming Awk will do.
6269 Put comment before action, since older 'make' can't handle comment
6270 in action.
6271 $(BUILT_SOURCES): List all built sources, not just some of them.
6272 $(MAINTAINERCLEANFILES): Remove *.stamp, and all built sources.
6273 $($(srcdir)/calc++-parser.stamp): Work even if POSIXLY_CORRECT.
6274 $($(calc_sources_generated)): Remove unnecessary test for existence
6275 of target. (This had a shell syntax error anyway; a stray "x".)
6276 (calc_extracted): List $(srcdir)/calc++-parser.yy, not
6277 calc++-parser.yy.
6278 * examples/.cvsignore, examples/calc++/.cvsignore: New files.
6279
c3d5a4a7
PE
6280 * bootstrap (gnulib_modules): Add gettext, now that it's no longer
6281 implied by the other modules.
6282
828c373b
AD
62832005-07-06 Akim Demaille <akim@epita.fr>
6284
6285 Bind examples/calc++ to the package.
6286 * examples/calc++/Makefile: Remove, replaced by...
6287 * examples/calc++/Makefile.am: ... this new file.
6288 * examples/calc++/test: Remove input.
6289 * examples/calc++/compile: Remove.
6290 * examples/Makefile.am: New.
6291 * configure.ac, Makefile.am: Adjust.
6292 * doc/Makefile.am (clean-local): New, for more recent texi2dvis.
6293
63cb01d6
PE
62942005-07-05 Paul Eggert <eggert@cs.ucla.edu>
6295
fd2df2ed
PE
6296 * data/glr.c (yyFail): Drastically simplify; since the format argument
6297 never had any % directives, we can simply pass it to yyerror.
6298 (yyparse): Use "t a; a=b;" rather than "t a = b;" when a will
6299 be modified later, as that is the usual style in glr.c.
6300 Problems reported by Paul Hilfinger.
6301
63cb01d6
PE
6302 Rewrite GLR parser to catch more buffer overrun, storage exhaustion,
6303 and size overflow errors.
6304 * data/glr.c: Include <stdio.h> etc. after user prolog, not before,
6305 in case the user prolog sets feature-test macros like _GNU_SOURCE.
6306 (YYSIZEMAX): New macro.
6307 (yystpcpy): New function, taken from yacc.c.
6308 (struct yyGLRStack.yyspaceLeft): Now size_t, not int.
6309 (yyinitGLRStack, yyfreeGLRstack): Remove unnecessary forward decls,
6310 so that we don't have to maintain their signatures.
6311 (yyFail): Check for buffer overflow, by using vsnprintf rather
6312 than vsprintf. Allocate a bigger buffer if possible.
6313 Report an error if buffer allocation fails.
6314 (yyStackOverflow): New function.
6315 (yyinitStateSet, yyinitGLRStack): Return a boolean indicating whether
6316 the initialization was successful. It might fail if storage was
6317 exhausted.
6318 (yyexpandGLRStack): Add more checks for storage allocation failure.
6319 Use yyStackOverflow to report failures.
6320 (yymarkStackDeleted, yyglrShift, yyglrShiftDefer, yydoAction):
6321 (yysplitStack, yyprocessOneStack, yyparse, yypstack):
6322 Don't assume stack number fits in int.
6323 (yysplitStack): Check for storage allocation failure.
6324 (yysplitStack, yyprocessOneStack): Add pure_formals, so that we
6325 can print diagnostics on storage allocation failure. All callers
6326 changed.
6327 (yyresolveValue): Use yybool for boolean.
6328 (yyreportSyntaxError): Check for size-calculation overflow.
6329 This code is taken from yacc.c.
6330 (yyparse): Check for storage allocation errors when allocating
6331 the initial stack.
6332
1c59e0a1
AD
63332005-07-05 Akim Demaille <akim@epita.fr>
6334
6335 Extract calc++ from the documentation.
6336 * doc/bison.texinfo (Calc++): Add the extraction marks.
6337 * examples/extexi: New, from the aborted GNU Programming 2E.
6338 Separate the different paragraph of a file with empty lines.
6339 * examples/Makefile: Use it to extract the whole calc++ example.
6340
8a0adb01
AD
63412005-06-24 Akim Demaille <akim@epita.fr>
6342
6343 * doc/bison.texinfo (C++ Parser Interface): Use defcv to define
6344 class typedefs.
6345
12545799
AD
63462005-06-22 Akim Demaille <akim@epita.fr>
6347
6348 * doc/bison.texinfo (C++ Language Interface): First stab.
6349 (C++ Parsers): Remove.
6350
99be0235
AD
63512005-06-22 Akim Demaille <akim@epita.fr>
6352
6353 * data/lalr1.cc (yylex_): Honor %lex-param.
6354
0ffd4fd1
AD
63552005-06-22 Akim Demaille <akim@epita.fr>
6356
6357 Start a set of simple examples.
6358 * examples/calc++/Makefile, examples/calc++/calc++-driver.cc,
6359 * examples/calc++/calc++-driver.hh,
6360 * examples/calc++/calc++-parser.yy,
6361 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc,
6362 * examples/calc++/compile, examples/calc++/test: New.
6363
0925ebb4
PE
63642005-06-09 Paul Eggert <eggert@cs.ucla.edu>
6365
6366 * data/yacc.c (malloc, free) [defined __cplusplus]: Wrap inside
6367 extern "C" {}. This fixes a problem reported by Paul Hilfinger,
6368 which stems from the 2005-05-27 patch.
6369
43d3b664
PH
63702005-06-06 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
6371
6372 * data/glr.c: Modify treatment of unused parameters to permit use
6373 of g++ (which doesn't allow __attribute__ ((unused)) for parameters).
6374
3062864d
PE
63752005-05-30 Paul Eggert <eggert@cs.ucla.edu>
6376
6377 Fix infringement on user name space reported by Janos Zoltan Szabo.
6378 * data/yacc.c (yyparse): strlen -> yystrlen.
6379
989b5b8e
AD
63802005-05-30 Akim Demaille <akim@epita.fr>
6381
6382 * data/lalr1.cc (_): New.
6383 Translate the various messages.
6384
bedf57f5
PE
63852005-05-27 Paul Eggert <eggert@cs.ucla.edu>
6386
6387 Fix infringement on user name space reported by Bruno Haible.
6388 * data/yacc.c (YYSIZE_T): Define first, so that later decls can use it.
6389 Prefer GCC's __SIZE_TYPE__ if available, so that we don't infringe on
6390 the user's name space.
6391 (alloca): Include <stdlib.h> to get it, if it's not built in.
6392 (YYMALLOC, YYFREE): Define only if needed.
6393 (malloc, free): Declare, but only if needed, as this infringes on
6394 the user name space.
6395
4d1801f1
PE
63962005-05-25 Paul Eggert <eggert@cs.ucla.edu>
6397
6398 Fix BeOS, FreeBSD, MacOS porting problems reported by Bruno Haible.
6399 * lib/bitset.c (bitset_print): Don't assume size_t can be printed
6400 with %d format.
6401 * lib/ebitset.c (min, max): Undef before defining.
6402 * lib/vbitset.c (min, max): Likewise.
6403 * lib/subpipe.c (create_subpipe): Save local variables in case
6404 vfork clobbers them.
6405
64062005-05-24 Bruno Haible <bruno@clisp.org>
6407
6408 * tests/synclines.at (AT_SYNCLINES_COMPILE): Add support for the
6409 error message syntax used by gcc-4.0.
6410
b94a9e1e
PE
64112005-05-23 Paul Eggert <eggert@cs.ucla.edu>
6412
85ac3861
PE
6413 * README: Mention m4 1.4.3. Remove obsolete advice about
6414 Sun Forte Developer 6 update 2, VMS, and MS-DOS.
6415
b94a9e1e
PE
6416 * bootstrap: Remove workaround for problem I encountered with
6417 gettext 0.14.1; it seems to be fixed now.
6418
51c30d21
PE
64192005-05-22 Paul Eggert <eggert@cs.ucla.edu>
6420
009ce67d
PE
6421 * NEWS: Version 2.0a.
6422
f2a97c62
PE
6423 * src/files.c: Include "stdio-safer.h"; this fixes a typo in
6424 the previous change.
6425
c8775f93
PE
6426 Various maintainer cleanups.
6427 * .cvsignore: Add a.exe, a.out, b.out,, conf[0-9]*, confdefs*,
6428 conftest*, for benefit of CVS commands run at the same time as
6429 "configure". Add build-aux, since "bootstrap" now creates it and
6430 its subfiles.
6431 * Makefile.cfg (move_if_change): Remove.
6432 * Makefile.maint: Remove the update stuff; we now use "bootstrap".
6433 (ftp-gnu, www-gnu, move_if_change, local_updates, update):
6434 (po_repo, do-po-update, po-update, wget_files, get-targets):
6435 (config.guess-url_prefix, config.sub-url_prefix):
6436 (ansi2knr.c-url_prefix, texinfo.tex-url_prefix):
6437 (standards.texi-url_prefix, make-stds.texi-url_prefix, taget, url):
6438 ($(get-targets), cvs-files, automake_repo, wget-update, cvs-update):
6439 Remove.
6440 * configure.ac (AC_CONFIG_AUX_DIR): Change from config to build-aux;
6441 this is now the recommended name.
6442 * config/.cvsignore: Remove config.guess, config.rpath, config.sub,
6443 depcomp, install-sh, mdate-sh, missing, mkinstalldirs, texinfo.tex,
6444 ylwrap. These files now go into build-aux.
6445 * config/move-if-change: Remove.
6446 * config/prev-version.txt: Bump from 1.75 to 2.0.
6447
3ea5f0ec
PE
6448 * bootstrap: Add stdio-safer, unistd-safer modules.
6449 Remove m4/glibc2.m4 (introduced by latest gnulib, but
6450 we don't need it).
6451 * lib/.cvsignore: Add dup-safer.c, fd-safer.c,
6452 fopen-safer.c, stdio-safer.h, unistd-safer.h.
6453 * lib/subpipe.c: Include "unistd-safer.h".
6454 (create_subpipe): Make sure all the newly-created
6455 file descriptors are > 2, so that diagnostics don't
6456 get sent down them (which might cause Bison to hang, in theory).
6457 * m4/.cvsignore: Add stdio-safer.m4, unistd-safer.m4.
6458 * src/files.c (xfopen): Use fopen_safer, not fopen.
6459
51c30d21
PE
6460 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Port
6461 yesterday's yacc.c fix.
6462
cea1469d
PE
64632005-05-21 Paul Eggert <eggert@cs.ucla.edu>
6464
3ea5f0ec
PE
6465 * data/glr.c, data/lalr1.cc: Update copyright date.
6466
cea1469d
PE
6467 Fix a destructor bug reported by Wolfgang Spraul in
6468 <http://lists.gnu.org/archive/html/bug-bison/2005-05/msg00042.html>.
6469 * data/yacc.c (yyabortlab): Don't call destructor, and
6470 don't set yychar to EMPTY.
6471 (yyoverflowlab): Don't call destructor.
6472 (yyreturn): Call destructor, if yychar is neither YYEOF nor YYEMPTY.
6473 * tests/calc.at (AT_CHECK_CALC): Expect one fewer output lines,
6474 since we no longer output the message "discarding lookahead token
6475 end of input ()".
6476
5e6f62f2
PH
64772005-05-20 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
6478
6479 * data/glr.c (YY_SYMBOL_PRINT): Don't print newline at end to
6480 fix a small glitch in debugging output.
6481 (yyprocessOneStack, yyrecoverSyntaxError, yyparse): Print newline
6482 after YY_SYMBOL_PRINT where needed.
6483
6484 (struct yyGLRState): Add some comments.
6485 (struct yySemanticOption): Add some comments.
6486 (union yyGLRStackItem): Add comment.
6487
6488 (yymergeOptionSets): Correct this to properly perform the union,
6489 avoiding infinite reported by Michael Rosien.
6490 Update comment.
6491
6492 * tests/glr-regression.at: Add test for GLR merging error reported
6493 by M. Rosien.
cea1469d 6494
0fb669f9
PE
64952005-05-13 Paul Eggert <eggert@cs.ucla.edu>
6496
6497 * COPYING, ChangeLog, GNUmakefile, HACKING, Makefile.am,
6498 Makefile.cfg, Makefile.maint, NEWS, README, README-alpha,
6499 README-cvs, TODO, bootstrap, configure.ac, data/Makefile.am,
6500 data/README, data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c,
6501 data/m4sugar/m4sugar.m4, doc/Makefile.am, doc/bison.texinfo,
6502 doc/fdl.texi, doc/gpl.texi, doc/refcard.tex, lib/Makefile.am,
6503 lib/abitset.c, lib/abitset.h, lib/bbitset.h, lib/bitset.c,
6504 lib/bitset.h, lib/bitset_stats.c, lib/bitset_stats.h,
6505 lib/bitsetv-print.c, lib/bitsetv-print.h, lib/bitsetv.c,
6506 lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/get-errno.c,
6507 lib/get-errno.h, lib/lbitset.c, lib/lbitset.h, lib/libiberty.h,
6508 lib/main.c, lib/subpipe.c, lib/subpipe.h, lib/timevar.c,
6509 lib/timevar.def, lib/timevar.h, lib/vbitset.c, lib/vbitset.h,
6510 lib/yyerror.c, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4, m4/timevar.m4,
6511 m4/warning.m4, src/LR0.c, src/LR0.h, src/Makefile.am, src/assoc.c,
6512 src/assoc.h, src/closure.c, src/closure.h, src/complain.c,
6513 src/complain.h, src/conflicts.c, src/conflicts.h, src/derives.c,
6514 src/derives.h, src/files.c, src/files.h, src/getargs.c,
6515 src/getargs.h, src/gram.c, src/gram.h, src/lalr.c, src/lalr.h,
6516 src/location.c, src/location.h, src/main.c, src/muscle_tab.c,
6517 src/muscle_tab.h, src/nullable.c, src/nullable.h, src/output.c,
6518 src/output.h, src/parse-gram.c, src/parse-gram.h,
6519 src/parse-gram.y, src/print.c, src/print.h, src/print_graph.c,
6520 src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c,
6521 src/reduce.h, src/relation.c, src/relation.h, src/scan-gram.l,
6522 src/scan-skel.l, src/state.c, src/state.h, src/symlist.c,
6523 src/symlist.h, src/symtab.c, src/symtab.h, src/system.h,
6524 src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h,
6525 src/vcg.c, src/vcg.h, src/vcg_defaults.h, tests/Makefile.am,
6526 tests/actions.at, tests/c++.at, tests/calc.at, tests/conflicts.at,
6527 tests/cxx-type.at, tests/existing.at, tests/glr-regression.at,
6528 tests/headers.at, tests/input.at, tests/local.at, tests/output.at,
6529 tests/reduce.at, tests/regression.at, tests/sets.at,
6530 tests/synclines.at, tests/testsuite.at, tests/torture.at:
6531 Update FSF postal mail address.
6532
51f4735e
PE
65332005-05-11 Paul Eggert <eggert@cs.ucla.edu>
6534
6535 * tests/local.at (AT_COMPILE_CXX): Treat LDFLAGS like AT_COMPILE does.
6536 Problem reported by Ralf Menzel.
6537
80ce3401
PE
65382005-05-01 Paul Eggert <eggert@cs.ucla.edu>
6539
6540 * tests/actions.at: Test that stack overflow invokes destructors.
6541 From Marcus Holland-Moritz.
6542 * data/yacc.c (yyerrlab): Move the code that destroys the stack
6543 from here....
6544 (yyreturn): to here. That way, destructors are called properly
6545 even if the stack overflows, or the user calls YYACCEPT or
6546 YYABORT. Stack-overflow problem reported by Marcus Holland-Moritz.
6547 (yyoverflowlab): Destroy the lookahead.
6548
65492005-04-24 Paul Eggert <eggert@cs.ucla.edu>
6550
6551 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): Add more-descriptive comment.
6552
72f000b0
PE
65532005-04-17 Paul Eggert <eggert@cs.ucla.edu>
6554
6555 * NEWS: Bison-generated C parsers no longer quote literal strings
6556 associated with tokens.
6557 * src/output.c (prepare_symbols): Don't escape strings,
6558 since users don't want to see C escapes.
6559 * tests/calc.at (AT_CHECK_CALC): Adjust to lack of quotes
6560 in diagnostics.
c19683bb 6561 * tests/input.at (Torturing the Scanner): Likewise.
72f000b0
PE
6562 * tests/regression.at (Token definitions, Web2c Actions): Likewise.
6563
1094323f
PE
65642005-04-16 Paul Eggert <eggert@cs.ucla.edu>
6565
6566 * tests/torture.at (AT_INCREASE_DATA_SIZE): Skip the test if
6567 the data size is known to be too small and we can't increase it.
6568 This works around an HP-UX 11.00 glitch reported by Andrew Benham.
6569
ca407bdf
PE
65702005-04-15 Paul Eggert <eggert@cs.ucla.edu>
6571
6572 * src/parse-gram.y: Include quotearg.h.
6573 (string_as_id): Quote $1 before using it as a key, since the
6574 lexer no longer quotes it for us.
6575 (string_content): Don't strip quotes, since lexer no longer
6576 quotes it for us.
6577 * src/scan-gram.l: Include quotearg.h.
6578 ("\""): Omit quote.
6579 ("'"<SC_ESCAPED_CHARACTER>): Quote symbol before using it as
6580 a key, since the rest of the lexer doesn't quote it.
6581 * src/symtab.c (symbol_get): Don't quote symbol; caller does it now.
6582 * tests/regression.at (Token definitions): Check for backslashes
6583 in token strings.
6584
6585 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): New macro.
6586 (YYSIZE_T): Define to unsigned long int when using an older compiler.
6587 (yyparse): Revamp code to generate long syntax error message, to
6588 make it easier to translate, and to avoid problems with arithmetic
6589 overflow. Change "virtual memory" to "memory" in diagnostic, since
6590 we don't know whether the memory is virtual.
6591
1ce59070
PE
65922005-04-13 Paul Eggert <eggert@cs.ucla.edu>
6593
6594 * NEWS: Bison-generated C parsers now use the _ macro to
6595 translate strings.
6596 * data/yacc.c (_) [!defined _]: New macro.
6597 All English strings wrapped inside this macro.
6598 * doc/bison.texinfo (Bison Parser): Document _.
6599 * po/POTFILES.in: Include src/parse-gram.c, since it now
6600 includes translateable strings that parse-gram.y doesn't.
6601
a749a695
PE
66022005-04-12 Paul Eggert <eggert@cs.ucla.edu>
6603
6604 * src/symtab.c (symbol_make_alias): Call symbol_type_set,
6605 reverting the 2004-10-11 change to this function.
6606 (symbol_check_alias_consistency): Don't call symbol_type_set
6607 if the type name is already correct.
6608 * tests/input.at (Typed symbol aliases): New test, from Tim Van Holder.
6609
8fb1053b
PE
66102005-03-25 Paul Eggert <eggert@cs.ucla.edu>
6611
6612 * tests/regression.at (Token definitions): Don't use a token named
6613 c, as that generates a "#define c ..." that runs afoul of buggy
6614 stdlib.h that uses the identifier c as a member of struct
6615 drand48_data. Problem reported by Horst Wente.
6616
ff498c4a
PE
66172005-03-21 Paul Eggert <eggert@cs.ucla.edu>
6618
6619 * bootstrap: Change translation URL from
6620 http://www2.iro.umontreal.ca/~gnutra/po/maint/bison/ to
6621 http://www.iro.umontreal.ca/translation/maint/bison/ to avoid
6622 redirection glitches. Problem reported by twlevo@xs4all.nl.
6623
65211d70
PE
66242005-03-20 Paul Eggert <eggert@cs.ucla.edu>
6625
6626 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Don't put options
6627 after operands; POSIX says this isn't portable for the c99 command.
6628
9577fb1f
PE
66292005-03-18 Paul Eggert <eggert@cs.ucla.edu>
6630
6631 * tests/glr-regression.at (glr-regr2a.y): Try to dump core
6632 immediately if a data overrun has occurred; this may help us track
6633 down what may be a spurious failure on MacOS.
6634
78b178f7
PE
66352005-03-17 Paul Eggert <eggert@cs.ucla.edu>
6636
a2599d0f
PE
6637 Respond to problems reported by twlevo@xs4all.nl.
6638
6639 * bootstrap: Use "trap - 0" rather than the unportable "trap 0".
6640
78b178f7
PE
6641 * src/vcg.h: Comment fix.
6642 * src/vcg_defaults.h: Parenthesize macro bodies to make them safe.
6643 (G_CMAX): Change to -1 instead of INT_MAX.
6644
6645 * data/yacc.c (yyparse): Omit spaces before #line.
78b178f7 6646
7296e729
PE
66472005-03-15 Paul Eggert <eggert@cs.ucla.edu>
6648
6649 * src/tables.c (state_number_to_vector_number): Put it inside an
6650 "#if 0", since it's not currently used. Problem reported by
6651 Roland McGrath.
6652
05ac60f3
PE
66532005-03-06 Paul Eggert <eggert@cs.ucla.edu>
6654
6655 * src/output.c (escaped_output): Renamed from
6656 escaped_file_name_output, since we now use it for symbol tags as
6657 well. All uses changed.
6658 (symbol_destructors_output, symbol_printers_output):
6659 Escape symbol tags too.
6660 Problem reported by Matyas Forstner in
6661 <http://lists.gnu.org/archive/html/bug-bison/2005-03/msg00009.html>.
6662
6663 * src/muscle_tab.c (muscle_code_grow): Don't quote numbers; it's
6664 not needed.
6665 * src/output.c (user_actions_output, token_definitions_output,
6666 symbol_destructors_output, symbol_printers_output): Likewise.
6667 * src/reader.c (prologue_augment): Likewise.
6668 * src/scan-gram.l (handle_action_dollar, handle_action_at): Likewise.
6669
6670 * src/vcg.c (output_edge): Don't quote linestyle arg.
6671 Problem reported by twlevo@xs4all.nl.
6672
7eb453ac
PE
66732005-02-28 Paul Eggert <eggert@cs.ucla.edu>
6674
6675 * doc/bison.texinfo (Semantic Tokens): Fix scoping problem in
6676 example, reported by Derek M Jones. Also, make the example even
6677 more outrageous, to better illustrate how bad the problem is.
6678
4c04c52a
PE
66792005-02-24 Paul Eggert <eggert@cs.ucla.edu>
6680
6681 * doc/bison.texinfo (Mfcalc Symtab): Correct the prototype for
6682 putsym. Typo reported by Sebastian Piping.
6683
a61e1620
PE
66842005-02-23 Paul Eggert <eggert@cs.ucla.edu>
6685
6686 * doc/bison.texinfo (Language and Grammar): some -> same
6687 (Epilogue): int he -> in the
6688 Typos reported by Sebastian Piping via Justin Pence.
6689
9ec93868
PE
66902005-02-07 Paul Eggert <eggert@cs.ucla.edu>
6691
6692 * tests/glr-regression.at (Improper handling of embedded actions
6693 and dollar(-N) in GLR parsers): Renamed from "Improper handling of
6694 embedded actions and $-N in GLR parsers", work around an Autoconf bug
6695 with dollar signs in test names.
6696 * tests/input.at (Invalid dollar-n): Renamed from "Invalid \$n",
6697 for a similar reason.
6698
73ce7e7e
PE
66992005-01-28 Paul Eggert <eggert@cs.ucla.edu>
6700
6701 * src/vcg.c (output_graph): G_VIEW -> normal_view in case someone
6702 wants to redefine G_VIEW.
6703
2e72b98e
PE
67042005-01-27 Paul Eggert <eggert@cs.ucla.edu>
6705
6706 * src/vcg.c (get_view_str): Remove case for normal_view.
6707 Problem reported by twlevo@xs4all.nl.
6708
e0d634e5
PE
67092005-01-24 Paul Eggert <eggert@cs.ucla.edu>
6710
ccf830a4
PE
6711 * configure.ac (O0CFLAGS, O0CXXFLAGS): Fix quoting bug.
6712 Problem reported by twlevo@xs4all.nl.
6713
e0d634e5
PE
6714 * doc/bison.texinfo: Change @dircategory from "GNU programming
6715 tools" to "Software development". Requested by Richard Stallman
6716 via Karl Berry.
6717
7bbc8cb0
PE
67182005-01-23 Paul Eggert <eggert@cs.ucla.edu>
6719
6720 * tests/c++.at (AT_CHECK_DOXYGEN): Don't use options after operands.
6721 Problem reported by twlevo@xs4all.nl.
6722
08b770bc
PE
67232005-01-21 Paul Eggert <eggert@cs.ucla.edu>
6724
6725 * data/yacc.c (YYCOPY, yystpcpy, yyparse): Remove "register"
6726 keyword; it's not needed with modern compilers, and it doesn't
6727 affect correctness with older compilers. Suggested by
6728 twlevo@xs4all.nl.
6729
95f22ad2
PE
67302005-01-17 Paul Eggert <eggert@cs.ucla.edu>
6731
6732 * data/glr.c (yyuserAction): Add "default: break;" case to pacify
6733 gcc -Wswitch-default.
6734 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
6735 * data/yacc.c (yyparse): Likewise.
6736
d229d15c
PE
67372005-01-12 Paul Eggert <eggert@cs.ucla.edu>
6738
6739 * src/system.h (OUTPUT_EXT, TAB_EXT): Define only if not defined
6740 already. Let config.h define any nonstandard values.
6741
ecadd90f
PE
67422005-01-10 Paul Eggert <eggert@cs.ucla.edu>
6743
6744 * tests/calc.at (_AT_DATA_CALC_Y): Use alarm (100), not alarm (10),
6745 for the benefit of slower hosts. Problem reported by
6746 Nelson H. F. Beebe.
6747
213744b5
PE
67482005-01-07 Paul Eggert <eggert@cs.ucla.edu>
6749
6750 * data/yacc.c (yyparse): Pacify non-GCC compilers about yyerrorlab
6751 being defined and not used.
6752 * data/lalr1.cc (yyparse): Likewise.
6753 Use "if (false)" rather than "if (0)".
6754
249d3236
PE
67552005-01-05 Paul Eggert <eggert@cs.ucla.edu>
6756
6757 * TODO: Mention that we should allow NUL bytes in tokens.
6758
987cc1fb
PE
67592005-01-02 Paul Eggert <eggert@cs.ucla.edu>
6760
6761 * src/scan-skel.l (<<EOF>>): Don't close standard output.
6762 Problem reported by Hans Aberg.
6763
08fe02d9
PE
67642005-01-01 Paul Eggert <eggert@cs.ucla.edu>
6765
6766 * src/getargs.c (version): Happy new year; update overall
6767 program copyright date from 2004 to 2005.
6768
6769 * src/scan-skel.l ("@output ".*\n): Don't close standard output.
6770 Problem reported by Hans Aberg.
6771 * tests/output.at (AT_CHECK_OUTPUT): New arg SHELLIO.
6772 (Output file names.): Add a test for the case when standard output
6773 is closed.
6774
010c0266
PE
67752004-12-26 Paul Eggert <eggert@cs.ucla.edu>
6776
6777 * doc/bison.texinfo (@copying): Update FDL version number to 1.2,
6778 to fix an oversight in the Bison 2.0 manual.
6779
da12206a
PE
67802004-12-25 Paul Eggert <eggert@cs.ucla.edu>
6781
6782 * NEWS: Version 2.0. Reformat the existing news items since
6783 1.875, so that related items are grouped together.
3a4734aa 6784 * configure.ac (AC_INIT): Bump version to 2.0.
da12206a
PE
6785 * src/parse-gram.c, src/parse-gram.h: Regenerate with 2.0.
6786
c935d934
PE
6787 * tests/torture.at (Exploding the Stack Size with Alloca): Set
6788 YYSTACK_USE_ALLOCA to 1 if __GNUC__ or alloca are defined;
6789 otherwise, we're not testing alloca. Unfortunately there's no
6790 simple way to consult HAVE_ALLOCA here.
6791
da12206a
PE
6792 * data/lalr1.cc (yydestruct_): Pacify unused variable warning
6793 for yymsg, too.
6794
6795 * src/LR0.c (new_itemsets): Use memset rather than zeroing by
6796 hand. This avoids a warning about comparing int to size_t when
6797 GCC warnings are enabled.
6798
0a2c5137
PE
67992004-12-22 Paul Eggert <eggert@cs.ucla.edu>
6800
d7e14fc0
PE
6801 * NEWS: Bison-generated parsers no longer default to using the
6802 alloca function (when available) to extend the parser stack, due
6803 to widespread problems in unchecked stack-overflow detection.
6804 * data/glr.c (YYMAXDEPTH): Remove undef when zero. It's the user's
6805 responsibility to set it to a positive value. This lets the user
6806 specify a value that is not a preprocessor constant.
6807 * data/yacc.c (YYMAXDEPTH): Likewise.
6808 (YYSTACK_ALLOC): Define only if YYSTACK_USE_ALLOCA is nonzero.
6809 * doc/bison.texinfo (Stack Overflow): YYMAXDEPTH no longer needs
6810 to be a compile-time constant. However, explain the constraints on it.
6811 Also, explain the constraints on YYINITDEPTH.
6812 (Table of Symbols): Explain that alloca is no longer the default.
6813 Explain the user's responsibility if they define YYSTACK_USE_ALLOCA
6814 to 1.
6815
0a2c5137
PE
6816 * doc/bison.texinfo (Location Default Action): Mention that n must
6817 be zero when k is zero. Suggested by Frank Heckenbach.
6818
e019c247
AD
68192004-12-22 Akim Demaille <akim@epita.fr>
6820
6821 * data/lalr1.cc (parser::token_number_type, parser::rhs_number_type)
6822 (parser::state_type, parser::semantic_type, parser::location_type):
6823 Private, not public.
6824 (parser::parse): Return ints, not bool.
6825 Returning a bool introduces a problem: 0 corresponds to false, and
6826 it seems weird to return false on success. Returning true changes
6827 the conventions for yyparse.
6828 Alternatively we could return void and send an exception.
6829 There is no clear consensus (yet?).
6830 (state_stack, semantic_stack, location_stack): Rename as...
6831 (state_stack_type, semantic_stack_type, location_stack_type): these.
6832 Private, not public.
6833 * tests/c++.at: New.
6834 * tests/testsuite.at, tests/Makefile.am: Adjust.
6835
72731bb7
AD
68362004-12-21 Akim Demaille <akim@epita.fr>
6837
6838 * data/lalr1.cc (parser::parse): Return a bool instead of an int.
6839
9a0d8bec
AD
68402004-12-21 Akim Demaille <akim@epita.fr>
6841
6842 Don't impose std::string for filenames.
6843
6844 * data/lalr1.cc (b4_filename_type): New.
6845 (position::filename): Use it.
6846 (parser.hh): Move the inclusion of stack.hh and location.hh below
6847 the user code, so that needed headers for the filename type can be
6848 included first.
72731bb7
AD
6849 Forward declare them before the user code.
6850 * tests/Makefile.am (check-local, installcheck-local): Pass
6851 TESTSUITEFLAGS to the TESTSUITE.
9a0d8bec 6852
99880de5
AD
68532004-12-20 Akim Demaille <akim@epita.fr>
6854
6855 Use more STL like names: my_class instead of MyClass.
6856
6857 * data/lalr1.cc (LocationStack, LocationType, RhsNumberType)
6858 (SemanticStack, SemanticType, StateStack, StateType)
6859 (TokenNumberType, Stack, Slice, Traits, Parser::location)
6860 (Parser::value): Rename as...
6861 (location_stack, location_type, rhs_number_type, semantic_stack)
6862 (semantic_type, state_stack, state_type, token_number_type, stack)
6863 (slice, traits, parser::yylloc, parser::yylval): these.
6864
6865 * tests/calc.at, tests/regression.at, tests/actions.at: Adjust.
6866
9bec482e
PE
68672004-12-19 Paul Eggert <eggert@cs.ucla.edu>
6868
6869 * data/glr.c (YYLLOC_DEFAULT): Use GNU spacing conventions.
6870 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
6871
f6fbd3da
PE
68722004-12-17 Paul Eggert <eggert@cs.ucla.edu>
6873
6874 Remove uses of 'short int' and 'unsigned short int'. This raises
6875 some arbitrary limits. It uses more memory but nowadays that's
6876 not much of an issue.
6877
6878 This change does not affect the generated parsers; that's a different
6879 task, as some users will want to conserve memory there.
6880
6881 Ideally we should use size_t to represent all object counts, and
6882 something like ptrdiff_t to represent signed differences of object
6883 counts; but that will require more code-cleanup than I have the
6884 time to do right now.
6885
6886 * src/LR0.c (allocate_itemsets, new_itemsets, save_reductions):
6887 Use size_t, not int or short int, to count objects.
6888 * src/closure.c (nritemset, closure): Likewise.
6889 * src/closure.h (nritemset, closure): Likewise.
6890 * src/nullable.c (nullable_compute): Likewise.
6891 * src/print.c (print_core): Likewise.
6892 * src/print_graph.c (print_core): Likewise.
6893 * src/state.c (state_compare, state_hash): Likewise.
6894 * src/state.h (struct state): Likewise.
6895 * src/tables.c (default_goto, goto_actions): Likewise.
6896
6897 * src/gram.h (rule_number, rule): Use int, not short int.
6898 * src/output.c (prepare_rules): Likewise.
6899 * src/state.h (state_number, STATE_NUMBER_MAXIMUM, transitions,
6900 errs, reductions): Likewise.
6901 * src/symtab.h (symbol_number, SYMBOL_NUMBER_MAXIMUM, struct symbol):
6902 Likewise.
6903 * src/tables.c (vector_number, tally, action_number,
6904 ACTION_NUMBER_MINIMUM): Likewise.
6905 * src/output.c (muscle_insert_short_int_table): Remove.
6906
efeed023
AD
69072004-12-17 Akim Demaille <akim@epita.fr>
6908
6909 * data/lalr1.cc: Extensive Doxygenation.
6910 (error_): Rename as...
6911 (error): this, since it is visible to the user.
6912 Adjust callers.
6913 (Parser::message): Now an automatic variable from...
6914 (Parser::yyreport_syntax_error_): here.
6915 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust to
6916 Parser::error.
6917 * tests/input.at: Escape $.
6918
bc82c5a5
PE
69192004-12-16 Paul Eggert <eggert@cs.ucla.edu>
6920
6921 * data/glr.c (b4_lhs_value, b4_rhs_value, b4_rhs-location):
6922 Parenthesize rhs to avoid obscure problems with mistakes like
6923 "foo$$bar = foo$1bar;". Problem reported by twlevo at xs4all.
6924 * data/lalr1.cc (b4_lhs_value, b4_rhs_value, b4_lhs_location,
6925 b4_rhs_location): Likewise.
6926 * data/yacc.c (b4_lhs_value, b4_rhs_value, b4_lhs_location,
6927 b4_rhs_location): Likewise.
6928
fd19f271
AD
69292004-12-16 Akim Demaille <akim@epita.fr>
6930
6931 * data/lalr1.cc (yyreport_syntax_error_): Catch up with glr.c and
6932 yacc.c: be sure to stay within yycheck_.
6933 * tests/actions.at: Re-enable C++ tests.
6934
10454ea4
AD
69352004-12-16 Akim Demaille <akim@epita.fr>
6936
6937 * src/print_graph.c (print_graph): Remove layoutalgorithm uses for
6938 real.
6939
c5b95ccf
AD
69402004-12-16 Akim Demaille <akim@epita.fr>
6941
6942 Use #define to handle the %name-prefix.
6943
6944 * data/glr.c, data/yacc.c: Comment changes.
6945 * data/lalr1.cc (yylex): Use #define to select the name of yylex,
6946 so that one can refer to yylex in the parser file, and have it
6947 renamed, as is the case with other skeletons.
6948
617a8f12
AD
69492004-12-16 Akim Demaille <akim@epita.fr>
6950
6951 Move lalr1.cc internals into yy*.
6952
6953 * data/lalr1.cc (semantic_stack_, location_stack_, state_stack_)
6954 (semantic_stack_, location_stack_, pact_, pact_ninf_, defact_)
6955 (pgoto_, defgoto_, table_, table_ninf_, check_, stos_, r1_, r2_)
6956 (name_, rhs_, prhs_, rline_, token_number_, eof_, last_, nnts_)
6957 (empty_, final_, terror_, errcode_, ntokens_)
6958 (user_token_number_max_, undef_token_, n_, len_, state_, nerrs_)
6959 (looka_, ilooka_, error_range_, nerrs_):
6960 Rename as...
6961 (yysemantic_stack_, yylocation_stack_, yystate_stack_)
6962 (yysemantic_stack_, yylocation_stack_, yypact_, yypact_ninf_)
6963 (yydefact_, yypgoto_, yydefgoto_, yytable_, yytable_ninf_)
6964 (yycheck_, yystos_, yyr1_, yyr2_, yyname_, yyrhs_, yyprhs_)
6965 (yyrline_, yytoken_number_, yyeof_, yylast_, yynnts_, yyempty_)
6966 (yyfinal_, yyterror_, yyerrcode_, yyntokens_)
6967 (yyuser_token_number_max_, yyundef_token_, yyn_, yylen_, yystate_)
6968 (yynerrs_, yylooka_, yyilooka_, yyerror_range_, yynerrs_):
6969 these.
6970
1e547e6e
PE
69712004-12-15 Paul Eggert <eggert@cs.ucla.edu>
6972
6973 Fix some problems reported by twlevo at xs4all.
6974 * src/symtab.c (symbol_new): Report an error if the input grammar
6975 contains too many symbols. This is better than calling abort() later.
6976 * src/vcg.h (enum layoutalgorithm): Remove. All uses removed.
6977 (struct node, struct graph):
6978 Rename member expand to stretch. All uses changed.
6979 (struct graph): Remove member layoutalgorithm. All uses removed.
6980 * src/vcg.c (get_layoutalgorithm_str): Remove. All uses removed.
6981 * src/vcg_defaults.h (G_STRETCH): Renamed from G_EXPAND.
6982 All uses changed.
6983 (N_STRETCH): Rename from N_EXPAND. All uses changed.
6984
735d6bd4
AD
69852004-12-15 Akim Demaille <akim@epita.fr>
6986
6987 * data/lalr1.cc: Normalize /** \brief ... */ to ///.
6988 Add more Doxygen comments.
6989 (symprint_, stack_print_, reduce_print_, destruct_, pop)
6990 (report_syntax_error_, translate_): Rename as...
6991 (yysymprint_, yystack_print_, yyreduce_print_, yydestruct_)
6992 (yypop_, yyreport_syntax_error_, yytranslate_): this.
6993
2e1f5829
AD
69942004-12-15 Akim Demaille <akim@epita.fr>
6995
6996 * data/lalr1.cc (lex_): Rename as...
6997 (yylex_): this.
6998 Move the trace here.
6999 Take the %name-prefix into account.
7000 Reported by Alexandre Duret-Lutz.
7001
a3cb6248
AD
70022004-12-15 Akim Demaille <akim@epita.fr>
7003
7004 Simplify the C++ parser constructor.
7005
7006 * data/lalr1.cc (debug_): Rename as...
7007 (yydebug_): so that the parser's internals are always in the yy*
7008 pseudo namespace.
7009 Adjust uses.
7010 (b4_parse_param_decl): Remove the leading comma as it is now only
7011 called as unique argument list.
7012 (Parser::Parser): Remove the constructor accepting a location and
7013 an initial debugging level.
7014 Remove from the other ctor the argument for the debugging level.
7015 (debug_level_type, debug_level, set_debug_level): New.
7016
7017 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust
7018 constructor calls.
7019
07fed891
AD
70202004-12-15 Akim Demaille <akim@epita.fr>
7021
7022 Remove b4_root related material: failure experiment
a3cb6248 7023 (which goal was to allow to derive from a class).
07fed891
AD
7024
7025 * data/lalr1.cc (b4_root, b4_param, b4_constructor): Remove
7026 definitions and uses.
7027
e603eaa5
PE
70282004-12-14 Paul Eggert <eggert@cs.ucla.edu>
7029
7030 * data/glr.c (struct yyGLRStack): yyerror_range now has 3 items,
7031 not 2, since it's not portable to subtract 1 from the start of an
7032 array. The new item 0 is never set or used. All uses changed.
7033
7034 (yyrecoverSyntaxError): Use YYLLOC_DEFAULT instead of assuming
7035 the default definition of YYLLOC_DEFAULT. Problem reported
7036 by Frank Heckenbach.
7037
fafb007d
PE
70382004-12-12 Paul Eggert <eggert@cs.ucla.edu>
7039
7040 * data/glr.c (YYRHSLOC): Don't have two definitions, one for
7041 the normal case and one for the error case. Just use the
7042 first one uniformly. Problem reported by Frank Heckenbach.
7043 (YYLLOC_DEFAULT): Use the conventions of yacc.c, so we can
7044 use exactly the same macro in both places.
7045 (yyerror_range): Now of type yyGLRStackItem, not YYLTYPE,
7046 so that the normal-case YYRHSLOC works for the error case too.
7047 All uses changed.
7048 * data/yacc.c (YYRHSLOC): New macro, taken from glr.c.
7049 (YYLLOC_DEFAULT): Use the same macro as glr.c.
7050 * doc/bison.texinfo (Location Default Action): Don't claim that
7051 we have an array of locations. Use the same macro for both glr
7052 and lalr parsers. Mention YYRHSLOC. Mention what happens when
7053 the index is 0.
7054
48814dcd
PE
70552004-12-10 Paul Eggert <eggert@cs.ucla.edu>
7056
a4e1a53b
PE
7057 * HACKING: Update email addresses to send announcements to.
7058
48814dcd
PE
7059 * configure.ac (AC_INIT): Bump version to 1.875f.
7060
337116ba
PE
70612004-12-10 Paul Eggert <eggert@cs.ucla.edu>
7062
7063 * NEWS: Version 1.875e.
7064 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875e.
7065
7066 * src/scan-skel.l: Include "complain.h", for "fatal".
7067
7068 * src/relation.h (relation_print, relation_digraph):
7069 Relation sizes are of type relation_node, not size_t (this is
7070 merely a doc fix, since the two types are equivalent).
7071 (relation_transpose): Relation sizes are of type relation_node,
7072 not int.
7073 * src/relation.c: Likewise.
7074 (top, infinity): Now of type relation_node, not int.
7075 (traverse, relation_transpose): Use relation_node, not int.
7076
7077 * data/glr.c (yyuserAction, yyrecoverSyntaxError): Mark args
7078 with ATTRIBUTE_UNUSED if they're not used, to avoid GCC warning.
7079 (yyparse): Remove unused local introduced in 2004-10-25 patch.
7080
7081 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): New arg
68b082af 7082 specifying whether the test should be skipped. Use it tp
337116ba 7083 specify that the [%defines %skeleton "lalr1.cc"] tests currently
68b082af 7084 fail on some hosts, and should be skipped.
337116ba 7085
da2a7671
PE
70862004-12-08 Paul Eggert <eggert@cs.ucla.edu>
7087
7088 * src/system.h (CALLOC, MALLOC, REALLOC): Remove. All callers
7089 changed to use xcalloc, xnmalloc, xnrealloc, respectively,
7090 unless otherwise specified below.
7091
7092 * src/LR0.c (allocate_itemsets): Use xnmalloc, not xcalloc,
7093 to allocate kernel_base, kernel_items, kernel_size, since
7094 they needn't be initialized to 0.
7095 (allocate_storgae): Likewise, for shiftset, redset, shift_symbol.
7096 * src/closure.c (new_closure): Likewise, for itemset.
7097 * src/derives.c (derives_compute): Likewise, for delts, derives, q.
7098 * src/lalr.c (set_goto_map): Likewise, for temp_map.
7099 (initialize_F): Likewise, for reads, edge, reads[i], includes[i].
7100 (build_relations): Likewise for edge, states1, includes.
7101 * src/nullable.c (nullable_compute): Likewise, for squeue, relts.
7102 * src/reader.c (packgram): Likewise, for ritem, rules.
7103 * src/reduce.c (nonterminals_reduce): Likewise for nontermmap.
7104 * src/relation.c (relation_digraph): Likewise for VERTICES.
7105 (relation_transpose): Likewise for new_R, end_R.
7106 * src/symtab.c (symbols_token_translations_init): Likewise for
7107 token_translations.
7108 * src/tables.c (save_row): Likewise for froms, tos, conflict_tos.
7109 (token_actions): Likewise for yydefact, actrow, conflrow,
7110 conflict_list.
7111 (save_column): Likewise for froms[symno], tos[symno].
7112 (goto_actions): Likewise for state_count.
7113 (pack_table): Likewise for base, pos, check.
7114 (tables_generate): Likewise for width.
7115
7116 * src/LR0.c (set_states): Don't reuse kernel_size and kernel_base
7117 for initial core. Just have a separate core, so we needn't worry
7118 about whether kernel_size and kernel_base are initialized.
7119
7120 * src/LR0.c (shift_symbol, redset, shiftset, kernel_base,
7121 kernel_size, kernel_items): Remove unnecessary initialization.
7122 * src/conflicts.c (conflicts): Likewise.
7123 * src/derives.c (derives): Likewise.
7124 * src/muscle_tablc (muscle_insert): Likewise.
7125 * src/relation.c (relation_digraph): Likewise.
7126 * src/tables.c (froms, tos, conflict_tos, tally, width, actrow, order,
7127 conflrow, conflict_table, conflict_list, table, check):
7128 Likewise.
7129
7130 * src/closure.c (new_closure): Arg is of type unsigned int, not int.
7131 This is because all callers pass unsigned int.
7132 * src/closure.h (new_closure): Likewise.
7133
7134 * src/lalr.c (initialize_F): Initialize reads[i] in all cases.
7135 (build_relations): Initialize includes[i] in all cases.
7136 * src/reader.c (packgram): Always initialize rules[ruleno].prec
7137 and rules[ruleno].precsym. Initialize members in order.
7138 * src/relation.c (relation_transpose): Always initialize new_R[i]
7139 and end_R[i].
7140 * src/table.c (conflict_row): Initialize 0 at end of conflict_list.
7141
7142 * src/output.c (prepare_actions): Pass 0 instead of conflict_list[0];
7143 conflict_list[0] was always 0, but now it isn't initialized.
7144
7145 * src/table.c (table_grow): When conflict_table grew, the grown
7146 area wasn't cleared. Fix this.
7147
7148 * lib/.cvsignore: Add strdup.c, strdup.h.
7149 * m4/.cvsignore: Add strdup.m4.
7150
00baeeac
PE
71512004-12-07 Paul Eggert <eggert@cs.ucla.edu>
7152
7153 * src/lalr.h (GOTO_NUMBER_MAXIMUM): New macro.
7154 * src/lalr.c (set_goto_map): Don't allow ngotos to equal
7155 GOTO_NUMBER_MAXIMUM, since we occasionally compute
7156 ngotos + 1 without checking for overflow.
7157 (build_relations): Use END_NODE, not -1, to denote end of edges.
7158 * src/lalr.c (set_goto_map, map_goto, initialize_F, add_loopback_edge,
7159 build_relations): Use goto_number, not int, for goto numbers.
7160 * src/tables.c (save_column, default_goto): Likewise.
7161
be3d9d42
AD
71622004-11-23 Akim Demaille <akim@epita.fr>
7163
7164 * data/lalr1.cc (YYSTYPE): Define it as is done for C, instead
7165 of #defining from yystype.
7166 Don't typedef yystype, C++ does not need it.
7167 This lets it possible to forward declare it as union.
7168
78e526d5
PE
71692004-11-23 Paul Eggert <eggert@cs.ucla.edu>
7170
7171 * bootstrap (gnulib_modules): Add extensions.
7172 Problem reported by Jim Meyering.
7173
afbb696d
PE
71742004-11-22 Paul Eggert <eggert@cs.ucla.edu>
7175
7176 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c,
7177 src/lalr.c, src/nullable.c, src/relation.c, src/scan-skel.l,
7178 src/system.h, src/tables.c: XFREE -> free, to accommodate
7179 recent change to gnulib xalloc.h.
78e526d5 7180 Problem reported by Jim Meyering.
afbb696d 7181
c1f8f16a
AD
71822004-11-17 Akim Demaille <akim@epita.fr>
7183
7184 * data/lalr1.cc (symprint_): Use cdebug_ to avoid warnings.
7185
db7e5eb5 71862004-11-17 Akim Demaille <akim@epita.fr>,
9a1e9989
AD
7187 Alexandre Duret-Lutz <adl@gnu.org>
7188
7189 * data/lalr1.cc (Parser::yycdebug_): New, a pointer, to allow
7190 changes.
7191 (YYCDEBUG): Adjust.
7192 Use it instead of cdebug_.
7193 (Parser::debug_stream, Parser::set_debug_stream): New.
7194 (Parser::symprint_): Define cdebug_ for temporary backward
7195 compatibility.
7196 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use
7197 debug_stream ().
7198
68e11668
AD
71992004-11-17 Akim Demaille <akim@epita.fr>
7200
7201 * data/lalr1.cc (Parser:print_): Remove, use %printer instead.
7202 * tests/regression.at (_AT_DATA_DANCER_Y): Adjust.
7203 * tests/calc.at (_AT_DATA_CALC_Y): Ditto.
7204 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
7205
97cbc73e
PE
72062004-10-27 Paul Eggert <eggert@cs.ucla.edu>
7207
7208 * data/glr.c (yyloc_default): Remove; not used.
7209 Problem reported by Frank Heckenbach.
7210
e342c3be
AD
72112004-10-25 Akim Demaille <akim@epita.fr>
7212
7213 * data/glr.c (YYRHSLOC): Move its definition next to its uses.
7214 Introduce another definition to address simple location arrays.
7215 (yyGLRStack): New member: yyerror_range.
7216 (yyrecoverSyntaxError, yyparse): Update it.
7217 (yyrecoverSyntaxError): Use it when shifting the error token to
7218 have an accurate range, equivalent to the one computed by both
7219 yacc.c and lalr1.cc.
7220 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Change its yylex so
7221 that column numbers start at column 0, as per GNU Coding
7222 Standards, the others tests, and the doc.
7223 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT_WITH_LOC):
7224 Adjust to the above change (first column is 0).
7225 And adjust the location of the "<error>", now covering the whole
7226 line.
7227
93602feb 72282004-10-22 Akim Demaille <akim@epita.fr>
04098407 7229 and Paul Eggert <eggert@cs.ucla.edu>
93602feb
PE
7230
7231 Remove some arbitrary limits on goto numbers and relations.
7232 * src/lalr.c (goto_map, ngotos, from_state, to_state): Omit
7233 initial values, since they're never used.
7234 (set_goto_map): ngotos is now unsigned, so test for overflow
7235 by seeing whether it wraps around to zero.
7236 * src/lalr.h (goto_number): Now size_t, not short int.
7237 (GOTO_NUMBER_MAXIMUM): Remove.
7238 * src/relation.c (relation_print, traverse, relation_transpose):
7239 Check for END_NODE rather than looking at sign.
7240 * src/relation.h (END_NODE): New macro.
7241 (relation_node): Now size_t, not short int.
7242
dba08b04
PE
72432004-10-22 Paul Eggert <eggert@cs.ucla.edu>
7244
7245 * doc/bison.texinfo (Language and Grammar): In example, "int" is a
7246 keyword, not an identifier. Problem reported by Baron Schwartz in
7247 <http://lists.gnu.org/archive/html/bug-bison/2004-10/msg00017.html>.
7248
df09ef2e
AD
72492004-10-11 Akim Demaille <akim@epita.fr>
7250
7251 * src/symtab.c (symbol_check_alias_consistency): Also check
7252 type names, destructors, and printers.
7253 Reported by Alexandre Duret-Lutz.
7254 Recode the handling of associativity and precedence in terms
7255 of symbol_precedence_set.
7256 Accept no redeclaration at all, not even equal to the previous
7257 value.
7258 (redeclaration): New.
7259 Use it to factor redeclaration complaints.
7260 (symbol_make_alias): Don't set the type of the alias, let
7261 symbol_check_alias_consistency do it as for other features.
7262 * src/symtab.h (symbol): Add new member prec_location, and
7263 type_location.
7264 * src/symtab.c (symbol_precedence_set, symbol_type_set): Set them.
7265 * tests/input.at (Incompatible Aliases): New.
7266
146bc99d
PE
72672004-10-09 Paul Eggert <eggert@cs.ucla.edu>
7268
7269 .cvsignore fixes to accommodate gnulib changes,
7270 and the practice of naming build directories "_build".
7271 * .cvsignore: Add "_*". Sort.
7272 * lib/.cvsignore: Add getopt_.h, xalloc-die.c.
7273 * m4/.cvsignore: Add "*_gl.m4".
7274
e503aa60
AD
72752004-10-06 Akim Demaille <akim@epita.fr>
7276
7277 * src/parse-gram.y (add_param): Fix the truncation of trailing
7278 spaces.
7279
b4a20338
AD
72802004-10-05 Akim Demaille <akim@epita.fr>
7281
7282 In Bison 1.875's yacc.c, YYLLOC_DEFAULT was called regardless
7283 whether the reducion was empty or not. This leaves room to
7284 improve the use of YYLLOC_DEFAULT in such a case.
7285 lalr1.cc is still experimental, so changing this is acceptable.
7286 And finally, there are probably not many users who changed the
7287 handling of locations in GLR, so changing is admissible too.
7288
7289 * data/glr.c, data/lalr1.cc, data/yacc.c (YYLLOC_DEFAULT): On an
7290 empty reduction, set @$ to an empty location ending the previously
7291 stacked symbol.
7292 Adjust uses to make sure the code is triggered on empty
7293 reductions.
7294 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust the
7295 expected output: empty reductions have empty locations.
7296
f85a5e6f
AD
72972004-09-29 Akim Demaille <akim@epita.fr>
7298
7299 * data/lalr1.cc: Move towards a more standard C++ coding style
7300 for templates: Class < T > -> Class<T>.
7301
b203fc2c
AD
73022004-09-29 Akim Demaille <akim@epita.fr>
7303
7304 * data/lalr1.cc: Reinstall the former ctor, for sake of
7305 compatibility, but warn it will be removed.
7306 Move towards a more standard C++ coding style (i.e., type *var ->
7307 type* var).
7308
5b7e1e73
PE
73092004-09-27 Paul Eggert <eggert@cs.ucla.edu>
7310
3fee967f
PE
7311 * src/parse-gram.y (add_param): Rewrite to avoid strchr,
7312 since it's less likely to work if NULs are involved in the future.
5b7e1e73 7313
0dcca5c2
AD
73142004-09-27 Akim Demaille <akim@epita.fr>
7315
7316 * data/yacc.c (YY_LOCATION_PRINT): Fix its default declaration.
7317
6dde1c82
AD
73182004-09-27 Akim Demaille <akim@epita.fr>
7319
7320 * data/lalr1.cc (b4_parse_param_decl_1): New.
b203fc2c 7321 (b4_parse_param_decl): Use it to have different names between attribute
6dde1c82
AD
7322 and argument names.
7323 (b4_cc_constructor_call): Likewise.
7324
b233d555
AD
73252004-09-24 Akim Demaille <akim@epita.fr>
7326
7327 * src/parse-gram.y (add_param): Strip the leading and trailing
7328 blanks from a formal argument declaration.
7329 (YY_LOCATION_PRINT): New.
7330
619404e3
AD
73312004-09-24 Akim Demaille <akim@epita.fr>
7332
7333 * data/c.m4 (b4_yysymprint_generate): Move the YYINPUT invocation
7334 after the location.
7335
dd8d9022
AD
73362004-09-24 Akim Demaille <akim@epita.fr>
7337
7338 * doc/bison.texinfo (Table of Symbols): Sort.
7339
0092f063
AD
73402004-09-21 Akim Demaille <akim@epita.fr>
7341
7342 * data/yacc.c, data/glr.c (b4_at_dollar, b4_dollar_dollar): Remove
7343 the useless parentheses.
7344 Suggested by Paul Eggert.
7345
451364ed
AD
73462004-09-20 Akim Demaille <akim@epita.fr>
7347
7348 Let the initial-action act on the look-ahead, and use it for the
7349 "initial push" (corresponding to an hypothetical beginning-of-file).
7350 And let lalr1.cc honor %initial-action.
7351
7352 * doc/bison.texinfo (Initial Action Decl): Clarify, and add an
7353 example.
7354 * data/lalr1.cc (Parser::initlocation_): Remove, bad experiment.
7355 (Parser::Parser): Remove the ctor that used to initialize it.
7356 (Parser::parse): Like in the other skeletons, issue the "starting
7357 parse" message before any action.
7358 Honor %initial-action.
7359 Initialize the stacks with the lookahead.
7360 * data/yacc.c: Let $$ and @$ in %initial-action designate the
7361 look-ahead.
7362 Push them in the stacks.
7363 * tests/actions.at, tests/calc.at: Adjust the C++ ctor invocations.
7364
18d192f0
AD
73652004-09-20 Akim Demaille <akim@epita.fr>
7366
7367 * doc/bison.texinfo (Initial Action Decl): New.
7368
b8458aa5
AD
73692004-09-20 Akim Demaille <akim@epita.fr>
7370
7371 * data/yacc.c (YY_LOCATION_PRINT): Use YYLTYPE_IS_TRIVIAL as a
7372 clearer criterion to define it.
7373 (parse): Initialize the initial location when YYLTYPE_IS_TRIVIAL.
7374 When reducing on an empty RHS, use the latest stacked location as
7375 location.
7376 yylloc is not always available.
7377 * data/glr.c: Likewise.
7378 Also, honor initial-actions.
7379
3fc16193
AD
73802004-09-20 Akim Demaille <akim@epita.fr>
7381
7382 * data/yacc.c (YY_LOCATION_PRINT): New.
7383 Define when we know YYLTYPE's structure, i.e., when the default
7384 YYLLOC_DEFAULT is used.
7385 * data/c.m4 (b4_yysymprint_generate): Use it.
7386 * data/lalr1.cc (YYLLOC_DEFAULT): Stop relying on the initial
7387 value of the result.
7388 (error_start_): Replace with...
7389 (error_range_): this location array.
7390 This allows to replace code relying on the implementation of
7391 locations by portable code.
7392 * data/yacc.c (yylerrsp): Replace with...
7393 (yyerror_range): this.
7394 Every time a token is popped, update yyerror_range[0], to have an
7395 accurate location for the error token.
7396 * data/glr.c (YY_LOCATION_PRINT): New.
7397 (yyprocessOneStack): Fix an invocation of YY_SYMBOL_PRINT:
7398 deference a pointer.
7399 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): No longer
7400 report the location in %printers.
7401
7402 * src/scan-skel.l: Instead of abort, report error messages to ease
7403 understanding skeleton scanning failures.
7404
ecfe33e7
AD
74052004-09-16 Akim Demaille <akim@epita.fr>
7406
7407 * data/lalr1.cc (Stack::Iterator, Stack::ConstIterator): Rename as...
7408 (iterator, const_iterator): these, to be more in the C++ spirit.
7409 Also, return reverse iterators so that when displaying the stack
7410 we display its bottom first.
7411 (Parser::stack_print_, Parser::reduce_print_): Match the messages
7412 from yacc.c.
7413 We should probably use vector here though.
7414
1576d44d
AD
74152004-09-16 Akim Demaille <akim@epita.fr>
7416
7417 Have more complete shift traces.
7418
7419 * data/yacc.c, data/lalr1.c, data/glr.c: Use YY_SYMBOL_PRINT
7420 to report Shifts instead of ad hoc YYDPRINTF invocations,
7421 including for the error token.
7422 * data/lalr1.cc (symprint_): Output the location.
7423 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): In C++, don't
7424 output the location within the %printer.
7425 Activate GLR tests, at least to make sure they compile properly.
7426 They still don't pass though.
7427 * tests/calc.at: Adjust expect verbose output, since now "Entering
7428 state..." is on a different line than the "Shifting" message.
7429
9c66f418
AD
74302004-09-08 Akim Demaille <akim@epita.fr>
7431
7432 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Move the
7433 Bison directive from the Bison file to the invocation of this
7434 macro, so that these directives are passed to
7435 AT_BISON_OPTION_PUSHDEFS to get correct help macros.
7436 Use these helping macros (e.g., AT_LOC, AT_VAL and so forth).
7437 Move the AT_SETUP/AT_CLEANUP outside, to report as test title
7438 the extra Bison directives instead of the whole series.
7439 Change the grammar so that there are recoverable errors, and
7440 unrecoverable errors. Now we can have the parser give up before
7441 consuming the whole input. As a result we now can observe that
7442 the lookahead is freed when needed.
7443 Change the parser source to parse argv[1] instead of a hard coded
7444 string.
7445 Simplify yylex, and give a value and location to EOF.
7446 Simplify some invocations of AT_CHECK_PRINTER_AND_DESTRUCTOR that
7447 passed directives already coded in the file.
7448 Add some tests to check the location of "error".
7449 For some tests, the C++ parser is correct, and not yacc.c.
7450 For other tests, they provide different, but unsatisfying, values,
7451 so keep the C++ value so that at least one parser is "correct"
7452 according to the test suite.
7453 (Actions after errors): Remove, this is subsumed by the
7454 AT_CHECK_PRINTER_AND_DESTRUCTOR series.
7455
52d5733f
AD
74562004-09-06 Akim Demaille <akim@epita.fr>
7457
7458 * data/lalr1.cc: Adjust the indentation of the labels.
04098407 7459 (Parser::pop): New.
52d5733f
AD
7460 Use it.
7461
a0e68930
AD
74622004-09-06 Akim Demaille <akim@epita.fr>
7463
7464 * data/yacc.cc, data/glr.cc (yydestruct): Accept an additional
7465 argument, an informative message.
7466 Call YY_SYMBOL_PRINT.
7467 Adjust all callers: integrate the associated YY_SYMBOL_PRINT.
7468 * data/lalr1.cc (destruct_): Likewise.
7469 In addition, no longer depend on b4_yysymprint_generate and
7470 b4_yydestruct_generate to generate these functions, do it "by
7471 hand".
7472
e757bb10
AD
74732004-09-03 Akim Demaille <akim@epita.fr>
7474
7475 * data/glr.c, data/lalr1.cc, data/yacc.c: When YYABORT was
7476 invoked, yydestruct the lookahead.
7477 * tests/calc.at (Calculator $1): Update the expected lengths of
7478 traces: there is an added line for the discarded lookahead.
7479 * doc/bison.texinfo (Destructor Decl): Some rewording.
7480 Define "discarded" symbols.
7481
0fe1f06d
AD
74822004-09-02 Akim Demaille <akim@epita.fr>
7483
7484 * data/lalr1.cc (translate_, destruct_): No reason to be static.
7485
284acc8b
AD
74862004-09-02 Akim Demaille <akim@epita.fr>
7487
7488 * data/glr.c, yacc.c (YYDSYMPRINT): Remove, not used.
7489 (YYDSYMPRINTF): Rename as...
7490 (YY_SYMBOL_PRINT): this.
7491 * data/lalr1.cc (YY_SYMBOL_PRINT): New, modeled after the previous
7492 two.
7493 Use it instead of direct symprint_ calls.
7494 (yybackup): Tweak the "Now at end of input" case to match yacc.c's
7495 one.
7496
a5eb1ed2
AD
74972004-09-02 Akim Demaille <akim@epita.fr>
7498
b7c72fe1
AD
7499 * data/lalr1.cc (b4_yysymprint_generate): New.
7500 (symprint_): New member function, defined when YYDEBUG.
7501 Use it consistently instead of token/nterm debugging output by
7502 hand.
a5eb1ed2
AD
7503 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust
7504 %printer calls to use cdebug_ when using lalr1.cc.
7505
417141dd
AD
75062004-08-30 Florian Krohm <florian@edamail.fishkill.ibm.com>
7507
7508 * data/glr.c: Guard the declarations of yypstack and yypdumpstack
7509 with #ifdef YYDEBUG.
7510
2fa09258
AD
75112004-08-26 Akim Demaille <akim@epita.fr>
7512
7513 * doc/bison.texinfo (Implementing Loops): Rename as...
7514 (Implementing Gotos/Loops): this.
7515
9378b508
PE
75162004-08-13 Paul Eggert <eggert@cs.ucla.edu>
7517
7518 Adjust to latest gnulib.
7519 * bootstrap (gnulib_modules): Add xalloc-die.
7520 Set LC_ALL=C so that file names sort consistently.
7521 Prefer the gnulib copies of gettext.m4, glibc21.m4,
7522 inttypes_h.m4, lib-ld.m4, lib-prefix.m4, po.m4, stdint_h.m4,
7523 uintmax_t.m4, ulonglong.m4.
7524 (intl_files_to_remove): Add gettext.m4, lib-ld.m4, lib-prefix.m4,
7525 po.m4 since we are now using _gl.m4 instead.
7526
87a8ad5c
PE
75272004-08-10 Florian Krohm <florian@edamail.fishkill.ibm.com>
7528
7529 * src/scan-action.l: Remove. Scanning of semantic actions is
7530 handled in scan-gram.l.
7531
dca81a78
PE
75322004-08-07 Florian Krohm <florian@edamail.fishkill.ibm.com>
7533
7534 * src/scan-gram.l (handle_syncline): Use uniqstr_new not xstrdup.
7535
7536 * src/location.h (struct): The file member is a uniqstr.
7537 (equal_boundaries): Use UNIQSTR_EQ for comparison.
7538
c9cbf7c5
PE
75392004-07-22 Paul Eggert <eggert@cs.ucla.edu>
7540
7541 Fix bug with non-%union parsers that have printers or destructors,
7542 which led to a Bison core dump. Reported by Peter Fales in
7543 <http://lists.gnu.org/archive/html/bug-bison/2004-07/msg00014.html>.
2fa09258 7544
c9cbf7c5
PE
7545 * data/c.m4 (b4_symbol_actions): Don't assume %union was used.
7546 * data/lalr1.cc (yystype) [defined YYSTYPE]: Define to YYSTYPE,
7547 not to our own type.
7548 * src/output.c (symbol_destructors_output, symbol_printers_output):
7549 Don't assume %union.
7550 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR,
7551 AT_CHECK_PRINTER_AND_DESTRUCTOR): New argument
7552 UNION-FLAG. All callers changed.
7553 (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't assume %union.
7554 Use type char, not unsigned int, when declaring an array of char;
7555 this lets us remove a cast.
7556 (Printers and Destructors): Add non-%union test cases.
7557
fa7e68c3
PE
75582004-06-21 Paul Eggert <eggert@cs.ucla.edu>
7559
7560 * doc/bison.texinfo: Minor editorial changes, mostly to the new
7561 GLR writeups. E.g., avoid frenchspacing and the future tense,
7562 change "lookahead" to "look-ahead", and change "wrt" to "with
7563 respect to".
2fa09258 7564
fa7e68c3
PE
75652004-06-21 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
7566
7567 * doc/bison.texinfo (Merging GLR Parses, Compiler Requirements):
7568 New sections, split off from the GLR Parsers section. Put the new
7569 Simple GLR Parser near the start of the GLR section, for clarity.
7570 Rewrite connective text.
7571
99a9344e
PE
75722004-06-21 Frank Heckenbach <frank@g-n-u.de>
7573
7574 * doc/bison.texinfo (Simple GLR Parsers): New section.
7575
8dd162d3
PE
75762004-06-21 Paul Eggert <eggert@cs.ucla.edu>
7577
7578 * NEWS, TODO, doc/bison.texinfo:
7579 Use "look-ahead" instead of "lookahead", to be consistent.
7580 * REFERENCES: Fix incorrect reference to DeRemer and Pennello,
7581 while we're fixing "look-ahead".
7582 * src/conflicts.c (shift_set): Renamed from shiftset.
7583 (look_ahead_set): Renamed from lookaheadset.
7584 * src/print.c: Likewise.
7585 * src/getargs.c (report_args): Add "look-ahead" as the new canonical
7586 name for "lookahead".
7587 (report_types, usage): Likewise.
7588 * src/getargs.h (report_look_ahead_tokens): Renamed from
7589 report_lookaheads.
7590 * src/lalr.c (compute_look_ahead_tokens): Renamed from
7591 compute_lookaheads.
7592 (state_look_ahead_tokens_count): Renamed from state_lookaheads_count.
7593 (look_ahead_tokens_print): Renamed from lookaheads_print.
7594 * src/state.c (state_rule_look_ahead_tokens_print): Renamed from
7595 state_rule_lookaheads_print.
7596 * src/state.h: Likewise.
7597 (reductions.look_ahead_tokens): Renamed from lookaheads.
7598 * tests/torture.at (AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR): Renamed from
7599 AT_DATA_LOOKAHEADS_GRAMMAR.
7600
57a90331
PE
76012004-06-03 Paul Eggert <eggert@cs.ucla.edu>
7602
7603 * README: Update location of patched M4 distribution.
7604
8ed3234a
PE
76052004-05-30 Albert Chin-A-Young <china@thewrittenword.com>
7606
7607 Don't assume the C++ compiler takes the same arguments as the C compiler
7608 (trivial change).
7609 * configure.ac (O0CXXFLAGS): New var.
7610 * tests/atlocal.in (CXXFLAGS): Use it.
7611
07971983
PE
76122004-05-29 Paul Eggert <eggert@cs.ucla.edu>
7613
7614 Fix some "make check" problems with C++ reported by
7615 Albert Chin-A-Young for Tru64 C++ in this thread:
7616 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00049.html
7617
7618 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check for std::cerr.
7619 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
7620 Output to a .cc file for C++, not to a .c file.
7621 * tests/calc.at (AT_CHECK_CALC): Likewise.
7622 * tests/regression.at (AT_CHECK_DANCER): Likewise.
7623 * tests/local.at (AT_COMPILE_CXX): Default to OUTPUT.cc, not OUTPUT.c.
7624
29058652
PE
76252004-05-28 Albert Chin-A-Young <china@thewrittenword.com>
7626
7627 * tests/calc.at, tests/actions.at: Workaround for SGI
7628 C++ compiler. (trivial change)
7629
62cb8a99
PE
76302004-05-27 Paul Eggert <eggert@cs.ucla.edu>
7631
fd418816
PE
7632 Spent a few hours checking out which prerequisite versions the
7633 current sources actually require. I went all the way back to
7634 Gettext 0.10.40, Automake 1.4, and Autoconf 2.57 and investigated
7635 a seemingly endless set of combinations of versions more recent
7636 than that. The bottom line is that the current sources require
7637 fairly recent versions of the build tools, and it'll be some work
7638 to change this.
7639 * configure.ac (AC_PREREQ): Increase from 2.58 to 2.59.
7640 (AM_INIT_AUTOMAKE): Increase from 1.7 to 1.8.
7641 (AM_GNU_GETTEXT_VERSION): Increase from 0.11.5 to 0.12.
7642 Add comments explaining why those particular versions are
7643 currently needed.
2fa09258 7644
62cb8a99
PE
7645 * src/parse-gram.y (lloc_default): Rewrite to avoid compiler bug
7646 in SGI MIPSpro 7.4.1m. Problem reported by Albert Chin-A-Young in
161a71f3 7647 <http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00037.html>.
62cb8a99
PE
7648
7649 * configure.ac (AC_PREREQ): Bump to 2.58, since 2.57 doesn't work
7650 (it fails with a Autoconf-without-aclocal-m4 diagnostic).
7651
caa52c10
PE
76522004-05-26 Paul Eggert <eggert@cs.ucla.edu>
7653
7654 * configure.ac (AM_GNU_GETTEXT_VERSION): Lower it from 0.14.1 to
7655 0.11.5. Suggested by Bruno Haible.
7656 * bootstrap: Remove gettext version checking.
7657
7658 * doc/bison.texinfo (Decl Summary): Also mention that %union
7659 can depend on prerequisite types. Problem reported by Tim
7660 Van Holder.
7661
4bfd5e4e
PE
76622004-05-25 Paul Eggert <eggert@cs.ucla.edu>
7663
2cef3017
PE
7664 * README: Mention GNU m4 1.4 bugs and Akim's patched version.
7665 * README-alpha: Don't tell people not to package this.
7666
b9c85d5c
PE
7667 * bootstrap: Don't assume $(...) works; use `...` instead.
7668 Problem reported by Paul Hilfinger. Also, diagnose non-GNU
7669 gettext better.
7670
4bfd5e4e
PE
7671 * doc/bison.texinfo (Decl Summary, Bison Options): Clarify what's
7672 put into the -d output file, and mention what to do if YYSTYPE is
7673 defined as a macro.
7674
6a36ff94
PE
76752004-05-24 Paul Eggert <eggert@cs.ucla.edu>
7676
6712933e
PE
7677 Undo change made earlier today: it caused autopoint to not bring
7678 in ABOUT-NLS. Ouch. Instead, substitute our own diagnostic for
7679 autopoint's.
7680
7681 * bootstrap: Check that gettext version matches what's in
7682 configure.ac. Warn users to ignore robots.txt ERROR 404.
7683 * bootstrap: Undo today's earlier change (logged below).
7684 * configure.ac (AM_GNU_GETTEXT_VERSION): Likewise.
b9c85d5c 7685
6a36ff94
PE
7686 The gettext version checking is causing more trouble than it's
7687 curing; remove it. Problem reported by Paul Hilfinger.
7688
7689 * bootstrap: Issue a warning that one can expect a message
7690 'AM_GNU_GETTEXT is used, but not AM_GNU_GETTEXT_VERSION'.
7691 * configure.ac (AM_GNU_GETTEXT_VERSION): Remove.
7692
209ea708
PE
76932004-05-23 Paul Eggert <eggert@cs.ucla.edu>
7694
7695 Ensure that the C++ compiler used for testing actually works on a
7696 simple test program; if not, skip the C++-related tests. Problem
7697 reported by Vin Shelton in:
161a71f3 7698 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00026.html
209ea708
PE
7699
7700 * m4/cxx.m4: New file.
7701 * configure.ac (BISON_TEST_FOR_WORKING_CXX_COMPILER): Add.
7702 * tests/atlocal.in (BISON_CXX_WORKS): Add.
7703 * tests/local.at (AT_COMPILE_CXX): Use it.
7704
41ca2549
PE
77052004-05-21 Paul Eggert <eggert@cs.ucla.edu>
7706
383e69dc
PE
7707 * data/glr.c (yylloc): Output this macro even if locations are not
7708 being generated, as the GLR parser needs it even in that case.
7709 Problem reported by Troy A. Johnson
7710 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=195946>.
7711
41ca2549
PE
7712 * configure.ac (AC_INIT): Update to 1.875e.
7713
e476c87d
PE
77142004-05-21 Paul Eggert <eggert@cs.ucla.edu>
7715
7716 * NEWS: Version 1.875d.
7717 * configure.ac (AC_INIT): Likewise.
7718 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875d.
7719
7720 * configure.ac (--enable-gcc-warnings): Do not enable -Wshadow,
7721 -Wmissing-prototypes, or -Wstrict-prototypes for C++. The current
7722 lalr1.cc runs afoul of the first, and the last two are no longer
7723 supported by GCC 3.4.0.
7724 * README: Mention GNU m4 1.4 or later; mention m4 patches.
7725 * HACKING: Use ./bootstrap, not "make update" to import foreign files.
7726
233a88ad
PE
77272004-05-06 Paul Eggert <eggert@cs.ucla.edu>
7728
7729 * src/muscle_tab.c (hash_muscle): Accept and return size_t, not
7730 unsigned int, for compatibility with latest gnulib hash module.
7731 * src/state.c (state_hash, state_hasher): Likewise.
7732 * src/symtab.c (hash_symbol, hash_symbol_hasher): Likewise.
7733 * src/uniqstr.c (hash_uniqstr): Likewise.
e476c87d 7734
12ffdd28
PE
77352004-05-03 Paul Eggert <eggert@cs.ucla.edu>
7736
7737 * NEWS: Unescaped newlines are no longer allowed in char & strings.
7738
7739 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER,
7740 SC_CHARACTER,SC_STRING>): Reject unescaped newlines in
7741 character and string literals.
7742 (unexpected_end): New function.
7743 (unexpected_eof): Use it.
7744 (unexpected_newline): New function.
7745 (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>): Coalesce duplicate
7746 actions.
e476c87d 7747
12ffdd28
PE
7748 * NEWS: Document %expect-rr.
7749
7750 * bootstrap (--gnulib-srcdir=*, --cvs-user=*):
7751 Fix typo by replacing $1 with $option.
7752 Remove more 'intl'-related files.
9668e2be 7753 Don't DEFUN AM_INTL_SUBDIR twice.
12ffdd28
PE
7754
7755 * lib/.cvsignore: Add strndup.h. Remove memchr.c, memcmp.c,
7756 memrchr.c, strcasecmp.c, strchr.c, strrchr.c, strspn.c, strtol.c,
7757 strtoul.c.
7758 * m4/.cvsignore: Add exitfail.m4, extensions.m4, gnulib.m4,
7759 hard-locale.m4, mbstate_t.m4, strerror_r.m4, strndup.m4,
7760 xstrndup.m4. Remove glibc21.m4, intdiv0.m4, inttypes-pri.m4,
7761 inttypes.m4, inttypes_h.m4, isc-posix.m4, lcmessage.m4,
7762 stdint_h.m4, uintmax_t.m4, ulonglong.m4.
7763 * src/.cvsignore: Add *.output.
7764
7765 * src/parse-gram.y: Put copyright notice inside %{ %} so it
7766 gets copied to the output file.
e476c87d 7767
1f65350a
PE
77682004-04-28 Paul Eggert <eggert@twinsun.com>
7769
7770 Get files from the gnulib and po repositories, instead of relying
7771 on them being in our CVS. Upgrade to latest versions of gnulib
7772 and Automake.
7773
7774 * Makefile.am (SUBDIRS): Remove m4; Automake now does m4.
7775 * bootstrap: Bootstrap from gnulib and po repositories.
7776 Much of this code was stolen from GNU diff and GNU tar's bootstrap.
7777 * README-cvs: Document these changes. Remove version numbers from
7778 mentions of build tools, since they change so often. Mention Flex.
7779
7780 * configure.ac (AC_CONFIG_MACRO_DIR): Add, with m4 as arg.
7781 (gl_USE_SYSTEM_EXTENSIONS): Add.
12ffdd28
PE
7782 (AC_GNU_SOURCE, AC_AIX, AC_MINIX):
7783 Remove; no longer needed, as gl_USE_SYSTEM_EXTENSIONS
1f65350a 7784 does this for us.
12ffdd28
PE
7785 (AC_ISC_POSIX): Remove; we no longer support this
7786 ancient OS, as it gets in the way of latest Autoconf & gnulib.
1f65350a
PE
7787 (AC_HEADER_STDC): Remove: we now assume C89 or better.
7788 (AC_CHECK_HEADERS_ONCE): Use instead of AC_CHECK_HEADERS.
7789 Do not check for C89 headers, except for locale.h which is used
7790 by the Yacc library and must port to K&R hosts.
7791 (AC_CHECK_FUNCS_ONCE): Use instead of AC_CHECK_FUNCS.
7792 Do not check for C89 functions, except for setlocale which is
7793 used by the Yacc library.
7794 (AC_CHECK_DECLS, AC_REPLACE_FUNCS): Remove; no longer needed.
7795 (gl_DIRNAME, gl_ERROR, gl_FUNC_ALLOCA, gl_FUNC_MEMCHR,
7796 gl_FUNC_MEMRCHR, gl_FUNC_STPCPY, gl_FUNC_STRNLEN, gl_FUNC_STRTOL,
7797 gl_GETOPT, gl_HASH, gl_MBSWIDTH, gl_OBSTACK, gl_QUOTE,
7798 gl_QUOTEARG, gl_XALLOC, jm_FUNC_GLIBC_UNLOCKED_IO, jm_FUNC_MALLOC,
7799 AM_GNU_GETTEXT): Remove; now done by:
7800 (GNULIB_AUTOCONF_SNIPPET): Add. "bootstrap" builds this for us.
7801 (AC_CONFIG_FILES): Remove m4/Makefile, as Automake now does this
7802 for us.
7803
7804 * lib/Makefile.am: Include gnulib.mk, built for us by "bootstrap".
7805 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES):
7806 Define to empty, as gnulib.mk will do the rest for us.
7807 ($(libbison_a_OBJECTS), stdbool.h): Remove, as gnulib.mk does this
7808 for us.
7809 (libbison_a_SOURCES): Define to $(lib_SOURCES) now.
7810 (lib_SOURCES): New symbol, containing only the non-gnulib libs.
7811
7812 * src/files.c: Include gnulib's xstrndup.h.
7813
7814 * src/system.h (MALLOC): Use xnmalloc, for better overflow checking.
7815 (REALLOC): Use xnrealloc, for likewise.
7816 (xstrndup, stpcpy): Remove decls, as gnulib does this for us now.
7817 (strnlen, memrchr): Remove decls; functions no longer used.
7818 Include <stpcpy.h>.
7819
7820 * config/depcomp, config/install-sh, lib/alloca.c, lib/argmatch.c,
7821 lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
7822 lib/error.c, lib/error.h, lib/getopt.c, lib/getopt.h,
7823 lib/getopt1.c, lib/gettext.h, lib/hash.c, lib/hash.h,
7824 lib/malloc.c, lib/mbswidth.c, lib/mbswidth.h, lib/memchr.c,
7825 lib/memcmp.c, lib/memrchr.c, lib/obstack.c, lib/obstack.h,
7826 lib/quote.c, lib/quote.h, lib/quotearg.c, lib/quotearg.h,
7827 lib/realloc.c, lib/stdbool_.h, lib/stpcpy.c, lib/strcasecmp.c,
7828 lib/strchr.c, lib/strncasecmp.c, lib/strnlen.c, lib/strrchr.c,
7829 lib/strspn.c, lib/strtol.c, lib/strtoul.c, lib/unlocked-io.h,
7830 lib/xalloc.h, lib/xmalloc.c, lib/xstrdup.c, lib/xstrndup.c,
7831 m4/Makefile.am, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
7832 m4/error.m4, m4/getopt.m4, m4/hash.m4, m4/malloc.m4,
7833 m4/mbrtowc.m4, m4/mbswidth.m4, m4/memchr.m4, m4/memcmp.m4,
7834 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/prereq.m4,
7835 m4/quote.m4, m4/quotearg.m4, m4/realloc.m4, m4/stdbool.m4,
7836 m4/stpcpy.m4, m4/strnlen.m4, m4/strtol.m4, m4/strtoul.m4,
7837 m4/unlocked-io.m4, m4/xalloc.m4, po/LINGUAS, po/Makefile.in.in,
7838 po/Makevars, po/da.po, po/de.po, po/es.po, po/et.po, po/fr.po,
7839 po/hr.po, po/id.po, po/it.po, po/ja.po, po/ms.po, po/nl.po,
7840 po/pt_BR.po, po/ro.po, po/ru.po, po/sv.po, po/tr.po:
7841 Remove, as these files are now generated automatically
7842 by bootstrap or automake.
7843
7844 * po/ChangeLog: Remove: all but one entry was a duplicate
7845 of this file, and I moved that 2000-11-02 entry here.
7846
7847 * config/.cvsignore: Add Makefile, depcomp, install-sh.
7848 * lib/.cvsignore: Add alloca.c, alloca.h, alloca_.h, argmatch.c,
7849 argmatch.h, basename.c, dirname.c, dirname.h, error.c, error.h,
7850 exit.h, exitfail.c, exitfail.h, getopt.c, getopt.h, getopt1.c,
7851 getopt_int.h, gettext.h, gnulib.mk, hard-locale.c, hard-locale.h,
7852 hash.c, hash.h, malloc.c, mbswidth.c, mbswidth.h, memchr.c,
7853 memcmp.c, memrchr.c, obstack.c, obstack.h, quote.c, quote.h,
7854 quotearg.c, quotearg.h, realloc.c, stdbool_.h, stpcpy.c, stpcpy.h,
7855 strcasecmp.c, strchr.c, stripslash.c, strncasecmp.c, strndup.c,
7856 strnlen.c, strrchr.c, strspn.c, strtol.c, strtoul.c,
7857 unlocked-io.h, xalloc.h, xmalloc.c, xstrdup.c, xstrndup.c,
7858 xstrndup.h.
7859 * m4/.cvsignore: Remove Makefile, Makefile.in. Add alloca.m4,
7860 dirname.m4, dos.m4, error.m4, getopt.m4, hash.m4, mbrtowc.m4,
7861 mbswidth.m4, obstack.m4, onceonly.m4, quote.m4, quotearg.m4,
7862 stdbool.m4, stpcpy.m4, strnlen.m4, unlocked-io.m4, xalloc.m4.
7863 * po/.cvsignore: Add *.po, LINGUAS, Makefile.in.in, Makevars.
7864 * src/.cvsignore: Remove *_.c.
7865
7866
7867 * Makefile.maint (GZIP_ENV): Don't use --rsyncable if gzip doesn't
7868 support it. (The latest stable gzip doesn't.)
7869
78702004-04-27 Paul Eggert <eggert@twinsun.com>
7871
7872 * data/lalr1.cc (Parser::stos_) [! YYDEBUG]: Define even in this
7873 case, as stos_ is now used by destructors due to the 2004-02-09
7874 change.
7875
7876 Remove more K&R C support.
7877 * lib/libiberty.y (PARAMS): Remove. All uses removed.
7878 * lib/subpipe.c (errno): Remove decl.
7879 Include <stdlib.h> unconditionally.
7880 (EXIT_FAILURE): Remove macro.
7881 * src/complain.c (vfprintf, strerror): Remove.
7882 * src/system.h: Include limits.h, stdlib.h, string.h, locale.h
7883 unconditionally.
7884 (EXIT_FAILURE, EXIT_SUCCESS, setlocale): Remove defns.
7885 Use latest Autoconf recommendations for including inttypes.h, stdint.h.
7886 (strchr, strspn, memchr): Remove decls.
7887 * tests/calc.at (_AT_DATA_CALC_Y): Include stdlib.h, string.h
7888 unconditionally. Do not declare perror.
7889 * tests/conflicts.at (%nonassoc and eof): Include stdlib.h
7890 unconditionally.
7891
7892 * src/complain.c (_): Remove useless defn, as system.h defines this.
7893
7894 * lib/bitset.h (__INT_TO_PTR): Remove; workaround no longer needed
7895 with latest obstack.h.
7896 * lib/ebitset.c (ebitset_elt_alloc): Don't bother to cast args
7897 to procedure types, as obstack.h now does that for us.
7898 * lib/lbitset.c (lbitset_elt_alloc): Likewise.
7899
7900 * lib/subpipe.h [HAVE_SYS_TYPES_H]: Include <sys/types.h>,
7901 so that this include file can stand alone.
7902 * lib/subpipe.c: Do not include <sys/types.h>, as subpipe.h
7903 does this now. Include subpipe.h first after config.h, to
7904 test whether it can stand alone.
7905
7906 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't
7907 declare yyerror when using lalr.cc, as GCC 3.4.0 warns about the
7908 unused declaration.
7909
7910 * tests/synclines.at (%union synch line): Put a dummy member in
7911 the union, because empty unions aren't allowed in C. Caught
7912 by GCC 3.4.0.
7913
4f16766c
PE
79142004-04-13 Jim Meyering <jim@meyering.net>
7915
7916 * src/conflicts.c (conflicts_print): Correct format string typo:
7917 use `%%' to produce literal `%'. (trivial change)
7918
779e7ceb
PE
79192004-03-30 Paul Eggert <eggert@twinsun.com>
7920
7921 * src/getargs.c (version): Update copyright year to 2004.
7922
7923 * data/c.m4 (b4_int_type): Use 'short int' rather than
7924 'short', and similarly for 'long', 'unsigned', etc.
7925 * data/glr.c (YYTRANSLATE, yyconfl, yySymbol, yyItemNum,
7926 yygetLRActions, yyprocessOneStack, yyrecoverSyntaxError,
7927 yy_yypstack, yydumpstack): Likewise.
7928 * data/lalr1.cc (user_token_number_max_, user_token_number_max_,
7929 translate_, seq_, [], pop, Slice, range_, operator+, operator+=):
7930 Likewise.
7931 * data/yacc.c (b4_int_type, yyss, YYSTACK_BYTES, yysigned_char,
7932 yy_stack_print, yyparse): Likewise.
7933 * doc/bison.texinfo (Prologue, Multiple Types): Likewise.
7934 * lib/bbitset.h (bitset_word, BITSET_WORD_BITS): Likewise.
7935 * lib/bitset.c (bitset_print): Likewise.
7936 * lib/bitset_stats.c (bitste_log_histogram_print): Likewise.
7937 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
7938 * lib/bitsetv.c (bitsetv_dump): Likewise.
7939 * lib/ebitset.c (EBITSET_ELT_BITS, ebitset_elt_alloc): Likewise.
7940 * lib/lbitset.c (LBITSET_ELT_BITS, lbitset_elt_alloc, debug_lbitset):
7941 Likewise.
7942 * src/LR0.c (allocate_itemsets): Likewise.
7943 * src/gram.h (rule_number, rule): Likewise.
7944 * src/lalr.h (goto_number): Likewise.
7945 * src/nullable.c (nullable_compute): Likewise.
7946 * src/output.c (prepare_rules): Likewise.
7947 * src/relation.c (relation_print, relation_digraph): Likewise.
7948 * src/relation.h (relation_node): Likewise.
7949 * src/state.h (state_number, transitions, errs, reductions,
7950 struct state): Likewise.
7951 * src/symtab.h (symbol_number, struct symbol): Likewise.
7952 * src/tables.c (vector_number, tally, action_number,
7953 default_goto, goto_actions): Likewise.
7954 * tests/existing.at (GNU Cim Grammar): Likewise.
7955 * tests/regression.at (Web2c Actions): Likewise.
7956
7957 * src/output.c (muscle_insert_short_int_table): Renamed from
7958 muscle_insert_short_table. All uses changed.
7959
d6328241
PH
79602004-03-25 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
7961
7962 * src/parse-gram.y: Define PERCENT_EXPECT_RR.
7963 (declaration): Replace expected_conflicts with expected_sr_conflicts.
7964 Add %expect-rr rule.
4f16766c 7965
d6328241
PH
7966 * src/scan-gram.l: Recognize %expect-rr.
7967
4f16766c 7968 * src/conflicts.h (expected_sr_conflicts): Rename from
d6328241 7969 expected_conflicts.
4f16766c 7970 (expected_rr_conflicts): Declare.
d6328241
PH
7971
7972 * src/conflicts.c (expected_sr_conflicts): Rename from
7973 expected_conflicts.
7974 (expected_rr_conflicts): Define.
7975 (conflicts_print): Check r/r conflicts against expected_rr_conflicts
7976 for GLR parsers.
7977 Use expected_sr_conflicts in place of expected_conflicts.
7978 Warn if expected_rr_conflicts used in non-GLR parser.
4f16766c 7979
d6328241 7980 * doc/bison.texinfo: Add documentation for %expect-rr.
4f16766c 7981
1452af69
PE
79822004-03-08 Paul Eggert <eggert@gnu.org>
7983
7984 Add support for hex token numbers. Suggested by Odd Arild Olsen in
161a71f3 7985 <http://lists.gnu.org/archive/html/bison-patches/2004-03/msg00000.html>.
1452af69
PE
7986
7987 * NEWS: Document hexadecimal tokens, no NUL bytes, %destructor
7988 in lalr1.cc.
7989 * doc/bison.texinfo (Token Decl): Add hexadecimal token numbers.
7990 * src/scan-gram.l (scan_integer): New function.
7991 ({int}): Use it.
7992 (0[xX][0-9abcdefABCDEF]+): New pattern, to support hex numbers.
7993 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>, \\x[0-9abcdefABCDEF]+,
7994 handle_action_dollar, handle_action_at, convert_ucn_to_byte):
7995 Say "long int", not "long", for uniformity with GNU style.
7996
006d217d
PE
79972004-02-25 Paul Eggert <eggert@twinsun.com>
7998
7999 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Ignore stdout from
8000 compilers. This fixes a problem with Intel's C++ compiler being
8001 chatty, reported by Guido Trentalancia in
161a71f3 8002 <http://lists.gnu.org/archive/html/bug-bison/2004-02/msg00030.html>.
006d217d 8003
c2729758
ADL
80042004-02-09 Alexandre Duret-Lutz <adl@gnu.org>
8005
8006 Support %destructor and merge error locations in lalr1.cc.
8007
8008 * data/lalr1.cc (b4_cxx_destruct_def): New macro.
8009 (Parser::stos_): Define unconditionally.
8010 (Parser::destruct_): New method. Generate its body with
8011 b4_yydestruct_generate.
8012 (Parser::error_start_): New attribute.
8013 (Parser::parse) <yyerrlab, yyerrlab1>: Call destruct_ on erroneous
8014 token which are discarded.
8015 (Parser::parse) <yyerrlab, yyerrorlab, yyerrlab1>: Update
8016 error_start_ when erroneous token are discarded.
8017 (Parser::parse) <yyerrlab1>: Compute the location of the error
8018 token so that it covers all the discarded tokens.
8019 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust so
8020 it can be called with `%skeleton "lalr1.cc"', and do that.
8021
dd0e0635
PE
80222004-02-02 Paul Eggert <eggert@twinsun.com>
8023
8024 * src/Makefile.am (AM_CPPFLAGS): New macro. It mentions
8025 $(top_srcdir)/lib and ../lib. This fixes a bug reported
8026 by Paul Hilfinger; the old INCLUDES value didn't mention ../lib.
8027 There's no need to mention top_builddir since Automake does that
8028 for us.
8029 (INCLUDES): Remove, as Automake says it's obsolescent.
8030 Contents migrated into AM_CPPFLAGS as described above.
8031 * lib/Makefile.am (INCLUDES): Remove; obsolescent.
8032
80332004-01-14 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
8034
8035 * data/glr.c (yytokenName): Bullet-proof against YYEMPTY token.
8036 (yyreportSyntaxError): Handle case where lookahead token is
8037 YYEMPTY.
8038
be16239b
PH
80392004-01-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
8040
8041 * data/glr.c: Put casts on uses of YYREALLOC and YYMALLOC so that
8042 resulting parsers are compilable with C++.
8043
5fa90832
PE
80442003-12-23 Paul Eggert <eggert@twinsun.com>
8045
8046 * config/depcomp, config/install-sh: Sync with Automake 1.8.
8047 * src/output.c (output_skeleton): Rename local var.
8048 * tests/input.at (Torturing the Scanner): Don't use \x0 or \0 in
8049 Bison tokens, as this runs afoul of the 2003-10-07 change that
8050 disallowed NUL bytes in character constants or string literals.
8051
8052 * tests/local.at: Require Autoconf 2.59's Autotest.
8053 * tests/testsuite.at: Don't include local.at, since we now assume
8054 Autoconf 2.59 or later. Autoconf 2.59 had some problems with
8055 including it.
8056 * tests/Makefile.am ($(TESTSUITE)): Remove warning about ignoring
8057 multiple inclusion warnings.
dd0e0635 8058
b165c324
AD
80592003-12-02 Akim Demaille <akim@epita.fr>
8060
8061 * doc/bison.texinfo (How Can I Reset the Parser): More about start
8062 conditions.
8063 From Bruno Haible.
8064
26e06a21
ADL
80652003-11-18 Alexandre Duret-Lutz <adl@gnu.org>
8066
8067 * doc/bison.texinfo (Bison Options): Escape `@' in `$@'.
8068
92ac3705
PE
80692003-10-07 Paul Eggert <eggert@twinsun.com>
8070
6a5ecb38
PE
8071 * tests/Makefile.am (clean-local): Don't run 'testsuite --clean'
8072 if testsuite doesn't exist.
8073
92ac3705
PE
8074 * doc/bison.texinfo (Symbols): NUL bytes are not allowed in string
8075 literals, unfortunately.
8076 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
8077 Complain about NUL bytes in character constants or string literals.
8078
91d2c560
PE
80792003-10-05 Paul Eggert <eggert@twinsun.com>
8080
8081 * NEWS: Don't document %no-default-prec, as it's still
8082 too experimental.
8083 * doc/bison.texinfo: Document %no-default-prec only if
8084 the defaultprec flag is set. Normally it's not.
8085
0cc3da3a
PE
80862003-10-04 Paul Eggert <eggert@twinsun.com>
8087
8088 * data/glr.c (b4_rhs_value, b4_rhs_location): Yield a
8089 non-modifiable lvalue, instead of a modifiable one.
8090 * doc/bison.texinfo (Actions): Document that $$ can
8091 be assigned to. Do not claim that $$ and $N are
8092 array element references: user code should not rely on this.
8093
22fccf95
PE
80942003-10-01 Paul Eggert <eggert@twinsun.com>
8095
8096 * src/parse-gram.h (PERCENT_NO_DEFAULT_PREC): New token.
8097 (grammar_declaration): Use it.
8098 * src/scan-gram.l: New token %no-default-prec.
8099 * tests/conflicts.at: Revamp tests to use %no-default-prec.
8100 * NEWS, doc/bison.texinfo: Document the above.
8101
fc8f2965
AD
81022003-10-01 Akim Demaille <akim@epita.fr>
8103
8104 VCG no longer supports long_straight_phase.
8105
8106 * src/vcg.c, src/vcg.h: Remove the handling of long_straight_phase.
8107 * src/print_graph.c (print_graph): Adjust.
8108
39a06c25
PE
81092003-09-30 Frank Heckenbach <frank@g-n-u.de>
8110 and Paul Eggert <eggert@twinsun.com>
8111
8112 * doc/bison.texinfo (Decl Summary, Contextual Precedence,
8113 Table of Symbols): Document %default-prec.
8114 * src/parse-gram.y (PERCENT_DEFAULT_PREC): New token.
8115 (grammar_declaration): Set default_prec on %default-prec.
8116 * src/scan-gram.l (%default-prec): New token.
8117 * src/reader.h (default_prec): New flag.
8118 * src/reader.c: Likewise.
8119 (packgram): Handle it.
8120 * tests/conflicts.at (%default-prec without %prec,
8121 %default-prec with %prec, %default-prec 1): New tests.
fc8f2965 8122
39a06c25
PE
81232003-09-30 Paul Eggert <eggert@twinsun.com>
8124
8125 * tests/testsuite.at: Include local.at, not input.at, fixing
8126 a typo in the 2003-08-25 patch.
8127
62b6aef9
AD
81282003-08-27 Akim Demaille <akim@epita.fr>
8129
8130 * data/lalr1.cc (yyparse) [__GNUC__]: "Use" yyerrorlab to pacify
8131 GCC warnings.
8132
89e1cc61
AD
81332003-08-26 Akim Demaille <akim@epita.fr>
8134
8135 * config/announce-gen (print_changelog_deltas): Neutralize "<#" as
8136 "<\#" to avoid magic from Gnus when posting parts of this script.
8137
a08460b0
AD
81382003-08-26 Akim Demaille <akim@epita.fr>
8139
8140 * data/lalr1.cc (Parser::report_syntax_error_): New, extracted from
8141 (Parser::parse): here.
8142 Adjust: nerrs and errstatus is now replaced by...
8143 (Parser::nerrs_, Parser::errstatus_): New.
8144
603f1cfd
AD
81452003-08-25 Akim Demaille <akim@epita.fr>
8146
8147 * config/announce-gen, Makefile.cfg: New.
8148 * Makefile.am: Adjust.
8149 * GNUmakefile, Makefile.maint: Update from CVS Autoconf, but
8150 keeping local WGET and WGETFLAGS modifications from Paul Eggert.
8151
cd3684cf
AD
81522003-08-25 Akim Demaille <akim@epita.fr>
8153
8154 When reducing initial empty rules, Bison parser read an initial
8155 location that is not defined. This results in garbage, and that
8156 affects Bison's own parser. Therefore we need (i) to extend Bison
8157 to support a means to initialize this location, and (ii) to use
8158 this CVS Bison to fix CVS Bison's parser.
8159
8160 * src/reader.h, reader.c (epilogue_augment): Remove, replace
8161 with...
8162 * src/muscle_tab.h, src/muscle_tab.c (muscle_code_grow): this.
8163 * src/parse-gram.y: Adjust.
8164 (%initial-action): New.
8165 (%error-verbose): Since we require CVS Bison, there is no reason
8166 not to use it.
8167 * src/scan-gram.l: Adjust.
8168 * src/Makefile.am (YACC): New, to make sure we use our own parser.
8169 * data/yacc.c (yyparse): Use b4_initial_action.
8170
4e03e201
AD
81712003-08-25 Akim Demaille <akim@epita.fr>
8172
8173 * doc/bison.texinfo: Don't promote stdout for error messages.
8174
8c182d05
AD
81752003-08-25 Akim Demaille <akim@epita.fr>
8176
8177 * data/lalr1.cc (Parser::reduce_print_): Remove unused yyi.
8178 From Alexandre Duret-Lutz.
8179
6a60c4cf
PE
81802003-08-25 Akim Demaille <akim@epita.fr>
8181
8182 Version 1.875c.
8183
25f66e1a
AD
81842003-08-25 Akim Demaille <akim@epita.fr>
8185
8186 * data/lalr1.cc (Parser::stack_print_, YY_STACK_PRINT): New.
8187 Use them.
8188
5348bfbe
AD
81892003-08-25 Akim Demaille <akim@epita.fr>
8190
8191 * data/lalr1.cc (Parser::reduce_print_): New.
8192 Use it.
8193
47301314
AD
81942003-08-25 Akim Demaille <akim@epita.fr>
8195
8196 Have lalr1.cc catch with Paul Eggert's patch to fix the infinite
8197 error recovery loops. This patch is based on
161a71f3 8198 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00000.html>.
47301314
AD
8199 Also, augment the similarity between lalr1.cc and yacc.c.
8200 Note: the locations of error recovery rules are not correct yet.
8201
8202 * data/lalr1.cc: Comment changes to augment the similarity between
8203 lalr1.cc and yacc.c.
8204 (YYERROR): Goto to yyerrorlab, not yyerrlab1.
8205 (yyerrlab1): Remove, but where it used to be (now the bottom part of
8206 yyerrlab), when hitting EOF, pop the whole stack here instead of
8207 merely falling thru the default error handling mechanism.
8208 (yyerrorlab): New label, with the old contents of YYERROR,
8209 plus the following change: pop the stack of rhs corresponding
8210 to the production that invoked YYERROR. That is how Yacc
8211 behaves (required by POSIX).
8212 * tests/calc.at (AT_CHECK_CALC_LALR1_CC): No longer expected to
8213 fail.
8214
1f7a61ff
AD
82152003-08-25 Akim Demaille <akim@epita.fr>
8216
8217 Tune local.at so that people can "autom4te -l autotest calc.at -o
8218 calc" for instance, to extract a sub test suite.
8219
8220 * tests/testsuite.at: Move the initialization, Autotest version
8221 requirement, and AT_TESTED invocation into...
8222 * tests/local.at: here.
8223 * tests/testsuite.at: Include it for compatibility with Autoconf
8224 2.57.
8225 * tests/Makefile.am ($(TESTSUITE)): Report that the warning should
8226 be ignore.
8227
327b5b56
PE
82282003-08-04 Paul Eggert <eggert@twinsun.com>
8229
8230 Rework code slightly to avoid gcc -Wtraditional warnings.
8231 * data/glr.c (yyuserMerge): Return void, not YYSTYPE.
8232 The returned value is now stored in *YY0. All callers changed.
8233 * src/output.c (merge_output): Adjust to the above change.
8234
0051e3ed
PE
82352003-07-26 Paul Eggert <eggert@twinsun.com>
8236
8237 * data/glr.c (YYASSERT): New macro.
8238 (yyfillin, yydoAction, yyglrReduce, yysplitStack,
8239 yyresolveStates, yyprocessOneStack):
8240 Use `YYASSERT (FOO);' rather than `if (! (FOO)) abort ();'.
8241 Derived from a suggestion by Frank Heckenbach.
1f7a61ff 8242
137437c6
PE
82432003-07-25 Paul Eggert <eggert@twinsun.com>
8244
5b620e06
PE
8245 * data/glr.c (yyglrReduce): Don't use C89 string concatenation,
8246 for portability to K&R C (after ansi2knr, presumably). See
161a71f3 8247 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>
5b620e06
PE
8248 by Frank Heckenbach, though I have omitted the structure-initialization
8249 part of his glr-knr.diff patch since I recall that the Portable
8250 C Compiler didn't require that change.
8251
137437c6
PE
8252 Let the user specify how to allocate and free memory.
8253 Derived from a suggestion by Frank Heckenbach in
161a71f3 8254 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>.
137437c6
PE
8255 * data/glr.c (YYFREE, YYMALLOC, YYREALLOC): New macros.
8256 All uses of free, malloc, realloc changed to use these macros,
8257 and unnecessary casts removed.
8258 * data/yacc.c (YYFREE, YYMALLOC): Likewise.
8259
ddb85ca5
PE
82602003-07-06 Matthias Mann <MatthiasMann@gmx.de>
8261
8262 * data/lalr1.cc (operator<<(std::ostream&, const Position&)):
8263 use s.empty() rather than s == "" to test for empty string; see
161a71f3 8264 <http://lists.gnu.org/archive/html/bison-patches/2003-07/msg00003.html>
ddb85ca5
PE
8265 (trivial change)
8266
39910e09
AD
82672003-06-25 Akim Demaille <akim@epita.fr>
8268
8269 * config/depcomp, config/install-sh: Update from masters.
8270
0ae99356
PE
82712003-06-20 Paul Eggert <eggert@twinsun.com>
8272
8273 * data/glr.c (YYLLOC_DEFAULT): Parenthesize arguments as needed,
8274 and return properly parenthesized result.
8275 * data/lalar1.cc (YYLLOC_DEFAULT): Likewise.
8276 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
8277 Remove unnecessary parentheses from uses.
8278 * doc/bison.texinfo (Location Default Action): Describe the
8279 conventions for parentheses.
8280
cd05d13c
PE
82812003-06-19 Paul Eggert <eggert@twinsun.com>
8282
81fd08ca
PE
8283 * data/glr.c (yyremoveDeletes, yy_reduce_print, yyglrReduce,
8284 yyreportTree): Do not assume that size_t is the same width as int,
8285 when printing sizes. Print sizes using an unsigned format.
8286 Problem reported by Frank Heckenbach in
161a71f3 8287 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00035.html>.
4dcf140b 8288
cd05d13c
PE
8289 Port to Forte Developer 7 C compiler.
8290 * data/glr.c (struct YYLTYPE): If locations are not being used,
8291 declare a single dummy member, as empty structs do not conform
8292 to the C standard.
8293 (YYERROR, YYBACKUP): Do not use "do { ...; return foo; } while (0)";
8294 the Forte Developer 7 C compiler complains that end-of-loop
8295 code is not reached.
8296
4dcf140b
PE
82972003-06-17 Paul Eggert <eggert@twinsun.com>
8298
8299 * lib/libiberty.h (PARAMS): Spell argument as Args, not as X, to
8300 avoid warnings from picky compilers about redefinition of PARAMS.
8301
8dd76bee
PE
83022003-06-17 Paul Eggert <eggert@twinsun.com>
8303
8304 Version 1.875b.
8305
8306 * NEWS: Document 1.875b.
8307
8308 * lib/bbitset.h: Do not include config.h; that's the includer's job.
8309 Do not include <sys/types.h>; shouldn't be needed on a C89 host.
8310 * lib/bitset.h (bitset_compatible_p): Indent as per GNU standard.
8311 Don't use 'index' in comments, as it's a builtin fn on some hosts.
8312 * lib/bitset_stats.c: Include gettext.h unconditionally, as
8313 per recent gettext manual's suggestion.
8314 * lib/ebitset.c (ebitset_resize, ebitset_unused_clear):
8315 Use prototypes, not old-style definitions.
8316 * lib/lbitset.c (lbitset_unused_clear): Likewise.
8317 * lib/vbitset.c (vbitset_resize, vbitset_ones, vbitset_zero,
8318 vbitset_empty_p, vbitset_copy1, vbitset_not, vbitset_equal_p,
8319 vbitset_subset_p, vbitset_disjoint_p, vbitset_and, vbitset_and_cmp,
8320 vbitset_andn, vbitset_andn_cmp, vbitset_or, vbitset_or_cmp,
8321 vbitset_xor, vbitset_xor_cmp, vbitset_and_or, vbitset_and_or_cmp,
8322 vbitset_andn_or, vbitset_andn_or_cmp, vbitset_or_and,
8323 vbitset_or_and_cmp, vbitset_copy): Likewise.
8324
8325 * lib/libiberty.h: Do not include config.h; that's the includer's job.
8326 Do not include <stdlib.h>.
8327 (PARAMS): Define unconditionally for C89.
8328 (ATTRIBUTE_NORETURN): Remove.
8329 (ATTRIBUTE_UNUSED): Define unconditionally.
8330
8331 Upgrade to 2003-06-08 libbitset, submitted by Michael Hayes in:
161a71f3 8332 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00005.html>
8dd76bee
PE
8333 * lib/Makefile.am (bitsets_sources): Add vbitset.c, vbitset.h.
8334 * lib/vbitset.c, lib/vbitset.h: New files.
8335 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
8336 lib/bitset_stats.c, lib/ebitset.c, lib/lbitset.c: Import
8337 from libbitset.
8338
8339 * doc/bison.texinfo (How Can I Reset the Parser): Renamed from
8340 `How Can I Reset @code{yyparse}', since texinfo does not allow
8341 arbitrary @ in node names.
8342
8343 * m4/Makefile.am (EXTRA_DIST): Add the following files, which
8344 shouldn't be needed according to the gettext 0.12.1 documentation
8345 but which seem to be needed anyway: codeset.m4 glibc21.m4
f8e8262e 8346 intdiv0.m4 inttypes-pri.m4 inttypes.m4 inttypes_h.m4 isc-posix.m4
8dd76bee 8347 lcmessage.m4 nls.m4 po.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4.
f8e8262e 8348 * po/Makefile.in.in: Upgrade to gettext 0.12.1 version.
cd05d13c 8349
8dd76bee
PE
8350 * lib/.cvsignore: Add stdbool.h.
8351 * m4/.cvsignore: Add nls.m4, po.m4.
8352
8353 Upgrade to CVS gnulib.
8354 * stdbool_.h: File renamed from stdbool.h.in.
8355 * configure.ac (AM_STDBOOL_H): Invoke this instead of
8356 AC_HEADER_STDBOOL.
8357 (AM_GNU_GETTEXT): Put brackets around args, as latest manual suggests.
8358 (AM_GNU_GETTEXT_VERSION): Update to 0.12.1.
8359 * lib/Makefile.am (EXTRA_DIST): Add stdbool_.h.
8360 (MOSTLYCLEANFILES): New var.
8361 ($(libbison_a_OBJECTS)): Depend on $(STDBOOL_H).
8362 (stdbool.h): New rule.
8363 * lib/dirname.c, lib/dirname.h, lib/hash.c, lib/hash.h,
8364 lib/malloc.c, lib/obstack.h, lib/quote.c, lib/realloc.c,
8365 lib/strcasecmp.c, lib/xalloc.h, m4/alloca.m4, m4/onceonly.m4,
8366 m4/quote.m4: Upgrade to today's gnulib.
8367
8368 * tests/calc.at (AT_CHECK_CALC): New option EXPECTED-TO-FAIL.
8369 (AT_CHECK_CALC_LALR1_CC): Use it, since the C++ LALR parser fails
8370 the tests right now.
8371 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Ensure yylex and
8372 yyerror are declared before use; C99 requires this.
8373
25005f6a
PH
83742003-06-09 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
8375
8376 * data/glr.c (YYERROR): Update definition to reset yyerrState to 0
8377 first.
8378 (yyrecoverSyntaxError): Correct the logic for setting and testing
8379 yyerrState.
8380 Correct comment on handling EOF.
8381 Allow states with only a default reduction, rather than failing
8dd76bee 8382 (I can't quite reconstruct why these were not allowed before).
25005f6a 8383
137437c6 8384 Fixes to avoid problem that $-N rules in GLR parsers can cause
25005f6a 8385 buffer overruns, corrupting state.
8dd76bee
PE
8386
8387 * src/output.c (prepare_rules): Output max_left_semantic_context
25005f6a
PH
8388 definition.
8389 * src/reader.h (max_left_semantic_context): New variable declaration.
8390 * src/scan-gram.l (max_left_semantic_context): Define.
8391 (handle_action_dollar): Update max_left_semantic_context.
8392 * data/glr.c (YYMAXLEFT): New definition.
8393 (yydoAction): Increase size of yyrhsVals by YYMAXLEFT.
8394 (yyresolveAction): Ditto.
8395
8396 Fixes to problems with location handling in GLR parsers reported by
8397 Frank Heckenbach (2003/06/05).
8398
8399 * data/glr.c (YYLTYPE): Make trivial if locations not used.
8400 (YYRHSLOC): Add parentheses, and define only if locations used.
8401 (YYLLOC_DEFAULT): Add parentheses, and give trivial definition if
8402 locations not used.
8403 (yyuserAction): Use YYLLOC_DEFAULT to set *yylocp.
8404 (yydoAction): Remove redundant initialization of *yyvalp and *yylocp.
8dd76bee 8405
25005f6a
PH
8406 * tests/cxx-type.at: Exercise location information; update tests
8407 to differentiate output with and without locations.
8dd76bee 8408 Remove forward declarations of yylex and yyerror---caused errors
25005f6a
PH
8409 because default YYLTYPE not yet defined.
8410 Change semantic actions to compute strings, rather than printing
8411 them directly (to test proper passing of semantics values). Change
8412 output to prefix notation and update test data and expected results.
8413 (yylex): Track locations.
8414 (stmtMerge): Return value rather than printing, and include arguments
8415 in value.
8dd76bee 8416
711f40b7
PE
84172003-06-03 Paul Eggert <eggert@twinsun.com>
8418
8419 Avoid warnings generated by GCC 2.95.4 when Bison is
8420 configured with --enable-gcc-warnings.
8421 * data/lalr1.cc (yy::]b4_parser_class_name[::parse,
8422 yy::]b4_parser_class_name[::translate_,
8423 yy::Stack::operator[] (unsigned),
8424 yy::Stack::operator[] (unsigned) const,
8425 yy::Slice::operator[] (unsigned),
8426 yy::Slice::operator[] (unsigned) const):
8427 Rename local vars to avoid warnings.
8428 * tests/glr-regression.at (Improper handling of embedded actions
8429 and $-N in GLR parsers): Remove unused local variable from yylex.
8430 * tests/regression.at (_AT_DATA_DANCER_Y): Declare yylex to take
8431 (void) as arg when not pure, since we now assume C89 when building
8432 Bison. Pacify GCC by using parameter.
8433
ac695f7d
PE
84342003-06-02 Paul Eggert <eggert@twinsun.com>
8435
8436 * data/lalr1.cc (yy::Position::lines, yy::Position::columns,
8437 yy::Location::lines, yy::Location::columns): Rename arguments
8438 to avoid shadowing; this removes a warning generated by GCC 3.3.
8439
26ec81e0
PE
84402003-06-01 Paul Eggert <eggert@twinsun.com>
8441
8442 Don't pass C-only warning optins (e.g., -Wmissing-declarations)
8443 to g++, as GCC 3.3 complains if you do it.
8444 * configure.ac (WARNING_CXXFLAGS): New subst. Set it to
8445 everything that WARNING_CFLAGS has, except omit warnings
8446 not suitable for C++.
8447 (AC_PROG_CXX): Use this instead of AC_CHECK_PROGS([CXX], [g++]).
8448 * tests/atlocal.in (CXXFLAGS): New var.
8449 * tests/local.at (AT_COMPILE_CXX): Use it instead of CFLAGS.
8450
8451 Fix a GLR parser bug I reported in February; see
161a71f3 8452 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00008.html>.
26ec81e0
PE
8453 The problem was that GLR parsers did not conform to the C standard,
8454 because actions like { $1 = $2 + $3; } expanded to expressions
8455 that invoked YYFILL in separate subexpressions, and YYFILL assigned
8456 to a local variable. The C standard says that expressions
8457 like (var = f ()) + (var = f ()) have undefined behavior.
8458 Another problem was that GCC sometimes issues warnings that
8459 yyfill and its parameters are unused.
8460
8461 * data/glr.c (yyfillin): Renamed from the old yyfill. Mark
8462 as possibly unused.
8463 (yyfill): New function.
8464 (YYFILL): Use it.
8465 (yyuserAction): Change type of yynormal to bool, so that it matches
8466 the new yyfill signature. Mark it as possibly unused.
8467
8468
8469 Follow up on a bug I reported in February, where a Bison-generated
8470 parser can loop. Provide a test case and a fix for yacc.c. I
8471 don't have a fix for lalr1.cc or for glr.c, unfortunately.
8472 The original bug report is in:
161a71f3 8473 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00044.html>
26ec81e0
PE
8474
8475 * data/yacc.c (YYERROR): Now just 'goto yyerrorlab', since the
8476 macro's size was becoming unwieldy.
8477 (yyerrlab): Do not discard an empty lookahead symbol, as this
8478 might destroy garbage.
8479 (yyerrorlab): New label, with the old contents of YYERROR,
8480 plus the following change: pop the stack of rhs corresponding
8481 to the production that invoked YYERROR. That is how Yacc
8482 behaves, and POSIX requires this behavior.
8483 (yyerrlab1): Use YYPOPSTACK instead of its definiens.
8484 * tests/calc.at (_AT_DATA_CALC_Y): Include unistd.h if available.
8485 Define 'alarm' to do nothing if unistd.h is not available.
8486 Add a new rule "exp: '-' error;" to test the above change to
8487 data/yacc.c. Use 'alarm' to abort any test taking longer than
8488 10 seconds, as it's probably looping.
8489 (AT_CHECK_CALC): Test recovery from error in new grammar rule.
8490 Also, the new yacc.c generates two fewer diagnostics for an
8491 existing test.
8492
d0829076
PE
84932003-05-24 Paul Eggert <eggert@twinsun.com>
8494
c6ae27df
PE
8495 * data/glr.c (YYSTACKEXPANDABLE): Do not evaluate
8496 YYSTYPE_IS_TRIVIAL or YYSTYPE_IS_TRIVIAL unless they are defined.
8497 This fixes a problem reported by John Bowman when the Compaq/HP
8498 Alpha cxx compiler happy (e.g. using cxx -D__USE_STD_IOSTREAM
8499 -ansi -Wall -gall).
8500 * data/yacc.c (union yyalloc): Likewise.
8501 (YYCOPY): Do not evaluate __GNUC__ unless it is defined.
26ec81e0 8502
d0829076
PE
8503 Switch from 'int' to 'bool' where that makes sense.
8504
8505 * lib/abitset.c (abitset_test, abitset_empty_p, abitset_equal_p,
8506 abitset_subset_p, abitset_disjoint_p, abitset_and_cmp,
8507 abitset_andn_cmp, abitset_or_cmp, abitset_xor_cmp, abitset_and_or,
8508 abitset_and_or_cmp, abitset_andn_or_cmp, abitset_or_and_cmp):
8509 Return or accept bool, not int. All callers changed.
8510 * lib/bbitset.h: (bitset_toggle_, bitset_copy_, bitset_and_or_cmp_,
8511 bitset_andn_or_cmp_, bitset_or_and_cmp_): Likewise.
8512 * lib/bitset.c (bitset_only_set_p, bitset_print, bitset_toggle_,
8513 bitset_copy_, bitset_op4_cmp, bitset_and_or_cmp_, bitset_andn_or_cmp_,
8514 bitset_or_and_cmp_): Likewise.
8515 * lib/bitset.h (bitset_test, bitset_only_set_p): Likewise.
8516 * lib/bitset_stats.c (bitset_stats_print, bitset_stats_toggle,
8517 bitset_stats_test, bitset_stats_empty_p, bitset_stats_disjoint_p,
8518 bitset_stats_equal_p, bitset_stats_subset_p, bitset_stats_and_cmp,
8519 bitset_stats_andn_cmp, bitset_stats_or_cmp, bitset_stats_xor_cmp,
8520 bitset_stats_and_or_cmp, bitset_stats_andn_or_cmp,
8521 bitset_stats_or_and_cmp): Likewise.
8522 * lib/ebitset.c (ebitset_elt_zero_p, ebitset_equal_p, ebitset_copy_cmp,
8523 ebitset_test, ebitset_empty_p, ebitset_subset_p, ebitset_disjoint_p,
8524 ebitset_op3_cmp, ebitset_and_cmp, ebitset_andn_cmp, ebitset_or_cmp,
8525 ebitset_xor_cmp): Likewise.
8526 * lib/lbitset.c (lbitset_elt_zero_p, lbitset_equal_p, lbitset_copy_cmp,
8527 lbitset_test, lbitset_empty_p, lbitset_subset_p, lbitset_disjoint_p,
8528 lbitset_op3_cmp, lbitset_and_cmp, lbitset_andn_cmp, lbitset_or_cmp,
8529 lbitset_xor_cmp): Likewise.
8530 * lib/bbitset.h: Include <stdbool.h>.
8531 (struct bitset_vtable): The following members now return bool, not
8532 int: toggle, test, empty_p, disjoint_p, equal_p, subset_p,
8533 and_cmp, andn_cmp, or_cmp, xor_cmp, and_or_cmp, andn_or_cmp,
8534 or_and_cmp).
8535 * src/conflicts.c (count_rr_conflicts): Likewise.
8536 * lib/bitset_stats.h (bitset_stats_enabled): Now bool, not int.
8537 All uses changed.
8538 * lib/ebitset.c (ebitset_obstack_init): Likewise.
8539 * lib/lbitset.c (lbitset_obstack_init): Likewise.
8540 * src/getargs.c (debug_flag, defines_flag, locations_flag,
8541 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
8542 graph_flag): Likewise.
8543 * src/getargs.h (debug_flag, defines_flag, locations_flag,
8544 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
8545 graph_flag): Likewise.
8546 * src/output.c (error_verbose): Likewise.
8547 * src/output.h (error_verbose): Likewise.
8548 * src/reader.c (start_flag, typed): Likewise.
8549 * src/reader.h (typed): Likewise.
8550 * src/getargs.c (LOCATIONS_OPTION): New constant.
8551 (long_options, getargs): Use it.
8552 * src/lalr.c (build_relations): Use bool, not int.
8553 * src/nullable.c (nullable_compute): Likewise.
8554 * src/print.c (print_reductions): Likewise.
8555 * src/tables.c (action_row, pack_vector): Likewise.
8556 * src/muscle_tab.h (MUSCLE_INSERT_BOOL): New macro.
8557 * src/output.c (prepare): Use it.
8558 * src/output.c (token_definitions_output,
8559 symbol_destructors_output, symbol_destructors_output): Use string,
8560 not boolean integer, to keep track of whether to output separator.
8561 * src/print_graph.c (print_core): Likewise.
8562 * src/state.c (state_rule_lookaheads_print): Likewise.
8563
8564 * config/install-sh: Sync from automake 1.7.5.
8565
6b2584b7
PE
85662003-05-14 Paul Eggert <eggert@twinsun.com>
8567
8568 * src/parse-gram.y (rules_or_grammar_declaration): Require a
8569 semicolon after a grammar declaration, in the interest of possible
8570 future changes to the Bison input language.
8571 Do not allow a stray semicolon at the start of the grammar.
8572 (rhses.1): Allow one or more semicolons after any rule, including
8573 just before "|" as required by POSIX.
8574 * tests/input.at (Torturing the Scanner): Add tests for ";|" in a
8575 grammar.
8576
caf37a36
ADL
85772003-05-14 Alexandre Duret-Lutz <adl@gnu.org>
8578
8579 %parse-param support for lalr1.cc.
8580
8581 * data/lalr1.cc (b4_parse_param_decl, b4_parse_param_cons,
8582 b4_cc_constructor_calls, b4_cc_constructor_call,
8583 b4_parse_param_vars, b4_cc_var_decls, b4_cc_var_decl): New m4
8584 definitions.
8585 (yy::b4_parser_class_name::b4_parser_class_name): Take extra
8586 parse-param arguments.
8587 (yy::b4_parser_class_name): Declare instance variables to
8588 hold parse-param arguments.
8589 * tests/calc.at: s/value/semantic_value/ because value clashes
8590 with a member of yy::b4_parser_class_name. Adjust C++ code
8591 to handle %parse-param. Enable %parse-param test in C++.
8592
3ab37077
PE
85932003-05-12 Paul Eggert <eggert@twinsun.com>
8594
8595 * doc/bison.texinfo (How Can I Reset @code{yyparse}): Reword the
8596 English a bit. Fix fclose typo. Change "const char" to "char
8597 const", and use ANSI C rather than K&R for "main". Suggest
8598 YY_FLUSH_BUFFER over yyrestart (as that is what Flex recommends)
8599 and suggest yy_switch_to_buffer.
8600
86012003-05-05 Paul Eggert <eggert@twinsun.com>
163ab321
PE
8602
8603 * lib/bitset.h (__INT_TO_PTR): Define to a value that presumes
8604 C89. This avoids a diagnostic on compilers that define __STDC__
8605 to 0, fixing a problem with Tru64 cc reported by Martin Mokrejs in
161a71f3 8606 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
163ab321 8607
e743727f
PE
86082003-05-03 Paul Eggert <eggert@twinsun.com>
8609
8610 * lib/bitset.h (BITSET_FOR_EACH, BITSET_FOR_EACH_REVERSE):
8611 Do not overrun array bounds.
8612 This should fix a bug reported today by Olatunji Oluwabukunmi in
161a71f3 8613 <http://lists.gnu.org/archive/html/bug-bison/2003-05/msg00004.html>.
e743727f 8614
916708d5
AD
86152003-04-29 Akim Demaille <akim@epita.fr>
8616
8617 * src/gram.h, src/gram.c (pure_parser, glr_parser): Move to...
8618 * src/getargs.c, src/getargs.h: here, as bool, not int.
8619 (nondeterministic_parser): New.
8620 * src/parse-gram.y, src/scan-gram.l: Support
8621 %nondeterministic-parser.
8622 * src/output.c (prepare): Use nondeterministic_parser instead
8623 of glr_parser where appropriate.
8624 * src/tables.c (conflict_row, action_row, save_row)
8625 (token_actions, token_actions, pack_vector): Ditto.
8626
a06ea4aa
AD
86272003-04-29 Akim Demaille <akim@epita.fr>
8628
8629 * doc/bison.texinfo (C++ Parsers, Implementing Loops): New.
8630
211074ca
AD
86312003-04-29 Akim Demaille <akim@epita.fr>
8632
8633 * tests/calc.at: Also test yacc.c and glr.c (but not lalr1.cc yet)
8634 with %pure-parser and %locations to exercise the patch from Yakov
8635 Markovitch below.
8636
6175ffe3
PE
86372003-04-28 Tim Van Holder <tim.van.holder@pandora.be>
8638
8639 * data/yacc.c: (b4_lex_param): Corrected for the case where
8640 %lex-param is provided and %pure-parser isn't.
8641
b1e95857
PE
86422003-04-27 Paul Eggert <eggert@twinsun.com>
8643
8644 Avoid gcc -Wundef warnings reported by Gerald Pfeifer in
161a71f3 8645 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00044.html>.
b1e95857
PE
8646 * data/yacc.c (YYSTACK_ALLOC): Don't evaluate YYSTACK_USE_ALLOCA
8647 if it is not defined.
8648 (YYMAXDEPTH): Don't evaluate YYMAXDEPTH if it is not defined.
8649
acda9df6
PE
86502003-04-26 Paul Eggert <eggert@twinsun.com>
8651
3470c57b
PE
8652 * data/lalr1.cc (yy::Parser::pact_ninf_, yy::Parser::table_ninf_):
8653 Declare to be of type suitable for the ninf value itself, not of
8654 type suitable for the corresponding table, since the latter might
8655 be unsigned but the ninf value might be negative. This fixes a
8656 bug reported by Alexandre Duret-Lutz in
161a71f3 8657 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00017.html>.
3470c57b 8658
acda9df6
PE
8659 * configure.ac (AC_FUNC_ERROR_AT_LINE): Remove, since gl_ERROR
8660 invokes it. We shouldn't invoke it twice because it will attempt
8661 to put error.o in the archive twice. This fixes a glitch reported
8662 by Martin Mokrejs in
161a71f3 8663 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
acda9df6 8664
b5250f26
PE
86652003-04-21 Paul Eggert <eggert@twinsun.com>
8666
8667 * m4/error.m4: Update from Bruno Haible's 2003-04-14 patch
8668 to gnulib.
8669
089ac0f1
PE
86702003-04-21 Yakov Markovitch <Markovitch@iso.ru>
8671
8672 * data/glr.c (yyexpandGLRStack) [!YYSTACKEXPANDABLE]:
8673 Fix obvious typo that results in uncompilable GLR parsers
8674 when both %pure-parser and %locations are used. (trivial change)
8675
5ededac6
PE
86762003-04-17 Paul Eggert <eggert@twinsun.com>
8677
1b8f2fff
PE
8678 * src/scan-gram.l: Add %option nounput, since we no longer use unput.
8679 (unexpected_eof): Renamed from unexpected_end_of_file, for brevity.
8680 Do not insert the expected token via unput, as this runs afoul
8681 of a POSIX-compatibility bug in flex 2.5.31.
8682 All uses changed to BEGIN the parent state,
8683 since we no longer insert the expected token via unput.
8684 * tests/regression.at (Invalid inputs): Remove cascaded diagnostic
8685 that is no longer emitted after the above change.
8686
5ededac6
PE
8687 * src/conflicts.c (set_conflicts): Resolve all conflicts, not just
8688 the first one. This change is from Paul Hilfinger, and it fixes
8689 regression reported by Werner Lemberg in
161a71f3 8690 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
5ededac6
PE
8691
8692 (resolve_sr_conflict): Don't invoke state_errs_set
8693 unless one or more tokens have been explicitly made errors.
8694 Otherwise, the above change causes Bison to abort.
8695
8696 * tests/existing.at (GNU pic Grammar): New test case, taken from
8697 Lemberg's email.
8698
b8be9132
AD
86992003-03-31 Akim Demaille <akim@epita.fr>
8700
8701 * doc/Makefile.am (AM_MAKEINFOFLAGS): Don't split the info file.
8702
d423d460
AD
87032003-03-31 Akim Demaille <akim@epita.fr>
8704
8705 * src/output.c (prepare_symbols): Avoid trailing spaces in the
8706 output.
8707
c7e441b4
AD
87082003-03-31 Akim Demaille <akim@epita.fr>
8709
8710 * doc/bison.texinfo (Strings are Destroyed): s/losses/loses/.
8711 From Paul Hilfinger.
8712
231897ad
AD
87132003-03-29 Akim Demaille <akim@epita.fr>
8714
8715 * m4/error.m4: Do not put under dynamic conditions some code which
8716 expansion is under static control.
8717
5b066063
AD
87182003-03-29 Akim Demaille <akim@epita.fr>
8719
8720 * doc/bison.texinfo (How Can I Reset @code{yyparse}): New.
8721
22a74fec
AD
87222003-03-29 Akim Demaille <akim@epita.fr>
8723
8724 * doc/bison.texinfo (Strings are Destroyed): New.
8725
0eee27e7
PE
87262003-03-13 Paul Eggert <eggert@twinsun.com>
8727
8728 * .cvsignore: Add configure.lineno.
8729 * src/.cvsignore: Add yacc.
8730 * tests/.cvsignore: Add testsuite.log.
8731 * doc/fdl.texi: Sync with latest FSF version.
8732
f61aad93
PE
87332003-03-12 Paul Eggert <eggert@twinsun.com>
8734
537636c7
PE
8735 * scan-gram.l (YY_USER_INIT): Initialize code_start, too.
8736 (<INITIAL><<EOF>>, <SC_PRE_CODE><<EOF>>): Set *loc to the scanner
8737 cursor, instead of leaving it undefined. This fixes a bug
8738 reported by Tim Van Holder in
161a71f3 8739 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00023.html>.
537636c7
PE
8740 * tests/input.at (Torturing the Scanner): Test the scanner on
8741 an empty input file, which was Tim Van Holder's test case.
8742
8743 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): When checking whether
8744 <sys/resource.h> can be included, include sys/time.h and
8745 sys/times.h first, if available. This works around the SunOS
8746 4.1.4 porting bug reported by Bruce Becker in
161a71f3 8747 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00018.html>.
537636c7
PE
8748
8749 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't
8750 AC_CHECK_HEADERS([sys/wait.h]), as this interferes with
8751 AC_HEADER_SYS_WAIT.
8752
f61aad93
PE
8753 Merge changes from gnulib. This was prompted because the CVS
8754 snapshot didn't build on Solaris 7 due to strnlen problems.
8755
8756 These changes need to be merged back into gnulib:
8757 * lib/hash.c: Include <stdbool.h> unconditionally.
8758 * m4/onceonly.m4 (m4_quote): New macro.
8759 (AC_CHECK_HEADERS_ONCE, AC_CHECK_FUNCS_ONCE, AC_CHECK_DECLS_ONCE):
8760 Quote AC_FOREACH variable-expansions properly.
8761 The 2003-01-03 obstack.h change also needs merging.
8762 {end of changes requiring merging}
5b066063 8763
f61aad93
PE
8764 * lib/stdbool.h.in, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
8765 m4/getopt.m4, m4/hash.m4, m4/malloc.m4, m4/memchr.m4,
8766 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/quote.m4,
8767 m4/quotearg.m4, m4/realloc.m4, m4/stpcpy.m4, m4/strnlen.m4,
8768 m4/strtol.m4, m4/strtoul.m4, m4/unlocked-io.m4, m4/xalloc.m4:
8769 New files, imported from gnulib.
8770 * m4/Makefile.am (EXTRA_DIST): Add the new m4/*.m4 files mentioned
8771 above.
8772
8773 * lib/mbswidth.c, m4/error.m4, m4/mbrtowc.m4, m4/mbswidth.m4,
8774 m4/memcmp.m4, m4/prereq.m4, m4/stdbool.m4: Update to current
8775 gnulib sources.
8776
8777 * configure.ac (gl_DIRNAME, gl_GETOPT, gl_HASH, gl_QUOTE, gl_XALLOC):
8778 Add.
8779 (gl_ERROR): New, replacing jm_PREREQ_ERROR.
8780 (gl_FUNC_ALLOCA): New, replacing AC_FUNC_ALLOCA.
8781 (gl_FUNC_STPCPY): New, replacing AC_REPLACE_FUNCS(stpcpy).
8782 (gl_FUNC_STRNLEN): New, replacing AC_FUNC_STRNLEN.
8783 (gl_MBSWIDTH): New, replacing jm_PREREQ_MBSWIDTH.
8784 (gl_OBSTACK): New, replacing AC_FUNC_OBSTACK.
8785 (gl_QUOTEARG): New, replacing jm_PREREQ_QUOTEARG.
8786 (jm_FUNC_GLIBC_UNLOCKED_IO, gl_FUNC_STPCPY, gl_FUNC_STRTOL): New.
8787 (jm_FUNC_MALLOC): New, replacing AC_FUNC_MALLOC.
8788 (jm_FUNC_REALLOC): New, replacing AC_FUNC_REALLOC.
8789 (jm_PREREQ_ARGMATCH): Remove.
8790 (AC_REPLACE_FUNCS): Remove memchr, memrchr, stpcpy, strtol, strtoul.
8791 * lib/Makefile.am (libbison_a_SOURCES): Add argmatch.c, argmatch.h.
8792
8793 * src/system.h: Include <stdbool.h> unconditionally.
8794
8795 * lib/bbitset.h: Include <limits.h> unconditionally. We have been
8796 assuming at least C89 in the bitset code for some time now.
8797
d2ffe116
AD
87982003-03-03 Akim Demaille <akim@epita.fr>
8799
8800 * ro.po: New.
8801
052826fd
AD
88022003-03-02 Akim Demaille <akim@epita.fr>
8803
8804 * doc/bison.texinfo (Table of Symbols): Reactivate the
8805 documentation for %lex-param, and %parse-param.
8806
c4749565
AD
88072003-03-02 Akim Demaille <akim@epita.fr>
8808
8809 * data/yacc.c, data/glr.c, data/lal1.cc: Use similar code to
8810 generate verbose error messages.
8811 Use the number of tokens as an upper bound in yytname, as it
8812 cannot be a non terminal.
8813
d5286af1
AD
88142003-03-02 Akim Demaille <akim@epita.fr>
8815
8816 * tests/regression.at (_AT_DATA_DANCER_Y): Fix the expected error
8817 message.
8818
22e304a6
AD
88192003-03-02 Akim Demaille <akim@epita.fr>
8820
22e304a6
AD
8821 * tests/regression.at (_AT_DATA_DANCER_Y, AT_CHECK_DANCER): New.
8822 Use them to exercise yycheck overrun.
8823 Based on Andrew Suffield's grammar.
8824
67a25fed
AD
88252003-03-02 Akim Demaille <akim@epita.fr>
8826
8827 Create tests/local.at for Bison generic testing macros.
8828
8829 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Move to...
8830 * tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS):
8831 This new file.
8832 * tests/calc.at (AT_CHECK_CALC): Adjust.
8833 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR)
8834 (AT_COMPILE, AT_COMPILE_CXX, AT_PARSER_CHECK): Move to...
8835 * tests/local.at: here.
8836 (AT_COMPILE_CXX): Tags the tests using it as c++.
8837 Ignore the test if CXX is not functional.
8838
9c2b381f
PE
88392003-03-01 Paul Eggert <eggert@twinsun.com>
8840
8841 * src/scan-gram.l (code_start): Initialize it to scanner_cursor,
8842 not loc->end, since loc->end might contain garbage and this leads
8843 to undefined behavior on some platforms.
8844 (id_loc, token_start): Use (IF_LINTed) initial values that do not
8845 depend on *loc, so that the reader doesn't give the the false
8846 impression that *loc is initialized.
8847 (<INITIAL>"%%"): Do not bother setting code_start, since its value
8848 does not survive the return.
8849
0433ba88
AD
88502003-03-01 Akim Demaille <akim@epita.fr>
8851
8852 * src/scan-gram.l (code_start): Always initialize it when entering
8853 into yylex, as SC_EPILOGUE is activated *before* the corresponding
8854 yylex invocation. An alternative would be making it static, but
8855 then it starts with the second %%'s beginning, instead of its end.
8856
b305ea69
PE
88572003-02-28 Paul Eggert <eggert@twinsun.com>
8858
8859 * lib/mbswidth.c: Include <wchar.h> before "mbswidth.h", to work
8860 around a UnixWare 7.1.1 porting bug reported by John Hughes in
161a71f3 8861 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00030.html>.
b305ea69 8862
c3d25e01
PE
88632003-02-26 Paul Eggert <eggert@twinsun.com>
8864
8865 * README: Mention compiler bug in Sun Forte Developer 6 update 2.
8866 Remove Sequent/Pyramid discussion (nobody uses them any more).
8867 Merge VMS and MS-DOS discussion; these ports may well be dead
8868 but let's keep mentioning them for now. Put <> around email
8869 addresses. Add copyright notice.
8870
c267ffbc
PE
88712003-02-24 Paul Eggert <eggert@twinsun.com>
8872
8873 * data/glr.c (yy_reduce_print): yylineno -> yylno,
8874 to avoid collision with flex use of yylineno.
8875 Problem reported by Bruce Lilly in
161a71f3 8876 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00016.html>.
c267ffbc
PE
8877 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
8878 * data/yacc.c (yy_reduce_print): Likewise.
8879
8880 * config/depcomp: Sync with Automake 1.7.3.
8881
f939fc12
AD
88822003-02-21 Akim Demaille <akim@epita.fr>
8883
8884 * data/lalr1.cc: Use temporary variables instead of casts to
8885 change integer types.
8886 Suggested by Paul Eggert.
8887
95923bd6
AD
88882003-02-21 Akim Demaille <akim@epita.fr>
8889
8890 * doc/bison.texinfo: Use "location" consistently to refer to @n,
8891 to avoid confusions with lalr1.cc's notion of Position.
8892 Suggested by Paul Eggert.
8893
2cdc240e
AD
88942003-02-20 Akim Demaille <akim@epita.fr>
8895
8896 * data/lalr1.cc (position.hh): Make sure "columns" never pushes
8897 before initial_columns.
8898 (location.hh): Use consistent variable names when defining the
8899 operator<<.
8900 Use "last" so that we subtract from Positions, not from unsigned.
8901
5d003116
AD
89022003-02-20 Akim Demaille <akim@epita.fr>
8903
8904 * data/lalr1.cc (position.hh): New subfile, including the extended
8905 and Doxygen'ed documentation of class Position.
8906 (location.hh): Use it.
8907 Document a` la Doxygen.
ba1ecc07 8908 With the help of Benoit Perrot.
5d003116 8909
d02b25f9
AD
89102003-02-20 Akim Demaille <akim@epita.fr>
8911
8912 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Define
8913 AT_YACC_IF.
8914 Redefine AT_YYERROR_SEES_LOC_IF using it.
8915 (_AT_DATA_CALC_Y): Don't declare yyerror when lalr1.cc, as it is
8916 not defined.
8917 Don't use the location in yy::Parser::error_ and
8918 yy::Parser::print_ when not %locations.
8919 Activate more lalr1.cc tests.
8920
0d1c3a04
AD
89212003-02-19 Akim Demaille <akim@epita.fr>
8922
8923 * data/lalr1.cc: When displaying a line number, be sure to make it
8924 an int.
8925
60a777aa
AD
89262003-02-19 Akim Demaille <akim@epita.fr>
8927
8928 * data/lalr1.cc (b4_stack_depth_init, yy::Parser::initdepth_):
8929 Remove, useless.
8930 (YYABORT, YYACCEPT, YYERROR): New.
8931 * tests/calc.at: Renable the lalr1.cc test.
8932
0b86fc41
AD
89332003-02-19 Akim Demaille <akim@epita.fr>
8934
8935 * tests/calc.at (AT_CHECK_CALC): Check different scenarios of
8936 error recovery, mixing with/without pops and discarding of the
8937 lookahead.
8938 Exercise YYERROR.
8939 Disable the lalr1.cc tests as currently it doesn't support YYERROR.
8940
da99a5dc
PE
89412003-02-17 Paul Eggert <eggert@twinsun.com>
8942
8943 * tests/atlocal.in (LDFLAGS, LIBS): New vars.
8944 * tests/testsuite.at (AT_COMPILE): Use them.
8945 This fixes the testsuite problem reported by Robert Lentz in
161a71f3 8946 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00011.html>.
da99a5dc 8947
93b8c255
PE
89482003-02-12 Paul Eggert <eggert@twinsun.com>
8949
8950 * data/yacc.c (yyerrlab) [YYERROR_VERBOSE]:
8951 Avoid subscript error in yycheck. Bug reported by Andrew Suffield in
161a71f3 8952 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00003.html>.
93b8c255
PE
8953 * data/glr.c (yyreportSyntaxError) [YYERROR_VERBOSE]: Likewise.
8954 Check for malloc failure, for consistency with yacc.c.
8955 (yytname_size): Remove, for consistency with yacc.c.
8956
8957 The bug still remains in data/lalr1.cc, as I didn't have time
8958 to fix it there.
8959
7548fed2
AD
89602003-02-06 Akim Demaille <akim@epita.fr>
8961
8962 * configure.ac (GXX): Rename as...
8963 (CXX): this, to keep the original Autoconf semantics.
8964 Require 2.57.
8965 * data/lalr1.cc: Fix b4_copyright invocations.
8966 If YYDEBUG is not defined, don't depend upon name_ being defined.
8967 (location.hh): Include string and iostream.
8968 (Position::filename): New member.
8969 (Position::Position ()): New.
8970 (operator<< (Position)): New.
8971 (operator- (Position, int)): New.
8972 (Location::first, Location::last): Rename as...
8973 (Location::begin, Location::end): these, to mock the conventional
8974 iterator names.
8975 (operator<< (Location)): New.
8976 * tests/atlocal.in (CXX): New.
8977 * tests/testsuite.at (AT_COMPILE_CXX): New.
8978 * tests/calc.at (_AT_DATA_CALC_Y): Adjust yyerror to report the
8979 locations in a more synthetic way.
8980 (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF is positive if
8981 lalr1.cc is used.
8982 Adjust the C locations to match those from Emacs: first column is
8983 column 0.
8984 Change all the expected results.
8985 Conform to the GCS: simplify the locations when applicable.
8986 (LOC, VAL, YYLLOC_FORMAL, YYLLOC_ARG, USE_YYLLOC, LEX_FORMALS)
8987 (LEX_ARGS, USE_LEX_ARGS, LEX_PRE_FORMALS, LEX_PRE_ARGS): Replace
8988 these CPP macros with the m4 macros new defined by...
8989 (AT_CHECK_PUSHDEFS): this, i.e.:
8990 (AT_LALR1_CC_IF, AT_PURE_LEX_IF, AT_LOC, AT_VAL, AT_LEX_FORMALS)
d02b25f9 8991 (AT_LEX_ARGS, AT_USE_LEX_ARGS, AT_LEX_PRE_FORMALS, AT_LEX_PRE_ARGS)
7548fed2
AD
8992 New macros.
8993 (AT_CHECK_POPDEFS): Undefine them.
8994 (AT_CHECK_CALC_LALR1_CC): New.
8995 Use it for the first lalr1.cc test.
8996
43a176ef
AD
89972003-02-04 Akim Demaille <akim@epita.fr>
8998
8999 * data/lalr1.cc (YYLLOC_DEFAULT): Fix its definition: be based on
9000 Location as is defined.
9001
fc049e9c
AD
90022003-02-04 Akim Demaille <akim@epita.fr>
9003
9004 * data/lalr1.cc: If YYDEBUG is not defined, don't depend upon
9005 name_ being defined.
9006
a737b216
PE
90072003-02-03 Paul Eggert <eggert@twinsun.com>
9008
9009 * src/gram.h (start_symbol): Remove unused decl.
9010
9011 Use more-consistent naming conventions for local vars.
9012
9013 * src/derives.c (derives_compute): Change type of local var from
9014 int to rule_number.
9015 * src/gram.c (grammar_rules_partial_print): Likewise.
9016 * src/print.c (print_core): Likewise.
9017 * src/reduce.c (reduce_grammar_tables): Likewise.
9018
9019 * src/gram.c (grammar_dump): Change name of item_number *
9020 local var from r to rp.
9021 * src/nullable.c (nullable_compute): Likewise.
9022
9023 * src/gram.h (ISTOKEN, ISVAR): Use i, not s, for int var.
9024
9025 * src/gram.h (symbol_number_as_item_number): Use sym, not s,
9026 for symbol or symbol_number var.
9027 * src/reader.c (grammar_start_symbol_set): Likewise.
9028 * src/reader.h (grammar_start_symbol_set, grammar_symbol_append):
9029 Likewise.
9030 * src/state.c (transitions_to): Likewise.
9031 * src/state.h: Likewise.
9032 * src/tables.c (symbol_number_to_vector_number): Likewise.
9033
9034 * src/muscle_tab.h (MUSCLE_OBSTACK_SGROW): Use p, not s, for
9035 char * var.
9036
9037 * src/parse-gram.y (lloc_default): Use loc, not r, for YYLTYPE
9038 var.
9039
9040 * src/scan-gram.l (no_cr_read): Use bytes_read, not s, for size
9041 var.
9042
9043 * src/system.h (xstrndup, strchr, strspn, strnlen, memchr, memrchr):
9044 Use str, not s, for char * var. Use ch, not c, for character var.
9045 Use size for size var.
9046
9047 * src/uniqstr.c (uniqstr_new, uniqstr_assert): Use str, not s, for
9048 char * var.
9049 (uniqstr_print, uniqst_print_processor): Use ustr, not s, for
9050 uniqstr var.
9051 * src/uniqstr.h: Likewise.
9052
9053 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
9054 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
9055 get_node_alignment_str, get_arrow_mode_str, get_crossing_type_str,
9056 get_view_str, get_linestyle_str, get_arrowstyle_str): Rename
9057 param to have same name as that of enum, so that we don't use
9058 "s" to stand for a non-state.
9059
68e93ad5
AD
90602003-02-02 Akim Demaille <akim@epita.fr>
9061
9062 * src/scan-skel.l: Scan more than one inert character per yylex
9063 invocation.
9064
92898986
PE
90652003-02-01 Paul Eggert <eggert@twinsun.com>
9066
9067 Version 1.875a.
9068
1d9d5d71
PE
9069 * po/LINGUAS: Add ms.
9070
0435d061
AD
90712003-01-30 Akim Demaille <akim@epita.fr>
9072
9073 * doc/Makefile.am (CLEANFILES): Add bison.fns for distcheck.
9074
6029a57f
PH
90752003-01-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
9076
9077 * tests/cxx-type.at: Correct apparent typo in Bison input: $$ instead
9078 of $1.
0435d061
AD
9079
9080 Changes in response to error report by S. Eken: GLR mode does not
6029a57f 9081 handle negative $ indices or $ indices in embedded rules correctly.
161a71f3 9082 See <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00076.html>.
0435d061 9083
6029a57f
PH
9084 * data/glr.c (b4_rhs_value): Change to use YYFILL macro.
9085 (b4_rhs_location): Ditto.
0435d061 9086 (yyfill): New function to copy from stack tree into array
6029a57f 9087 incrementally.
0435d061
AD
9088 (yyuserAction): Modify to allow incremental move of semantic values
9089 to rhs array when in GLR mode.
9090 Define YYFILL to use in user-defined actions to fill semantic array
6029a57f
PH
9091 as needed.
9092 Remove dummy use of yystack, as there is now a guaranteed use.
9093 (yydoAction): Modify to allow incremental move of semantic values
9094 to rhs array when in GLR mode.
9095 (yyresolveAction): Ditto.
9096 (yyglrShiftDefer): Update comment.
0435d061 9097 (yyresolveStates): Use X == NULL for pointers, not !X.
6029a57f
PH
9098 (yyglrReduce): Ditto.
9099 (yydoAction): Ditto
0435d061 9100
6029a57f
PH
9101 * tests/glr-regr1.at: Rename to ...
9102 * tests/glr-regression.at: Add new regression test for the problems
9103 described above (adapted from S. Eken).
9104 Update copyright notice.
9105 * tests/testsuite.at: Rename glr-regr1.at to glr-regression.at.
9106 * tests/Makefile.am: Ditto.
9107
6cee6297
PE
91082003-01-28 Paul Eggert <eggert@twinsun.com>
9109
9110 * data/lalr1.cc: Do not use @output_header_name@ unless
9111 b4_defines_flag is set. This fixes two bugs reported by
9112 Tim Van Holder in
161a71f3
PE
9113 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00071.html>
9114 and <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00073.html>.
6cee6297 9115
b2a836b5
PE
91162003-01-21 Paul Eggert <eggert@twinsun.com>
9117
9118 * data/yacc.c (YYERROR): Move code from yyerrlab1 to here, so that
9119 we don't need to worry about yyerrlab1 being reported as an
9120 "unused label" by non-GCC C compilers. The downside is that if
9121 locations are used then a couple of statements are duplicated each
9122 time YYERROR is invoked, but the upside is that the warnings
9123 should vanish.
9124 (yyerrlab1): Move code to YERROR.
9125 (yyerrlab2): Remove. Change uses back to yyerrlab1.
9126 This reverts some of the 2002-12-27 change.
9127
4196b931
PE
91282003-01-17 Paul Eggert <eggert@twinsun.com>
9129
9130 * src/output.c (symbol_printers_output): Fix typo that led
9131 to core dump. Problem reported by Antonio Rus in
161a71f3 9132 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00058.html>.
4196b931 9133
3ae831b4
AD
91342003-01-13 Akim Demaille <akim@epita.fr>,
9135 Quoc Peyrot <chojin@lrde.epita.fr>,
9136 Robert Anisko <anisko_r@lrde.epita.fr>
9137
9138 * data/lalr1.cc (parse::yyerrlab1): When popping the stack, stop
9139 when the stacks contain one element, as the loop would otherwise
9140 free the last state, and then use the top state (the one we just
9141 popped). This means that the initial elements will not be freed
9142 explicitly, as is the case in yacc.c; it is not a problem, as
9143 these elements have fake values.
9144
e3aa65c5
PE
91452003-01-11 Paul Eggert <eggert@twinsun.com>
9146
9147 * NEWS: %expect-violations are now just warnings, reverting
9148 to Bison 1.30 and 1.75 behavior. This fixes the GCC 3.2
9149 bootstrapping problem reported by Matthias Klose; see
161a71f3 9150 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00053.html>.
e3aa65c5
PE
9151 * src/conflicts.c (conflicts_print): Likewise.
9152 * tests/conflicts.at (%expect not enough, %expect too much,
9153 %expect with reduce conflicts): Likewise.
9154 * doc/bison.texinfo (Expect Decl): Document this. Also mention
9155 that the warning is enabled if the number of conflicts changes
9156 (not necessarily increases).
9157
9158 * src/getargs.c (version): Update copyright year.
9159
f0057011
AD
91602003-01-09 Akim Demaille <akim@epita.fr>
9161
9162 * src/Makefile.am, lib/Makefile.am: Use $(VAR) instead of @VAR@.
9163
1ee6d2a0
PE
91642003-01-08 Paul Eggert <eggert@twinsun.com>
9165
9166 * Makefile.maint (WGETFLAGS):
9167 New macro, containing "-C off" to disable proxy caches.
9168 All uses of $(WGET) changed to $(WGET) $(WGETFLAGS).
9169 (rel-check): Use $(WGET) instead of wget.
9170
d4fd77c4
PE
91712003-01-06 Paul Eggert <eggert@twinsun.com>
9172
9173 * doc/bison.texinfo (Generalized LR Parsing): Add a reference to
9174 the GLR paper of Scott, Johnstone and Hussain.
9175
464c6927
PE
91762003-01-04 Paul Eggert <eggert@twinsun.com>
9177
d600ee67
PE
9178 * configure.ac (AC_ARG_ENABLE): Add --disable-yacc.
9179 (YACC_SCRIPT, YACC_LIBRARY): New vars to AC_SUBST.
9180 * lib/Makefile.am (lib_LIBRARIES): liby.a -> @YACC_LIBRARY@.
9181 (EXTRA_LIBRARIES): New var, for liby.a.
9182 * src/Makefile.am (bin_SCRIPTS): yacc -> @YACC_SCRIPT@.
9183 (EXTRA_SCRIPTS): New var, for yacc.
9184
464c6927
PE
9185 * data/yacc.c (yyerrlab1): Omit attribute if __cplusplus is defined,
9186 since GNU C++ (as of 3.2.1) does not allow attributes on labels.
9187 Problem reported by Nelson H. F. Beebe.
9188
91892003-01-03 Paul Eggert <eggert@twinsun.com>
9190
9191 * lib/obstack.h (__INT_TO_PTR) [__STDC__]: Cast result to
9192 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
9193 when compiling Bison 1.875's `bitset bset = obstack_alloc
9194 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
9195
9196 * src/scan-skel.l (QPUTS): Omit redundant `;' from macro definition.
9197 ([^@\n]): Renamed from [^@\n]+ so that the token buffer does not
9198 grow to a huge size with typical invocation.
d600ee67 9199
464c6927
PE
9200 * lib/hash.c (_Bool, bool, false, true, __bool_true_false_are_defined):
9201 Use the pattern recommended by Autoconf 2.57, except also protect
9202 against double-definition.
9203 * src/system.h: Likewise.
9204 Portability issues reported by Nelson H. F. Beebe.
d600ee67 9205
464c6927
PE
9206 * data/glr.c (yybool): Renamed from bool, to avoid collisions in C.
9207 All uses changed. Provide a definition in both C and C++.
9208 (yytrue, yyfalse): Define even if defined (__cplusplus).
9209
9210 * lib/bitset_stats.c (bitset_stats_list): Remove unused var.
9211 Reported by Nelson H. F. Beebe.
d600ee67 9212
464c6927
PE
9213 * src/scan-skel.l ("@oline@"): Output lineno+1, not lineno.
9214
0f42c7d5
PE
92152003-01-02 Paul Eggert <eggert@twinsun.com>
9216
9217 * data/yacc.c (yyerrlab1): Append `;' after attribute, to
9218 pacify the buggy "smart preprocessor" in MacOS 10.2.3.
9219 Bug reported by Nelson H. F. Beebe.
9220
dc546b0f
PE
92212003-01-01 Paul Eggert <eggert@twinsun.com>
9222
9223 * Version 1.875.
9224
2c09b6a7
PE
92252002-12-30 Paul Eggert <eggert@twinsun.com>
9226
9227 * src/scan-gram.l (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>","):
9228 Moved here from...
9229 (<INITIAL>","): Here. This causes stray "," to be treated
9230 more uniformly.
9231
dc546b0f 9232 * src/scan-gram.l (<SC_BRACED_CODE>"}"): Output ";" before the
2c09b6a7
PE
9233 last brace in braced code when not in Yacc mode, for compatibility
9234 with Bison 1.35. This resurrects the 2001-12-15 patch to
9235 src/reader.c.
9236
9237 * src/reader.h (YYDECL): Use YYSTYPE, not its deprecated alias
9238 yystype. This follows up the 2002-12-24 YYSTYPE bug fix.
9239
535c0f63
PE
92402002-12-28 Paul Eggert <eggert@twinsun.com>
9241
9242 * src/symtab.c (symbol_make_alias): Set type of SYMVAL to be
9243 that of SYM's type. This fixes Debian bug 168069, reported by
9244 Thomas Olsson.
d600ee67 9245
963fcc17
PE
92462002-12-28 Paul Eggert <eggert@twinsun.com>
9247
9248 Version 1.75f.
9249
9250 Switch back to the Yacc style of conflict reports, undoing some
9251 of the 2002-07-30 change.
9252 * doc/bison.texinfo (Understanding): Use Yacc style for
9253 conflict reports. Also, use new way of locating rules.
9254 * src/conflicts.c (conflict_report):
9255 Renamed from conflict_report_yacc, removing the old
9256 'conflict_report'. Translate the entire conflict report at once,
9257 so that we don't assume that "," has the same interpretation in
9258 all languages.
9259 (conflicts_output): Use Yacc-style conflict report for each state,
9260 instead of our more-complicated style.
9261 (conflicts_print): Use Yacc-style conflict report, except print
9262 the input file name when not emulating Yacc.
9263 * tests/conflicts.at (Unresolved SR Conflicts, Defaulted
9264 Conflicted Reduction, %expect not enough, %expect too much,
9265 %expect with reduce conflicts): Switch to Yacc-style conflict reports.
9266 * tests/existing.at (GNU Cim Grammar): Likewise.
9267 * tests/glr-regr1.at (Badly Collapsed GLR States): Likewise.
9268
9269 * src/complain.c (warn_at, warn, complain_at, complain, fatal_at,
9270 fatal): Don't invoke fflush; it's not needed and it might even be
9271 harmful for stdout, as stdout might not be open.
9272 * src/reduce.c (reduce_print): Likewise.
9273
b1efe548
PE
92742002-12-27 Paul Eggert <eggert@twinsun.com>
9275
9276 Fix a bug where error locations were not being recorded correctly.
9277 This problem was originally reported by Paul Hilfinger in
161a71f3 9278 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00086.html>.
b1efe548
PE
9279
9280 * data/yacc.c (yyparse): New local var yylerrsp, to record the
9281 top of the location stack's error locations.
9282 (yyerrlab): Set it. When discarding a token, push its location
9283 onto yylerrsp so that we don't lose track of the error's end.
9284 (yyerrlab1): Now is only the target of YYERROR, so that we can
9285 properly record the location of the action that failed. For GCC
9286 2.93 and later, insert an __attribute__ ((__unused__)) to avoid
9287 GCC warning about yyerrlab1 being unused if YYERROR is unused.
9288 (yyerrlab2): New label, which yyerrlab now falls through to.
9289 Compute the error's location by applying YYLLOC_DEFAULT to
9290 the locations of all the symbols that went into the error.
9291 * doc/bison.texinfo (Location Default Action): Mention that
9292 YYLLOC_DEFAULT is also invoked for syntax errors.
9293 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
9294 Error locations include the locations of all the tokens that were
9295 discarded, not just the last token.
d600ee67 9296
983c5c2c
PE
92972002-12-26 Paul Eggert <eggert@twinsun.com>
9298
b1efe548
PE
9299 * src/files.c: Include quote.h.
9300 (compute_output_file_names): Warn if we detect conflicting
9301 outputs to the same file. This should catch the misunderstanding
9302 exemplified by Debian Bug 165349, reported by Bruce Stephens..
9303
9304 * src/conflicts.c (conflicts_print): If the user specifies
9305 "%expect N", report an error if there are any reduce/reduce
9306 conflicts. This is what the manual says should happen.
9307 This fixes Debian bug 130890, reported by Anthony DeRobertis.
9308 * tests/conflicts.at (%expect with reduce conflicts): New test.
9309
983c5c2c
PE
9310 Don't use m4_include on relative file names, as it doesn't work as
9311 desired if there happens to be a file with that name under ".".
d600ee67 9312
983c5c2c
PE
9313 * m4sugar/version.m4: Remove; it was included but it wasn't used.
9314 * data/Makefile.am (dist_m4sugar_DATA): Remove m4sugar/version.m4.
9315 * data/m4sugar/m4sugar.m4: Don't include m4sugar/version.m4.
9316 * data/glr.c, data/lalr1.cc, data/yacc.c: Don't include c.m4.
9317 * src/output.c (output_skeleton): Use full path names when
9318 specifying a file to include; don't rely on include path, as
9319 it's unreliable when the working file contains a file with
9320 that name.
d600ee67 9321
983c5c2c
PE
93222002-12-25 Paul Eggert <eggert@twinsun.com>
9323
9324 Remove obsolete references to bison.simple and bison.hairy.
9325 Problem mentioned by Aubin Mahe in
161a71f3 9326 <http://lists.gnu.org/archive/html/help-bison/2002-12/msg00010.html>.
983c5c2c
PE
9327 * data/glr.c: Comment fix.
9328 * doc/bison.1: Remove references. Also, mention "yacc".
9329
9330 * src/getargs.c (getargs) [MSDOS]: Don't assume optarg != NULL
9331 with -g option.
9332
9333 * src/parse-gram.y (declaration): Use enum "report_states" rather
9334 than its numeric value 1.
9335
9336 * src/scan-skel.l ("@output ".*\n): Close any old yyout before
9337 opening a new one. This fixes Debian bug 165349, reported by
9338 Bruce Stephens.
9339
23f2d9dc
PE
93402002-12-24 Paul Eggert <eggert@twinsun.com>
9341
9342 Version 1.75e.
9343
9344 * Makefile.maint (cvs-update): Don't assume that the shell
9345 supports $(...), as Solaris sh doesn't.
9346
9347 * src/parse-gram.y (lloc_default): Remove test for empty
9348 nonterminals at the end, since it didn't change the result.
9349
93502002-12-24 Paul Eggert <eggert@twinsun.com>
33167b8b
PE
9351
9352 If the user does not define YYSTYPE as a macro, Bison now declares it
9353 using typedef instead of defining it as a macro. POSIX requires this.
9354 For consistency, YYLTYPE is also declared instead of defined.
9355
9356 %union directives can now have a tag before the `{', e.g., the
9357 directive `%union foo {...}' now generates the C code
9358 `typedef union foo { ... } YYSTYPE;'; this is for Yacc compatibility.
9359 The default union tag is `YYSTYPE', for compatibility with Solaris 9
9360 Yacc. For consistency, YYLTYPE's struct tag is now `YYLTYPE'
9361 instead of `yyltype'.
9362
9363 `yystype' and `yyltype' are now obsolescent macros instead of being
9364 typedefs or tags; they are no longer documented and will be
9365 withdrawn in a future release.
9366
9367 * data/glr.c (b4_location_type): Remove.
9368 (YYSTYPE): Renamed from yystype.
9369 (YYSTYPE_IS_DECLARED): New macro, used to prevent double-typedef.
9370 (struct YYLTYPE): Renamed from struct yyltype.
9371 (YYLTYPE): Renamed from yyltype.
9372 (yyltype, yystype): New (and obsolescent) macros,
9373 for backward compatibility.
9374 * data/yacc.c: Likewise.
9375
9376 * data/yacc.c (YYSTYPE): Declare as union YYSTYPE if the user
9377 does not specify a union tag. This is for compatibility with
9378 Solaris 9 yacc.
9379
9380 * src/parse-gram.y (add_param): 2nd arg is now char * not char
9381 const *, since it is now modified by stripping surrounding { }.
9382 (current_braced_code): Remove.
9383 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_UNION,
9384 PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Change names to include
9385 trailing " {...}". Now of type <chars>.
9386 (grammar_declaration): Adjust to bundled tokens.
9387 (code_content): Remove; stripping is now done by add_param.
9388 (print_token_value): Print contents of bundled tokens.
9389 (token_name): New function.
9390
9391 * src/reader.h (braced_code, current_braced_code): Remove.
9392 (token_name): New decl.
9393
9394 * src/scan-gram.l (handle_dollar, handle_at): Now takes int
9395 token_type, not braced_code code_kind. All uses changed.
9396 (SC_PRE_CODE): New state, for scanning after a keyword that
9397 has (or usually has) an immediately-following braced code.
9398 (token_type): New local var, to keep track of which token type
9399 to return when scanning braced code.
9400 (<INITIAL>"%destructor", <INITIAL>"%lex-param",
dc546b0f 9401 <INITIAL>"%parse-param", <INITIAL>"%printer",
33167b8b
PE
9402 <INITIAL>"%union"): Set token type and BEGIN SC_PRE_CODE
9403 instead of returning a token type immediately.
9404 (<INITIAL>"{"): Set token type.
9405 (<SC_BRACED_CODE>"}"): Use it.
9406 (handle_action_dollar, handle_action_at): Now returns bool
9407 indicating success. Fail if ! current_rule; this prevents a core dump.
9408 (handle_symbol_code_dollar, handle_symbol_code_at):
9409 Remove; merge body into caller.
9410 (handle_dollar, handle_at): Complain in invalid contexts.
9411
9412 * NEWS, doc/bison.texinfo: Document the above.
9413 * NEWS: Fix years and program names in copyright notice.
9414
879ca4f8
PE
94152002-12-17 Paul Eggert <eggert@twinsun.com>
9416
9417 * NEWS, doc/bison.texinfo (Parser Function, Pure Calling, Error
9418 Reporting, Table of Symbols): Omit mentions of %lex-param and
9419 %parse-param from the documentation for now.
9420
1c5fe69d
PE
94212002-12-15 Paul Eggert <eggert@twinsun.com>
9422
9423 Undo most of the 2002-11-12 yychar -> yytoken patch, as it broke
9424 GCC 3.2.1 (which depends on yychar == YYEMPTY when there is no
9425 lookahead symbol, and which sets yychar in parser actions) and it
7ea9026a
PE
9426 disagreed with the Bison documentation. Bug
9427 reported by Andrew Walrond.
d600ee67 9428
1c5fe69d
PE
9429 * data/yacc.c (YYTRANSLATE): Don't check for negative argument,
9430 as the caller now does that.
9431 (yyclearin, YYBACKUP, yyparse): Use yychar, not yytoken.
9432 (YYEMPTY): Parenthesize right hand side, since others use it.
9433 (yyparse): Don't assume that our generated code is the only code
9434 that sets yychar.
9435
d1de5372
PE
94362002-12-13 Paul Eggert <eggert@twinsun.com>
9437
9438 Version 1.75d.
9439
9440 POSIX requires a "yacc" command.
9441 * src/Makefile.am (bin_SCRIPTS): New macro, for yacc.
9442 (MOSTLYCLEANFILES): Add yacc.
9443 (yacc): New rule.
1c5fe69d 9444 * doc/bison.texinfo (Invocation, Bison Options): Mention yacc
d1de5372
PE
9445 as an alias for bison y.
9446
9447 * po/LINGUAS: Add da.
d600ee67 9448
d1de5372
PE
9449 * src/getargs.c (__GNU_LIBRARY__) [lint]: Define to work around
9450 problem with latest <getopt.h>.
9451 (HACK_FOR___GNU_LIBRARY___PROTOTYPE): New macro.
9452
9453 * doc/fdl.texi: Upgrade to 1.2.
9454 * lib/alloca.c, lib/error.c, lib/getopt.c, lib/getopt.h
9455 lib/getopt1.c, lib/gettext.h, lib/memrchr.c, lib/obstack.c,
9456 lib/obstack.h, lib/strnlen.c, lib/unlocked-io.h: Sync with
9457 gnulib.
9458 * config/install-sh: Sync with autotools.
9459
9460 Fix a bad interaction with flex 2.5.23 reported by Bruce Lilly in
161a71f3 9461 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
d1de5372
PE
9462 * data/yacc.c (YYLTYPE, struct yyltype): Do not define unless
9463 locations are requested.
9464 (union yyalloc): Do not depend on YYLTYPE_IS_TRIVIAL unless
9465 locations are requested.
9466
d0f3fe23
PE
94672002-12-12 Paul Eggert <eggert@twinsun.com>
9468
9469 Remove unportable casts and storage allocation tricks.
9470 While we're at it, remove almost all casts, since they
9471 usually aren't needed and are a sign of trouble.
9472
9473 * configure.ac (AC_CHECK_TYPES): Check for uintptr_t.
9474
9475 * src/derives.c (derives_compute): Do not subtract NTOKENS from
9476 the pointer DSET returned by malloc; this isn't portable.
9477 Instead, always use DSET[i - NTOKENS] rather than DSET[i].
9478 Similarly for DERIVES.
9479 * src/lalr.c (set_goto_map): Likewise, for GOTO_MAP and TEMP_MAP.
9480 * src/nullable.c (nullable_compute): Likewise, for RSETS and NULLABLE.
9481 * src/reduce.c (reduce_grammar_tables): Likewise, for nontermmap
9482
9483 * src/derives.c (derives_compute): Do not bother invoking
9484 int_of_rule_number, since rule numbers are integers.
9485
9486 * src/files.c (concat2, tr, compute_base_name): Use xmalloc (N)
9487 rather than XMALLOC (char, N).
9488
9489 * src/files.c (filename_split): Rewrite to avoid cast.
9490
9491 * src/gram.h (symbol_number_as_item_number,
9492 item_number_as_symbol_number, rule_number_as_item_number,
9493 item_number_as_rule_number):
9494 Now inline functions rather than macros, to avoid casts.
9495 * src/state.h (state_number_as_int): Likewise.
9496 * src/tables.c (state_number_to_vector_number,
9497 symbol_number_to_vector_number): Likewise.
9498
9499 * src/gram.h (int_of_rule_number): Remove; no longer used.
9500
9501 * src/lalr.c (add_lookback_edge): Use malloc rather than calloc,
9502 since the resulting storage is always stored into.
9503
9504 * src/main.c (alloca) [C_ALLOCA]: Add decl here, the only place
9505 where it's needed.
9506
9507 * src/muscle_tab.c (muscle_m4_output):
9508 Now inline. Return bool, not int.
9509 * src/state.c (state_compare): Likewise.
9510 * src/symtab.c (symbol_check_defined,
9511 symbol_check_alias_consistency, symbol_pack, symbol_translation,
9512 hash_compare_symbol, hash_symbol):
9513 Likewise.
9514 * src/uniqstr.c (uniqstr_print): Likewise.
9515 * src/muscle_tab.c (muscle_m4_output_processor):
9516 New function, to avoid casts.
9517 * src/state.c (state_comparator, stage_hasher): Likewise.
9518 * src/symtab.c (symbol_check_defined_processor,
9519 symbol_check_alias_consistency_processor, symbol_pack_processor,
9520 symbol_translation_processor, hash_symbol_comparator,
9521 hash_symbol_hasher): Likewise.
9522 * src/uniqstr.c (uniqstr_print_processor): Likewise.
9523 * src/muscle_tab.c (muscles_m4_output):
9524 Use new functions instead of casting old functions unportably.
9525 * src/state.c (state_hash_new): Likewise.
9526 * src/symtab.c (symbols_new, symbols_do, symbols_check_defined,
9527 symbols_token_translations_init):
9528 Likewise.
9529 * src/uniqstr.c (uniqstrs_new, hash_initialize, uniqstrs_do): Likewise.
9530
9531 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): Use long local
9532 var instead of casting to long, to avoid casts.
9533 (prepare_states): Use MALLOC rather than alloca, so that we don't
9534 have to worry about alloca.
9535 * src/state.c (state_hash_lookup): Likewise.
9536
9537 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>"'"): Use unsigned char
9538 local var instead of casting to unsigned char, to avoid casts.
9539
9540 * src/state.c (TRANSITIONS_ALLOC, ERRS_ALLOC, REDUCTIONS_ALLOC,
9541 STATE_ALLOC): Remove.
9542 (transitions_new, errs_new, reductions_new, state_new): Use malloc
9543 rather than calloc, and use offsetof to avoid allocating slightly
9544 too much storage.
9545 (state_new): Initialize all members.
9546
9547 * src/state.c (state_hash): Use unsigned accumulator, not signed.
9548
9549 * src/symtab.c (symbol_free): Remove; unused.
9550 (symbol_get): Remove cast in lhs of assignment.
9551 (symbols_do): Now static. Accept generic arguments, not
9552 hashing-related ones.
9553
9554 * src/symtab.h: (NUMBER_UNDEFINED): Remove unnecessary cast.
9555 (symbol_processor): Remove.
9556 (symbols_do): Remove decl; now static.
9557
9558 * src/system.h (alloca): Remove; decl no longer needed.
9559 (<stddef.h>): Include, for offsetof.
9560 (<inttypes.>, <stdint.h>): Include if available.
9561 (uintptr_t): New type, if system lacks it.
9562 (CALLOC, MALLOC, REALLOC): New macros.
9563 All uses of XCALLOC, XMALLOC, and XREALLOC changed to use these
9564 new macros.
9565
9566 * src/tables.c (table_size): Now int, to pacify GCC.
9567 (table_grow, table_ninf_remap): Use signed table size.
9568 (save_row): Don't bother initializing locals when not needed.
9569 (default_goto, goto_actions, pack_vector): Remove unnecessary casts.
9570 * src/uniqstr.c (hash_compare_uniqstr): Likewise.
9571
9572 * src/vcg.h: Correct misspellings.
9573
9574 * src/vcg_defaults.h (G_CMAX): Now INT_MAX.
9575
9576
9577 * src/getargs.c (getargs): Don't assume EOF == -1.
9578
26b4a969
PE
95792002-12-09 Paul Eggert <eggert@twinsun.com>
9580
9581 Change identifier spellings to avoid collisions with names
9582 that are reserved by POSIX.
9583
9584 Don't use names ending in _t, since POSIX reserves them.
9585 For consistency, remove _e and _s endings -- they're weren't
9586 needed to remove ambiguity. All uses changed.
9587 * src/uniqstr.h (uniqstr): Renamed from uniqstr_t, which in
9588 turn was just renamed from struniq_t.
9589 * src/uniqstr.c (uniqstr_processor): Renamed from struniq_processor,
9590 which in turn was just renamed from struniq_processor_t.
9591 (hash_compare_uniqstr): Renamed from hash_compare_struniq, which
9592 in turn was renamed from hash_compare_struniq_t.
9593 * src/LR0.c (struct state_list): Renamed from struct state_list_s.
9594 (state_list): Renamed from state_list_t.
9595 * src/assoc.h (assoc): Renamed from assoc_t.
9596 * src/conflicts.c (enum conflict_resolution): Renamed from
9597 enum conflict_resolution_e.
9598 * src/derives.c (struct rule_list): Renamed from struct rule_list_s.
9599 (rule_list): Renamed from rule_list_t.
9600 * src/getargs.h (enum trace): Renamed from enum trace_e.
9601 (enum report): Renamed from enum report_e.
9602 * src/gram.h (item_number): Renamed from item_number_t.
9603 (rule_number): Renamed from rule_number_t.
9604 (struct rule_s): Remove the "rule_s" part; not used.
9605 (rule): Renamed from rule_t.
9606 (rule_filter): Renamed from rule_filter_t.
9607 * src/lalr.c (struct goto_list): Renamed from struct goto_list_s.
9608 (goto_list): Renamed from goto_list_t.
9609 * src/lalr.h (goto_number): Renamed from goto_number_t.
9610 * src/location.h (location): Renamed from location_t.
9611 * src/muscle_tab.c (muscle_entry): Renamed from muscle_entry_t,
9612 and moved here from:
9613 * src/muscle_tab.h (muscle_entry_t): here.
9614 * src/nullable.c (struct rule_list): Renamed from struct rule_list_s.
9615 (rule_list): Renamed from rule_list_t.
9616 * src/print_graph.c (static_graph): Renamed from graph.
9617 * src/reader.h (braced_code): Renamed from braced_code_t.
9618 Remove brace_code_e tag.
9619 * src/relation.h (relation_node): Renamed from relation_node_t.
9620 (relation_nodes): Renamed from relation_nodes_t.
9621 (relation): Renamed from relation_t.
9622 * src/state.h (state_number): Renamed from state_number_t.
9623 (struct state): Renamed from struct state_s.
9624 (state): Renamed from state_t.
9625 (transitions): Renamed from transitions_t. Unused (and
9626 misspelled) transtion_s tag removed.
9627 (errs): Renamed from errs_t. Unused errs_s tag removed.
9628 (reductions): Renamed from reductions_t. Unused tag
9629 reductions_s removed.
9630 * src/symlist.h (symbol_list): Renamed from symbol_list_t.
9631 (struct symbol_list): Renamed from struct symbol_list_s.
9632 * src/symtab.h (symbol_number): Renamed from symbol_number_t.
9633 (struct symbol): Renamed from struct symbol_s.
9634 (symbol): Renamed from symbol_t.
9635 * src/tables.c (vector_number): Renamed from vector_number_t.
9636 (action_number): Renamed from action_t.
9637 * src/tables.h (base_number): Renamed from base_t.
9638 * src/vcg.h (enum color): Renamed from enum color_e.
9639 (enum textmode): Renamed from enum textmode_e.
9640 (enum shape): Renamed from enum shape_e.
9641 (struct colorentry): Renamed from struct colorentry_s.
9642 (struct classname): Renamed from struct classname_s.
9643 (struct infoname): Renamed from struct infoname_s.
9644 (enum layoutalgorithm): Renamed from enum layoutalgorithm_e.
9645 (enum decision): Renamed from enum decision_e.
9646 (enum orientation): Renamed from enum orientation_e.
9647 (enum alignment): Renamed from enum alignment_e.
9648 (enum arrow_mode): Renamed from enum arrow_mode_e.
9649 (enum crossing_type): Renamed from enum crossing_type_e.
9650 (enum view): Renamed from enum view_e.
9651 (struct node): Renamed from struct node_s.
9652 (node): Renamed from node_t.
9653 (enum linestyle): Renamed from enum linestyle_e.
9654 (enum arrowstyle): Renamed from enum arrowstyle_e.
9655 (struct edge): Renamed from struct edge.
9656 (edge): Renamed from edge_t.
9657 (struct graph): Renamed from struct graph_s.
9658 (graph): Renamed from graph_t.
9659 * tests/calc.at (_AT_DATA_CALC_Y, Simple LALR Calculator):
9660 Rename value_t -> value.
9661 * tests/input.at (Torturing the Scanner): Rename value_t -> value,
9662 value_t_as_yystype -> value_as_yystype.
9663
9664 Don't include <errno.h> in the mainstream code, since it
9665 reserves E[A-Z0-9]* and we want to use symbols like 'EQUALS'.
9666 * lib/get-errno.c, lib/get-errno.h: New files.
9667 * lib/Makefile.am (libbison_a_SOURCES): Add get-errno.h,
9668 get-errno.c.
9669 * src/files.c (xfopen, xfclose): Use get_errno instead of errno.
9670 * src/output.c (output_skeleton): Likewise.
9671 * src/scan-gram.l (<INITIAL>{int}): Use set_errno and get_errno
9672 instead of errno.
9673 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>\\x[0-9abcdefABCDEF]+):
9674 Likewise.
9675 (handle_action_dollar, handle_action_at): Likewise.
9676 * src/system.h: Do not include <errno.h>.
9677 (TAB_EXT): Renamed from EXT_TAB.
9678 (OUTPUT_EXT): Renamed from EXT_OUTPUT.
9679
9680 Avoid str[a-z]*, since <string.h> reserves that name space.
9681 Change all instances of "struniq" in names to "uniqstr", and
9682 likewise for "STRUNIQ" and "UNIQSTR".
9683 * src/uniqstr.c: Renamed from src/struniq.c.
9684 * src/uniqstr.h: Renamed from src/struniq.h.
9685 * src/Makefile.am (bison_SOURCES): Adjust to these renamings.
9686 * src/files.c (strsuffix): Remove; unused.
9687 (concat2): Renamed from stringappend. Now static.
9688 * src/files.h (strsuffix, stringappend): Remove; unused.
9689 * src/parse-gram.y (<chars>): Renamed from <string>.
9690 (<uniqstr>): Renamed from <struniq>.
9691 * src/scan-gram.l (obstack_for_string): Renamed from string_obstack.
9692 * src/vcg.h (struct node_s.expand): Renamed from struct node_s.stretch.
9693 (struct graph_s.expand): Renamed from struct graph_s.stretch.
9694 * src/vcg_defaults.h (G_EXPAND): Renamed from G_STRETCH.
9695 (G_LONG_STRAIGHT_PHASE): Renamed from G_STRAIGHT_PHASE.
9696 (N_EXPAND): Renamed from N_STRETCH.
9697
9698 Avoid *_MAX and *_MIN, since <limits.h> reserves that name space.
9699 * data/yacc.c (YYSTACK_GAP_MAXIMUM): Renamed from YYSTACK_GAP_MAX.
9700 * src/gram.h (ITEM_NUMBER_MAX, ITEM_NUMBER_MIN, RULE_NUMBER_MAX):
9701 Remove; unused.
9702 * src/lalr.h (GOTO_NUMBER_MAXIMUM): Renamed from GOTO_NUMBER_MAX.
9703 * src/state.h (STATE_NUMBER_MAXIMUM): Renamed from STATE_NUMBER_MAX.
9704 * src/symtab.h (SYMBOL_NUMBER_MAXIMUM): Renamed from SYMBOL_NUMBER_MAX.
9705 * src/tables.c (VECTOR_NUMBER_MAX, VECTOR_NUMBER_MIN): Remove; unused.
9706 (BASE_MAXIMUM): Renamed from BASE_MAX.
9707 (BASE_MINIMUM): Renamed from BASE_MIN.
9708 (ACTION_MAX): Remove; unused.
9709 (ACTION_NUMBER_MINIMUM): Renamed from ACTION_MIN.
9710 Unnecessary casts removed from above defines.
9711
9712
9713 Fix misspelling in names.
9714 * src/vcg.h (enum_alignment_e): Renamed from enum_alignement_e.
9715 * src/vcg_defaults.h (G_NODE_ALIGNMENT): Renamed from
9716 G_NODE_ALIGNEMENT.
9717
9718
9719 * lib/timevar.c (timevar_report): Renamed from time_report,
9720 for consistency with other names.
9721 * lib/timevar.h (timevar_report): New decl.
9722 * src/system.h (time_report): Remove; decl is now in lib/timevar.h.
9723
9724
9725 Sort include-file uses.
9726
9727 Reorder all include files under src to be in the order "system.h".
9728 then the ../lib include files in angle brackets (alphabetized),
9729 then the . include files in double-quotes (alphabetized). Fix
9730 dependency breakages encountered in this process, as follows:
9731 * src/closure.h, src/derives.h, src/state.h: Include "gram.h".
9732 * src/complain.c: Don't include stdlib.h, string.h _LIBC stuff.
9733 * src/state.h: Include "symtab.h".
9734
996b1c7e
PE
97352002-12-08 Paul Eggert <eggert@twinsun.com>
9736
9737 * data/glr.c, data/lalr1.cc, data/yacc.c: Do not use __file__,
9738 since this causes problems when __file__ contains character
9739 sequences like "@" that are treated specially by src/scan-skel.l.
9740 Instead, just use the file's basename. This fixes the bug
9741 reported by Martin Mokrejs in
161a71f3 9742 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00007.html>.
996b1c7e 9743
e19c4e5d
PE
97442002-12-06 Paul Eggert <eggert@twinsun.com>
9745
9746 Add support for rules that do not have trailing semicolons, as
9747 POSIX requires. Improve the quality of locations in Bison
9748 diagnostics.
26b4a969 9749
e19c4e5d
PE
9750 * src/location.c: Include <quotearg.h>.
9751 (empty_location): Now const.
9752 (location_print): New function. Follow the recommendation of the
9753 GNU Coding Standards for locations that span file boundaries.
9754 * src/location.h: Do not include <quotearg.h>; no longer needed.
9755 (boundary): New type.
9756 (location_t): Use it. This allows locations to span file boundaries.
9757 All member uses changed: file -> start.file or end.file (as needed),
9758 first_line -> start.line, first_column -> start.column,
9759 last_line -> end.line, last_column -> end.column.
9760 (equal_boundaries): New function.
9761 (LOCATION_RESET, LOCATION_STEP): Remove.
9762 (LOCATION_PRINT): Remove. All callers changed to use location_print.
9763 (empty_location): Now const.
9764 (location_print): New decl.
9765 * src/parse-gram.y (lloc_default): New function, which handles
9766 empty locations more accurately.
9767 (YYLLOC_DEFAULT): Use it.
9768 (%token COLON): Remove.
9769 (%token ID_COLON): New token.
26b4a969 9770 (rules): Use it.
e19c4e5d
PE
9771 (declarations, rules): Remove trailing semicolon.
9772 (declaration, rules_or_grammar_declaration):
9773 Allow empty (";") declaration.
9774 (symbol_def): Remove empty actions; no longer needed.
9775 (rules_or_grammar_declaration): Remove trailing semicolon.
9776 (semi_colon.opt): Remove.
9777 * src/reader.h: Include location.h.
9778 (scanner_cursor): New decl.
9779 * src/reduce.c (nonterminals_reduce): Use warn_at rather than
9780 rolling our own.
9781 * src/scan-gram.l (YY_USER_INIT): Initialize scanner_cursor instead
9782 of *loc.
9783 (STEP): Remove. No longer needed, now that adjust_location does
9784 the work. All uses removed.
9785 (scanner_cursor): New var.
9786 (adjust_location): Renamed from extend_location. It now sets
9787 *loc and adjusts the scanner cursor. All uses changed.
9788 Don't bother testing for CR.
9789 (handle_syncline): Remove location arg; now updates scanner cursor.
9790 All callers changed.
9791 (unexpected_end_of_file): Now accepts start boundary of token or
9792 comment, not location. All callers changed. Update scanner cursor,
9793 not the location.
9794 (SC_AFTER_IDENTIFIER): New state.
9795 (context_state): Renamed from c_context. All uses changed.
9796 (id_loc, code_start, token_start): New local vars.
9797 (<INITIAL,SC_AFTER_IDENTIFIER>): New initial context. Move all
9798 processing of Yacc white space and equivalents here.
9799 (<INITIAL>{id}): Save id_loc. Begin state SC_AFTER_IDENTIFIER
9800 instead of returning ID immediately, since we need to search for
9801 a subsequent colon.
9802 (<INITIAL>"'", "\""): Save token_start.
9803 (<INITIAL>"%{", "{", "%%"): Save code_start.
9804 (<SC_AFTER_IDENTIFIER>): New state, looking for a colon.
9805 (<SC_YACC_COMMENT>, <SC_COMMENT>, <SC_LINE_COMMENT>):
9806 BEGIN context_state at end, not INITIAL.
9807 (<SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'",
9808 <SC_BRACED_CODE>"}", <SC_PROLOGUE>"%}", <SC_EPILOGUE><<EOF>>):
9809 Return correct token start.
9810 (<SC_BRACED_CODE,SC_PROLOGUE,SC_EPILOGUE>): Save start boundary when
9811 the start of a character, string or multiline comment is found.
9812 * tests/conflicts.at (S/R in initial, Defaulted Conflicted
9813 Reduction): Adjust reported locations to match the more-precise
9814 results now expected.
9815 * tests/input.at (Invalid $n, Invalid @n, Type Clashes): Likewise.
9816 * tests/reduce.at (Useless Rules, Reduced Automaton,
9817 Underivable Rules): Likewise.
9818 * tests/regression.at (Invalid inputs): No longer `expecting ";"
9819 or "|"' now that so many other tokens are allowed by the new grammar.
9820
9821 * src/complain.h (current_file): Remove duplicate decl;
9822 current_file is now owned by files.h.
9823 * src/complain.c, src/scan-gram.l: Include files.h.
9824
98252002-12-06 Paul Eggert <eggert@twinsun.com>
26b4a969 9826
e19c4e5d
PE
9827 * data/glr.c (yy_reduce_print): Don't assume that yyrline[yyrule]
9828 promotes to int; it might be unsigned int.
9829 * data/yacc.c (yy_reduce_print): Likewise.
9830
9831 * doc/bison.texinfo (Table of Symbols): YYERROR_VERBOSE should
9832 be #defined in the prologue, not in the Bison declarations.
9833 This fixes Debian Bug 102878, reported by Shaul Karl.
26b4a969 9834
b64755e3
PE
98352002-12-02 Paul Eggert <eggert@twinsun.com>
9836
9837 * configure.ac (AC_REPLACE_FUNCS): Add strtoul.
9838 * lib/strtoul.c: New file, from gnulib.
9839 This fixes a porting bug reported by Peter Klein in
161a71f3 9840 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00000.html>.
b64755e3 9841
6e746484
PE
98422002-11-30 Paul Eggert <eggert@twinsun.com>
9843
b64755e3
PE
9844 * src/scan-gram.l (no_cr_read, extend_location): Move to epilogue,
9845 and put only a forward declaration in the prologue. This is for
9846 consistency with the other scanner helper functions.
9847
6ba55592
PE
9848 Type clashes now generate warnings, not errors, since it
9849 appears that POSIX may allow some grammars with type clashes.
9850 * src/reader.c (grammar_current_rule_check): Warn about
9851 type clashes instead of complaining.
9852 * tests/input.at (Type Clashes): Expect warnings, not complaints.
9853
6e746484
PE
9854 Add Yacc library, since POSIX requires it.
9855 * doc/bison.texinfo (Yacc Library): New node. Regenerate top menu.
9856 * lib/Makefile.am (lib_LIBRARIES, liby_a_SOURCES): New macros.
9857 * lib/main.c, lib/yyerror.c: New files.
9858
9859 gram_error can be static; it need not be extern.
9860 * src/reader.h (gram_error): Remove decl.
9861 * src/parse-gram.y (gram_error): Now static. Add static decl.
9862 (print_token_value): Omit parameter names from forward decl,
9863 for consistency.
9864
88510f9c
PE
98652002-11-29 Paul Eggert <eggert@twinsun.com>
9866
6e746484
PE
9867 * doc/bison.texinfo: Emphasize that yylex and yyerror must
9868 be declared before being used. E.g., one should typically
9869 declare them in the prologue. Use GNU coding style in examples.
9870 Put "const" consistently after the type it modifies. Mention
9871 that C99 supports "inline". Mention that yyerror traditionally
9872 returns "int".
9873
88510f9c
PE
9874 %parse-param and %lex-param now take just one argument, the
9875 declaration; the argument name is deduced from the declaration.
9876
9877 * doc/bison.texinfo (Parser Function, Pure Calling, Error
9878 Reporting, Table of Symbols): Document this.
9879 * src/parse-gram.y (add_param): New function.
9880 (COMMA): Remove.
9881 (declaration): Implement new rule for %parse-param and %lex-param.
9882 * src/scan-gram.l: "," now elicits a warning, rather than being
9883 a token; this is more compatible with byacc.
9884 * tests/calc.at (Simple LALR Calculator): Adopt new convention.
9885
bb92250c
PE
98862002-11-27 Paul Eggert <eggert@twinsun.com>
9887
9888 Rename identifiers to avoid real and potential collisions.
9889
9890 * data/c.m4 (b4_yysymprint_generate): yyout -> yyoutput,
9891 to avoid collision with lex macro described by Bruce Lilly in
161a71f3 9892 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
bb92250c
PE
9893 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
9894 * doc/bison.texinfo (Prologue, Tracing): yyprint -> print_token_value.
9895 * src/parse-gram.y (print_token_value): Renamed from yyprint.
9896 All uses changed.
9897 (YYPARSE_PARAM, YYLEX_PARAM, yycontrol): Remove. All uses changed.
9898 The name "yycontrol" violates the name space rules, and this stuff
9899 wasn't being used anyway.
9900 (input): Remove action; this stuff wasn't being used.
9901 (gram_error): Rename local variable yylloc -> loc.
9902 * src/reader.h (struct gram_control_s, gram_control_t): Remove.
9903 (YY_DECL): Don't use "yy" at start of local variables.
9904 All uses changed, e.g., yylloc -> loc.
9905 * src/scan-gram.l (STEP): Renamed from YY_STEP. All uses changed.
9906 (STRING_GROW): Renamed from YY_OBS_GROW. All uses changed.
9907 (STRING_FINISH): Renamed from YY_OBS_FINISH. All uses changed.
9908 (STRING_FREE): Renamed from YY_OBS_FREE. All uses changed.
9909
9910 * src/parse-gram.y (gram_error): loc is now const *.
9911 * src/reader.h (gram_error): Likewise.
9912
3af4feb2
PE
99132002-11-24 Paul Eggert <eggert@twinsun.com>
9914
9915 Version 1.75c.
9916
9917 * tests/actions.at (Actions after errors): Use an output format
9918 more similar to that of the Printers and Destructors test.
9919 Test the position of the ';' token too.
9920 (Printers and Destructors): Likewise.
9921 (Printers and Destructors: %glr-parser): Remove for now, to avoid
9922 unnecessarily alarming people when the test fails.
9923
9924 * data/yacc.c (yyerrlab1): Move this label down, so that the
9925 parser does not discard the lookahead token if the user code
9926 invokes YYERROR. This change is required for POSIX conformance.
9927
9928 * lib/error.c: Sync with gnulib.
9929
99302002-11-22 Paul Eggert <eggert@twinsun.com>
9931
9932 * lib/quotearg.c, lib/quotearg.h: Sync with gnulib.
9933 * lib/mbswidth.c, lib/mbswidth.h: Likewise.
9934 * lib/xmalloc.c: Likewise.
26b4a969 9935
58004308
PE
99362002-11-20 Paul Eggert <eggert@twinsun.com>
9937
9938 * lib/argmatch.c, lib/argmatch.h: Sync with gnulib.
9939
99402002-11-20 Paul Eggert <eggert@twinsun.com>
26b4a969 9941
58004308
PE
9942 Avoid use of <assert.h>, as the GNU Coding Standards hint that one
9943 should use `if (! x) abort ();' rather than `assert (x);', and
9944 anyway it's one less thing to worry about configuring.
9945
9946 * data/glr.c, lib/hash.c, src/system.h: Do not include <assert.h>.
9947 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise,
9948 and replace all instances of assert with abort.
9949 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
9950 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Likewise.
9951
9952 * data/glr.c (yydoAction, yyglrReduce, yysplitStack, yyresolveStates,
9953 yyresolveAction, yyprocessOneStack): Use abort rather than assert.
9954 * lib/hash.c (hash_lookup, hash_get_first, hash_get_next,
9955 hash_find_entry, hash_rehash, hash_insert): Likewise.
9956 * src/conflicts.c (resolve_sr_conflict): Likewise.
9957 * src/lalr.c (set_goto_map, map_goto): Likewise.
9958 * src/nullable.c (nullable_compute): Likewise.
9959 * src/output.c (prepare_rules, token_definitions_output): Likewise.
9960 * src/reader.c (packgram, reader): Likewise.
9961 * src/state.c (state_new, state_free, state_transitions_set,
9962 state_reduction_find): Likewise.
9963 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias,
9964 symbol_pack): Likewise.
9965 * src/tables.c (conflict_row, pack_vector): Likewise.
9966 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
9967 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
9968 get_node_alignement_str, get_arrow_mode_str, get_crossing_type_str,
9969 get_view_str, get_linestyle_str, get_arrowstyle_str): Likewise.
9970
9971 * lib/argmatch.h (ARRAY_CARDINALITY): Do not bother to #undef.
9972 (ARGMATCH_CONSTRAINT): New macro.
9973 (ARGMATCH_ASSERT): Use it.
9974
9975 * src/system.h (verify): New macro.
9976 * src/getargs.c (trace_argmatch, report_argmatch): Use verify
9977 rather than assert.
9978 * src/tables.c (tables_generate): Likewise.
9979
9980 * src/struniq.c (struniq_assert): Now returns void, and aborts
9981 if the assertion is false.
9982 (struniq_assert_p): Remove.
9983 * src/struniq.h: Likewise.
9984
76ae8198
PE
99852002-11-18 Paul Eggert <eggert@twinsun.com>
9986
9987 * data/glr.c (yygetLRActions): Replace `yyindex' with
9988 `yytable[yyindex]' to fix typo introduced in my 2002-11-09 patch.
9989 This fixes the regression with Sun ONE Studio 7 cc that I reported in
161a71f3 9990 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00077.html>.
76ae8198 9991
d3c4e709
AD
99922002-11-18 Akim Demaille <akim@epita.fr>
9993
9994 * doc/bison.texinfo (Tracing): `yyprint' shouldn't prepend a
9995 space.
9996 From Tim Van Holder.
9997
8d8a7238
PE
99982002-11-17 Paul Eggert <eggert@twinsun.com>
9999
10000 Pacify Sun ONE Studio 7 lint. Also, rename "ParseError"
10001 to "SyntaxError" for consistency with my 2002-11-15 change.
10002
10003 * data/glr.c (YYDPRINTF, YYDSYMPRINT, YYDSYMPRINTF) [!YYDEBUG]: Do
10004 not define to {}, since this breaks the common use of `YYDPRINTF
10005 ((...));' if a single statement is desired (e.g. before `else').
10006 Work around GCC warnings by surrounding corresponding calls with
10007 {} if needed.
10008 (yyhasResolvedValue): Remove unused function.
10009 (yymergeOptionSets, yyresolvStack): Use `continue;' for empty
10010 loop body.
10011 (yyreportSyntaxError): Renamed from yyreportParseError.
10012 (yyrecoverSyntaxError): Renamed from yyrecoverParseError.
10013 All uses changed.
10014 * tests/calc.at (_AT_DATA_CALC_Y): Make vars static instead of
10015 extern when possible. Remove unused initializations.
10016
b0937b22
AD
100172002-11-16 Akim Demaille <akim@epita.fr>
10018
10019 Augment the similarity between GLR and LALR traces.
10020
10021 * data/yacc.c (yy_stack_print, YY_STACK_PRINT, yy_reduce_print)
10022 (YY_REDUCE_PRINT): New.
10023 (yyparse): Use them.
10024 * data/glr.c (yy_reduce_print): Use YYFPRINTF, no need for
10025 YYDPRINT here.
10026 (yyglrReduce, yyrecoverParseError, yyparse): Don't report the
10027 state reached after the reduction/recovery, since...
10028 (yyparse, yyprocessOneStack): Report the state we are entering in.
10029
c5e3e510
AD
100302002-11-16 Akim Demaille <akim@epita.fr>
10031
10032 * src/getargs.h, src/getargs.c (trace_e, trace_args, trace_types):
10033 Add support for --trace=skeleton.
10034 * src/scan-skel.l: %option debug.
10035 Scan strings of non-@ or \n instead of character by character.
10036 (scan_skel): Handle trace_skeleton.
10037 (QPUTS): New.
10038 (@output_parser_name@, @output_header_name@): ``Restore'' their
10039 support (used to be M4 macros).
10040 * data/yacc.c: Quote larger chunks, a la glr.c.
10041 * data/lalr1.cc: Likewise.
10042 The header guards are no longer available, so use some other
10043 string than `YYLSP_NEEDED'.
10044
4c6cc1db
AD
100452002-11-16 Akim Demaille <akim@epita.fr>
10046
10047 Make the ``Printers and Destructors'' test more verbose, taking
10048 `yacc.c''s behavior as (possibly wrong) reference.
10049
10050 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use printf
10051 instead of fprint on stdout.
10052 Set and report the last_line of the symbols.
10053 Consistently display values and locations.
10054
6d9e8019
PE
100552002-11-16 Paul Eggert <eggert@twinsun.com>
10056
10057 * data/yacc.c: Avoid over-quoting of __line__ and __file__.
10058
6e649e65
PE
100592002-11-15 Paul Eggert <eggert@twinsun.com>
10060
b25d88f6
PE
10061 * tests/actions.at (Actions after errors): New test case.
10062
6e649e65
PE
10063 * data/glr.c, data/lalr1.cc, data/yacc.cc, doc/bison.texinfo,
10064 src/conflicts.c, src/parse-gram.y, src/tables.c, src/tables.h,
10065 tests/action.at, tests/calc.at, tests/conflicts.at,
10066 tests/cxx-type.at, tests/regression.at:
10067 "parse error" -> "syntax error" for POSIX compatibility.
10068 "parsing stack overflow..." -> "parser stack overflow" so
10069 that code matches Bison documentation.
10070
0f39aab9
AD
100712002-11-15 Akim Demaille <akim@epita.fr>
10072
10073 * src/parse-gram.y (declaration): Have %parse-param and %lex-param
10074 take two BRACED_CODE, not two string_content.
10075 Free the scanner's obstack when we are done.
10076 (code_content): New.
10077 * tests/calc.at: Adjust.
10078 * doc/bison.texinfo: Adjust.
10079 Also, make sure to include the `,' for these declarations.
10080
761c1926
AD
100812002-11-15 Tim Van Holder <tim.van.holder@pandora.be>
10082
10083 * m4/prereq.m4: Removed the commented jm_PREREQ_HASH
10084 definition; avoids potential autoreconf problems.
10085
b0f98b10
AD
100862002-11-15 Akim Demaille <akim@epita.fr>
10087
10088 Always check the value returned by yyparse.
10089
10090 * tests/calc.at (_AT_DATA_CALC_Y): Have `main' exit with the value
10091 returned by yyparse.
10092 (_AT_CHECK_CALC_ERROR): Take the expected exit value as argument.
10093 Adjust calls.
10094 * tests/glr-regr1.at (glr-regr1.y): Have `main' exit with the value
10095 returned by yyparse.
10096
970785f1
PH
100972002-11-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10098
10099 * data/glr.c (yyFail): Always set yyerrflag. Corrects regression
10100 on input.at test.
10101
8fcc7db1
PE
101022002-11-14 Paul Eggert <eggert@twinsun.com>
10103
7ec1b48e
PE
10104 * src/output.c (output_skeleton): Call xfopen instead of
10105 duplicating xfopen's body.
10106
cfff7583 10107 Fix bugs reported by Nelson H. F. Beebe in
161a71f3 10108 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00078.html>.
cfff7583 10109
8fcc7db1
PE
10110 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that
10111 "$CC -E foo.h" is allowed, as this doesn't work with the Portland
10112 Group compiler. Instead, use "$CC -E bar.c". Include the .h
10113 file twice in the grammar, as an extra check.
10114
10115 * tests/input.at (Torturing the Scanner): Surround the
10116 backslash-newline tests with "#if 0", to make it less likely that
10117 we'll run into compiler bugs. Bring back solitary \ inside
10118 comment, but add a closing comment to work around HP C bug. Don't
e3aa65c5 10119 test backslash-newline in C character constant.
8fcc7db1 10120
4e8d992c
AD
101212002-11-14 Akim Demaille <akim@epita.fr>
10122
10123 * tests/synclines.at (AT_SYNCLINES_COMPILE): Ignore the exit
10124 status of the compiler.
f32b346d 10125 Calling `exit 1' is no longer needed.
4e8d992c
AD
10126 Reported by Nelson H. F. Beebe.
10127
9501dc6e
AD
101282002-11-14 Akim Demaille <akim@epita.fr>
10129
10130 * tests/atlocal.in (CPPFLAGS): We have config.h.
10131 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR):
10132 New.
10133 * tests/actions.at, tests/calc.at, tests/conflicts.at,
10134 * tests/cxx-type.at, tests/glr-regr1.at, tests/headers.at,
10135 * tests/regression.at, tests/torture.at: Use them for all the
10136 grammars that are to be compiled.
10137 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Rename as...
10138 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): this.
10139 * doc/bison.texinfo (GLR Parsers): Document `inline'.
10140
18b519c0
AD
101412002-11-14 Akim Demaille <akim@epita.fr>
10142
10143 * doc/bison.texinfo: Various formatting changes (alignments in
10144 samples, additional @group/@end group, GCS in samples.
10145 Use @deffn instead of simple @table to define the directives,
10146 macros, variables etc.
10147
9a86cdb9
PE
101482002-11-13 Paul Eggert <eggert@twinsun.com>
10149
daa33def 10150 Fix some bugs reported by Albert Chin-A-Young in
161a71f3 10151 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00066.html>.
18b519c0 10152
daa33def 10153 * tests/input.at (Torturing the Scanner): Don't invoke "cc a.c b.c
8fcc7db1 10154 -o c"; the HP C compiler chatters during compilation.
daa33def
PE
10155 Instead, invoke "cc -c a.c -o a.o; cc -c b.c -o b.o; cc a.o b.o -o c".
10156 * tests/headers.at (export YYLTYPE): Likewise.
10157
10158 * tests/input.at (Torturing the Scanner): Remove lines containing
8fcc7db1 10159 solitary backslashes, as they tickle a bug in the HP C compiler.
daa33def 10160
9a86cdb9
PE
10161 * tests/glr-regr1.at (Badly Collapsed GLR States): Avoid //
10162 comments, since they're not portable. Use GNU coding style.
10163
9c1e26bd
AD
101642002-11-13 Akim Demaille <akim@epita.fr>
10165
10166 * data/yacc.c: Leave bigger chunks of quoted text.
10167 (YYDSYMPRINTF): New.
10168 Use it to report symbol activities.
10169 * data/glr.c (YYDSYMPRINTF): New.
10170 Use it.
10171
87f721cc
PE
101722002-11-12 Paul Eggert <eggert@twinsun.com>
10173
10174 Version 1.75b.
10175
10176 * data/glr.c (yydoAction): Return YYRESULTTAG, not int.
10177 (yyglrReduce): Return yyok, not 0.
10178 This should avoid the enumerated-type warnings reported
464c6927 10179 by Nelson H. F. Beebe in
161a71f3 10180 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00057.html>.
87f721cc
PE
10181
10182 * lib/bbitset.h (BITSET_INLINE): Remove.
10183 * lib/bitset.h [! BITSET_INLINE]: Remove.
10184 (bitset_set, bitset_reset, bitset_test): Rename local vars
10185 to avoid shadowing warnings by GCC.
10186
10187 * data/glr.c (inline): Remove #define. It's the user's
10188 responsibility to #define it away, just like 'const'.
464c6927 10189 This fixes one of the bugs reported by Nelson H. F. Beebe in
161a71f3 10190 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00058.html>.
18b519c0 10191
87f721cc
PE
10192 * Makefile.maint (po-check): Scan .l and .y files instead of the
10193 .c and the .h files that they generate. This fixes the bug
10194 reported by Tim Van Holder in:
161a71f3 10195 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00062.html>
87f721cc
PE
10196 Look for N_ as well as for _. Try to avoid matching #define for
10197 N_ and _.
10198 * po/POTFILES.in: Remove src/parse-gram.c, src/scan-gram.c,
10199 src/system.h. Add src/parse-gram.y, src/scan-gram.l.
10200 * src/scan-gram.l: Revamp regular expressions so that " and '
10201 do not confuse xgettext.
10202
10203 * src/struniq.h (struniq_new): Do not declare the return type
10204 to be 'const'; this violates the C standard.
10205 * src/struniq.c (struniq_new): Likewise.
10206
be14ade5
AD
102072002-11-12 Albert Chin-A-Young <china@thewrittenword.com>
10208
10209 * src/Makefile.am (LDADD): Link $(LIBINTL) last to avoid the
10210 duplicate definition of optind on Tru64 UNIX 4.0D with the Compaq
10211 linker.
10212
05291fbc
AD
102132002-11-12 Akim Demaille <akim@epita.fr>
10214
10215 * Makefile.maint: Sync with Autoconf:
10216 (local_updates): New.
10217
1f5fd52e
AD
102182002-11-12 Akim Demaille <akim@epita.fr>
10219
10220 * po/POTFILES.in (src/lalr.c, src/state.c): Remove
10221
283f1e64
AD
102222002-11-12 Akim Demaille <akim@epita.fr>
10223
10224 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Display the
10225 locations.
10226
886b69d1
AD
102272002-11-12 Akim Demaille <akim@epita.fr>
10228
10229 * data/c.m4 (b4_yysymprint_generate): Pass *yyvaluep to YYPRINT,
10230 not yyvalue.
10231
3df37415
AD
102322002-11-12 Akim Demaille <akim@epita.fr>
10233
10234 * tests/actions.at (AT_CHECK_PRINTER_AND_DESTRUCTOR): New.
10235 Use it to test the GLR parser.
10236
7bd6c77e
AD
102372002-11-12 Akim Demaille <akim@epita.fr>
10238
10239 * tests/regression.at (input.y): s/YYEOF/MYEOF/, as the skeleton
10240 defines it.
10241 * data/glr.c (yystos): New.
10242 (b4_yysymprint_generate, b4_yydestruct_generate): Invoke.
10243 (YYDSYMPRINT): New.
10244 (yyval): Don't define it, it is handled via M4.
10245 (yyrecoverParseError): Free verbosely the discarded symbols.
10246 * data/yacc.c (yysymprint): Remove, rather...
10247 (b4_yysymprint_generate): invoke.
10248 * data/c.m4 (b4_yysymprint_generate): New.
10249 Accept pointers as arguments, as opposed to the version from
10250 yacc.c.
10251 (b4_yydestruct_generate): Likewise.
10252 * tests/cations.at (Printers and Destructors): Use Bison directives
10253 instead of CPP macros.
10254 Don't rely on internal details.
10255
b0400cc6
AD
102562002-11-12 Akim Demaille <akim@epita.fr>
10257
10258 * data/c.m4 (b4_yydestruct_generate, b4_symbol_actions): New.
10259 * data/yacc.c: Rename yychar1 as yytoken, as in glr.c.
10260 Don't work on yychar (i.e., do set it to YYEMPTY, don't match
10261 it against YYEMPTY and so forth), work on yytoken (i.e., set
10262 it to YYEMPTY etc.).
10263 (yydestruct): Replace with a b4_yydestruct_generate invocation.
10264 (b4_symbol_actions): Remove.
10265 * data/glr.c (YYTRANSLATE): As for yacc.c, if negative, it stands
10266 for 0, end-of-input.
10267
72f889cc
AD
102682002-11-12 Akim Demaille <akim@epita.fr>
10269
10270 * doc/bison.texinfo (Destructor Decl): New.
10271
b1ae9233
AD
102722002-11-12 Akim Demaille <akim@epita.fr>
10273
10274 * src/tables.c (tables_generate): Use free for pointers that
10275 cannot be NULL, not XFREE.
10276 (pack_vector): Use assert, not fatal, for bound violations.
10277 * src/state.c (state_new): Likewise.
10278 * src/reader.c (reader): Likewise.
10279 * src/lalr.c (set_goto_map): Likewise.
72f889cc 10280 * src/location.h (LOCATION_PRINT): If first_line is 0, just issue
b1ae9233
AD
10281 the file name.
10282
7ec2d4cd
AD
102832002-11-12 Akim Demaille <akim@epita.fr>
10284
10285 * src/scan-gram.l, src/reader.h (scanner_last_string_free):
10286 Restore.
10287 * src/scan-gram.l (last_string): Is global to the file, not to
10288 yylex.
10289 * src/parse-gram.y (input): Don't append the epilogue here,
10290 (epilogue.opt): do it here, and free the scanner's obstack.
10291 * src/reader.c (epilogue_set): Rename as...
10292 (epilogue_augment): this.
10293 * data/c.m4 (b4_epilogue): Defaults to empty.
10294
573a6cd3
AD
102952002-11-12 Akim Demaille <akim@epita.fr>
10296
10297 * src/getargs.c (long_options): Remove duplicates.
10298 * src/vmsgetargs.c, src/build.com, src/bison.cld, src/vmshlp.mar:
10299 Remove.
10300 * doc/bison.rnh: Remove.
10301 * doc/bison.texinfo (VMS Invocation): Remove.
10302
95612cfa
AD
103032002-11-12 Akim Demaille <akim@epita.fr>
10304
10305 * src/struniq.h, src/struniq.c (struniq_t): Is const.
10306 (STRUNIQ_EQ, struniq_assert, struniq_assert_p): New.
10307
10308 Use struniq for symbols.
10309
10310 * src/symtab.h (symbol_t): The tag member is a struniq.
10311 (symbol_type_set): Adjust.
10312 * src/symtab.c (symbol_new): Takes a struniq.
10313 (symbol_free): Don't free the tag member.
10314 (hash_compare_symbol_t, hash_symbol_t): Rename as...
10315 (hash_compare_symbol, hash_symbol): these.
10316 Use the fact that tags as struniqs.
10317 (symbol_get): Use struniq_new.
10318 * src/symlist.h, src/symlist.c (symbol_list_n_type_name_get):
10319 Returns a strniq.
10320 * src/reader.h (merger_list, grammar_currentmerge_set): The name
10321 and type members are struniqs.
10322 * src/reader.c (get_merge_function)
10323 (grammar_current_rule_merge_set): Adjust.
10324 (TYPE, current_type): Are struniq.
10325
10326 Use struniq for file names.
10327
10328 * src/files.h, src/files.c (infile): Split into...
10329 (grammar_file, current_file): these.
10330 * src/scan-gram.c (YY_USER_INIT, handle_syncline): Adjust.
10331 * src/reduce.c (reduce_print): Likewise.
10332 * src/getargs.c (getargs): Likewise.
10333 * src/complain.h, src/complain.c: Likewise.
10334 * src/main.c (main): Call struniqs_new early enough to use it for
10335 file names.
10336 Don't free the input file name.
10337
3e6656f9
AD
103382002-11-12 Akim Demaille <akim@epita.fr>
10339
10340 * src/symtab.c (symbol_free): Remove dead deactivated code:
10341 type_name are properly removed.
10342 Don't use XFREE to free items that cannot be NULL.
10343 * src/struniq.h, src/struniq.c: New.
10344 * src/main.c (main): Initialize/free struniqs.
10345 * src/parse-gram.y (%union): Add astruniq member.
10346 (yyprint): Adjust.
10347 * src/scan-gram.l (<{tag}>): Return a struniq.
10348 Free the obstack bit that used to store it.
10349 * src/symtab.h (symbol_t): The 'type_name' member is a struniq.
10350
7672019c
PE
103512002-11-11 Paul Eggert <eggert@twinsun.com>
10352
10353 Revamp to fix many (but not all) of the C- and M4-related quoting
10354 problems. Among other things, this fixes the Bison bug reported
10355 by Jan Hubicka when processing the Bash grammar; see:
161a71f3 10356 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00039.html>
7672019c
PE
10357
10358 Use new @ escapes consistently. Represent brackets with @{ and @}
10359 rather than @<:@ and @:>@, since this works a bit better with dumb
10360 editors like vi. Represent @ with @@, since @ is now consistently
10361 an escape. Use @oline@ and @ofile@ rather than __oline__ and
10362 __ofile__, to avoid unexpected expansions. Similarly, use @output
10363 rather than #output.
10364
10365 * data/c.m4 (b4_copyright): Omit file name from comment, since
10366 the file name could contain "*/".
10367 (b4_synclines_flag): Don't quote the 2nd argument; it should already
10368 be quoted. All uses changed.
10369
10370 * data/glr.c: Use new @ escapes consistently.
10371 (b4_input_suffix, b4_output_parser_suffix, b4_output_parser_name,
10372 b4_output_header_suffix, b4_output_header_name, b4_header_guard):
10373 Remove, since they couldn't handle arbitrary characters in file
10374 names.
10375 * data/lalr1.cc: Likewise.
10376 * data/yacc.c: Likewise.
10377
10378 * src/files.c (output_infix): Remove; all uses removed.
10379 * src/files.h: Likewise.
10380
10381 * data/glr.c: Remove use of "#ifdef b4_header_guard", since it
10382 mishandled funny characters in file names, and anyway it isn't
10383 needed any more.
10384 * data/yacc.c: Likewise.
10385 * data/lalr1.cc: Use YYSLP_NEEDED instead of b4_header_guard.
10386
10387 * data/glr.c (YYSTYPE_IS_TRIVIAL): Define when the .h file would.
10388 * data/yacc.c: Likewise.
10389
10390 * src/muscle_tab.c: Include quotearg.h, since we need to quote C
10391 strings now.
10392 (muscle_init): Quote filename as a C string.
10393 * src/muscle_tab.h (MUSCLE_GROW_STRING_PAIR): Remove; unused.
10394 (MUSCLE_OBSTACK_SGROW, MUSCLE_INSERT_C_STRING): New macros.
10395 * src/output.c (escaped_file_name_output): New function.
10396 (prepare_symbols): Quote tokens for M4.
10397 (prepare): Don't insert output_infix, output_prefix,
10398 output_parser_name, output_header_name; this is now down by scan-skel.
10399 Insert skeleton as a C string.
10400
10401 * src/output.c (user_actions_output, symbol_destructors_output,
10402 symbol_printers_output): Quote filenames for C and M4.
10403 * src/reader.c (prologue_augment, epilogue_set): Likewise.
10404
10405 * src/scan-gram.l (<SC_CHARACTER>): Don't worry about any backslash
10406 escapes other than \\ and \'; this simplifies the code.
10407 (<SC_STRING>): Likewise, for \\ and \".
10408 (<SC_COMMENT,SC_LINE_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,
10409 SC_PROLOGUE,SC_EPILOGUE>): Escape $ and @, too.
10410 Use new escapes @{ and @} for [ and ].
10411
10412 * src/scan-skel.l (yylineno, yyoutname): Remove static vars, replacing
10413 them with auto vars.
10414 Switch to new escape scheme, where @ is the escape character uniformly.
10415 Abort if a stray escape character is found. Avoid unbounded input
10416 buffer when parsing non-escaped text.
10417
10418 * tests/input.at (Torturing the Scanner): Add tests that @oline@,
10419 __oline__, #output, $@, and @{ do not have unintended meanings.
10420
acea4f3b
PE
104212002-11-09 Paul Eggert <eggert@twinsun.com>
10422
10423 Fix the test failure due to GCC warnings described in
161a71f3 10424 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00000.html>.
acea4f3b
PE
10425 * data/glr.c (yyis_pact_ninf, yyis_table_ninf): New macros, which
10426 evaluate to 0 if it's impossible for NINF to be in the respective
10427 table.
10428 (yygetLRActions, yyrecoverParseError): Use them.
10429
10430 * src/scan-gram.l (unexpected_end_of_file): Fix bug: columns were
10431 counted in the token inserted at end of file. Now takes
10432 location_t *, not location_t, so that the location can be
10433 adjusted. All uses changed.
10434
10435 * tests/regression.at (Invalid inputs): Adjust wording in
10436 diagnostic to match the new behavior.
10437
10438 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR,
10439 AT_DATA_HORIZONTAL_GRAMMAR, AT_DATA_LOOKAHEADS_GRAMMAR,
10440 AT_DATA_STACK_TORTURE): Replace `assert (x);' with `if (! (x))
10441 abort ();'. This reduces the runtime of the "Many lookaheads"
10442 test from 27.6 to 2.7 minutes on a 440 MHz Ultrasparc III running
10443 GCC 3.2.
10444
20ef1ad5
PE
104452002-11-07 Paul Eggert <eggert@twinsun.com>
10446
10447 * src/parse-gram.y (CHARACTER): Remove unused token.
10448 All uses removed.
10449
10450 * src/scan-gram.l: Remove stack option. We no longer use the
10451 stack, since the stack was never deeper than 1; instead, use the
10452 new auto var c_context to record the stacked value.
10453
10454 Remove nounput option. At an unexpected end of file, we now unput
10455 the minimal input necessary to end cleanly; this simplifies the
10456 code.
10457
10458 Avoid unbounded token sizes where this is easy.
10459
10460 (unexpected_end_of_file): New function.
10461 Use it to systematize the error message on unexpected EOF.
10462 (last-string): Now auto, not static.
10463 (YY_OBS_FREE): Remove unnecessary do while (0) wrapper.
10464 (scanner_last_string_free): Remove; not used.
10465 (percent_percent_count): Move decl to just before use.
10466 (SC_ESCAPED_CHARACTER): Return ID at unexpected end of file,
10467 not the (never otherwised-used) CHARACTER.
10468
93724f13
AD
104692002-11-07 Akim Demaille <akim@epita.fr>
10470
10471 Let yyerror always receive the msg as last argument, so that
10472 yyerror can be variadic.
10473
10474 * data/yacc.c (b4_yyerror_args): New.
10475 Use it when calling yyerror.
10476 * data/glr.c (b4_yyerror_args, b4_lyyerror_args): New.
10477 Use it when calling yyerror.
10478 * doc/bison.texinfo (Error Reporting): Adjust.
10479 * tests/calc.at (_AT_DATA_CALC_Y): Adjust.
10480 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Adjust.
10481
6e40b4eb
AD
104822002-11-06 Akim Demaille <akim@epita.fr>
10483
10484 #line should have quoted strings.
10485 Ideally, this should be done by m4_quotearg.
10486
10487 * src/scan-skel.l: Include quotearg.h.
10488 Quote __ofile__.
10489 * src/output.c (symbol_printers_output)
10490 (symbol_destructors_output): Quote the file name.
10491
2dfbfc12
AD
104922002-11-06 Akim Demaille <akim@epita.fr>
10493
10494 * tests/regression.at (Invalid inputs): Adjust to the recent
10495 messages.
10496
437c2d80
AD
104972002-11-06 Akim Demaille <akim@epita.fr>
10498
10499 Restore --no-lines.
10500 Reported by Jim Kent.
10501
10502 * data/c.m4 (b4_syncline): New.
10503 * data/glr.c, data/yacc.c, data/lalr1.cc: Use it.
10504 * src/reader.c (prologue_augment, epilogue_set): Use b4_syncline.
10505 * src/output.c (user_actions_output): Likewise.
10506 (prepare): Define 'b4_synclines_flag'.
2dfbfc12 10507 * src/muscle_tab.c (muscle_init): Don't define b4_linef.
437c2d80 10508
900c5db5
AD
105092002-11-06 Akim Demaille <akim@epita.fr>
10510
10511 * src/main.c (main): Free `infile'.
10512 * src/scan-gram.l (handle_syncline): New.
10513 Recognize `#line'.
10514 * src/output.c (user_actions_output, symbol_destructors_output)
10515 (symbol_printers_output): Use the location's file name, not
10516 infile.
10517 * src/reader.c (prologue_augment, epilogue_set): Likewise.
10518
e183b123 105192002-11-05 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
51b4a04c 10520
e183b123 10521 * src/tables.c (matching_state): Don't allow states to match if
51b4a04c 10522 either has GLR conflict entries.
e183b123 10523
193eb6b7
PE
105242002-11-05 Paul Eggert <eggert@twinsun.com>
10525
e183b123
PE
10526 * src/scan-gram.l: Use more accurate diagnostics, e.g.
10527 "integer out of range" rather than "invalid value".
10528 * tests/input.at (Invalid $n, Invalid @n): Change expected wording
10529 accordingly.
10530
193eb6b7
PE
10531 Scan <% and %> digraphs in C code as POSIX 1003.1-2001 requires.
10532 Also, remove one static variable in the scanner.
10533
10534 * src/scan-gram.l (braces_level): Now auto, not static.
10535 Initialize to zero if the compiler is being picky.
10536 (INITIAL): Clear braces_level instead of incrementing it.
10537 (SC_BRACED_CODE): Treat <% and %> as { and } when inside C code,
10538 as POSIX 1003.1-2001 requires.
10539 * src/system.h (IF_LINT): New macro, taken from coreutils.
10540 * configure.ac: Define "lint" if --enable-gcc-warnings.
10541
29c01725
AD
105422002-11-05 Akim Demaille <akim@epita.fr>
10543
10544 * src/scan-gram.l: When it starts with `%', complain about the
10545 whole directive, not just that `invalid character: %'.
10546
8aeac3ca
AD
105472002-11-04 Akim Demaille <akim@epita.fr>
10548
10549 * Makefile.maint: Update from Autoconf.
10550 (update, cvs-update, po-update, do-po-update): New.
10551
793a58bb
AD
105522002-11-04 Akim Demaille <akim@epita.fr>
10553
10554 * tests/glr-regr1.at (Badly Collapsed GLR States): Prototype yylex
10555 and yyerror.
10556 Have yyerror `use' its arguments.
10557 * tests/calc.at (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF
10558 returns true when location & yacc & pure & parse-param.
10559 (_AT_DATA_CALC_Y): Let yyerror ``use'' its arguments.
10560
c4d720cd
AD
105612002-11-04 Akim Demaille <akim@epita.fr>
10562
10563 * src/location.h (LOCATION_PRINT): Use quotearg slot 3 to avoid
10564 clashes.
10565 * src/scan-gram.l: Use [\'] instead of ['] to pacify
10566 font-lock-mode.
10567 Use complain_at.
10568 Use quote, not quote_n since LOCATION_PRINT no longer uses the
10569 slot 0.
10570
613a0dc5
PE
105712002-11-03 Paul Eggert <eggert@twinsun.com>
10572
10573 * src/reader.c (get_merge_function, grammar_current_rule_check):
10574 Use consistent diagnostics for reporting type name clashes.
10575 Quote the types with <>, for consistency with Yacc.
10576 * tests/input.at (Type Clashes): Adjust to diagnostic changes.
10577
2a8d363a
AD
105782002-11-03 Akim Demaille <akim@epita.fr>
10579
10580 * data/c.m4 (b4_identification, b4_user_args, b4_parse_param):
10581 New.
10582 * data/yacc.m4 (b4_pure_args, b4_Pure_args): New.
10583 (b4_parse_param): Remove.
10584 Use b4_identification.
10585 Propagate b4_pure_args where needed to pass them to yyerror.
10586 * data/glr.m4 (b4_parse_param): Remove.
10587 (b4_user_formals, b4_pure_args, b4_pure_formals, b4_lpure_args)
10588 (b4_lpure_formals): New.
10589 Use b4_identification.
10590 (YY_USER_FORMALS, YY_USER_ARGS): Remove, replaced by
10591 b4_user_formals and b4_user_args.
10592 (yyexpandGLRStack, yyFail, yyaddDeferredAction, yyglrShiftDefer)
10593 (yyreportAmbiguity): When using a pure parser, also need
10594 the location, and the parse-params.
10595 Adjust callers.
10596 (yyuserAction, yyglrShift, yyreportParseError, yyrecoverParseError):
10597 When using a pure parser, also need the parse-params.
10598 Adjust callers.
10599 * tests/calc.at: Test pure (%pure-parser) and absolutely pure
10600 (%pure-parser + %parse-param) LALR and GLR parsers.
10601 (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): New, define AT_PARAM_IF,
10602 AT_LOCATION_IF, AT_PURE_IF, AT_GLR_IF, AAT_PURE_AND_LOC_IF,
10603 AT_GLR_OR_PARAM_IF, AT_YYERROR_ARG_LOC_IF, AT_YYERROR_SEES_LOC_IF.
10604 (_AT_DATA_CALC_Y): Equip for purity of yyerror.
10605 (_AT_CHECK_CALC_ERROR): Use AT_YYERROR_SEES_LOC_IF.
10606 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Equip for yyerror purity.
10607 * doc/bison.texinfo: Untabify the whole file.
10608 (Parser Function): Document %parse-param, deprecate YYPARSE_PARAM.
10609 (Pure Calling): Document %lex-param, deprecate YYLEX_PARAM.
10610 (Error Reporting): Adjust to these new directives.
10611 Document %error-verbose, deprecate YYERROR_VERBOSE.
10612
9e32add8
AD
106132002-11-03 Akim Demaille <akim@epita.fr>
10614
10615 * tests/calc.at: Change all the AT_CHECK_CALC_LALR and
10616 AT_CHECK_CALC_GLR invocations to use % directives, instead of
10617 command line options.
10618 * tests/cxx-type.at: Formatting changes.
10619
b02d90a5
PE
106202002-11-03 Paul Eggert <eggert@twinsun.com>
10621
10622 * src/scan-gram.l: Revamp to fix POSIX incompatibilities,
10623 to count columns correctly, and to check for invalid inputs.
9e32add8 10624
b02d90a5
PE
10625 Use mbsnwidth to count columns correctly. Account for tabs, too.
10626 Include mbswidth.h.
10627 (YY_USER_ACTION): Invoke extend_location rather than LOCATION_COLUMNS.
10628 (extend_location): New function.
10629 (YY_LINES): Remove.
10630
10631 Handle CRLF in C code rather than in Lex code.
10632 (YY_INPUT): New macro.
10633 (no_cr_read): New function.
10634
10635 Scan UCNs, even though we don't fully handle them yet.
10636 (convert_ucn_to_byte): New function.
10637
10638 Handle backslash-newline correctly in C code.
10639 (SC_LINE_COMMENT, SC_YACC_COMMENT): New states.
10640 (eols, blanks): Remove. YY_USER_ACTION now counts newlines etc.;
10641 all uses changed.
10642 (tag, splice): New EREs. Do not allow NUL or newline in tags.
10643 Use {splice} wherever C allows backslash-newline.
10644 YY_STEP after space, newline, vertical-tab.
10645 ("/*"): BEGIN SC_YACC_COMMENT, not yy_push_state (SC_COMMENT).
9e32add8 10646
b02d90a5
PE
10647 (letter, id): Don't assume ASCII; e.g., spell out a-z.
10648
10649 ({int}, handle_action_dollar, handle_action_at): Check for integer
10650 overflow.
9e32add8 10651
b02d90a5
PE
10652 (YY_STEP): Omit trailing semicolon, so that it's more like C.
10653
10654 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>): Allow \0 and \00
10655 as well as \000. Check for UCHAR_MAX, not 255.
10656 Allow \x with an arbitrary positive number of digits, as in C.
10657 Check for overflow here.
10658 Allow \? and UCNs, for compatibility with C.
10659
10660 (handle_symbol_code_dollar): Use quote_n slot 1 to avoid collision
10661 with quote slot used by complain_at.
10662
10663 * tests/input.at: Add tests for backslash-newline, m4 quotes
10664 in symbols, long literals, and funny escapes in strings.
10665
10666 * configure.ac (jm_PREREQ_MBSWIDTH): Add.
10667 * lib/Makefile.am (libbison_a_SOURCES): Add mbswidth.h, mbswidth.c.
10668 * lib/mbswidth.h, lib/mbswidth.c: New files, from GNU gettext.
10669 * m4/Makefile.am (EXTRA_DIST): Add mbswidth.m4.
10670 * m4/mbswidth.m4: New file, from GNU coreutils.
10671
10672 * doc/bison.texinfo (Grammar Outline): Document // comments.
10673 (Symbols): Document that trigraphs have no special meaning in Bison,
10674 nor is backslash-newline allowed.
10675 (Actions): Document that trigraphs have no special meaning.
10676
10677 * src/location.h (LOCATION_COLUMNS, LOCATION_LINES): Remove;
10678 no longer used.
10679
106802002-11-02 Paul Eggert <eggert@twinsun.com>
10681
10682 * src/reader.c: Don't include quote.h; not needed.
10683 (get_merge_function): Reword warning to be consistent with
10684 type clash diagnostic in grammar_current_rule_check.
10685
10686 * lib/quotearg.c (quotearg_buffer_restyled): Fix off-by-two
10687 bug in trigraph handling.
10688
10689 * src/output.c (prepare_symbols): When printing token names,
10690 escape "[" as "@<:@" and likewise for "]".
10691
10692 * src/system.h (errno): Remove declaration, as we are now
10693 assuming C89 or better, and C89 guarantees errno.
10694
762b212b
PE
106952002-10-30 Paul Eggert <eggert@twinsun.com>
10696
10697 * lib/bitset_stats.c (bitset_stats_read, bitset_stats_write):
10698 Check for close failures.
10699 * src/files.h (xfclose): Return void, not int, since it always
10700 returned zero.
10701 * src/files.c (xfclose): Likewise. Report I/O error if ferror
10702 indicates one.
10703 * src/output.c (output_skeleton): Use xfclose rather than fclose
10704 and ferror. xfclose now checks ferror.
10705
10706 * data/glr.c (YYLEFTMOST_STATE): Remove.
10707 (yyreportTree): Use a stack-based leftmost state. This avoids
10708 our continuing battles with bogus warnings about initializers.
10709
56100c60
AD
107102002-10-30 Akim Demaille <akim@epita.fr>
10711
10712 * src/system.h: Don't use #ifdef/#ifndef on HAVE_ values, only
10713 #if.
10714
51b4a04c
PH
107152002-10-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10716
10717 * tests/glr-regr1.at: New test for reported regressions.
10718 * tests/testsuite.at: Add glr-regr1.at test.
10719 * tests/Makefile.am: Add glr-regr1.at test.
e183b123 10720
bf1ebda2
PE
107212002-10-24 Paul Eggert <eggert@twinsun.com>
10722
5c16c6b1
PE
10723 Version 1.75a.
10724
bf1ebda2
PE
10725 * tests/calc.at (_AT_DATA_CALC_Y): Remove unused strcat declaration.
10726 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Include stdlib.h, since
10727 we use malloc. Don't assume 'A' through 'Z' are contiguous.
10728 Don't assume strdup exists; POSIX says its an XSI extension.
10729 Check for buffer overflow on input.
10730
b526ee61
AD
107312002-10-24 Akim Demaille <akim@epita.fr>
10732
10733 * src/output.c (output_skeleton): Don't disable M4sugar comments
10734 too soon: it results in comments being expanded.
10735 * data/yacc.c, data/glr.c, data/lalr1.cc: Do it right before the
10736 first output.
10737
f1886bb2
AD
107382002-10-24 Akim Demaille <akim@epita.fr>
10739
10740 * data/yacc.c (m4_int_type): New.
10741 * data/c.m4 (m4_int_type): Don't use yysigned_char, but `signed
10742 char' as only yacc.c wants K&R portability.
10743 * data/glr.c (yysigned_char): Remove.
10744 * data/lalr1.cc: Rename the trailing b4_name as b4_parser_class_name.
10745 Reported by Quoc Peyrot.
10746
c5576256
PE
107472002-10-23 Paul Eggert <eggert@twinsun.com>
10748
10749 * src/main.c (main): With --trace=time, report times even if a
10750 non-fatal error occurs. Formerly, the times were reported in some
10751 such cases but not in others.
10752 * src/reader.c (reader): Just return if a complaint has been issued,
10753 instead of exiting, so that 'main' can report times.
10754
27b0ffea
AD
107552002-10-22 Akim Demaille <akim@epita.fr>
10756
10757 * src/system.h: Include sys/types.
10758 Reported by Bert Deknuydt.
10759
223a7883
PE
107602002-10-23 Paul Eggert <eggert@twinsun.com>
10761
10762 * configure.ac (AC_PROG_LEX): Use instead of AM_PROG_LEX.
10763 Suggested by Art Haas.
10764
107652002-10-22 Paul Eggert <eggert@twinsun.com>
10766
10767 * src/complain.c (exit) [! (STDC_HEADERS || _LIBC)]: Remove exit
10768 decl; not needed any more.
10769 * src/main.c (main): Use return to exit, undoing yesterday's change.
10770 The last OS that we could find where this wouldn't work is
10771 SunOS 3.5, and that's too old to worry about now.
10772
10773 * data/glr.c (struct yyltype): Define members even when not
10774 doing locations. This is more consistent with yacc.c, and it
10775 works around the following bug reports:
161a71f3
PE
10776 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00106.html
10777 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00111.html
27b0ffea 10778
223a7883
PE
10779 * doc/bison.texinfo: Minor spelling and typographical fixes. Use
10780 @acronym consistently. Standardize on "Yacc" instead of "YACC",
10781 "Algol" instead of "ALGOL". Give a bit more history about BNF.
10782
8b76775a
AD
107832002-10-22 Akim Demaille <akim@epita.fr>
10784
10785 * data/README: New.
10786
6db10d14
PE
107872002-10-21 Paul Eggert <eggert@twinsun.com>
10788
10789 Be consistent about 'bool'; the old code used an enum in one
10790 module and an int in another, and this violates the C standard.
10791 * m4/stdbool.m4: New file, from coreutils 4.5.3.
10792 * configure.ac (AC_HEADER_STDBOOL): Add.
10793 * m4/Makefile.am (EXTRA_DIST): Add stdbool.m4.
10794 * src/muscle_tab.c (hash_compare_muscles): (a ? FALSE : TRUE) -> (! a)
10795 * src/symtab.c (hash_compare_symbol_t): Likewise.
10796 * src/system.h (bool, false, true): Use a definition consistent
10797 with ../lib/hash.c. All uses changed.
10798
10799 * src/complain.c (warning_issued): Renamed from warn_message_count,
10800 so that we needn't worry about integer overflow (!).
10801 Now of type bool. All uses changed.
10802 (complaint_issued): Renamed from complain_message_count; likewise.
10803
10804 * src/main.c (main): Use exit to exit with failure.
27b0ffea 10805
6db10d14
PE
10806 * src/complain.c (fatal_at, fatal): Use EXIT_FAILURE and EXIT_SUCCESS
10807 rather than 1 and 0.
10808 * src/main.c (main): Likewise.
10809 * src/getargs.c (getargs): Likewise.
10810 * src/reader.c (reader): Likewise.
10811
10812 * src/getarg.c (getargs): Remove duplicate code for
10813 "Try `bison --help'".
10814
10815 * src/files.c (xfopen, xfclose): Use EXIT_FAILURE rather than 2.
10816 What was that "2" for?
10817
10818 * src/complain.h (fatal, fatal_at): Add __attribute__((__noreturn__)).
10819 * src/getargs.c (usage): Likewise.
10820
10821 * src/getargs.c (getargs): When there are too few operands, report
10822 the last one. When there are too many, report the first extra
10823 one. This is how diffutils does it.
10824
92a060fd
PE
108252002-10-20 Paul Eggert <eggert@twinsun.com>
10826
10827 Remove K&R vestiges.
10828 * configure.ac (AC_C_CONST, AM_C_PROTOTYPES): Remove.
10829 * src/complain.c (VA_START): Remove. Assume prototypes.
10830 (vfprintf) [! (HAVE_VPRINTF || defined vfprintf)]: New macro.
10831 (private_strerror, warn_at, warn, complain_at, complain, fatal_at,
10832 fatal): Assume prototypes.
10833 * src/complain.h: Assume prototypes.
10834 * src/system.h (PARAMS): Remove.
10835 Include <limits.h> unconditionally, since it's guaranteeed even
10836 for a freestanding C89 compiler.
10837 (SHRT_MIN, SHRT_MAX): Remove, since C89 guarantees them.
10838 * src/vmsgetargs.c (getargs, cli_present, cli_get_value): Prototype.
8b76775a 10839
e7cb57c0
AD
108402002-10-20 Akim Demaille <akim@epita.fr>
10841
10842 * src/muscle_tab.c (muscle_grow): Remove trailing debugging code.
10843 * data/glr.c (YY_USER_FORMALS, YY_USER_ARGS): New.
10844 (yyuserAction, yydoAction, yyglrReduce, yyresolveValue)
10845 (yyresolveStates, yyresolveAction, yyresolveStack)
10846 (yyprocessOneStack): Use them.
10847 (yy_reduce_print): New.
10848 * tests/calc.at (_AT_DATA_CALC_Y): Exercise %parse-param.
10849
0245f82d
AD
108502002-10-20 Akim Demaille <akim@epita.fr>
10851
10852 * data/c.m4 (b4_c_ansi_args): Recognize functions with no
10853 arguments and output `void'.
10854 (b4_c_function): Rename as...
10855 (b4_c_function_def): this.
10856 (b4_c_function_decl, b4_c_ansi_function_def)
10857 (b4_c_ansi_function_decl): New.
10858 Change the interpretation of the arguments: before `int, foo', now
10859 `int foo, foo'.
10860 * data/yacc.c (yyparse): Prototype and define thanks to these.
10861 Adjust b4_c_function_def uses.
10862 * data/glr.c (yyparse): Likewise, but ANSI only.
10863
39912f52
AD
108642002-10-20 Akim Demaille <akim@epita.fr>
10865
10866 * src/output.c (prepare): Move the definition of `tokens_number',
10867 `nterms_number', `undef_token_number', `user_token_number_max'
10868 to...
10869 (prepare_tokens): Here.
10870 (prepare_tokens): Rename as...
10871 (prepare_symbols): this.
10872 (prepare): Move the definition of `rules_number' to...
10873 (prepare_rules): here.
10874 (prepare): Move the definition of `last', `final_state_number',
10875 `states_number' to...
10876 (prepare_states): here.
10877 * data/yacc.c, data/lalr1.cc, data/glr.c: Normalize `>' into `<'.
10878
20c1e2ad
AD
108792002-10-20 Akim Demaille <akim@epita.fr>
10880
10881 * src/tables.h, src/tables.c, src/output.c: Comment changes.
10882
21964f43
AD
108832002-10-20 Akim Demaille <akim@epita.fr>
10884
10885 * data/yacc.c, data/yacc.c (b4_location_if, b4_pure_if): Move to...
10886 * data/c.m4: here.
10887
66d30cd4
AD
108882002-10-20 Akim Demaille <akim@epita.fr>
10889
10890 * src/output.c (prepare): Use MUSCLE_INSERT_STRING.
10891 * src/muscle_tab.c (muscle_pair_list_grow): Rename `val as
10892 `pair'.
10893 (muscle_init): Move the `b4_ltype', `b4_maxdepth', `b4_initdepth',
10894 `name' to...
10895 * data/glr.c, data/lalr1.cc, data/yacc.c (b4_location_type)
10896 (b4_stack_depth_init, b4_stack_depth_max, b4_parser_class_name):
10897 These.
10898
95f2c9fe
PE
108992002-10-19 Paul Eggert <eggert@twinsun.com>
10900
10901 Do not create a temporary file, as that involves security and
10902 cleanup headaches. Instead, use a pair of pipes.
10903 Derived from a suggestion by Florian Krohm.
10904 * lib/subpipe.c, lib/subpipe.h, m4/subpipe.m4: New files.
10905 * lib/mkstemp.c, lib/readpipe.c, lib/tempname.c, m4/mkstemp.m4: Remove.
10906 * configure.ac (UTILS_FUNC_MKSTEMP, jm_PREREQ_TEMPNAME): Remove.
10907 (BISON_PREREQ_SUBPIPE): Add.
10908 * lib/Makefile.am (libbison_a_SOURCES): Remove readpipe.c.
10909 Add subpipe.h, subpipe.c.
10910 * m4/Makefile.am (EXTRA_DIST): Remove mkstemp.m4. Add subpipe.m4.
10911 * po/POTFILES.in: Add lib/subpipe.c.
10912 * src/output.c: Include "subpipe.h".
10913 (m4_invoke): Remove decl.
10914 (scan_skel): New decl.
10915 (output_skeleton): Use pipe rather than temporary file for m4 input.
10916 Check that m4sugar.m4 is readable, to avoid deadlock.
10917 Check for pipe I/O error.
10918 * src/scan-skel.l (readpipe): Remove decl.
10919 (scan_skel): New function, to be used in place of m4_invoke.
10920 Read from stream rather than file.
66d30cd4 10921
95f2c9fe
PE
10922 * lib/timevar.c (TICKS_TO_MSEC, CLOCKS_TO_MSEC): Do not cast to
10923 float, as this generates a warning on Solaris 8 + GCC 3.2 with
10924 --enable-gcc-warnings. Instead, divide into 1.0 rather than 1;
10925 this generates a more-accurate value anyway.
10926
10927 * lib/timevar.c (timervar_accumulate): Rename locals to
10928 avoid confusion with similarly-named more-global.
10929 * src/muscle_tab.c (muscle_pair_list_grow): Likewise.
10930
10931 * src/output.c (prepare): Use xstrdup to convert char const *
10932 to char *, to avoid GCC warning.
10933
c19988b7
AD
109342002-10-19 Akim Demaille <akim@epita.fr>
10935
10936 * tests/calc.at (_AT_DATA_CALC_Y): Define VAL, LOC, LEX_FORMALS,
10937 LEX_PRE_FORMALS, LEX_ARGS, LEX_PRE_ARGS, USE_LEX_ARGS.
10938 Use them to have `calc.y' ready for %pure-parser.
10939 * data/yacc.c (YYLEX): Pass a yylex return type to
10940 b4_c_function_call.
10941
ae7453f2
AD
109422002-10-19 Akim Demaille <akim@epita.fr>
10943
10944 Prototype support of %lex-param and %parse-param.
10945
10946 * src/parse-gram.y: Add the definition of the %lex-param and
10947 %parse-param tokens, plus their rules.
10948 Drop the `_' version of %glr-parser.
10949 Add the "," token.
10950 * src/scan-gram.l (INITIAL): Scan them.
10951 * src/muscle_tab.c: Comment changes.
10952 (muscle_insert, muscle_find): Rename `pair' as `probe'.
10953 * src/muscle_tab.h (MUSCLE_INSERT_PREFIX): Remove unused.
10954 (muscle_entry_s): The `value' member is no longer const.
10955 Adjust all dependencies.
10956 * src/muscle_tab.c (muscle_init): Adjust: use
10957 MUSCLE_INSERT_STRING.
10958 Initialize the obstack earlier.
10959 * src/muscle_tab.h, src/muscle_tab.c (muscle_grow)
10960 (muscle_pair_list_grow): New.
10961 * data/c.m4 (b4_c_function_call, b4_c_args): New.
10962 * data/yacc.c (YYLEX): Use b4_c_function_call to honor %lex-param.
10963 * tests/calc.at: Use %locations, not --locations.
10964 (AT_CHECK_CALC_GLR): Use %glr-parser, not %glr_parser.
10965
0e575721
AD
109662002-10-19 Akim Demaille <akim@epita.fr>
10967
10968 * src/getargs.c (usage): Take status as argument and exit
10969 accordingly.
10970 Report the traditional `Try ... --help' message when status != 0.
10971 (usage, version): Don't take a FILE * as arg, it is pointless.
10972 (getargs): When there is an incorrect number of arguments, make it
10973 an error, and report it GNUlically thanks to `usage ()'.
10974
724ce7f5
PE
109752002-10-18 Paul Eggert <eggert@twinsun.com>
10976
3a781eb2
PE
10977 * data/glr.c (yyreportParseError): Don't assume that sprintf
10978 yields the length of the printed string, as this is not true
10979 on SunOS 4.1.4. Reported by Peter Klein.
10980
724ce7f5
PE
10981 * tests/calc.at (_AT_DATA_CALC_Y): #undef memcmp and realloc.
10982 * tests/conflicts.at (%nonassoc and eof): Likewise.
10983 Fixes SunOS 4.1.4 test failure reported by Peter Klein.
10984
473d0a75
AD
109852002-10-17 Akim Demaille <akim@epita.fr>
10986
10987 * src/getargs.h (trace_e): Add trace_scan, and trace_parse.
10988 * src/getargs.c (trace_types, trace_args): Adjust.
10989 * src/reader.c (grammar_current_rule_prec_set)
10990 (grammar_current_rule_dprec_set, grammar_current_rule_merge_set):
10991 Standardize error messages.
10992 And s/@prec/%prec/!
10993 (reader): Use trace_flag to enable scanner/parser debugging,
10994 instead of an adhoc scheme.
10995 * src/scan-gram.l: Remove trailing debugging code.
10996
e76d2469
PE
109972002-10-16 Paul Eggert <eggert@twinsun.com>
10998
93e2236a
PE
10999 * src/muscle_tab.h (MUSCLE_TAB_H_): Was misspelled as
11000 MUSCLE_TAB_H.
11001
e76d2469
PE
11002 * NEWS: Officially drop support for building Bison with K&R C,
11003 since it didn't work anyway and it's not worth worrying about.
11004 * Makefile.maint (wget_files): Remove ansi2knr.c.
11005 (ansi2knr.c-url_prefix): Remove.
11006 * lib/.cvsignore: Remove ansi2knr, ansi2knr.*.
11007 * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
11008 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
11009
5bd1c419
PE
110102002-10-15 Paul Eggert <eggert@twinsun.com>
11011
11012 Stop using the "enum_" trick for K&R-style function definitions;
11013 it confused me, and I was the author! Instead, assume that people
11014 who want to use K&R C compilers (when using these modules in GCC,
11015 perhaps?) will run ansi2knr.
11016
11017 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): Remove.
11018 All uses of "enum_" changed to "enum ".
11019 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
11020 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
e76d2469 11021
5bd1c419
PE
11022 * lib/abitset.c (abitset_and, abitset_and_cmp, abitset_and_or,
11023 abitset_and_or_cmp, abitset_andn, abitset_andn_cmp,
11024 abitset_andn_or, abitset_andn_or_cmp, abitset_bytes, abitset_copy,
11025 abitset_copy1, abitset_disjoint_p, abitset_empty_p,
11026 abitset_equal_p, abitset_init, abitset_list, abitset_list_reverse,
11027 abitset_not, abitset_ones, abitset_or, abitset_or_and,
11028 abitset_or_and_cmp, abitset_or_cmp, abitset_reset, abitset_set,
11029 abitset_size, abitset_small_list, abitset_subset_p, abitset_test,
11030 abitset_unused_clear, abitset_xor, abitset_xor_cmp, abitset_zero):
11031 Use function prototypes; this removes the need for declaring
11032 static functions simply to provide their prototypes.
11033 * lib/bitset.c (bitset_alloc, bitset_and_or_, bitset_and_or_cmp_,
11034 bitset_andn_or_, bitset_andn_or_cmp_, bitset_bytes, bitset_copy_,
11035 bitset_count_, bitset_create, bitset_dump, bitset_first,
11036 bitset_free, bitset_init, bitset_last, bitset_next,
11037 bitset_obstack_alloc, bitset_obstack_free, bitset_only_set_p,
11038 bitset_op4_cmp, bitset_or_and_, bitset_or_and_cmp_, bitset_prev,
11039 bitset_print, bitset_release_memory, bitset_toggle_,
11040 bitset_type_choose, bitset_type_get, bitset_type_name_get,
11041 debug_bitset): Likewise.
11042 * lib/bitset.h (bitset_set, bitset_reset, bitset_test): Likewise.
11043 * lib/bitset_stats.c (bitset_log_histogram_print,
11044 bitset_percent_histogram_print, bitset_stats_and,
11045 bitset_stats_and_cmp, bitset_stats_and_or,
11046 bitset_stats_and_or_cmp, bitset_stats_andn, bitset_stats_andn_cmp,
11047 bitset_stats_andn_or, bitset_stats_andn_or_cmp, bitset_stats_copy,
11048 bitset_stats_count, bitset_stats_disable, bitset_stats_disjoint_p,
11049 bitset_stats_dump, bitset_stats_empty_p, bitset_stats_enable,
11050 bitset_stats_equal_p, bitset_stats_free, bitset_stats_init,
11051 bitset_stats_list, bitset_stats_list_reverse, bitset_stats_not,
11052 bitset_stats_ones, bitset_stats_or, bitset_stats_or_and,
11053 bitset_stats_or_and_cmp, bitset_stats_or_cmp, bitset_stats_print,
11054 bitset_stats_print_1, bitset_stats_read, bitset_stats_reset,
11055 bitset_stats_set, bitset_stats_size, bitset_stats_subset_p,
11056 bitset_stats_test, bitset_stats_toggle, bitset_stats_type_get,
11057 bitset_stats_write, bitset_stats_xor, bitset_stats_xor_cmp,
11058 bitset_stats_zero): Likewise.
11059 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
11060 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
11061 bitsetv_dump, debug_bitsetv): Likewise.
11062 * lib/ebitset.c (ebitset_and, ebitset_and_cmp, ebitset_andn,
11063 ebitset_andn_cmp, ebitset_bytes, ebitset_copy, ebitset_copy_,
11064 ebitset_copy_cmp, ebitset_disjoint_p, ebitset_elt_add,
11065 ebitset_elt_alloc, ebitset_elt_calloc, ebitset_elt_find,
11066 ebitset_elt_free, ebitset_elt_last, ebitset_elt_remove,
11067 ebitset_elt_zero_p, ebitset_elts_grow, ebitset_empty_p,
11068 ebitset_equal_p, ebitset_free, ebitset_init, ebitset_list,
11069 ebitset_list_reverse, ebitset_not, ebitset_ones, ebitset_op3_cmp,
11070 ebitset_or, ebitset_or_cmp, ebitset_release_memory, ebitset_reset,
11071 ebitset_set, ebitset_size, ebitset_subset_p, ebitset_test,
11072 ebitset_weed, ebitset_xor, ebitset_xor_cmp, ebitset_zero):
11073 Likewise.
11074 * lib/lbitset.c (debug_lbitset, lbitset_and, lbitset_and_cmp,
11075 lbitset_andn, lbitset_andn_cmp, lbitset_bytes, lbitset_copy,
11076 lbitset_copy_cmp, lbitset_disjoint_p, lbitset_elt_alloc,
11077 lbitset_elt_calloc, lbitset_elt_find, lbitset_elt_free,
11078 lbitset_elt_link, lbitset_elt_unlink, lbitset_elt_zero_p,
11079 lbitset_empty_p, lbitset_equal_p, lbitset_free, lbitset_init,
11080 lbitset_list, lbitset_list_reverse, lbitset_not, lbitset_ones,
11081 lbitset_op3_cmp, lbitset_or, lbitset_or_cmp, lbitset_prune,
11082 lbitset_release_memory, lbitset_reset, lbitset_set, lbitset_size,
11083 lbitset_subset_p, lbitset_test, lbitset_weed, lbitset_xor,
11084 lbitset_xor_cmp, lbitset_zero): Likewise.
e76d2469 11085
ae26e1f0
AD
110862002-10-14 Akim Demaille <akim@epita.fr>
11087
11088 Version 1.75.
11089
d43baf71
AD
110902002-10-14 Akim Demaille <akim@epita.fr>
11091
11092 * tests/Makefile.am (maintainer-check-posix): New.
11093
7ebc83e3
AD
110942002-10-14 Akim Demaille <akim@epita.fr>
11095
11096 * data/glr.c [YYDEBUG] (YYLEFTMOST_STATE): Initialize the yyloc
11097 member.
11098
05846dae
AD
110992002-10-14 Akim Demaille <akim@epita.fr>
11100
11101 * src/tables.c (table_ninf_remap): base -> tab.
11102 Reported by Matt Rosing.
11103
1318e37d
PE
111042002-10-14 Paul Eggert <eggert@twinsun.com>
11105
447fbb17
PE
11106 * tests/action.at, tests/calc.at, tests/conflicts.at,
11107 tests/cxx-type.at, tests/headers.at, tests/input.at,
11108 tests/regression.at, tests/synclines.at, tests/torture.at:
11109 Say "bison -o foo.c foo.y", not "bison foo.y -o foo.c",
11110 so that the tests still work even if POSIXLY_CORRECT is set.
11111 * doc/bison.texinfo (Rpcalc Compile, Invocation): Likewise.
05846dae 11112
1318e37d
PE
11113 * data/c.m4 (b4_int_type): Use yysigned_char instead of signed char,
11114 for portability to K&R hosts. Fix typo: signed char is guaranteed
11115 only to 127, not to 128.
11116 * data/glr.c (yysigned_char): New type.
11117 * data/yacc.c (yysigned_char): Likewise.
11118 * tests/regression.at (Web2c Actions): signed char -> yysigned_char.
11119
cc0f0794
PE
111202002-10-13 Paul Eggert <eggert@twinsun.com>
11121
5038f418
PE
11122 * data/yacc.c (yyparse): Rewrite to avoid "comparison is always
11123 true due to limited range of data type" warning from GCC.
11124
cc0f0794
PE
11125 * data/c.m4 (b4_token_defines): Protect against double-inclusion
11126 by wrapping enum yytokentype's definition inside #ifndef
11127 YYTOKENTYPE. This undoes a bug I introduced on 2002-10-12.
11128
6fed0802
AD
111292002-10-13 Akim Demaille <akim@epita.fr>
11130
11131 * data/glr.c (yyglrShiftDefer, yyaddDeferredAction, yydoAction):
11132 Un yy- yyrhs to avoid the name clash with the global YYRHS.
11133
32f0598d
AD
111342002-10-13 Akim Demaille <akim@epita.fr>
11135
11136 * Makefile.maint: Update from Autoconf 2.54.
11137 * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Remove, shipped with 2.54.
11138
7ea9a33f
AD
111392002-10-13 Akim Demaille <akim@epita.fr>
11140
11141 * src/print.c (print_state): Separate the list of solved conflicts
11142 from the other items.
11143 * tests/conflicts.at (Resolved SR Conflicts): Adjust.
11144
ea99527d
AD
111452002-10-13 Akim Demaille <akim@epita.fr>
11146
11147 Let nondeterministic skeletons be usable with deterministic
11148 tables.
11149
11150 With the patch, GAWK compiled by GCC without -O2 passes its test
11151 suite using a GLR parser driven by LALR tables. It fails with -O2
11152 because `struct stat' gives two different answers on my machine:
11153 88 (definition of an auto var) and later 96 (memset on this var).
11154 Hence the stack is badly corrumpted. The headers inclusion is to
11155 blame: if I move the awk.h inclusion before GLR's system header
11156 inclusion, the two struct stat have the same size.
11157
11158 * src/tables.c (pack_table): Always create conflict_table.
11159 (token_actions): Always create conflict_list.
11160 * data/glr.c (YYFLAG): Remove, unused.
11161
f377f69f
AD
111622002-10-13 Akim Demaille <akim@epita.fr>
11163
11164 * configure.ac (AC_GNU_SOURCE): Use it instead of hand written code.
11165 (O0FLAGS): New.
11166 (VALGRIND, GXX): New.
11167 * tests/atlocal.in (CFLAGS): Use O0FLAGS.
11168 * tests/bison.in: Run $PREBISON a pre-command.
11169 * tests/Makefile.am (maintainer-check, maintainer-check-valgrind)
11170 (maintainer-check-g++): New.
11171 * Makefile.am (maintainer-check): New.
11172
2a1fe6ed
AD
111732002-10-13 Akim Demaille <akim@epita.fr>
11174
11175 * data/glr.c: Formatting changes.
11176 Tweak some trace messages to match yacc.c's.
11177
f50adbbd
AD
111782002-10-13 Akim Demaille <akim@epita.fr>
11179
11180 GLR parsers sometimes raise parse errors instead of performing the
11181 default reduction.
11182 Reported by Charles-Henry de Boysson.
11183
11184 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Don't
ba0fe3c7 11185 check the length of the traces when %glr.
f50adbbd
AD
11186 (_AT_CHECK_CALC_ERROR): Also skip `^Stack' lines, coming from
11187 GLR's traces.
11188 (AT_CHECK_CALC_LALR, AT_CHECK_CALC_GLR): New.
11189 Test GLR parsers.
11190 * data/glr.c (YYLEFTMOST_STATE): Fix its value.
11191 (yyltype): Remove the yy prefix from the member names.
11192 (yytable): Complete its comment.
11193 (yygetLRActions): Map error action number from YYTABLE from
11194 YYTABLE_NINF to 0.
11195 (yyisErrorAction): No longer compare YYACTION to YYPACT_NINF
11196 (which was a bug: it should have been YYTABEL_NINF, and yet it was
11197 not satisfying as we could compare an YYACTION computed from
11198 YYDEFACT to YYTABLE_NINF although they are unrelated): 0 is the
11199 only value for error actions.
11200 (yyreportParseError): In verbose parse error messages, don't issue
11201 `error' in the list of expected tokens.
11202 * data/yacc.c (yyparse) <yybackup>: Rewrite the decoding of the
11203 next action to perform to match glr.c's decoding.
11204 (yytable): Complete its comment.
11205
bcbad5b9
PE
112062002-10-13 Paul Eggert <eggert@twinsun.com>
11207
11208 Fix problem reported by Henrik Grubbstroem in
161a71f3 11209 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00098.html>:
bcbad5b9
PE
11210 "nonterm: { $$ = 123; } { $$ = $1; };" was wrongly rejected,
11211 because the Bison parser reads the second action before reducing
11212 the first one.
11213 * src/scan-gram.l (rule_length): New static var.
11214 Use it to keep track of the rule length in the scanner, since
11215 we can't expect the parser to be in lock-step sync with the scanner.
11216 (handle_action_dollar, handle_action_at): Use this var.
11217 * tests/actions.at (Exotic Dollars): Test for the problem.
05846dae 11218
14904b89
PE
112192002-10-12 Paul Eggert <eggert@twinsun.com>
11220
1fe611e5
PE
11221 * lib/timevar.c [! IN_GCC && HAVE_SYS_TIME_H]: Include <sys/time.h>.
11222 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): Check for <sys/time.h>.
11223 Include <sys/time.h> when checking for clock_t and struct tms.
11224 Use same include order as source.
11225 This is for the SunOS 4.1.4 porting bug reported by Peter Klein in
161a71f3 11226 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00016.html>.
05846dae 11227
1fe611e5
PE
11228 * lib/timevar.c: Update copyright date and clarify comments.
11229 (get_time) [IN_GCC]: Keep the GCC version for reference.
05846dae 11230
1fe611e5
PE
11231 * lib/timevar.c, lib/timevar.h, lib/timevar.def: Import
11232 GCC version as of today, then merge Bison's changes.
11233 Change "GCC" to "Bison" in copyright notice. timevar.def's
11234 author is Akim, so change that too.
11235
98194095
PE
11236 * src/reader.c (grammar_current_rule_check):
11237 Don't worry about the default action if $$ is untyped.
11238 Prevents bogus warnings reported by Jim Gifford in
161a71f3 11239 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00015.html>.
98194095 11240
14904b89
PE
11241 * data/c.m4 (b4_token_enum): Do not define YYTOKENTYPE.
11242 * data/glr.c, data/lalr1.cc, data/yacc.c:
11243 Output token definitions before the first part of user declarations.
11244 Fixes compatibility problem reported by Jim Gifford for kbd in
161a71f3 11245 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00014.html>.
14904b89 11246
ff6dca18
PE
112472002-10-11 Paul Eggert <eggert@twinsun.com>
11248
11249 * data/yacc.c (yyreport_parse_error): Remove, putting its body into...
11250 (yyparse): here. This undoes some of the 2002-07-25 change.
11251 Compatibility problem reported by Ralf S. Engelschall with
11252 OSSP cfg <http://www.ossp.org/pkg/lib/cfg/>.
11253
eb714592
AD
112542002-10-11 Akim Demaille <akim@epita.fr>
11255
11256 * tests/regression.at Characters Escapes): New.
11257 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Accept \' in strings and
11258 characters.
11259 Reported by Jan Nieuwenhuizen.
11260
b7195100
AD
112612002-10-11 Akim Demaille <akim@epita.fr>
11262
11263 * po/id.po: New.
11264
f28a0f2d
PE
112652002-10-10 Paul Eggert <eggert@twinsun.com>
11266
11267 Portability fixes for bitsets; this also avoids several GCC
11268 warnings.
11269
11270 * lib/abitset.c: Include <stddef.h>, for offsetof.
11271 * lib/lbitset.c: Likewise.
11272
11273 * lib/abitset.c (abitset_bytes): Return a size that is aligned
11274 properly for vectors of objects. Do not assume that adding a
11275 header size to a multiple of a word size yields a value that is
11276 properly aligned for the whole union.
11277 * lib/bitsetv.c (bitsetv_alloc): Likewise.
11278
11279 * lib/bitset_stats.c (bitset_stats_bytes): Adjust to new,
11280 unique names for structures.
11281 * lib/ebitset.c (ebitset_bytes): Likewise.
11282 * lib/lbitset.c (lbitset_bytes): Likewise.
11283
11284 * lib/abitset.c (abitset_ones, abitset_zero, abitset_empty_p,
11285 abitset_copy1, abitset_not, abitset_equal_p, abitset_subset_p,
11286 abitset_disjoint_p, abitset_and, abitset_and_cmp, abitset_andn,
11287 abitset_andn_cmp, abitset_or, abitset_or_cmp, abitset_xor,
11288 abitset_xor_cmp, abitset_and_or, abitset_and_or_cmp,
11289 abitset_andn_or, abitset_andn_or_cmp, abitset_or_and,
11290 abitset_or_and_cmp, abitset_copy): Supply prototype decls,
11291 to improve the type-checking that GCC can do.
11292 * lib/bitset.c (bitset_op4_cmp): Likewise.
11293 * lib/bitset_stats.c (bitset_stats_count,
11294 bitset_stats_empty_p, bitset_stats_ones, bitset_stats_zero,
11295 bitset_stats_copy, bitset_stats_disjoint_p,
11296 bitset_stats_equal_p, bitset_stats_not, bitset_stats_subset_p,
11297 bitset_stats_and, bitset_stats_and_cmp, bitset_stats_andn,
11298 bitset_stats_andn_cmp, bitset_stats_or, bitset_stats_or_cmp,
11299 bitset_stats_xor, bitset_stats_xor_cmp, bitset_stats_and_or,
11300 bitset_stats_and_or_cmp, bitset_stats_andn_or,
11301 bitset_stats_andn_or_cmp, bitset_stats_or_and,
11302 bitset_stats_or_and_cmp): Likewise.
11303 * lib/lbitset.c (lbitset_and, lbitset_and_cmp, lbitset_andn,
11304 lbitset_andn_cmp, lbitset_or, lbitset_or_cmp, lbitset_xor,
11305 lbitset_xor_cmp, lbitset_empty_p, lbitset_ones, lbitset_not,
11306 lbitset_subset_p, lbitset_disjoint_p, debug_lbitset): Likewise.
11307
11308 * lib/abitset.h: Include bitset.h, not bbitset.h.
11309 * lib/ebitset.h: Likewise.
11310 * lib/lbitset.h: Likewise.
11311
11312 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): New types.
11313 All instances of parameters of type enum bitset_opts are now of
11314 type enum_bitset_opts, to conform to the C Standard, and similarly
11315 for enum_bitset_type.
11316 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
11317 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
11318
11319 Do not use "struct bitset_struct" to mean different things in
11320 different modules. Not only is this confusing, it violates
11321 the C Standard, which requires that structure types in different
11322 modules must be compatible if one is to be passed to the other.
11323 * lib/bbitset.h (bitset): Now points to a union, not to a struct.
11324 All instances of "struct bitset_struct *" replaced with "bitset".
11325 * lib/bitset.h (struct bitset_struct): Remove, replacing with....
11326 (union bitset_union, struct abitset_struct, struct ebitset_struct,
11327 struct lbitset_struct, struct bitset_stats_struct): New types.
11328 All uses of struct bitset_struct changed to union bitset_union,
11329 etc.
ba0fe3c7 11330 * lib/abitset.c (struct abitset_struct, abitset,
f28a0f2d
PE
11331 struct bitset_struct): Remove.
11332 * lib/bitset_stats.c (struct bitset_stats_struct, bitset_stats,
11333 struct bitset_struct): Remove.
11334 * lib/ebitset.c (struct ebitset_struct, ebitset, struct
11335 bitset_struct): Remove.
11336 * lib/lbitset.c (struct lbitset_struct, lbitset, bitset_struct):
11337 Likewise.
11338
11339 Do not call a function of type T using a call that assumes the
11340 function is of a different type U. Standard C requires that a
11341 function must be called with a type that is compatible with its
11342 definition.
11343 * lib/bbitset.h (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
11344 New decls.
11345 * lib/bitset.c (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
11346 New functions.
11347 * lib/ebitset.c (PFV): Remove.
11348 * lib/lbitset.c (PFV): Likewise.
11349 * lib/ebitset.c (ebitset_and, ebitset_andn, ebitset_or,
11350 ebitset_xor, ebitset_copy, ebitset_ones, ebitset_empty_p): New
11351 decls.
11352 (ebitset_and, ebitset_andn, ebitset_or, ebitset_xor): New functions.
11353 (ebitset_vtable): Use them.
11354 * lib/lbitset.c (lbitset_and, lbitset_andn, lbitset_or,
11355 lbitset_xor): New functions.
11356 (lbitset_vtable): Use them.
11357
11358 * lib/bitset.h (bitset_next, bitset_prev, bitset_only_set_p):
11359 Declare.
11360
11361 * lib/bitsetv.c (bitsetv_alloc): Add a cast to (void *) to avoid a
11362 GCC warning.
11363 * lib/lbitset.c (LBITSET_CURRENT1): Likewise.
11364 Use offsetof, for simplicity.
11365
6fbe4984
PE
113662002-10-06 Paul Eggert <eggert@twinsun.com>
11367
11368 * lib/bitset.h (bitset_reset): Do not assume that bitset_word is
11369 the same width as int. This reapplies a hunk of the 2002-08-12 patch
161a71f3 11370 <http://lists.gnu.org/archive/html/bison-patches/2002-08/msg00007.html>,
6fbe4984
PE
11371 which was inadvertently undone by the 2002-09-30 patch.
11372 * lib/lbitset.c (debug_lbitset): Do not assume that bitset_word is
11373 the same width as int.
11374
420f93c8
PE
113752002-10-04 Paul Eggert <eggert@twinsun.com>
11376
11377 Version 1.50.
11378
11379 * configure.ac (AC_INIT), NEWS: Increment version number.
11380
11381 * doc/bison.texinfo: Minor spelling, grammar, and white space
11382 fixes.
11383 (Symbols): Mention that any negative value returned from yylex
11384 signifies end-of-input. Warn about negative chars. Mention
11385 the portable Standard C character set.
11386
11387 The GNU coding standard says CFLAGS and YFLAGS are reserved
11388 for the installer to set.
11389 * lib/Makefile.am (AM_CFLAGS): Renamed from CFLAGS.
11390 * src/Makefile.am (AM_CFLAGS): Likewise.
11391 (AM_YFLAGS): Renamed from YFLAGS.
11392
11393 Fix some MAX and MIN problems.
11394 * src/gram.h (ITEM_NUMBER_MIN): MIN_MAX -> INT_MIN.
11395 * src/lalr.h (GOTO_NUMBER_MAX): INT_MAX -> SHRT_MAX.
11396 * src/symtab.h (SYMBOL_NUMBER_MAX): New macro.
11397 * src/reader.c (reader): Use it.
11398
11399 * tests/regression.at (Braces parsing): Use grep, not fgrep, as
11400 POSIX 1003.1-2001 has removed fgrep.
11401
114022002-10-04 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
11403
11404 * lib/bbitset.h (BITSET_WINDEX_MAX): Redefine so that it cannot be
11405 interpreted as signed.
11406 * lib/ebitset.c (ebitset_list): Fix bug.
11407
ff68026d
PE
114082002-10-01 Paul Eggert <eggert@twinsun.com>
11409
11410 More fixes for 64-bit hosts and large bitsets.
11411
11412 * lib/abitset.c (struct abitset_struct.n_bits, abitset_small_list,
11413 abitset_size, abitset_list, abitset_list_reverse, abitset_list):
11414 Use bitset_bindex, not int or unsigned int or size_t, to count bits.
11415 * lib/bbitset.h (struct bitset_vtable.size, struct bitset_vtable.count,
11416 struct bitset_vtable.list, struct bitset_vtable.list_reverse,
11417 bitset_count_, bitset_next, bitset_prev, bitset_first, bitset_last,
11418 bitset_count_): Likewise.
11419 * lib/bitset.h (bitset_iterator.num, bitset_iterator.i,
11420 bitset_first, bitset_last): Likewise.
11421 * lib/bitset_stats.c (bitset_stats_size, bitset_stats_list,
11422 bitset_stats_list_reverse, bitset_stats_size,
11423 bitset_stats_count, bitset_stats_list, bitset_stat_list_reverse):
11424 Likewise.
11425 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
11426 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
11427 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
11428 bitsetv_reflexive_transitive_closure): Likewise.
11429 * lib/bitsetv.h (bitsetv_alloc, bitsetv_create): Likewise.
11430 * lib/ebitset.c (ebitset_size, ebitset_list, ebitset_list_reverse):
11431 Likewise.
11432 * lib/lbitset.c (lbitset_size, lbitset_list, lbitset_list_merge):
11433 Likewise.
420f93c8 11434
ff68026d
PE
11435 * lib/abitset.c (abitset_ones, abitset_zero, abitset_bytes):
11436 Use size_t, not unsigned int, to count bytes.
11437 * lib/abitset.h (abitset_bytes): Likewise.
11438 * lib/bitset.c (bitset_bytes, bitset_alloc, bitset_obstack_alloc):
11439 Likewise.
11440 * lib/bitset.h (bitset_bytes): Likewise.
11441 * lib/bitset_stats.c (bitset_stats_bytes, bitset_stats_init): Likewise.
11442 * lib/bitset_stats.h (bitset_stats_bytes): Likewise.
11443 * lib/bitsetv.c (bitsetv_alloc): Likewise.
11444 * lib/ebitset.c (ebitset_bytes): Likewise.
11445 * lib/ebitset.h (ebitset_bytes): Likewise.
11446 * lib/lbitset.c (lbitset_bytes): Likewise.
11447 * lib/lbitset.h (lbitset_bytes): Likewise.
420f93c8 11448
ff68026d
PE
11449 * lib/abitset.c (abitset_empty_p, abitset_not, abitset_equal_p,
11450 abitset_subset_p, abitset_disjoint_p, abitset_and,
11451 abitset_and_cmp, abitset_andn, abitset_andn_cmp, abitset_or,
11452 abitset_or_cmp, abitset_xor, abitset_xor_cmp, abitset_and_or,
11453 abitset_and_or_cmp, abitset_andn_or, abitset_andn_or_cmp,
11454 abitset_or_and, abitset_or_and_cmp):
11455 Use bitset_windex instead of unsigned int.
11456 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
11457 * lib/ebitset.c (struct ebitset_struct.size, ebitset_elts_grow,
11458 ebitset_elt_add, ebitset_elt_remove, ebitset_weed,
11459 ebitset_elt_find, ebitset_list_reverse, ebitset_list, ebitset_init):
11460 Likewise.
11461 * lib/lbitset.c (lbitset_ones, lbitset_not): Likewise.
420f93c8 11462
ff68026d
PE
11463 * lib/bitset.c (bitset_print):
11464 Use proper printf formats for widths of integer types.
11465 * lib/bitset_stats.c (bitset_percent_histogram_print,
11466 bitset_log_histogram_print, bitset_stats_print_1): Likewise.
11467 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
11468 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
11469 * lib/lbitset.c (lbitset_bytes): Likewise.
420f93c8 11470
ff68026d
PE
11471 * lib/bbitset.h (BITSET_BINDEX_MAX, BITSET_WINDEX_MAX,
11472 BITSET_SIZE_MAX): New macros.
11473 (BITSET_INDEX_MAX): Remove. It wasn't right, since it assumed that
11474 sizeof (bitset_word) == sizeof (bitset_windex). All uses changed
11475 to BITSET_WINDEX_MAX.
11476
11477 * lib/bitset.c (bitset_next, bitset_prev, bitset_first,
11478 bitset_last): Return BITSET_BINDEX_MAX (not -1) for no value,
11479 since we now return the bitset_bindex type (not int).
11480
11481 * lib/bitsetv.c (bitsetv_alloc): Check for arithmetic overflow
11482 when computing sizes.
11483 * lib/ebitset.c (ebitset_elts_grow): Likewise.
11484
11485 * lib/lbitset.c (lbitset_elt_find): Simplify windex calculation
11486 and avoid cast to unsigned.
11487
6aa452a6
AD
114882002-09-30 Akim Demaille <akim@epita.fr>
11489
11490 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
11491 * lib/bitset_stats.c, lib/bitsetv.c, lib/ebitset.c, lib/lbitset.c:
11492 Updates from Michael Hayes.
11493
927f7817
AD
114942002-09-30 Art Haas <ahaas@neosoft.com>
11495
11496 * configure.ac: Update AC_OUTPUT and AM_CONFIG_HEADER
11497 invocations.
11498 * tests/cxx-type.at (declarator): Don't rely on NDEBUG being not
11499 defined.
11500
9738f41e
AD
115012002-09-27 Akim Demaille <akim@epita.fr>
11502
11503 Version 1.49c.
11504
a5c75d7f
AD
115052002-09-27 Akim Demaille <akim@epita.fr>
11506
11507 * configure.ac (AM_INIT_AUTOMAKE): We _need_ 1.7.
11508 (Because of AC_LIBSOURCE).
11509
8280e179
AD
115102002-09-27 Akim Demaille <akim@epita.fr>
11511
11512 Playing with Autoscan.
11513
11514 * configure.ac: Remove the old LIBOBJ tweaks.
11515 (AC_REPLACE_FUNCS): Add strrchr and strtol.
11516 * lib/strrchr.c: New.
11517 * lib/strtol.c: New, from the Coreutils 4.5.1.
11518
ae64af35
AD
115192002-09-27 Akim Demaille <akim@epita.fr>
11520
11521 Playing with Autoscan.
11522
11523 * m4/prereq.m4 (jm_PREREQ_ARGMATCH, jm_FUNC_ARGMATCH): New.
11524 * lib/Makefile.am (libbison_a_SOURCES): No longer include
11525 argmatch.c and argmatch.h, since they are AC_LIBSOURCE'd.
11526 * lib/strcasecmp.c, lib/strncasecmp.c, lib/memcmp.c: New, from the
11527 Coreutils 4.5.1.
11528
d1a1114f
AD
115292002-09-24 Akim Demaille <akim@epita.fr>
11530
11531 * doc/bison.texinfo (Stack Overflow): xref to Recursion.
11532 (Frequently Asked Questions, Parser Stack Overflow): New.
11533
b906441c
AD
115342002-09-13 Akim Demaille <akim@epita.fr>
11535
11536 Playing with autoscan.
11537
11538 * src/reader.c (get_merge_function): Use xstrdup, not strdup.
11539 * src/files.c (skeleton_find): Remove, unused.
11540 * m4/memcmp.m4: New, from the Coreutils 4.5.1.
11541 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Run jm_FUNC_MEMCMP.
11542
bd701811
AD
115432002-09-13 Akim Demaille <akim@epita.fr>
11544
11545 * configure.ac (AM_INIT_AUTOMAKE): Require Automake 1.6.3.
11546 * Makefile.am (AUTOMAKE_OPTIONS): Don't.
11547
e0a13e7b
AD
115482002-09-13 Akim Demaille <akim@epita.fr>
11549
11550 * configure.ac: Require 2.54.
11551 s/jm_FUNC_MALLOC/AC_FUNC_MALLOC/.
11552 s/jm_FUNC_REALLOC/AC_FUNC_REALLOC/.
11553 * m4/c-bs-a.m4, m4/malloc.m4, m4/mbstate_t.m4, m4/realloc.m4:
11554 Remove, provided by Autoconf macros.
11555
c97011bf
AD
115562002-09-12 Akim Demaille <akim@epita.fr>
11557
11558 * m4/prereq.m4: Update, from Coreutils 4.5.1.
11559
d862b1be
AD
115602002-09-12 Akim Demaille <akim@epita.fr>
11561
11562 * m4/prereq.m4: Update, from Fileutils 4.1.5.
11563 * configure.ac (jm_PREREQ_TEMPNAME): Invoke it.
11564 Reported by Martin Mokrejs.
11565
3d38c03a
AD
115662002-09-10 Akim Demaille <akim@epita.fr>
11567
11568 * src/parse-gram.y: Associate a human readable string to each
11569 token type.
11570 * tests/regression.at (Invalid inputs): Adjust.
11571
b6347355
AD
115722002-09-10 Gary V. Vaughan <gary@gnu.org>
11573
11574 * tests/Makefile.am ($(srcdir)/package.m4): Bison now ships
11575 with an Autoconf-2.5x style configure.ac.
11576
09ba4ab2
PE
115772002-09-06 Paul Eggert <eggert@twinsun.com>
11578
11579 * doc/bison.texinfo (Conditions): Make explicit that the GPL
11580 exception applies only to yacc.c. This is a modification of a
11581 patch originally suggested by Akim Demaille.
11582
21846f69
AD
115832002-09-06 Akim Demaille <akim@epita.fr>
11584
09ba4ab2
PE
11585 * data/c.m4 (b4_copyright): Move the GPL exception comment from
11586 here to...
11587 * data/yacc.c: here.
11588
21846f69
AD
11589 * data/lalr1.cc (struct yyltype): Don't define it, since we use
11590 LocationType.
11591 (b4_ltype): Default to yy::Location from location.hh.
11592
c0ad8bf3
AD
115932002-09-04 Jim Meyering <jim@meyering.net>
11594
11595 * data/yacc.c: Guard the declaration of yytoknum also with
11596 `#ifdef YYPRINT', so it is declared only when used.
11597
3a93251e
AD
115982002-09-04 Akim Demaille <akim@epita.fr>
11599
11600 * configure.in: Rename as...
11601 * configure.ac: this.
11602 Bump to 1.49c.
11603
427c0dda
AD
116042002-09-04 Akim Demaille <akim@epita.fr>
11605
11606 * src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
11607 * src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't
11608 translate maintainer only messages.
11609
6a254321
PE
116102002-08-12 Paul Eggert <eggert@twinsun.com>
11611
645e30d1
PE
11612 Version 1.49b.
11613
6a254321
PE
11614 * Makefile.am (SUBDIRS): Remove intl.
11615 (DISTCLEANFILES): Remove.
11616 * NEWS: Mention that GNU M4 is now required. Clarify what is
11617 meant by "larger grammars". Mention the pt_BR translation.
11618 * configure.in (AC_CHECK_DECLS): Add getenv, getopt.
11619 (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var.
11620 Bump version from 0.11.2 to 0.11.5.
11621 (BISON_PREREQ_STAGE): Remove.
11622 (AM_GNU_GETTEXT): Use external gettext.
11623 (AC_OUTPUT): Remove intl/Makefile.
11624
11625 * config/depcomp, config/install-sh: Sync with Automake 1.6.3.
11626
11627 * data/glr.c: Include string.h, for strlen.
11628 (yyreportParseError): Use size_t for yysize.
11629 (yy_yypstack): No longer nested inside yypstates, as nested
11630 functions are not portable. Do not assume size_t is the
11631 same width as int.
11632 (yypstates): Do not assume that ptrdiff_t is the same width
11633 as int, and similarly for yyposn and YYINDEX.
11634
11635 * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.
11636
11637 * lib/Makefile.am (INCLUDES): Do not include from the intl
11638 directory, which has been removed.
11639 * src/Makefile.am (INCLUDES): Likewise.
11640
11641 * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
11642 (bitsets_sources, additional_bitsets_sources, timevars_sources):
11643 New vars.
11644
11645 * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
11646 * tests/Makefile.am (EXTRA_DIST): Likewise.
11647
11648 * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
11649 Do not assume that bitset_windex is the same width as unsigned.
11650
11651 * lib/abitset.c (abitset_unused_clear): Do not assume that
11652 bitset_word is the same width as int.
11653 * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise.
11654 * lib/bitset.h (bitset_set, bitset_reset): Likewise.
11655 * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise.
11656 * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise.
11657 * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise.
11658
11659 * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for
11660 portability to one's complement hosts!).
11661 * lib/ebitset.c (ebitset_op1): Likewise.
11662 * lib/lbitset.c (lbitset_op1): Likewise.
11663
11664 * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar.
11665 * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
11666 lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c:
11667 Sync with fileutils.
11668 * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
11669 lib/gettext.h: Sync with diffutils.
11670
11671 * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
11672 lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.
11673
11674 * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
11675 PROTOTYPES to check for prototypes, and "defined __STDC__" to
11676 check for void *.
11677
11678 * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not
11679 size_t; the old version tried to do this but casted improperly.
11680 (bitset_bindex, bitset_windex): Now size_t, not unsigned long.
11681 (bitset_test): Now returns int, not unsigned long.
11682
11683 * lib/bitset_stats.c: Include "gettext.h".
11684 (_): New macro.
11685 (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
11686 name locals "index", as it generates unnecessary warnings on some
11687 hosts that have an "index" function.
11688
11689 * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print,
11690 bitset_stats_read, bitset_stats_write): Wrap strings in _() if
11691 they need translation.
11692 * src/LR0.c (state_list_append, new_itemsets, get_state,
11693 append_states, generate_states): Likewise.
11694 * src/assoc.c (assoc_to_string): Likewise.
11695 * src/closure.c (print_closure, set_firsts, closure): Likewise.
11696 * src/gram.c (grammar_dump): Likewise.
11697 * src/injections.c (injections_compute): Likewise.
11698 * src/lalr.c (lookaheads_print): Likewise.
11699 * src/relation.c (relation_transpose): Likewise.
11700 * src/scan-gram.l: Likewise.
11701 * src/tables.c (table_grow, pack_vector): Likewise.
11702
11703 * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4,
11704 glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4.
11705 * m4/malloc.m4, m4/realloc.m4: Sync with diffutils.
11706 * m4/mbstate_t.m4: Sync with fileutils.
11707 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T.
11708
11709 * po/LINGUAS: Add pt_BR.
11710 * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c,
11711 src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c,
11712 lib/timevar.c.
11713 Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
11714 manual recommends.
11715 Similarly, use src/scan-gram.l instead of src/scan-gram.c.
11716
11717 * src/complain.c (strerror_r): Remove decl; not needed.
11718 (strerror): Use same pattern as ../lib/error.c.
11719
11720 * src/files.c, src/files.h (compute_header_macro): Remove; unused.
11721
11722 * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.
11723
11724 * src/main.c (main): Cast result of bindtextdomain and textdomain
11725 to void, to avoid a GCC warning when --disable-nls is in effect.
11726
11727 * src/scan-gram.l: Use strings rather than escapes when possible,
11728 to minimize the number of warnings from xgettext.
11729 (handle_action_dollar, handle_action_at): Don't use isdigit,
11730 as it mishandles negative chars and it may not work as expected
11731 outside the C locale.
11732
11733 * src/symtab.c (symbol_get): Don't cast LHS of an assignment;
11734 this is a GCC extension and is not portable to other compilers.
11735
11736 * src/system.h (alloca): Use same pattern as ../lib/error.c.
11737 Do not include <ctype.h>; no longer needed.
11738 Do not include <malloc.h>; no longer needed (and generates
11739 warnings on OpenBSD 3.0).
11740
11741 * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
11742 it's not portable.
11743
11744 * tests/regression.at: Do not use 'cc -c input.c -o input';
11745 Sun C rejects this. Instead, use 'cc -c input.c -o input.o'.
11746
11747 * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero
11748 exit status as failure, not just exit status 1. Sun C exits
11749 with status 2 sometimes.
11750
11751 * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
11752 Use it for the two large tests.
11753
c8f002c7
AD
117542002-08-02 Akim Demaille <akim@epita.fr>
11755
11756 * src/conflicts.c (conflicts_output): Don't output rules never
11757 reduced here, since anyway that computation doesn't work.
11758 * src/gram.h, src/gram.h (rule_filter_t, rule_useful_p)
11759 (rule_useless_p, rule_never_reduced_p): New.
11760 (grammar_rules_partial_print): Use a filter instead of a range.
11761 Display the title only if needed.
11762 (grammar_rules_print): Adjust.
11763 (grammar_rules_never_reduced_report): New.
11764 * src/tables.c (action_row): Move the computation of rules never
11765 reduced to...
11766 (token_actions): here.
11767 * src/main.c (main): Make the parser before making the report, so
11768 that rules never reduced are computed.
11769 Call grammar_rules_never_reduced_report.
11770 * src/print.c (print_results): Report rules never reduced.
11771 * tests/conflicts.at, tests/reduce.at: Adjust.
11772
cd08e51e
AD
117732002-08-01 Akim Demaille <akim@epita.fr>
11774
11775 Instead of attaching lookaheads and duplicating the rules being
11776 reduced by a state, attach the lookaheads to the reductions.
11777
11778 * src/state.h (state_t): Remove the `lookaheads',
11779 `lookaheads_rule' member.
11780 (reductions_t): Add a `lookaheads' member.
11781 Use a regular array for the `rules'.
11782 * src/state.c (reductions_new): Initialize the lookaheads member
11783 to 0.
11784 (state_rule_lookaheads_print): Adjust.
11785 * src/state.h, src/state.c (state_reductions_find): New.
11786 * src/conflicts.c (resolve_sr_conflict, set_conflicts)
11787 (count_rr_conflicts): Adjust.
11788 * src/lalr.c (LArule): Remove.
11789 (add_lookback_edge): Adjust.
11790 (state_lookaheads_count): New.
11791 (states_lookaheads_initialize): Merge into...
11792 (initialize_LA): this.
11793 (lalr_free): Adjust.
11794 * src/main.c (main): Don't free nullable and derives too early: it
11795 is used by --verbose.
11796 * src/print.c, src/print_graph.c, src/tables.c: Adjust.
11797
bb0027a9
AD
117982002-08-01 Akim Demaille <akim@epita.fr>
11799
11800 * src/derives.h, src/derives.c (derives): A `rule_t***' instead of
11801 `rule_number_t**'.
11802 (set_derives, free_derives): Rename as...
11803 (derives_compute, derives_free): this.
11804 Adjust all dependencies.
11805 * src/nullable.c (set_nullable, free_nullable): Rename as...
11806 (nullable_compute, nullable_free): these.
11807 (rule_list_t): Store rule_t *, not rule_number_t.
11808 * src/state.c (state_rule_lookaheads_print): Directly compare rule
11809 pointers, instead of their numbers.
11810 * src/main.c (main): Call nullable_free, and derives_free earlier,
11811 as they were lo longer used.
11812
3325ddc4
AD
118132002-08-01 Akim Demaille <akim@epita.fr>
11814
11815 * lib/timevar.c (get_time): Include children time.
11816 * src/lalr.h (LA, LArule): Don't export them: used with the
11817 state_t.
11818 * src/lalr.c (LA, LArule): Static.
11819 * src/lalr.h, src/lalr.c (lalr_free): New.
11820 * src/main.c (main): Call it.
11821 * src/tables.c (pack_vector): Check whether loc is >= to the
11822 table_size, not >.
11823 (pack_tables): Don't free froms, tos, conflict_tos, and pos...
11824 (tables_generate): do it, since that's also it which allocates
11825 them.
11826 Don't free LA and LArule, main does.
11827
c6f1a33c
AD
118282002-07-31 Akim Demaille <akim@epita.fr>
11829
11830 Separate parser tables computation and output.
11831
11832 * src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
11833 (conflict_list, conflict_list_cnt, table, check, table_ninf)
11834 (yydefgoto, yydefact, high): Move to...
11835 * src/tables.h, src/tables.c: here.
11836 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
11837 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
11838 (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
11839 (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
11840 (ACTION_MIN, actrow, order, nentries, pos, conflrow)
11841 (conflict_list_free, table_size, lowzero, table_grow, conflict_row)
11842 (action_row, save_row, token_actions, save_column, default_goto)
11843 (goto_actions, sort_actions, matching_state, pack_vector)
11844 (table_ninf_remap, pack_table, prepare_actions): Move to...
11845 * src/tables.c: here.
11846 * src/tables.h, src/tables.c(tables_generate, tables_free): New.
11847 * src/output.c (token_actions, output_base, output_conflicts)
11848 (output_check): Merge into...
11849 (prepare_actions): this.
11850 (actions_output): Rename as...
11851 (user_actions_output): this.
11852 * src/main.c (main): Call tables_generate and tables_free.
11853
1509d42f
AD
118542002-07-31 Akim Demaille <akim@epita.fr>
11855
11856 Steal GCC's --time-report support.
11857
11858 * lib/timevar.c, lib/timevar.h, lib/timevar.def: New,
11859 stolen/adjusted from GCC.
11860 * m4/stage.m4: Remove time related checks.
11861 * m4/timevar.m4: New.
11862 * configure.in: Adjust.
11863 * src/system.h: Adjust to using timevar.h.
11864 * src/getargs.h, src/getargs.c: Support trace_time for
11865 --trace=time.
11866 * src/main.c (stage): Remove.
11867 (main): Replace `stage' invocations with timevar calls.
11868 * src/output.c: Insert pertinent timevar calls.
11869
273a74fa
AD
118702002-07-31 Akim Demaille <akim@epita.fr>
11871
11872 Let --trace have arguments.
11873
11874 * src/getargs.h (enum trace_e): New.
11875 * src/getargs.c (trace_args, trace_types, trace_argmatch): New.
11876 (long_options, short_options): --trace/-T takes an optional
11877 argument.
11878 Change all the uses of trace_flag to reflect the new flags.
11879 * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
11880
11881 Strengthen `stage' portability.
11882
11883 * m4/stage.m4 (BISON_PREREQ_STAGE): New.
11884 * configure.in: Use it.
11885 Don't check for malloc.h and sys/times.h.
11886 * src/system.h: Include them when appropriate.
11887 * src/main.c (stage): Compile only when mallinfo, struct mallinfo,
11888 times and struct tms are available.
11889
217598da
AD
118902002-07-30 Akim Demaille <akim@epita.fr>
11891
11892 In verbose parse error message, don't report `error' as an
11893 expected token.
11894 * tests/actions.at (Printers and Destructors): Adjust.
11895 * tests/calc.at (Calculator $1): Adjust.
11896 * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose
11897 error message, do not report the parser accepts the error token in
11898 that state.
11899
52489d44
AD
119002002-07-30 Akim Demaille <akim@epita.fr>
11901
11902 Normalize conflict related messages.
11903
11904 * src/complain.h, src/complain.c (warn, complain): New.
11905 * src/conflicts.c (conflicts_print): Use them.
11906 (conflict_report_yacc): New, extracted from...
11907 (conflicts_print): here.
11908 * tests/conflicts.at, tests/existing.at: Adjust.
11909
e8832397
AD
119102002-07-30 Akim Demaille <akim@epita.fr>
11911
11912 Report rules which are never reduced by the parser: those hidden
11913 by conflicts.
11914
11915 * src/LR0.c (save_reductions): Don't make the final state too
11916 different: save its reduction (accept) instead of having a state
11917 without any action (no shift or goto, no reduce).
11918 Note: the final state is now a ``regular'' state, i.e., the
11919 parsers now contain `reduce 0' as default reduction.
11920 Nevertheless, since they decide to `accept' when yystate =
11921 final_state, they still will not reduce rule 0.
11922 * src/print.c (print_actions, print_reduction): Adjust.
11923 * src/output.c (action_row): Track reduced rules.
11924 (token_actions): Report rules never reduced.
11925 * tests/conflicts.at, tests/regression.at: Adjust.
11926
caf23d24
AD
119272002-07-30 Akim Demaille <akim@epita.fr>
11928
11929 `stage' was accidently included in a previous patch.
11930 Initiate its autoconfiscation.
11931
11932 * configure.in: Look for malloc.h and sys/times.h.
11933 * src/main.c (stage): Adjust.
11934 Report only when trace_flag.
11935
640748ee
AD
119362002-07-29 Akim Demaille <akim@epita.fr>
11937
11938 * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not
11939 state_number_t.
11940 (errs_t): symbol_t*, not symbol_number_t.
11941 (reductions_t): rule_t*, not rule_number_t.
11942 (FOR_EACH_SHIFT): New.
11943 * src/LR0.c, src/conflicts.c, src/lalr.c, src/output.c
11944 * src/print.c, src/print_graph.c: Adjust.
11945
88bce5a2
AD
119462002-07-29 Akim Demaille <akim@epita.fr>
11947
11948 Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
11949
11950 * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
11951 (endtoken, accept): these.
11952 * src/reader.c (reader): Set endtoken's default tag to "$end".
11953 Set undeftoken's tag to "$undefined" instead of "$undefined.".
11954 * doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
11955 Adjust.
11956
1bfb97db
AD
119572002-07-29 Akim Demaille <akim@epita.fr>
11958
11959 * src/reduce.c (reduce_grammar): When the language is empty,
11960 complain about the start symbol, not the axiom.
11961 Use its location.
11962 * tests/reduce.at (Empty Language): New.
11963
fc5734fe
AD
119642002-07-26 Akim Demaille <akim@epita.fr>
11965
11966 * src/reader.h, src/reader.c (gram_error): ... can't get
11967 yycontrol without making too strong assumptions on the parser
11968 itself.
11969 * src/output.c (prepare_tokens): Use the real 0th value of
11970 token_translations instead of `0'.
11971 * src/parse-gram.y (yyerror): Don't rely on yycontrol being
11972 visible here.
11973 * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
11974 for the time being: %locations ought to provide it to yyerror.
11975
3650b4b8
AD
119762002-07-25 Akim Demaille <akim@epita.fr>
11977
11978 * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
11979 * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
11980 * tests/regression.at (Web2c Actions): Adjust.
11981
4b3d3a8e
AD
119822002-07-25 Akim Demaille <akim@epita.fr>
11983
11984 Stop storing rules from 1 to nrules + 1.
11985
11986 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
11987 * src/nullable.c, src/output.c, src/print.c, src/reader.c
11988 * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
11989 Iterate from 0 to nrules.
11990 Use rule_number_as_item_number and item_number_as_rule_number.
11991 Adjust to `derive' now containing possibly 0.
11992 * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
11993 Handle the `- 1' part in rule numbers from/to item numbers.
11994 * src/conflicts.c (log_resolution): Fix the message which reversed
11995 shift and reduce.
11996 * src/output.c (action_row): Initialize default_rule to -1.
11997 (token_actions): Adjust.
11998 * tests/sets.at (Nullable, Firsts): Fix the previously bogus
11999 expected output.
12000 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
12001
4a2a22f4
AD
120022002-07-25 Akim Demaille <akim@epita.fr>
12003
12004 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
12005 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
12006 (b4_c_knr_arg_decl): New.
12007 * data/yacc.c: Use it to define yysymprint, yydestruct, and
12008 yyreport_parse_error.
12009
b8df3223
AD
120102002-07-25 Akim Demaille <akim@epita.fr>
12011
12012 * data/yacc.c (yyreport_parse_error): New, extracted from...
12013 (yyparse): here.
12014 (yydestruct, yysymprint): Move above yyparse.
12015 Be K&R compliant.
12016
a762e609
AD
120172002-07-25 Akim Demaille <akim@epita.fr>
12018
12019 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
12020 replace...
12021 (b4_sint_type, b4_uint_type): these.
12022 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
12023 * tests/regression.at (Web2c Actions): Adjust.
12024
12b0043a
AD
120252002-07-25 Akim Demaille <akim@epita.fr>
12026
12027 * src/gram.h (TIEM_NUMBER_MAX): New.
12028 (item_number_of_rule_number, rule_number_of_item_number): Rename
12029 as...
12030 (rule_number_as_item_number, item_number_as_rule_number): these.
12031 Adjust dependencies.
12032 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
12033 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
12034 (symbol_number_to_vector_number): New.
12035 (order): Of vector_number_t* type.
12036 (base_t, BASE_MAX, BASE_MIN): New.
12037 (froms, tos, width, pos, check): Of base_t type.
12038 (action_number_t, ACTION_MIN, ACTION_MAX): New.
12039 (actrow): Of action_number_t type.
12040 (conflrow): Of unsigned int type.
12041 (table_ninf, base_ninf): New.
12042 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
12043 (muscle_insert_int_table, muscle_insert_base_table)
12044 (muscle_insert_rule_number_table): New.
12045 (prepare_tokens): Output `toknum' as int_table.
12046 (action_row): Returns a rule_number_t.
12047 Use ACTION_MIN, not SHRT_MIN.
12048 (token_actions): yydefact is rule_number_t*.
12049 (table_ninf_remap): New.
12050 (pack_table): Use it for `base' and `table'.
12051 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
12052 replaced with...
12053 (YYPACT_NINF, YYTABLE_NINF): these.
12054 (yypact, yytable): Compute their types instead of hard-coded
12055 `short'.
12056 * tests/regression.at (Web2c Actions): Adjust.
12057
5dde258a
AD
120582002-07-19 Akim Demaille <akim@epita.fr>
12059
12060 * src/scan-gram.l (id): Can start with an underscore.
12061
a945ec39
AD
120622002-07-16 Akim Demaille <akim@epita.fr>
12063
12064 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
12065 Adjust all former `associativity' dependencies.
12066 * src/symtab.c (symbol_new): Default associativity is `undef', not
12067 `right'.
12068 (symbol_check_alias_consistence): Adjust.
12069
fae437e8
AD
120702002-07-09 Akim Demaille <akim@epita.fr>
12071
12072 * doc/bison.texinfo: Properly set the ``header'' part.
12073 Use @dircategory ``GNU programming tools'' as per Texinfo's
12074 documentation.
12075 Use @copying.
12076
1a715ef2
AD
120772002-07-09 Akim Demaille <akim@epita.fr>
12078
12079 * lib/quotearg.h: Protect against multiple inclusions.
12080 * src/location.h (location_t): Add a `file' member.
12081 (LOCATION_RESET, LOCATION_PRINT): Adjust.
12082 * src/complain.c (warn_at, complain_at, fatal_at): Drop
12083 `error_one_per_line' support.
12084
a5d50994
AD
120852002-07-09 Akim Demaille <akim@epita.fr>
12086
12087 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
12088 * src/reader.c (lineno): Remove.
12089 Adjust all dependencies.
12090 (get_merge_function): Take a location and use complain_at.
12091 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
12092 * tests/regression.at (Invalid inputs, Mixing %token styles):
12093 Adjust.
12094
b275314e
AD
120952002-07-09 Akim Demaille <akim@epita.fr>
12096
12097 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
12098 recovery rule, and forbid extensions when --yacc.
12099 (gram_error): Use complain_at.
12100 * src/reader.c (reader): Exit if there were parse errors.
12101
865b9df1
AD
121022002-07-09 Akim Demaille <akim@epita.fr>
12103
12104 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
12105 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
12106 Reported by R Blake <blakers@mac.com>.
12107
c76e14da
AD
121082002-07-09 Akim Demaille <akim@epita.fr>
12109
12110 * data/yacc.c: Output the copyright notive in the header.
12111
7db2ed2d
AD
121122002-07-03 Akim Demaille <akim@epita.fr>
12113
12114 * src/output.c (froms, tos): Are state_number_t.
12115 (save_column): sp, sp1, and sp2 are state_number_t.
12116 (prepare): Rename `final' as `final_state_number', `nnts' as
12117 `nterms_number', `nrules' as `rules_number', `nstates' as
12118 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
12119 unused.
12120 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
12121 * data/lalr1.cc (nsym_): Remove, unused.
12122
e68e0410
AD
121232002-07-03 Akim Demaille <akim@epita.fr>
12124
12125 * src/lalr.h, src/lalr.c (goto_number_t): New.
12126 * src/lalr.c (goto_list_t): New.
12127 Propagate them.
12128 * src/nullable.c (rule_list_t): New.
12129 Propagate.
12130 * src/types.h: Remove.
12131
e1a4f3a4
AD
121322002-07-03 Akim Demaille <akim@epita.fr>
12133
12134 * src/closure.c (print_fderives): Use rule_rhs_print.
12135 * src/derives.c (print_derives): Use rule_rhs_print.
12136 (rule_list_t): New, replaces `shorts'.
12137 (set_derives): Add comments.
12138 * tests/sets.at (Nullable, Firsts): Adjust.
12139
536545f3
AD
121402002-07-03 Akim Demaille <akim@epita.fr>
12141
12142 * src/output.c (prepare_actions): Free `tally' and `width'.
12143 (prepare_actions): Allocate and free `order'.
12144 * src/symtab.c (symbols_free): Free `symbols'.
12145 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
12146 * src/output.c (m4_invoke): Move to...
12147 * src/scan-skel.l: here.
12148 (<<EOF>>): Close yyout, and free its name.
12149
8b752b00
AD
121502002-07-03 Akim Demaille <akim@epita.fr>
12151
12152 Fix some memory leaks, and fix a bug: state 0 was examined twice.
12153
12154 * src/LR0.c (new_state): Merge into...
12155 (state_list_append): this.
12156 (new_states): Merge into...
12157 (generate_states): here.
12158 (set_states): Don't ensure a proper `errs' state member here, do it...
12159 * src/conflicts.c (conflicts_solve): here.
12160 * src/state.h, src/state.c: Comment changes.
12161 (state_t): Rename member `shifts' as `transitions'.
12162 Adjust all dependencies.
12163 (errs_new): For consistency, also take the values as argument.
12164 (errs_dup): Remove.
12165 (state_errs_set): New.
12166 (state_reductions_set, state_transitions_set): Assert that no
12167 previous value was assigned.
12168 (state_free): New.
12169 (states_free): Use it.
12170 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
12171 temporary storage: use `errs' and `nerrs' as elsewhere.
12172 (set_conflicts): Allocate and free this `errs'.
12173
613f5e1a
AD
121742002-07-02 Akim Demaille <akim@epita.fr>
12175
12176 * lib/libiberty.h: New.
12177 * lib: Update the bitset implementation from upstream.
12178 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
12179 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
12180 * src/main.c: Adjust bitset stats calls.
12181
26e0cadc
PE
121822002-07-01 Paul Eggert <eggert@twinsun.com>
12183
12184 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
12185 char, so that negative chars don't collide with $.
12186
1154cced
AD
121872002-06-30 Akim Demaille <akim@epita.fr>
12188
12189 Have the GLR tests be `warning' checked, and fix the warnings.
12190
12191 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
12192 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
12193 (yyremoveDeletes): `yyi' and `yyj' are size_t.
12194 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
12195 (yyaddDeferredAction): static.
12196 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
12197 (yyreportParseError): yyprefix is const.
12198 yytokenp is used only when verbose.
12199 (yy__GNUC__): Replace with __GNUC__.
12200 (yypdumpstack): yyi is size_t.
12201 (yypreference): Un-yy local variables and arguments, to avoid
12202 clashes with `yyr1'. Anyway, we are not in the user name space.
12203 (yytname_size): be an int, as is compared with ints.
12204 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
12205 Use them.
12206 * tests/cxx-gram.at: Use quotation to protect $1.
12207 Use AT_COMPILE to enable warnings hunts.
12208 Prototype yylex and yyerror.
12209 `Use' argc.
12210 Include `string.h', not `strings.h'.
12211 Produce and prototype stmtMerge only when used.
12212 yylex takes a location.
12213
97650f4e
AD
122142002-06-30 Akim Demaille <akim@epita.fr>
12215
12216 We spend a lot of time in quotearg, in particular when --verbose.
12217
12218 * src/symtab.c (symbol_get): Store a quoted version of the key.
12219 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
12220 Adjust all callers.
12221
d2576365
AD
122222002-06-30 Akim Demaille <akim@epita.fr>
12223
12224 * src/state.h (reductions_t): Rename member `nreds' as num.
12225 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
12226 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
12227
ccaf65bc
AD
122282002-06-30 Akim Demaille <akim@epita.fr>
12229
12230 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
12231 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
12232 (shifts_to): Rename as...
12233 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
12234 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
12235 (TRANSITION_IS_DISABLED, transitions_to): these.
12236
87675353
AD
122372002-06-30 Akim Demaille <akim@epita.fr>
12238
12239 * src/print.c (print_shifts, print_gotos): Merge into...
12240 (print_transitions): this.
12241 (print_transitions, print_errs, print_reductions): Align the
12242 lookaheads columns.
12243 (print_core, print_transitions, print_errs, print_state,
12244 print_grammar): Output empty lines separator before, not after.
12245 (state_default_rule_compute): Rename as...
12246 (state_default_rule): this.
12247 * tests/conflicts.at (Defaulted Conflicted Reduction),
12248 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
12249 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
12250
ce4ccb4b
AD
122512002-06-30 Akim Demaille <akim@epita.fr>
12252
12253 Display items as we display rules.
12254
12255 * src/gram.h, src/gram.c (rule_lhs_print): New.
12256 * src/gram.c (grammar_rules_partial_print): Use it.
12257 * src/print.c (print_core): Likewise.
12258 * tests/conflicts.at (Defaulted Conflicted Reduction),
12259 (Unresolved SR Conflicts): Adjust.
12260 (Unresolved SR Conflicts): Adjust and rename as...
12261 (Resolved SR Conflicts): this, as was meant.
12262 * tests/regression.at (Web2c Report): Adjust.
12263
bc933ef1
AD
122642002-06-30 Akim Demaille <akim@epita.fr>
12265
12266 * src/print.c (state_default_rule_compute): New, extracted from...
12267 (print_reductions): here.
12268 Pessimize, but clarify the code.
12269 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
12270
53d4308d
AD
122712002-06-30 Akim Demaille <akim@epita.fr>
12272
12273 * src/output.c (action_row): Let default_rule be always a rule
12274 number.
12275
574fb2d5
AD
122762002-06-30 Akim Demaille <akim@epita.fr>
12277
12278 * src/closure.c (print_firsts, print_fderives, closure):
12279 Use BITSET_EXECUTE.
12280 * src/lalr.c (lookaheads_print): Likewise.
12281 * src/state.c (state_rule_lookaheads_print): Likewise.
12282 * src/print_graph.c (print_core): Likewise.
12283 * src/print.c (print_reductions): Likewise.
12284 * src/output.c (action_row): Likewise.
12285 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
12286
05811fd7
AD
122872002-06-30 Akim Demaille <akim@epita.fr>
12288
12289 * src/print_graph.c: Use report_flag.
12290
0e4d5753
AD
122912002-06-30 Akim Demaille <akim@epita.fr>
12292
12293 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
12294 to...
12295 * src/relation.h, src/relation.c (traverse, relation_digraph)
12296 (relation_print, relation_transpose): New.
12297
24c7d800
AD
122982002-06-30 Akim Demaille <akim@epita.fr>
12299
12300 * src/state.h, src/state.c (shifts_to): New.
12301 * src/lalr.c (build_relations): Use it.
12302
9222837b
AD
123032002-06-30 Akim Demaille <akim@epita.fr>
12304
12305 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
12306 (item_number_of_rule_number, rule_number_of_item_number): New.
12307 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
12308 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
12309 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
12310 Propagate their use.
12311 Much remains to be done, in particular wrt `shorts' from types.h.
12312
260008e5
AD
123132002-06-30 Akim Demaille <akim@epita.fr>
12314
12315 * src/symtab.c (symbol_new): Initialize the `printer' member.
12316
8a731ca8
AD
123172002-06-30 Akim Demaille <akim@epita.fr>
12318
12319 * src/LR0.c (save_reductions): Remove, replaced by...
12320 * src/state.h, src/state.c (state_reductions_set): New.
12321 (reductions, errs): Rename as...
12322 (reductions_t, errs_t): these.
12323 Adjust all dependencies.
12324
32e1e0a4
AD
123252002-06-30 Akim Demaille <akim@epita.fr>
12326
12327 * src/LR0.c (state_list_t, state_list_append): New.
12328 (first_state, last_state): Now symbol_list_t.
12329 (this_state): Remove.
12330 (new_itemsets, append_states, save_reductions): Take a state_t as
12331 argument.
12332 (set_states, generate_states): Adjust.
12333 (save_shifts): Remove, replaced by...
12334 * src/state.h, src/state.c (state_shifts_set): New.
12335 (shifts): Rename as...
12336 (shifts_t): this.
12337 Adjust all dependencies.
12338 * src/state.h (state_t): Remove the `next' member.
12339
e5fb6710
AD
123402002-06-30 Akim Demaille <akim@epita.fr>
12341
12342 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
12343 escaped in slot 0.
12344
c7ca99d4
AD
123452002-06-30 Akim Demaille <akim@epita.fr>
12346
12347 Use hash.h for the state hash table.
12348
12349 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
12350 (allocate_storage): Use state_hash_new.
12351 (free_storage): Use state_hash_free.
12352 (new_state, get_state): Adjust.
12353 * src/lalr.h, src/lalr.c (states): Move to...
12354 * src/states.h (state_t): Remove the `link' member, no longer
12355 used.
12356 * src/states.h, src/states.c: here.
12357 (state_hash_new, state_hash_free, state_hash_lookup)
12358 (state_hash_insert, states_free): New.
12359 * src/states.c (state_table, state_compare, state_hash): New.
12360 * src/output.c (output_actions): Do not free states now, since we
12361 still need to know the final_state number in `prepare', called
12362 afterwards. Do it...
12363 * src/main.c (main): here: call states_free after `output'.
12364
df0e7316
AD
123652002-06-30 Akim Demaille <akim@epita.fr>
12366
12367 * src/state.h, src/state.c (state_new): New, extracted from...
12368 * src/LR0.c (new_state): here.
12369 * src/state.h (STATE_ALLOC): Move to...
12370 * src/state.c: here.
12371 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
12372 * src/state.h, src/state.c: here.
12373
39f41916
AD
123742002-06-30 Akim Demaille <akim@epita.fr>
12375
12376 * src/reader.c (gensym): Rename as...
12377 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
12378 (getsym): Rename as...
12379 (symbol_get): this.
12380
d57650a5
AD
123812002-06-30 Akim Demaille <akim@epita.fr>
12382
12383 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
12384 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
12385 * src/output.c, src/print.c, src/print_graph.c: Propagate.
12386 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
12387
5a08f1ce
AD
123882002-06-30 Akim Demaille <akim@epita.fr>
12389
12390 Make the test suite pass with warnings checked.
12391
12392 * tests/actions.at (Printers and Destructors): Improve.
12393 Avoid unsigned vs. signed issues.
12394 * tests/calc.at: Don't exercise the scanner here, do it...
12395 * tests/input.at (Torturing the Scanner): here.
12396
720623af
PH
123972002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12398
88e7e941 12399 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
720623af
PH
12400 reorganize first lines parallel to yacc.c.
12401
fb8135fa
AD
124022002-06-28 Akim Demaille <akim@epita.fr>
12403
12404 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
12405 (b4_token_enum, b4_token_defines): New, factored from...
12406 * data/lalr1.cc, data/yacc.c, glr.c: here.
12407
41442480
AD
124082002-06-28 Akim Demaille <akim@epita.fr>
12409
12410 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
12411 unused variables.
12412 * src/output.c (merger_output): static.
12413
e0e5bf84
AD
124142002-06-28 Akim Demaille <akim@epita.fr>
12415
ba0fe3c7 12416 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
e0e5bf84
AD
12417 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
12418 pacify GCC.
12419 * src/output.c (save_row): Initialize all the variables to pacify GCC.
e0e5bf84 12420
676385e2
PH
124212002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12422
12423 Accumulated changelog for new GLR parsing features.
12424
6a254321 12425 * src/conflicts.c (count_total_conflicts): Change name to
676385e2
PH
12426 conflicts_total_count.
12427 * src/conflicts.h: Ditto.
12428 * src/output.c (token_actions): Use the new name.
12429 (output_conflicts): Change conflp => conflict_list_heads, and
12430 confl => conflict_list for better readability.
12431 * data/glr.c: Use the new names.
12432 * NEWS: Add self to GLR announcement.
e0e5bf84 12433
676385e2
PH
12434 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
12435
12436 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
12437 Akim Demaille.
12438
12439 * data/bison.glr: Change name to glr.c
12440 * data/glr.c: Renamed from bison.glr.
12441 * data/Makefile.am: Add glr.c
e0e5bf84
AD
12442
12443 * src/getargs.c:
12444
676385e2 12445 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
ba0fe3c7 12446 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
e0e5bf84 12447
676385e2
PH
12448 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12449
12450 * data/bison.glr: Be sure to restore the
12451 current #line when returning to the skeleton contents after having
12452 exposed the input file's #line.
12453
12454 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12455
12456 * data/bison.glr: Bring up to date with changes to bison.simple.
12457
12458 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12459
12460 * data/bison.glr: Correct definitions that use b4_prefix.
12461 Various reformatting.
12462 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
12463 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
12464 yytokenp argument; now part of stack.
12465 (yychar): Define to behave as documented.
12466 (yyclearin): Ditto.
e0e5bf84 12467
676385e2
PH
12468 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12469
12470 * src/reader.h: Add declaration for free_merger_functions.
12471
12472 * src/reader.c (merge_functions): New variable.
12473 (get_merge_function): New function.
12474 (free_merger_functions): New function.
12475 (readgram): Check for %prec that is not followed by a symbol.
12476 Handle %dprec and %merge declarations.
12477 (packgram): Initialize dprec and merger fields in rules array.
12478
12479 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
12480 conflict_list_cnt, conflict_list_free): New variables.
12481 (table_grow): Also grow conflict_table.
e0e5bf84 12482 (prepare_rules): Output dprec and merger tables.
676385e2 12483 (conflict_row): New function.
e0e5bf84 12484 (action_row): Output conflict lists for GLR parser. Don't use
676385e2
PH
12485 default reduction in conflicted states for GLR parser so that there
12486 are spaces for the conflict lists.
12487 (save_row): Also save conflict information.
12488 (token_actions): Allocate conflict list.
12489 (merger_output): New function.
12490 (pack_vector): Pack conflict table, too.
12491 (output_conflicts): New function to output yyconflp and yyconfl.
12492 (output_check): Allocate conflict_tos.
12493 (output_actions): Output conflict tables, also.
12494 (output_skeleton): Output b4_mergers definition.
12495 (prepare): Output b4_max_rhs_length definition.
12496 Use 'bison.glr' as default skeleton for GLR parsers.
12497
12498 * src/gram.c (glr_parser): New flag.
12499 (grammar_free): Call free_merger_functions.
12500
12501 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
12502 all pairs of conflicting reductions, rather than just all tokens
12503 causing conflicts. Needed to size conflict tables.
e0e5bf84 12504 (conflicts_output): Modify call to count_rr_conflicts for new
676385e2
PH
12505 interface.
12506 (conflicts_print): Ditto.
12507 (count_total_conflicts): New function.
12508
12509 * src/reader.h (merger_list): New type.
12510 (merge_functions): New variable.
12511
12512 * src/lex.h (tok_dprec, tok_merge): New token types.
12513
12514 * src/gram.h (rule_s): Add dprec and merger fields.
12515 (glr_parser): New flag.
12516
12517 * src/conflicts.h (count_total_conflicts): New function.
12518
12519 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
12520
12521 * doc/bison.texinfo (Generalized LR Parsing): New section.
12522 (GLR Parsers): New section.
12523 (Language and Grammar): Mention GLR parsing.
12524 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
12525 Correct typo ("tge" -> "the").
12526
12527 * data/bison.glr: New skeleton for GLR parsing.
12528
12529 * tests/cxx-gram.at: New tests for GLR parsing.
12530
12531 * tests/testsuite.at: Include cxx-gram.at.
12532
12533 * tests/Makefile.am: Add cxx-gram.at.
e0e5bf84 12534
676385e2
PH
12535 * src/parse-gram.y:
12536
12537 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
12538
12539 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
e0e5bf84 12540
b5480d74 125412002-06-27 Akim Demaille <akim@epita.fr>
e2aaf4c4
AD
12542
12543 * src/options.h, src/options.c: Remove.
12544 * src/getargs.c (short_options, long_options): New.
12545
60491a94
AD
125462002-06-27 Akim Demaille <akim@epita.fr>
12547
12548 * data/bison.simple, data/bison.c++: Rename as...
12549 * data/yacc.c, data/lalr1.cc: these.
12550 * doc/bison.texinfo (Environment Variables): Remove.
12551
9be0c25b
AD
125522002-06-25 Raja R Harinath <harinath@cs.umn.edu>
12553
12554 * src/getargs.c (report_argmatch): Initialize strtok().
12555
1ae72863
AD
125562002-06-20 Akim Demaille <akim@epita.fr>
12557
12558 * data/bison.simple (b4_symbol_actions): New, replaces...
12559 (b4_symbol_destructor, b4_symbol_printer): these.
12560 (yysymprint): Be sure to call YYPRINT only for tokens, and using
12561 user token numbers.
12562
87542d29
AD
125632002-06-20 Akim Demaille <akim@epita.fr>
12564
12565 * data/bison.simple (yydestructor): Rename as...
12566 (yydestruct): this.
12567
1a31ed21
AD
125682002-06-20 Akim Demaille <akim@epita.fr>
12569
12570 * src/symtab.h, src/symtab.c (symbol_type_set)
12571 (symbol_destructor_set, symbol_precedence_set): The location is
12572 the last argument.
12573 Adjust all callers.
12574
e776192e
AD
125752002-06-20 Akim Demaille <akim@epita.fr>
12576
12577 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
12578 internals.
12579 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
12580 Takes a location.
12581 * src/symtab.h, src/symtab.c (symbol_class_set)
12582 (symbol_user_token_number_set): Likewise.
12583 Adjust all callers.
12584 Promote complain_at.
12585 * tests/input.at (Type Clashes): Adjust.
12586
5c1180b3
AD
125872002-06-20 Akim Demaille <akim@epita.fr>
12588
12589 * data/bison.simple (YYLEX): Fix the declaration when
12590 %pure-parser.
12591
e3170060
AD
125922002-06-20 Akim Demaille <akim@epita.fr>
12593
12594 * data/bison.simple (yysymprint): Don't print the token number,
12595 just its name.
12596 * tests/actions.at (Destructors): Rename as...
12597 (Printers and Destructors): this.
12598 Also exercise %printer.
12599
253862fd
AD
126002002-06-20 Akim Demaille <akim@epita.fr>
12601
12602 * data/bison.simple (YYDSYMPRINT): New.
12603 Use it to remove many of the #if YYDEBUG/if (yydebug).
12604
366eea36
AD
126052002-06-20 Akim Demaille <akim@epita.fr>
12606
12607 * src/symtab.h, src/symtab.c (symbol_t): printer and
12608 printer_location are new members.
12609 (symbol_printer_set): New.
12610 * src/parse-gram.y (PERCENT_PRINTER): New token.
12611 Handle its associated rule.
12612 * src/scan-gram.l: Adjust.
12613 (handle_destructor_at, handle_destructor_dollar): Rename as...
12614 (handle_symbol_code_at, handle_symbol_code_dollar): these.
12615 * src/output.c (symbol_printers_output): New.
12616 (output_skeleton): Call it.
12617 * data/bison.simple (yysymprint): New. Cannot be named yyprint
12618 since there are already many grammar files with a user `yyprint'.
12619 Replace the calls to YYPRINT to calls to yysymprint.
12620 * tests/calc.at: Adjust.
12621 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
12622 taking advantage of parser very internal details (stack size!).
12623
4f25ebb0
AD
126242002-06-20 Akim Demaille <akim@epita.fr>
12625
12626 * src/scan-gram.l: Complete the scanner with the missing patterns
12627 to pacify Flex.
12628 Use `quote' and `symbol_tag_get' where appropriate.
12629
93b68a0e
AD
126302002-06-19 Akim Demaille <akim@epita.fr>
12631
12632 * tests/actions.at (Destructors): Augment to test locations.
12633 * data/bison.simple (yydestructor): Pass it the current location
12634 if locations are enabled.
12635 Prototype only when __STDC__ or C++.
12636 Change the argument names to move into the yy name space: there is
12637 user code here.
12638
58612f1d
AD
126392002-06-19 Akim Demaille <akim@epita.fr>
12640
74310291
AD
12641 * data/bison.simple (b4_pure_if): New.
12642 Use it instead of #ifdef YYPURE.
12643
126442002-06-19 Akim Demaille <akim@epita.fr>
12645
12646 * data/bison.simple (b4_location_if): New.
58612f1d
AD
12647 Use it instead of #ifdef YYLSP_NEEDED.
12648
f25bfb75
AD
126492002-06-19 Akim Demaille <akim@epita.fr>
12650
12651 Prepare @$ in %destructor, but currently don't bind it in the
12652 skeleton, as %location use is not cleaned up yet.
12653
12654 * src/scan-gram.l (handle_dollar, handle_destructor_at)
12655 (handle_action_at): New.
12656 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
12657 a braced_code_t and a location as additional arguments.
12658 (handle_destructor_dollar): Instead of requiring `b4_eval', just
12659 unquote one when outputting `b4_dollar_dollar'.
12660 Adjust callers.
12661 * data/bison.simple (b4_eval): Remove.
12662 (b4_symbol_destructor): Adjust.
12663 * tests/input.at (Invalid @n): Adjust.
12664
c732d2c6
AD
126652002-06-19 Zack Weinberg <zack@codesourcery.com>
12666
12667 * doc/bison.texinfo: Document ability to have multiple
12668 prologue sections.
12669
8c165d89
AD
126702002-06-18 Akim Demaille <akim@epita.fr>
12671
12672 * src/files.c (compute_base_names): When computing the output file
12673 names from the input file name, strip the directory part.
12674
ca98bf57
AD
126752002-06-18 Akim Demaille <akim@epita.fr>
12676
12677 * data/bison.simple.new: Comment changes.
12678 Reported by Andreas Schwab.
12679
0bfb02ff
AD
126802002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
12681
12682 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
12683 there are no `label `yyoverflowlab' defined but not used' warnings
12684 when yyoverflow is defined.
12685
24c0aad7
AD
126862002-06-18 Akim Demaille <akim@epita.fr>
12687
12688 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
12689 new member.
12690 (symbol_destructor_set): Adjust.
12691 * src/output.c (symbol_destructors_output): Output the destructor
12692 locations.
12693 Output the symbol name.
12694 * data/bison.simple (b4_symbol_destructor): Adjust.
12695
5719c109
AD
126962002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
12697 and Akim Demaille <akim@epita.fr>
12698
12699 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
12700 what's left on the stack when the error recovery hits EOF.
12701 * tests/actions.at (Destructors): Complete to exercise this case.
12702
9280d3ef
AD
127032002-06-17 Akim Demaille <akim@epita.fr>
12704
12705 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
12706 arguments is really empty, not only equal to `[]'.
12707 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
12708 member.
12709 (symbol_destructor_set): New.
12710 * src/output.c (symbol_destructors_output): New.
12711 * src/reader.h (brace_code_t, current_braced_code): New.
12712 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
12713 (handle_dollar): Rename as...
12714 (handle_action_dollar): this.
12715 (handle_destructor_dollar): New.
12716 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
12717 (grammar_declaration): Use it.
12718 * data/bison.simple (yystos): Is always defined.
12719 (yydestructor): New.
12720 * tests/actions.at (Destructors): New.
12721 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
12722
dafdc66f
AD
127232002-06-17 Akim Demaille <akim@epita.fr>
12724
12725 * src/symlist.h, src/symlist.c (symbol_list_length): New.
12726 * src/scan-gram.l (handle_dollar, handle_at): Compute the
12727 rule_length only when needed.
12728 * src/output.c (actions_output, token_definitions_output): Output
12729 the full M4 block.
12730 * src/symtab.c: Don't access directly to the symbol tag, use
12731 symbol_tag_get.
12732 * src/parse-gram.y: Use symbol_list_free.
12733
56c47203
AD
127342002-06-17 Akim Demaille <akim@epita.fr>
12735
12736 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
12737 (symbol_list_prepend, get_type_name): Move to...
12738 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
12739 (symbol_list_prepend, symbol_list_n_type_name_get): here.
12740 Adjust all callers.
12741 (symbol_list_free): New.
12742 * src/scan-gram.l (handle_dollar): Takes a location.
12743 * tests/input.at (Invalid $n): Adjust.
12744
1e0bab92
AD
127452002-06-17 Akim Demaille <akim@epita.fr>
12746
12747 * src/reader.h, src/reader.c (symbol_list_new): Export it.
12748 (symbol_list_prepend): New.
12749 * src/parse-gram.y (%union): `list' is a new member.
12750 (symbols.1): New, replaces...
12751 (terms_to_prec.1, nterms_to_type.1): these.
12752 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
12753 Take a location as additional argument.
12754 Adjust all callers.
12755
04e60654
AD
127562002-06-15 Akim Demaille <akim@epita.fr>
12757
12758 * src/parse-gram.y: Move %token in the declaration section so that
12759 we don't depend upon CVS Bison.
12760
10e5b8bd
AD
127612002-06-15 Akim Demaille <akim@epita.fr>
12762
12763 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
12764 * src/print.c (print_core): Use it.
12765
9801d40c
AD
127662002-06-15 Akim Demaille <akim@epita.fr>
12767
12768 * src/conflicts.c (log_resolution): Accept the rule involved in
12769 the sr conflicts instead of the lookahead number that points to
12770 that rule.
12771 (flush_reduce): Accept the current lookahead vector as argument,
12772 instead of the index in LA.
12773 (resolve_sr_conflict): Accept the current number of lookahead
12774 bitset to consider for the STATE, instead of the index in LA.
12775 (set_conflicts): Adjust.
12776 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
12777
c0263492
AD
127782002-06-15 Akim Demaille <akim@epita.fr>
12779
12780 * src/state.h (state_t): Replace the `lookaheadsp' member, a
12781 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
12782 Adjust all dependencies.
12783 * src/lalr.c (initialize_lookaheads): Split into...
12784 (states_lookaheads_count, states_lookaheads_initialize): these.
12785 (lalr): Adjust.
12786
9757c359
AD
127872002-06-15 Akim Demaille <akim@epita.fr>
12788
12789 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
12790 out of...
12791 (grammar_rules_print): here.
12792 * src/reduce.c (reduce_output): Use it.
12793 * tests/reduce.at (Useless Rules, Reduced Automaton)
12794 (Underivable Rules): Adjust.
12795
6b98e4b5
AD
127962002-06-15 Akim Demaille <akim@epita.fr>
12797
12798 Copy BYacc's nice way to report the grammar.
12799
12800 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
12801 New.
12802 Don't print the rules' location, it is confusing and useless.
12803 (rule_print): Use grammar_rhs_print.
12804 * src/print.c (print_grammar): Use grammar_rules_print.
12805
6b98e4b5
AD
128062002-06-15 Akim Demaille <akim@epita.fr>
12807
12808 Complete and rationalize `useless thing' warnings.
12809
12810 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
12811 (symbol_tag_print): New.
12812 Use them everywhere in place of accessing directly the tag member.
12813 * src/gram.h, src/gram.c (rule_print): New.
12814 Use it where a rule used to be printed `by hand'.
12815 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
12816 (reduce_grammar_tables): Report the useless rules.
12817 (reduce_print): Useless things are a warning, not an error.
12818 Report it as such.
12819 * tests/reduce.at (Useless Nonterminals, Useless Rules):
12820 (Reduced Automaton, Underivable Rules): Adjust.
12821 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
12822 * tests/conflicts.at (Unresolved SR Conflicts)
12823 (Solved SR Conflicts): Adjust.
12824
ee000ba4
AD
128252002-06-15 Akim Demaille <akim@epita.fr>
12826
12827 Let symbols have a location.
12828
12829 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
12830 (getsym): Adjust.
12831 Adjust all callers.
12832 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
12833 Use location_t, not int.
12834 * src/symtab.c (symbol_check_defined): Take advantage of the
12835 location.
12836 * tests/regression.at (Invalid inputs): Adjust.
12837
8efe435c
AD
128382002-06-15 Akim Demaille <akim@epita.fr>
12839
12840 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
12841 (input): Don't try to initialize yylloc here, do it in the
12842 scanner.
12843 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
12844 * src/gram.h (rule_t): Change line and action_line into location
12845 and action_location, of location_t type.
12846 Adjust all dependencies.
12847 * src/location.h, src/location.c (empty_location): New.
12848 * src/reader.h, src/reader.c (grammar_start_symbol_set)
12849 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
12850 (grammar_current_rule_symbol_append)
12851 (grammar_current_rule_action_append): Expect a location as argument.
12852 * src/reader.c (grammar_midrule_action): Adjust to attach an
12853 action's location as dummy symbol location.
12854 * src/symtab.h, src/symtab.c (startsymbol_location): New.
12855 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
12856 the line numbers.
12857
1921f1d7
AD
128582002-06-14 Akim Demaille <akim@epita.fr>
12859
12860 Grammar declarations may be found in the grammar section.
12861
12862 * src/parse-gram.y (rules_or_grammar_declaration): New.
12863 (declarations): Each declaration may end with a semicolon, not
12864 just...
12865 (grammar_declaration): `"%union"'.
12866 (grammar): Branch to rules_or_grammar_declaration.
12867
4515534c
AD
128682002-06-14 Akim Demaille <akim@epita.fr>
12869
12870 * src/main.c (main): Invoke scanner_free.
12871
f958596b
AD
128722002-06-14 Akim Demaille <akim@epita.fr>
12873
12874 * src/output.c (m4_invoke): Extracted from...
12875 (output_skeleton): here.
12876 Free tempfile.
12877
2c569025
AD
128782002-06-14 Akim Demaille <akim@epita.fr>
12879
12880 * src/parse-gram.y (directives, directive, gram)
12881 (grammar_directives, precedence_directives, precedence_directive):
12882 Rename as...
12883 (declarations, declaration, grammar, grammar_declaration)
12884 (precedence_declaration, precedence_declarator): these.
12885 (symbol_declaration): New.
12886
592e8d4d
AD
128872002-06-14 Akim Demaille <akim@epita.fr>
12888
12889 * src/files.c (action_obstack): Remove, unused.
12890 (output_obstack): Remove it, and all its dependencies, as it is no
12891 longer needed.
12892 * src/reader.c (epilogue_set): Build the epilogue in the
12893 muscle_obstack.
12894 * src/output.h, src/output.c (muscle_obstack): Move to...
12895 * src/muscle_tab.h, src/muscle_tab.h: here.
12896 (muscle_init): Initialize muscle_obstack.
12897 (muscle_free): New.
12898 * src/main.c (main): Call it.
12899
0c15323d
AD
129002002-06-14 Akim Demaille <akim@epita.fr>
12901
12902 * src/location.h: New, extracted from...
12903 * src/reader.h: here.
12904 * src/Makefile.am (noinst_HEADERS): Merge into
12905 (bison_SOURCES): this.
12906 Add location.h.
12907 * src/parse-gram.y: Use location_t instead of Bison's.
12908 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
12909 Use location_t instead of ints.
12910
e96c9728
AD
129112002-06-14 Akim Demaille <akim@epita.fr>
12912
12913 * data/bison.simple, data/bison.c++: Be sure to restore the
12914 current #line when returning to the skeleton contents after having
12915 exposed the input file's #line.
12916
75d1fe16
AD
129172002-06-12 Akim Demaille <akim@epita.fr>
12918
12919 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
12920 eager.
12921 * tests/actions.at (Exotic Dollars): New.
12922
6c35d22c
AD
129232002-06-12 Akim Demaille <akim@epita.fr>
12924
12925 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
12926 ['"/] too eagerly.
12927 * tests/input.at (Torturing the Scanner): New.
12928
1d6412ad
AD
129292002-06-11 Akim Demaille <akim@epita.fr>
12930
12931 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
12932 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
12933 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
12934 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
12935 * src/reader.c (reader): Use it.
12936
4cdb01db
AD
129372002-06-11 Akim Demaille <akim@epita.fr>
12938
12939 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
12940 Adjust all callers.
12941 (scanner_last_string_free): New.
12942
44995b2e
AD
129432002-06-11 Akim Demaille <akim@epita.fr>
12944
12945 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
12946 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
12947 (last_string, YY_OBS_FREE): New.
12948 Use them when returning an ID.
12949
e9955c83
AD
129502002-06-11 Akim Demaille <akim@epita.fr>
12951
12952 Have Bison grammars parsed by a Bison grammar.
12953
12954 * src/reader.c, src/reader.h (prologue_augment): New.
12955 * src/reader.c (copy_definition): Remove.
12956
12957 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
12958 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
12959 (grammar_current_rule_prec_set, grammar_current_rule_check)
12960 (grammar_current_rule_symbol_append)
12961 (grammar_current_rule_action_append): Export.
12962 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
12963 (symbol_list_action_append): Remove.
12964 Hook the routines from reader.
12965 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
12966 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
12967
12968 * src/reader.c (read_declarations): Remove, unused.
12969
12970 * src/parse-gram.y: Handle the epilogue.
12971 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
12972 (grammar_start_symbol_set): this.
12973 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
12974 * src/reader.c (readgram): Remove, unused.
12975 (reader): Adjust to insert eoftoken and axiom where appropriate.
12976
12977 * src/reader.c (copy_dollar): Replace with...
12978 * src/scan-gram.h (handle_dollar): this.
12979 * src/parse-gram.y: Remove `%thong'.
12980
12981 * src/reader.c (copy_at): Replace with...
12982 * src/scan-gram.h (handle_at): this.
12983
12984 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
12985 New.
12986
12987 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
12988 time being.
12989
12990 * src/reader.h, src/reader.c (grammar_rule_end): New.
12991
12992 * src/parse.y (current_type, current_class): New.
12993 Implement `%nterm', `%token' support.
12994 Merge `%term' into `%token'.
12995 (string_as_id): New.
12996 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
12997 type name.
12998
12999 * src/parse-gram.y: Be sure to handle properly the beginning of
13000 rules.
13001
13002 * src/parse-gram.y: Handle %type.
13003 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
13004
13005 * src/parse-gram.y: More directives support.
13006 * src/options.c: No longer handle source directives.
13007
13008 * src/parse-gram.y: Fix %output.
13009
13010 * src/parse-gram.y: Handle %union.
13011 Use the prologue locations.
13012 * src/reader.c (parse_union_decl): Remove.
13013
13014 * src/reader.h, src/reader.c (epilogue_set): New.
13015 * src/parse-gram.y: Use it.
13016
13017 * data/bison.simple, data/bison.c++: b4_stype is now either not
13018 defined, then default to int, or to the contents of %union,
13019 without `union' itself.
13020 Adjust.
13021 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
13022
13023 * src/output.c (actions_output): Don't output braces, as they are
13024 already handled by the scanner.
13025
13026 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
13027 characters to themselves.
13028
13029 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
13030 that the epilogue has a proper #line.
13031
13032 * src/parse-gram.y: Handle precedence/associativity.
13033
13034 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
13035 a terminal.
13036 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
13037 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
13038 at all to define terminals that cannot be emitted.
13039
13040 * src/scan-gram.l: Escape M4 characters.
13041
13042 * src/scan-gram.l: Working properly with escapes in user
13043 strings/characters.
13044
13045 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
13046 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
13047 grammar.
13048 Use more modest sizes, as for the time being the parser does not
13049 release memory, and therefore the process swallows a huge amount
13050 of memory.
13051
13052 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
13053 stricter %token grammar.
13054
13055 * src/symtab.h (associativity): Add `undef_assoc'.
13056 (symbol_precedence_set): Do nothing when passed an undef_assoc.
13057 * src/symtab.c (symbol_check_alias_consistence): Adjust.
13058
13059 * tests/regression.at (Invalid %directive): Remove, as it is now
13060 meaningless.
13061 (Invalid inputs): Adjust to the new error messages.
13062 (Token definitions): The new grammar doesn't allow too many
13063 eccentricities.
13064
13065 * src/lex.h, src/lex.c: Remove.
13066 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
13067 (copy_character, copy_string2, copy_string, copy_identifier)
13068 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
13069 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
13070 (parse_action): Remove.
13071 * po/POTFILES.in: Adjust.
13072
2e047461
AD
130732002-06-11 Akim Demaille <akim@epita.fr>
13074
cd05d13c 13075 * src/reader.c (parse_action): Don't store directly into the
2e047461
AD
13076 rule's action member: return the action as a string.
13077 Don't require `rule_length' as an argument: compute it.
13078 (grammar_current_rule_symbol_append)
13079 (grammar_current_rule_action_append): New, eved out from
13080 (readgram): here.
13081 Remove `action_flag', `rulelength', unused now.
13082
9af3fbce
AD
130832002-06-11 Akim Demaille <akim@epita.fr>
13084
13085 * src/reader.c (grammar_current_rule_prec_set).
13086 (grammar_current_rule_check): New, eved out from...
13087 (readgram): here.
13088 Remove `xaction', `first_rhs': useless.
13089 * tests/input.at (Type clashes): New.
13090 * tests/existing.at (GNU Cim Grammar): Adjust.
13091
1485e106
AD
130922002-06-11 Akim Demaille <akim@epita.fr>
13093
13094 * src/reader.c (grammar_midrule_action): New, Eved out from
13095 (readgram): here.
13096
da4160c3
AD
130972002-06-11 Akim Demaille <akim@epita.fr>
13098
13099 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
13100 New.
13101 (readgram): Use them as replacement of inlined code, crule and
13102 crule1.
13103
f6d0f937
AD
131042002-06-11 Akim Demaille <akim@epita.fr>
13105
13106 * src/reader.c (grammar_end, grammar_symbol_append): New.
13107 (readgram): Use them.
13108 Make the use of `p' as local as possible.
13109
69078d4b
AD
131102002-06-10 Akim Demaille <akim@epita.fr>
13111
13112 GCJ's parser requires the tokens to be defined before the prologue.
13113
13114 * data/bison.simple: Output the token definition before the user's
13115 prologue.
13116 * tests/regression.at (Braces parsing, Duplicate string)
13117 (Mixing %token styles): Check the output from bison.
13118 (Early token definitions): New.
13119
5e424082
AD
131202002-06-10 Akim Demaille <akim@epita.fr>
13121
13122 * src/symtab.c (symbol_user_token_number_set): Don't complain when
13123 assigning twice the same user number to a token, so that we can
13124 use it in...
13125 * src/lex.c (lex): here.
13126 Also use `symbol_class_set' instead of hand written code.
13127 * src/reader.c (parse_assoc_decl): Likewise.
13128
44536b35
AD
131292002-06-10 Akim Demaille <akim@epita.fr>
13130
13131 * src/symtab.c, src/symtab.c (symbol_class_set)
13132 (symbol_user_token_number_set): New.
13133 * src/reader.c (parse_token_decl): Use them.
13134 Use a switch instead of ifs.
13135 Use a single argument.
13136
8b9f2372
AD
131372002-06-10 Akim Demaille <akim@epita.fr>
13138
13139 Remove `%thong' support as it is undocumented, unused, duplicates
13140 `%token's job, and creates useless e-mail traffic with people who
13141 want to know what it is, why it is undocumented, unused, and
13142 duplicates `%token's job.
13143
13144 * src/reader.c (parse_thong_decl): Remove.
13145 * src/options.c (option_table): Remove "thong".
13146 * src/lex.h (tok_thong): Remove.
13147
3ae2b51f
AD
131482002-06-10 Akim Demaille <akim@epita.fr>
13149
13150 * src/symtab.c, src/symtab.c (symbol_type_set)
13151 (symbol_precedence_set): New.
13152 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
13153 (value_components_used): Remove, unused.
13154
2f1afb73
AD
131552002-06-09 Akim Demaille <akim@epita.fr>
13156
13157 Move symbols handling code out of the reader.
13158
13159 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
13160 (axiom): Move to...
13161 * src/symtab.h, src/symtab.c: here.
13162
13163 * src/gram.c (start_symbol): Remove: use startsymbol->number.
13164 * src/reader.c (startval): Rename as...
13165 * src/symtab.h, src/symtab.c (startsymbol): this.
13166 * src/reader.c: Adjust.
13167
13168 * src/reader.c (symbol_check_defined, symbol_make_alias)
13169 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
13170 (token_translations_init)
13171 Move to...
13172 * src/symtab.c: here.
13173 * src/reader.c (packsymbols): Move to...
13174 * src/symtab.h, src/symtab.c (symbols_pack): here.
13175 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
13176 argument.
13177
e9bca3ad
AD
131782002-06-03 Akim Demaille <akim@epita.fr>
13179
13180 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
13181 then statements.
13182
86eff183
AD
131832002-06-03 Akim Demaille <akim@epita.fr>
13184
13185 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
13186 structs with non literals.
13187 * src/scan-skel.l: never-interactive.
13188 * src/conflicts.c (enum conflict_resolution_e): No trailing
13189 comma.
13190 * src/getargs.c (usage): Split long literal strings.
13191 Reported by Hans Aberg.
13192
717be197
AD
131932002-05-28 Akim Demaille <akim@epita.fr>
13194
13195 * data/bison.c++: Use C++ ostreams.
13196 (cdebug_): New member.
13197
670ddffd
AD
131982002-05-28 Akim Demaille <akim@epita.fr>
13199
13200 * src/output.c (output_skeleton): Be sure to allocate enough room
13201 for `/' _and_ for `\0' in full_skeleton.
13202
769b430f
AD
132032002-05-28 Akim Demaille <akim@epita.fr>
13204
13205 * data/bison.c++: Catch up with bison.simple:
13206 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13207 and Paul Eggert <eggert@twinsun.com>: `error' handing.
13208 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
13209 and popping traces.
13210
7067cb36
PH
132112002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13212
13213 * src/output.c (output_skeleton): Put an explicit path in front of
13214 the skeleton file name, rather than relying on the -I directory,
13215 to partially alleviate effects of having a skeleton file lying around
13216 in the current directory.
769b430f 13217
4a713ec2
PH
132182002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13219
769b430f 13220 * src/conflicts.c (log_resolution): Correct typo:
4a713ec2
PH
13221 obstack_printf should be obstack_fgrow1.
13222
b408954b
AD
132232002-05-26 Akim Demaille <akim@epita.fr>
13224
13225 * src/state.h (state_t): `solved_conflicts' is a new member.
13226 * src/LR0.c (new_state): Set it to 0.
13227 * src/conflicts.h, src/conflicts.c (print_conflicts)
13228 (free_conflicts, solve_conflicts): Rename as...
13229 (conflicts_print, conflicts_free, conflicts_solve): these.
13230 Adjust callers.
13231 * src/conflicts.c (enum conflict_resolution_e)
13232 (solved_conflicts_obstack): New, used by...
13233 (log_resolution): this.
13234 Adjust to attach the conflict resolution to each state.
13235 Complete the description with the precedence/associativity
13236 information.
13237 (resolve_sr_conflict): Adjust.
13238 * src/print.c (print_state): Output its solved_conflicts.
13239 * tests/conflicts.at (Unresolved SR Conflicts)
13240 (Solved SR Conflicts): Exercise --report=all.
13241
a49aecd5
AD
132422002-05-26 Akim Demaille <akim@epita.fr>
13243
13244 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
13245 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
13246 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
13247 (token_number_t, item_number_as_token_number)
13248 (token_number_as_item_number, muscle_insert_token_number_table):
13249 Rename as...
13250 (symbol_number_t, item_number_as_symbol_number)
13251 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
13252 these, since it is more appropriate.
13253
5504898e
AD
132542002-05-26 Akim Demaille <akim@epita.fr>
13255
13256 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
13257 `Error:' lines.
13258 * data/bison.simple (yystos) [YYDEBUG]: New.
13259 (yyparse) [YYDEBUG]: Display the symbols which are popped during
13260 error recovery.
13261 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
13262
ec3bc396
AD
132632002-05-25 Akim Demaille <akim@epita.fr>
13264
13265 * doc/bison.texinfo (Debugging): Split into...
13266 (Tracing): this new section, its former contents, and...
13267 (Understanding): this new section.
13268 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
13269 by...
13270 (report_flag): this.
13271 Adjust all dependencies.
13272 (report_args, report_types, report_argmatch): New.
13273 (usage, getargs): Report/support -r, --report.
13274 * src/options.h
13275 (struct option_table_struct): Rename as..,
13276 (struct option_table_s): this.
13277 Rename the `set_flag' member to `flag' to match with getopt_long's
13278 struct.
13279 * src/options.c (option_table): Split verbose into an entry for
13280 %verbose, and another for --verbose.
13281 Support --report/-r, so remove -r from the obsolete --raw.
13282 * src/print.c: Attach full item sets and lookaheads reports to
13283 report_flag instead of trace_flag.
13284 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
13285
78df8250
PE
132862002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13287 and Paul Eggert <eggert@twinsun.com>
769b430f 13288
78df8250
PE
13289 * data/bison.simple (yyparse): Correct error handling to conform to
13290 POSIX and yacc. Specifically, after syntax error is discovered,
13291 do not reduce further before shifting the error token.
13292 Clean up the code a bit by removing the labels yyerrdefault,
13293 yyerrhandle, yyerrpop.
13294 * NEWS: Document the above.
13295
c0c9ea05
PH
132962002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13297
13298 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
13299 type; it isn't always big enough, since it doesn't necessarily
13300 include non-terminals.
769b430f 13301 (yytranslate): Expand definition of yy_token_number_type, so that
c0c9ea05
PH
13302 the latter can be removed.
13303 (yy_token_number_type): Remove, only one use.
13304 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
13305 don't use TokenNumberType as element type.
769b430f 13306
c0c9ea05
PH
13307 * tests/regression.at: Modify expected output to agree with change
13308 to yyr1 and yytranslate.
769b430f 13309
6390a83f
FK
133102002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
13311
13312 * src/reader.c (parse_action): Use copy_character instead of
13313 obstack_1grow.
13314
db7c8e9a
AD
133152002-05-13 Akim Demaille <akim@epita.fr>
13316
13317 * tests/regression.at (Token definitions): Prototype yylex and
13318 yyerror.
13319
fcc61800
PH
133202002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13321
158c687b 13322 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
fcc61800
PH
13323 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
13324 32-bit arithmetic.
13325 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
13326
5683e9b2
AD
133272002-05-07 Akim Demaille <akim@epita.fr>
13328
13329 * tests/synclines.at: Be sure to prototype yylex and yyerror to
13330 avoid GCC warnings.
13331
0c2d3f4c
AD
133322002-05-07 Akim Demaille <akim@epita.fr>
13333
13334 Kill GCC warnings.
13335
13336 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
13337 over the RHS of each rule.
13338 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
13339 * src/state.h (state_t): Member `nitems' is unsigned short.
13340 * src/LR0.c (get_state): Adjust.
13341 * src/reader.c (packgram): Likewise.
13342 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
13343 `Type'.
13344 (muscle_insert_int_table): Remove, unused.
13345 (prepare_rules): Remove `max'.
13346
1565b720
AD
133472002-05-06 Akim Demaille <akim@epita.fr>
13348
13349 * src/closure.c (print_firsts): Display of the symbol tags.
13350 (bitmatrix_print): Move to...
13351 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
13352 here.
13353 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
13354
cfaee611
AD
133552002-05-06 Akim Demaille <akim@epita.fr>
13356
13357 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
13358 hash_do_for_each.
13359
458be8e0
AD
133602002-05-06 Akim Demaille <akim@epita.fr>
13361
13362 * src/LR0.c (new_state, get_state): Instead of using the global
13363 `kernel_size' and `kernel_base', have two new arguments:
13364 `core_size' and `core'.
13365 Adjust callers.
13366
a900a624
AD
133672002-05-06 Akim Demaille <akim@epita.fr>
13368
13369 * src/reader.c (packgram): No longer end `ritem' with a 0
13370 sentinel: it is not used.
13371
d4e7d3a1
AD
133722002-05-05 Akim Demaille <akim@epita.fr>
13373
13374 New experimental feature: display the lookaheads in the report and
13375 graph.
13376
13377 * src/print (print_core): When --trace-flag, display the rules
13378 lookaheads.
13379 * src/print_graph.c (print_core): Likewise.
13380 Swap the arguments.
13381 Adjust caller.
13382
39ceb25b
AD
133832002-05-05 Akim Demaille <akim@epita.fr>
13384
13385 * tests/torture.at (Many lookaheads): New test.
13386
5372019f
AD
133872002-05-05 Akim Demaille <akim@epita.fr>
13388
13389 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
13390 (GENERATE_MUSCLE_INSERT_TABLE): this.
13391 (output_int_table, output_unsigned_int_table, output_short_table)
13392 (output_token_number_table, output_item_number_table): Replace with...
13393 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
13394 (muscle_insert_short_table, muscle_insert_token_number_table)
13395 (muscle_insert_item_number_table): these.
13396 Adjust all callers.
13397 (prepare_tokens): Don't free `translations', since...
13398 * src/reader.h, src/reader.c (grammar_free): do it.
13399 Move to...
13400 * src/gram.h, src/gram.c (grammar_free): here.
13401 * data/bison.simple, data/bison.c++: b4_token_number_max is now
13402 b4_translate_max.
13403
5df5f6d5
AD
134042002-05-05 Akim Demaille <akim@epita.fr>
13405
13406 * src/output.c (output_unsigned_int_table): New.
13407 (prepare_rules): `i' is unsigned.
13408 `prhs', `rline', `r2' are unsigned int.
13409 Rename muscle `rhs_number_max' as `rhs_max'.
13410 Output muscles `prhs_max', `rline_max', and `r2_max'.
13411 Free rline and r1.
13412 * data/bison.simple, data/bison.c++: Adjust to use these muscles
13413 to compute types instead of constant types.
13414 * tests/regression.at (Web2c Actions): Adjust.
13415
b87f8b21
AD
134162002-05-04 Akim Demaille <akim@epita.fr>
13417
13418 * src/symtab.h (SALIAS, SUNDEF): Rename as...
13419 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
13420 Adjust dependencies.
13421 * src/output.c (token_definitions_output): Be sure not to output a
13422 `#define 'a'' when fed with `%token 'a' "a"'.
13423 * tests/regression.at (Token definitions): New.
13424
8bb936e4
PE
134252002-05-03 Paul Eggert <eggert@twinsun.com>
13426
13427 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
13428 for K&R C.
13429
134302002-05-03 gettextize <bug-gnu-gettext@gnu.org>
13431
13432 * Makefile.am (SUBDIRS): Remove intl.
13433 (EXTRA_DIST): Add config/config.rpath.
13434
53c71a12
AD
134352002-05-03 Akim Demaille <akim@epita.fr>
13436
13437 * data/bison.simple (m4_if): Don't output empty enums.
13438 And actually, output valid enum definitions :(.
13439
289dd0cf
AD
134402002-05-03 Akim Demaille <akim@epita.fr>
13441
13442 * configure.bat: Remove, completely obsolete.
13443 * Makefile.am (EXTRA_DIST): Adjust.
13444 Don't distribute config.rpath...
13445 * config/Makefile.am (EXTRA_DIST): Do it.
13446
db85e524
AD
134472002-05-03 Akim Demaille <akim@epita.fr>
13448
13449 * configure.in (GETTEXT_VERSION): New.
13450 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
13451
83ccf991
AD
134522002-05-03 Akim Demaille <akim@epita.fr>
13453
13454 * data/bison.simple (b4_token_enum): New.
13455 (b4_token_defines): Use it to output tokens both as #define and
13456 enums.
13457 Suggested by Paul Eggert.
13458 * src/output.c (token_definitions_output): Don't output spurious
13459 white spaces.
13460
1f418995
AD
134612002-05-03 Akim Demaille <akim@epita.fr>
13462
13463 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
13464
45119f04
RA
134652002-05-02 Robert Anisko <robert@lrde.epita.fr>
13466
13467 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
13468 Update the stack class, give a try to deque as the default container.
13469
b2d52318
AD
134702002-05-02 Akim Demaille <akim@epita.fr>
13471
13472 * data/bison.simple (yyparse): Do not implement @$ = @1.
13473 (YYLLOC_DEFAULT): Adjust to do it.
13474 * doc/bison.texinfo (Location Default Action): Fix.
13475
3a8b4109
AD
134762002-05-02 Akim Demaille <akim@epita.fr>
13477
13478 * src/reader.c (parse_braces): Merge into...
13479 (parse_action): this.
13480
84614e13
AD
134812002-05-02 Akim Demaille <akim@epita.fr>
13482
13483 * configure.in (ALL_LINGUAS): Remove.
13484 * po/LINGUAS, hr.po: New.
13485
fdbcd8e2
AD
134862002-05-02 Akim Demaille <akim@epita.fr>
13487
13488 Remove the so called hairy (semantic) parsers.
13489
13490 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
13491 * src/gram.h, src/gram.c (semantic_parser): Remove.
13492 (rule_t): Remove the guard and guard_line members.
13493 * src/lex.h (token_t): remove tok_guard.
13494 * src/options.c (option_table): Remove %guard and %semantic_parser
13495 support.
13496 * src/output.c, src/output.h (guards_output): Remove.
13497 (prepare): Adjust.
13498 (token_definitions_output): Don't output the `T'
13499 tokens (???).
13500 (output_skeleton): Don't output the guards.
13501 * src/files.c, src/files.c (attrsfile): Remove.
13502 * src/reader.c (symbol_list): Remove the guard and guard_line
13503 members.
13504 Adjust dependencies.
13505 (parse_guard): Remove.
13506 * data/bison.hairy: Remove.
13507 * doc/bison.texinfo (Environment Variables): Remove occurrences of
13508 BISON_HAIRY.
13509
82b6cb3f
AD
135102002-05-02 Akim Demaille <akim@epita.fr>
13511
13512 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
13513 (parse_guard): Rename the formal argument `stack_offset' as
13514 `rule_length', which is more readable.
13515 Adjust callers.
13516 (copy_at, copy_dollar): Instead of outputting the hard coded
13517 values of $$, $n and so forth, output invocation to b4_lhs_value,
13518 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
900c877b
AD
13519 Note: this patch partially drops `semantic-parser' support: it
13520 always does `rule_length - n', where semantic parsers ought to
13521 always use `-n'.
82b6cb3f
AD
13522 * data/bison.simple, data/bison.c++ (b4_lhs_value)
13523 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
13524
6cbfbcc5
AD
135252002-05-02 Akim Demaille <akim@epita.fr>
13526
13527 * configure.in (AC_INIT): Bump to 1.49b.
13528 (AM_INIT_AUTOMAKE): Short invocation.
13529
b8548114
AD
135302002-05-02 Akim Demaille <akim@epita.fr>
13531
13532 Version 1.49a.
13533
c20cd1fa
AD
135342002-05-01 Akim Demaille <akim@epita.fr>
13535
13536 * src/skeleton.h: Remove.
13537
8a9566d4
AD
135382002-05-01 Akim Demaille <akim@epita.fr>
13539
13540 * src/skeleton.h: Fix the #endif.
13541 Reported by Magnus Fromreide.
13542
8c6d399a
PE
135432002-04-26 Paul Eggert <eggert@twinsun.com>
13544
13545 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
13546 Define if we define YYSTYPE and YYLTYPE, respectively.
b756bb75 13547 (YYCOPY): Fix [] quoting problem in the non-GCC case.
8a9566d4 13548
2b7ed18a
RA
135492002-04-25 Robert Anisko <robert@lrde.epita.fr>
13550
13551 * src/scan-skel.l: Postprocess quadrigraphs.
13552
13553 * src/reader.c (copy_character): New function, used to output
13554 single characters while replacing `[' and `]' with quadrigraphs, to
13555 avoid troubles with M4 quotes.
13556 (copy_comment): Output characters with copy_character.
13557 (read_additionnal_code): Likewise.
13558 (copy_string2): Likewise.
13559 (copy_definition): Likewise.
13560
13561 * tests/calc.at: Exercise M4 quoting.
13562
34a89c50
AD
135632002-04-25 Akim Demaille <akim@epita.fr>
13564
13565 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
13566 between `!' and the command.
13567 Reported by Paul Eggert.
13568
0dd1580a
RA
135692002-04-24 Robert Anisko <robert@lrde.epita.fr>
13570
13571 * tests/calc.at: Exercise prologue splitting.
13572
13573 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
13574 `b4_post_prologue' instead of `b4_prologue'.
13575
13576 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
13577 muscles.
13578 (output): Free pre_prologue_obstack and post_prologue_obstack.
13579 * src/files.h, src/files.c (attrs_obstack): Remove.
13580 (pre_prologue_obstack, post_prologue_obstack): New.
13581 * src/reader.c (copy_definition): Add a parameter to specify the
13582 obstack to fill, instead of using attrs_obstack unconditionally.
13583 (read_declarations): Pass pre_prologue_obstack to copy_definition if
13584 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
13585
83c1796f
PE
135862002-04-23 Paul Eggert <eggert@twinsun.com>
13587
13588 * data/bison.simple: Remove unnecessary commentary and white
13589 space differences from 1_29-branch.
13590 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
13591
13592 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
13593 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
13594 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
13595 constructors or destructors.
13596
13597 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
13598
1207eeac
AD
135992002-04-23 Akim Demaille <akim@epita.fr>
13600
13601 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
13602 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
13603 location with columns.
13604 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
13605 All reported by Paul Eggert.
13606
78ab8f67
AD
136072002-04-22 Akim Demaille <akim@epita.fr>
13608
13609 * src/reduce.c (dump_grammar): Move to...
13610 * src/gram.h, src/gram.c (grammar_dump): here.
13611 Be sure to separate long item numbers.
13612 Don't read the members of a rule's prec if its nil.
13613
133c20e2
AD
136142002-04-22 Akim Demaille <akim@epita.fr>
13615
13616 * src/output.c (table_size, table_grow): New.
13617 (MAXTABLE): Remove, replace uses with table_size.
13618 (pack_vector): Instead of dying when the table is too big, grow it.
13619
9515e8a7
AD
136202002-04-22 Akim Demaille <akim@epita.fr>
13621
13622 * data/bison.simple (yyr1): Its type is that of a token number.
13623 * data/bison.c++ (r1_): Likewise.
13624 * tests/regression.at (Web2c Actions): Adjust.
13625
23c5a174
AD
136262002-04-22 Akim Demaille <akim@epita.fr>
13627
13628 * src/reader.c (token_translations_init): 256 is now the default
13629 value for the error token, i.e., it will be assigned another
13630 number if the user assigned 256 to one of her tokens.
13631 (reader): Don't force 256 to error.
13632 * doc/bison.texinfo (Symbols): Adjust.
13633 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
13634 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
13635 etc. instead of 10, 20, 30 (which was used to `jump' over error
13636 (256) and undefined (2)).
13637
5fbb0954
AD
136382002-04-22 Akim Demaille <akim@epita.fr>
13639
13640 Propagate more token_number_t.
13641
13642 * src/gram.h (token_number_as_item_number)
13643 (item_number_as_token_number): New.
13644 * src/output.c (GENERATE_OUTPUT_TABLE): New.
13645 Use it to create output_item_number_table and
13646 output_token_number_table.
13647 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
13648 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
13649 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
13650 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
13651
4f940944
AD
136522002-04-22 Akim Demaille <akim@epita.fr>
13653
13654 * src/output.h, src/output.c (get_lines_number): Remove.
13655
3ded9a63
AD
136562002-04-19 Akim Demaille <akim@epita.fr>
13657
13658 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
13659 as Lex/Flex'.
13660 (Debugging): More details about enabling the debugging features.
13661 (Table of Symbols): Describe $$, $n, @$, and @n.
13662 Suggested by Tim Josling.
13663
e0c471a9
AD
136642002-04-19 Akim Demaille <akim@epita.fr>
13665
13666 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
13667
fecc10cd
AD
136682002-04-10 Akim Demaille <akim@epita.fr>
13669
13670 * src/system.h: Rely on HAVE_LIMITS_H.
13671 Suggested by Paul Eggert.
13672
51dec47b
AD
136732002-04-09 Akim Demaille <akim@epita.fr>
13674
13675 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
13676 full stderr, and strip it according to the bison options, instead
13677 of composing the error message from different bits.
13678 This makes it easier to check for several error messages.
13679 Adjust all the invocations.
13680 Add an invocation exercising the error token.
13681 Add an invocation demonstrating a stupid error message.
13682 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
13683 Adjust the tests.
13684 Error message are for stderr, not stdout.
13685
007a50a4
AD
136862002-04-09 Akim Demaille <akim@epita.fr>
13687
13688 * src/gram.h, src/gram.c (error_token_number): Remove, use
13689 errtoken->number.
13690 * src/reader.c (reader): Don't specify the user token number (2)
13691 for $undefined, as it uselessly prevents using it.
13692 * src/gram.h (token_number_t): Move to...
13693 * src/symtab.h: here.
13694 (state_t.number): Is a token_number_t.
13695 * src/print.c, src/reader.c: Use undeftoken->number instead of
13696 hard coded 2.
13697 (Even though this 2 is not the same as above: the number of the
13698 undeftoken remains being 2, it is its user token number which
13699 might not be 2).
13700 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
13701 `user_token_number_max'.
13702 Output `undef_token_number'.
13703 * data/bison.simple, data/bison.c++: Use them.
13704 Be sure to map invalid yylex return values to
13705 `undef_token_number'. This saves us from gratuitous SEGV.
13706
13707 * tests/conflicts.at (Solved SR Conflicts)
13708 (Unresolved SR Conflicts): Adjust.
13709 * tests/regression.at (Web2c Actions): Adjust.
13710
06446ccf
AD
137112002-04-08 Akim Demaille <akim@epita.fr>
13712
13713 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
13714 Adding #line.
13715 Remove the duplicate `typedefs'.
13716 (RhsNumberType): Fix the declaration and various other typos.
13717 Use __ofile__.
13718 * data/bison.simple: Use __ofile__.
13719 * src/scan-skel.l: Handle __ofile__.
13720
62a3e4f0
AD
137212002-04-08 Akim Demaille <akim@epita.fr>
13722
13723 * src/gram.h (item_number_t): New, the type of item numbers in
13724 RITEM. Note that it must be able to code symbol numbers as
13725 positive number, and the negation of rule numbers as negative
13726 numbers.
13727 Adjust all dependencies (pretty many).
13728 * src/reduce.c (rule): Remove this `short *' pointer: use
13729 item_number_t.
13730 * src/system.h (MINSHORT, MAXSHORT): Remove.
13731 Include `limits.h'.
13732 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
13733 (shortcpy): Remove.
13734 (MAXTABLE): Move to...
13735 * src/output.c (MAXTABLE): here.
13736 (prepare_rules): Use output_int_table to output rhs.
13737 * data/bison.simple, data/bison.c++: Adjust.
13738 * tests/torture.at (Big triangle): Move the limit from 254 to
13739 500.
13740 * tests/regression.at (Web2c Actions): Ajust.
13741
13742 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
13743 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
13744 passes, but produces negative #line number, once fixed, GCC is
13745 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
13746 C), it passes.
13747 * src/state.h (state_h): Code input lines on ints, not shorts.
13748
bb88b0fc
AD
137492002-04-08 Akim Demaille <akim@epita.fr>
13750
13751 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
13752 and then the grammar.
13753
9a636f47
AD
137542002-04-08 Akim Demaille <akim@epita.fr>
13755
13756 * src/system.h: No longer using strndup.
13757
680e8701
AD
137582002-04-07 Akim Demaille <akim@epita.fr>
13759
13760 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
13761 * src/output.c (output_table_data): Return the longest number.
13762 (prepare_tokens): Output `token_number_max').
13763 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
13764 New.
13765 Use them to define yy_token_number_type/TokenNumberType.
13766 Use this type for yytranslate.
13767 * tests/torture.at (Big triangle): Push the limit from 124 to
13768 253.
13769 * tests/regression.at (Web2c Actions): Adjust.
13770
817e9f41
AD
137712002-04-07 Akim Demaille <akim@epita.fr>
13772
13773 * tests/torture.at (Big triangle): New.
13774 (GNU AWK Grammar, GNU Cim Grammar): Move to...
13775 * tests/existing.at: here.
13776
5123689b
AD
137772002-04-07 Akim Demaille <akim@epita.fr>
13778
13779 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
13780 nritems.
13781 Adjust dependencies.
13782
f3849179
AD
137832002-04-07 Akim Demaille <akim@epita.fr>
13784
13785 * src/reader.c: Normalize increments to prefix form.
13786
bd02036a
AD
137872002-04-07 Akim Demaille <akim@epita.fr>
13788
13789 * src/reader.c, symtab.c: Remove debugging code.
13790
db8837cb
AD
137912002-04-07 Akim Demaille <akim@epita.fr>
13792
13793 Rename all the `bucket's as `symbol_t'.
13794
13795 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
13796 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
13797 * src/symtab.c, src/symtab.h (bucket): Rename as...
13798 (symbol_t): this.
13799 (symbol_list_new, bucket_check_defined, bucket_make_alias)
13800 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
13801 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
13802 (buckets_new, buckets_free, buckets_do): Rename as...
13803 (symbol_list_new, symbol_check_defined, symbol_make_alias)
13804 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
13805 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
13806 (symbols_new, symbols_free, symbols_do): these.
13807
72a23c97
AD
138082002-04-07 Akim Demaille <akim@epita.fr>
13809
13810 Use lib/hash for the symbol table.
13811
13812 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
13813 EOF.
13814 * src/lex.c (lex): Set the `number' member of new terminals.
13815 * src/reader.c (bucket_check_defined, bucket_make_alias)
13816 (bucket_check_alias_consistence, bucket_translation): New.
13817 (reader, grammar_free, readgram, token_translations_init)
13818 (packsymbols): Adjust.
13819 (reader): Number the predefined tokens.
13820 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
13821 for predefined tokens.
13822 * src/symtab.h (bucket): Remove all the hash table related
13823 members.
13824 * src/symtab.c (symtab): Replace by...
13825 (bucket_table): this.
13826 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
13827 (buckets_new, buckets_do): New.
13828
280a38c3
AD
138292002-04-07 Akim Demaille <akim@epita.fr>
13830
13831 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
13832 (start_symbol, max_user_token_number, semantic_parser)
13833 (error_token_number): Initialize.
13834 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
13835 Initialize.
13836 (reader): Don't.
13837 (errtoken, eoftoken, undeftoken, axiom): Extern.
13838
03b31c0c
AD
138392002-04-07 Akim Demaille <akim@epita.fr>
13840
13841 * src/gram.h (rule_s): prec and precsym are now pointers
13842 to the bucket giving the priority/associativity.
13843 Member `associativity' removed: useless.
13844 * src/reduce.c, src/conflicts.c: Adjust.
13845
8b3df748
AD
138462002-04-07 Akim Demaille <akim@epita.fr>
13847
13848 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
13849 Properly escape the symbols' TAG when outputting them.
13850
e601aa1d
AD
138512002-04-07 Akim Demaille <akim@epita.fr>
13852
13853 * src/lalr.h (LA): Is a bitsetv, not bitset*.
13854
b0299a2e
AD
138552002-04-07 Akim Demaille <akim@epita.fr>
13856
13857 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
13858 (LArule): this, which is an array to rule_t*.
13859 * src/print.c, src/conflicts.c: Adjust.
13860
d7e1f00c
AD
138612002-04-07 Akim Demaille <akim@epita.fr>
13862
13863 * src/gram.h (rule_t): Rename `number' as `user_number'.
13864 `number' is a new member.
13865 Adjust dependencies.
13866 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
13867
cc9305dd
AD
138682002-04-07 Akim Demaille <akim@epita.fr>
13869
13870 As a result of the previous patch, it is no longer needed
13871 to reorder ritem itself.
13872
13873 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
13874
b0940840
AD
138752002-04-07 Akim Demaille <akim@epita.fr>
13876
13877 Be sure never to walk through RITEMS, but use only data related to
13878 the rules themselves. RITEMS should be banished.
13879
13880 * src/output.c (output_token_translations): Rename as...
13881 (prepare_tokens): this.
13882 In addition to `translate', prepare the muscles `tname' and
13883 `toknum', which were handled by...
13884 (output_rule_data): this.
13885 Remove, and move the remainder of its outputs into...
13886 (prepare_rules): this new routines, which also merges content from
13887 (output_gram): this.
13888 (prepare_rules): Be sure never to walk through RITEMS.
13889 (output_stos): Rename as...
13890 (prepare_stos): this.
13891 (output): Always invoke prepare_states, after all, just don't use it
13892 in the output if you don't need it.
13893
643a5994
AD
138942002-04-07 Akim Demaille <akim@epita.fr>
13895
13896 * src/LR0.c (new_state): Display `nstates' as the name of the
13897 newly created state.
13898 Adjust to initialize first_state and last_state if needed.
13899 Be sure to distinguish the initial from the final state.
13900 (new_states): Create the itemset of the initial state, and use
13901 new_state.
13902 * src/closure.c (closure): Now that the initial state has its
13903 items properly set, there is no need for a special case when
13904 creating `ruleset'.
13905
13906 As a result, now the rule 0, reducing to $axiom, is visible in the
13907 outputs. Adjust the test suite.
13908
13909 * tests/conflicts.at (Solved SR Conflicts)
13910 (Unresolved SR Conflicts): Adjust.
13911 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
13912 * tests/conflicts.at (S/R in initial): New.
13913
b4c4ccc2
AD
139142002-04-07 Akim Demaille <akim@epita.fr>
13915
13916 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
13917 the RHS of the rules.
13918 * src/output.c (output_gram): Likewise.
13919
bba97eb2
AD
139202002-04-07 Akim Demaille <akim@epita.fr>
13921
13922 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
13923 bucket.
13924 Adjust all dependencies.
13925 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
13926 `number' of the buckets too.
13927 * src/gram.h: Include `symtab.h'.
13928 (associativity): Move to...
13929 * src/symtab.h: here.
13930 No longer include `gram.h'.
13931
c3b407f4
AD
139322002-04-07 Akim Demaille <akim@epita.fr>
13933
13934 * src/gram.h, src/gram.c (rules_rhs_length): New.
13935 (ritem_longest_rhs): Use it.
13936 * src/gram.h (rule_t): `number' is a new member.
13937 * src/reader.c (packgram): Set it.
13938 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
13939 the end of `rules', and count them out of `nrules'.
13940 (reduce_output, dump_grammar): Adjust.
13941 * src/print.c (print_grammar): It is no longer needed to check for
13942 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
13943 * tests/reduce.at (Reduced Automaton): New test.
13944
11652ab3
AD
139452002-04-07 Akim Demaille <akim@epita.fr>
13946
13947 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
13948 lacking `+ 1' to nrules, Bison reported as useless a token if it
13949 was used solely to set the precedence of the last rule...
13950
26b23c1a
AD
139512002-04-07 Akim Demaille <akim@epita.fr>
13952
13953 * data/bison.c++, data/bison.simple: Don't output the current file
13954 name in #line, to avoid useless diffs between two identical
13955 outputs under different names.
13956
18bcecb0
AD
139572002-04-07 Akim Demaille <akim@epita.fr>
13958
13959 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
13960 Normalize loops to using `< nrules + 1', not `<= nrules'.
13961
fa770c86
AD
139622002-04-07 Akim Demaille <akim@epita.fr>
13963
13964 * TODO: Update.
13965
d9b739c3
AD
139662002-04-07 Akim Demaille <akim@epita.fr>
13967
13968 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
13969 bucket.value as bucket.number.
13970
99013900
AD
139712002-04-07 Akim Demaille <akim@epita.fr>
13972
13973 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
13974 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
13975 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
13976 RHS, instead of being an index in RITEMS.
13977
e966383b
PE
139782002-04-04 Paul Eggert <eggert@twinsun.com>
13979
13980 * doc/bison.texinfo: Update copyright date.
13981 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
13982 (Symbols): Warn about running Bison in one character set,
13983 but compiling and/or running in an incompatible one.
13984 Warn about character code 256, too.
13985
139862002-04-03 Paul Eggert <eggert@twinsun.com>
13987
13988 * src/bison.data (YYSTACK_ALLOC): Depend on whether
13989 YYERROR_VERBOSE is nonzero, not whether it is defined.
13990
13991 Merge changes from bison-1_29-branch.
c307773e 13992
8d6c48b9
PE
139932002-03-20 Paul Eggert <eggert@twinsun.com>
13994
13995 Merge fixes from Debian bison_1.34-1.diff.
13996
13997 * configure.in (AC_PREREQ): 2.53.
13998
e53c6322
AD
139992002-03-20 Akim Demaille <akim@epita.fr>
14000
14001 * src/conflicts.c (log_resolution): Argument `resolution' is const.
14002
9ffbeca7
PE
140032002-03-19 Paul Eggert <eggert@twinsun.com>
14004
21db0b2a
PE
14005 * src/bison.simple (YYCOPY): New macro.
14006 (YYSTACK_RELOCATE): Use it.
14007 Remove Type arg; no longer needed. All callers changed.
14008 (yymemcpy): Remove; no longer needed.
14009
9ffbeca7
PE
14010 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
14011 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
14012
642cb8f8
AD
140132002-03-19 Akim Demaille <akim@epita.fr>
14014
14015 Test and fix the #line outputs.
14016
14017 * tests/atlocal.at (GCC): New.
14018 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
0ffd4fd1 14019 (Prologue synch line, %union synch line, Postprologue synch line)
642cb8f8
AD
14020 (Action synch line, Epilogue synch line): New tests.
14021 * src/reader.c (parse_union_decl): Define the muscle stype_line.
14022 * data/bison.simple, data/bison.c++: Use it.
14023
3c31a486
AD
140242002-03-19 Akim Demaille <akim@epita.fr>
14025
14026 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
14027 (Solved SR Conflicts, %expect not enough, %expect right)
14028 (%expect too much): Move to...
14029 * tests/conflicts.at: this new file.
14030
0d8bed56
AD
140312002-03-19 Akim Demaille <akim@epita.fr>
14032
14033 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
14034 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
14035 that we can move to enums for instance.
14036 * src/output.c (token_definitions_output): Output a list of
14037 `token-name, token-number' instead of the #define.
14038 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
14039
9208d17f
AD
140402002-03-14 Akim Demaille <akim@epita.fr>
14041
14042 Use Gettext 0.11.1.
14043
af27eacb
RA
140442002-03-09 Robert Anisko <robert@lrde.epita.fr>
14045
14046 * data/bison.c++: Make the user able to add members to the generated
14047 parser by subclassing.
14048
9101a310
RA
140492002-03-05 Robert Anisko <robert@lrde.epita.fr>
14050
14051 * src/reader.c (read_additionnal_code): `c' should be an integer, not
14052 a character.
14053 Reported by Nicolas Tisserand and Nicolas Burrus.
14054
fff9bf0b
RA
140552002-03-04 Robert Anisko <robert@lrde.epita.fr>
14056
14057 * src/reader.c: Warn about lacking semi-colons, do not complain.
14058
64dba31e
RA
140592002-03-04 Robert Anisko <robert@lrde.epita.fr>
14060
14061 * data/bison.c++: Remove a debug line.
14062
374f5a14
RA
140632002-03-04 Robert Anisko <robert@lrde.epita.fr>
14064
14065 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
14066 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
14067 provide a default implementation.
14068
bfcf1f3a
AD
140692002-03-04 Akim Demaille <akim@epita.fr>
14070
14071 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
14072 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
14073 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
14074 * tests/semantic.at (Parsing Guards): Similarly.
14075 * src/reader.at (readgram): Complain if the last rule is not ended
14076 with a semi-colon.
14077
65ccf9fc
AD
140782002-03-04 Akim Demaille <akim@epita.fr>
14079
14080 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
14081 * src/closure.c: here.
14082 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
14083 RTC.
14084 * src/warshall.h, src/warshall.c: Remove.
14085 * tests/sets.at (Broken Closure): Adjust.
14086
d0039cbc
AD
140872002-03-04 Akim Demaille <akim@epita.fr>
14088
14089 * src/output.c (output_skeleton): tempdir is const.
14090 bytes_read is unused.
14091
345cea78
AD
140922002-03-04 Akim Demaille <akim@epita.fr>
14093
14094 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
14095 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
14096 Update.
14097 From Michael Hayes.
14098
564801f7
AD
140992002-03-04 Akim Demaille <akim@epita.fr>
14100
14101 * src/closure.c (closure): `r' is unused.
14102
e5352bc7
AD
141032002-03-04 Akim Demaille <akim@epita.fr>
14104
14105 * tests/sets.at (Broken Closure): Add the ending `;'.
14106 * src/reader.at (readgram): Complain if a rule is not ended with a
14107 semi-colon.
14108
914feea9
AD
141092002-03-04 Akim Demaille <akim@epita.fr>
14110
14111 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
14112 (count_sr_conflicts): Use bitset_count.
14113 * src/reduce.c (inaccessable_symbols): Ditto.
14114 (bits_size): Remove.
14115 * src/warshall.h, src/warshall.c: Convert to bitsetv.
14116
f0250de6
AD
141172002-03-04 Akim Demaille <akim@epita.fr>
14118
14119 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
14120 * src/reduce.c: Remove the `bitset_zero's following the
14121 `bitset_create's, as now it is performed by the latter.
14122
ef017502
AD
141232002-03-04 Akim Demaille <akim@epita.fr>
14124
14125 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
14126 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
14127 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
14128 latest sources from Michael.
14129
76514394
AD
141302002-03-04 Akim Demaille <akim@epita.fr>
14131
14132 * src/output.c (output): Don't free the grammar.
14133 * src/reader.c (grammar_free): New.
14134 * src/main.c (main): Call it and don't free symtab here.
14135
55024580
AD
141362002-03-04 Akim Demaille <akim@epita.fr>
14137
14138 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
14139 before returning.
14140 Reported by Benoit Perrot.
14141
f9abaa2c
AD
141422002-03-04 Akim Demaille <akim@epita.fr>
14143
14144 Use bitset operations when possible, not loops over bits.
14145
14146 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
14147 bitset_or.
14148 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
14149 * src/reduce.c (useless_nonterminals): Formatting changes.
14150 * src/warshall.c (TC): Use bitset_or.
14151
0e721e75
AD
141522002-03-04 Akim Demaille <akim@epita.fr>
14153
14154 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
14155 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
14156 Ditto.
14157
0fb1ffb1
AD
141582002-03-04 Akim Demaille <akim@epita.fr>
14159
14160 * src/lalr.c (F): Now a bitset*.
14161 Adjust all dependencies.
14162
b86796bf
AD
141632002-03-04 Akim Demaille <akim@epita.fr>
14164
14165 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
14166 Adjust all dependencies.
14167
602bbf31
AD
141682002-03-04 Akim Demaille <akim@epita.fr>
14169
14170 * src/L0.c, src/LR0.h (nstates): Be size_t.
14171 Adjust comparisons (signed vs unsigned).
14172 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
14173 bitset*.
14174 Adjust all dependencies.
14175
d8a0245c
AD
141762002-03-04 Akim Demaille <akim@epita.fr>
14177
14178 * src/closure.c (firsts): Now, also a bitset.
14179 Adjust all dependencies.
14180 (varsetsize): Remove, now unused.
14181 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
14182
34ba9743
AD
141832002-03-04 Akim Demaille <akim@epita.fr>
14184
14185 * src/print.c: Convert to use bitset.h, not hand coded iterations
14186 over ints.
14187
ed86e78c
AD
141882002-03-04 Akim Demaille <akim@epita.fr>
14189
14190 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
14191
dfdb1797
AD
141922002-03-04 Akim Demaille <akim@epita.fr>
14193
14194 * src/closure.c (ruleset): Be a bitset.
14195 (rulesetsize): Remove.
14196
7086e707
AD
141972002-03-04 Akim Demaille <akim@epita.fr>
14198
14199 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
14200 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
14201 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
14202 * src/closure.c (fderives): Be an array of bitsets.
14203
98254360
RA
142042002-02-28 Robert Anisko <robert@lrde.epita.fr>
14205
14206 * data/bison.c++: Merge the two generated headers. Insert a copyright
14207 notice in each output file.
14208
a75c057f
AD
142092002-02-28 Akim Demaille <akim@epita.fr>
14210
14211 * data/bison.c++: Copy the prologue of bison.simple to fetch
14212 useful M4 definitions, such as b4_header_guard.
14213
06b00abc
AD
142142002-02-25 Akim Demaille <akim@epita.fr>
14215
14216 * src/getargs.c (version): Give the name of the authors, and use a
a75c057f
AD
14217 translator friendly scheme for the bgr
14218 copyright notice.
06b00abc 14219
70e7d534
AD
142202002-02-25 Akim Demaille <akim@epita.fr>
14221
14222 * src/output.c (header_output): Remove, now handled completely via
14223 M4.
14224
abe017f6
AD
142252002-02-25 Akim Demaille <akim@epita.fr>
14226
14227 * m4/m4.m4: New, from CVS Autoconf.
14228 * configure.in: Invoke it.
14229 * src/output.c (output_skeleton): Use its result instead of the
14230 hard coded name.
14231
381fb12e
AD
142322002-02-25 Akim Demaille <akim@epita.fr>
14233
14234 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
14235 Fileutils 4.1.5.
14236 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
14237 * src/output.c (output_skeleton): Use mkstemp to create a real
14238 temporary file.
14239 Move the filling of `skeleton' and its muscle to...
14240 (prepare): here.
14241 (output): Move the definition of the prologue muscle to...
14242 (prepare): here.
14243 * src/system.h (DEFAULT_TMPDIR): New.
14244
6f38107f
PE
142452002-02-14 Paul Eggert <eggert@twinsun.com>
14246
14247 Remove the support for C++ namespace cleanliness; it was
14248 causing more problems than it was curing, since it didn't work
14249 properly on some nonstandard C++ compilers. This can wait
14250 for a proper C++ parser.
14251
14252 * NEWS: Document this.
14253 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
14254 of C++, as it's treated like C now.
14255 * src/bison.simple (YYSTD): Remove.
14256 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
14257 Treat C++ just like Standard C instead of trying to support
14258 namespace cleanliness.
14259
80cce3da
AD
142602002-02-14 Akim Demaille <akim@epita.fr>
14261
14262 * tests/regression.at (else): Adjust to Andreas' change.
14263
842e8679
AD
142642002-02-14 Akim Demaille <akim@epita.fr>
14265
14266 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
14267
4bda3f10
AD
142682002-02-13 Andreas Schwab <schwab@suse.de>
14269
14270 * src/output.c (output_rule_data): Don't output NULL, it might
14271 not be defined yet.
14272
4162fa07 142732002-02-11 Robert Anisko <robert@lrde.epita.fr>
b418ecd8 14274
4162fa07
RA
14275 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
14276 (Copyright notice): Update.
b418ecd8 14277
bd16a5dc
AD
142782002-02-11 Akim Demaille <akim@epita.fr>
14279
14280 * tests/regression.at (%nonassoc and eof): Don't include
14281 nonportable headers.
14282
8d69a1a3
RA
142832002-02-08 Robert Anisko <robert@lrde.epita.fr>
14284
14285 * data/bison.c++: Correct error recovery. Make the user able to
14286 initialize the starting location.
14287
9b2d0677
AD
142882002-02-07 Akim Demaille <akim@epita.fr>
14289
14290 * tests/input.at: New.
14291
69e2658b
RA
142922002-02-07 Robert Anisko <robert@lrde.epita.fr>
14293
14294 * data/bison.c++: Replace some direct m4 expansions by constants. Be
9b2d0677 14295 more consistent when naming methods and variables. Put preprocessor
69e2658b
RA
14296 directives around tables only needed for debugging.
14297
4aacc3a7
RA
142982002-02-07 Robert Anisko <robert@lrde.epita.fr>
14299
14300 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
14301 C++ parsers.
14302 (yy::b4_name::parse): Use print_.
14303
762a801e
RA
143042002-02-07 Robert Anisko <robert@lrde.epita.fr>
14305
14306 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
14307
4bb2bc3f
RA
143082002-02-07 Robert Anisko <robert@lrde.epita.fr>
14309
14310 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
14311 C++ parsers.
14312 (yy::b4_name::parse): Build verbose error messages, and use error_.
14313
6b45a3ca
RA
143142002-02-06 Robert Anisko <robert@lrde.epita.fr>
14315
14316 * data/bison.c++: Fix m4 quoting in comments.
14317
50997c6e
RA
143182002-02-06 Robert Anisko <robert@lrde.epita.fr>
14319
14320 * data/bison.c++: Adjust the parser code. Fix some muscles that were
14321 not expanded by m4.
14322
3f3eed27
AD
143232002-02-05 Akim Demaille <akim@epita.fr>
14324
14325 * data/bison.c++: Adjust to the M4 back end.
14326 More is certainly needed.
14327
be2a1a68
AD
143282002-02-05 Akim Demaille <akim@epita.fr>
14329
14330 Give a try to M4 as a back end.
14331
14332 * lib/readpipe.c: New, from wdiff.
14333 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
14334 BISON_HAIRY.
14335 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
14336 specific values. Now it is m4 that performs the lookup.
14337 * src/parse-skel.y: Remove.
14338 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
14339 * src/output.c (actions_output, guards_output)
14340 (token_definitions_output): No longer keeps track of the output
14341 line number, hence remove the second argument.
14342 (guards_output): Check against the guard member of a rule, not the
14343 action member.
14344 Adjust callers.
14345 (output_skeleton): Don't look for the skeleton location, let m4 do
14346 that.
14347 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
14348 file will be used.
14349 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
14350 (prepare): Given that for the time being changesyntax is not
14351 usable in M4, rename the muscles using `-' to `_'.
14352 Define `defines_flag', `output_parser_name' and `output_header_name'.
14353 * src/output.h (actions_output, guards_output)
14354 (token_definitions_output): Adjust prototypes.
14355 * src/scan-skel.l: Instead of scanning the skeletons, it now
14356 processes the output of m4: `__oline__' and `#output'.
14357 * data/bison.simple: Adjust to be used by M4(sugar).
14358 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
14359 to date.
14360 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
14361 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
14362 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
14363 shamelessly stolen from CVS Autoconf.
14364
beda758b
AD
143652002-02-05 Akim Demaille <akim@epita.fr>
14366
14367 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
14368 * configure.in: Check for the declarations of free and malloc.
14369 * src/muscle_tab.c: Adjust.
14370
5ece6d43
AD
143712002-02-05 Akim Demaille <akim@epita.fr>
14372
14373 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
14374 which have no values.
14375
5bb18f9a
AD
143762002-02-05 Akim Demaille <akim@epita.fr>
14377
14378 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
14379 * data/: here.
14380
894dd62e
PE
143812002-01-29 Paul Eggert <eggert@twinsun.com>
14382
14383 * src/bison.simple (YYSIZE_T): Do not define merely because
14384 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
14385 On some platforms, <alloca.h> does not declare YYSTD (size_t).
14386
82841af7
AD
143872002-01-27 Akim Demaille <akim@epita.fr>
14388
14389 Fix `%nonassoc and eof'.
14390
14391 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
14392 which were not properly copied! Replace
14393 memcpy (res->errs, src->errs, src->nerrs);
14394 with
14395 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
14396 !!!
14397 * tests/regression.at (%nonassoc and eof): Adjust to newest
14398 Autotest: `.' is not in the PATH.
14399
318b76e9
AD
144002002-01-27 Akim Demaille <akim@epita.fr>
14401
14402 * tests/sets.at (AT_EXTRACT_SETS): New.
14403 (Nullable): Use it.
14404 (Firsts): New.
14405
30d2f3d5
AD
144062002-01-26 Akim Demaille <akim@epita.fr>
14407
14408 * tests/actions.at, tests/calc.at, tests/headers.at,
14409 * tests/torture.at: Adjust to the newest Autotest which no longer
14410 forces `.' in the PATH.
14411
30f8c395
AD
144122002-01-25 Akim Demaille <akim@epita.fr>
14413
14414 * tests/regression.at (%nonassoc and eof): New.
14415 Suggested by Robert Anisko.
14416
29ae55f1
AD
144172002-01-24 Akim Demaille <akim@epita.fr>
14418
14419 Bison dumps core when trying to complain about broken input files.
14420 Reported by Cris van Pelt.
14421
14422 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
14423 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
14424 into...
14425 (Invalid inputs): Strengthen: exercise parse_percent_token.
14426
2b548aa6
RA
144272002-01-24 Robert Anisko <robert.anisko@epita.fr>
14428
14429 * src/Makefile.am: Add bison.c++.
14430 * src/bison.c++: New skeleton.
14431
bb0146c2
AD
144322002-01-21 Paolo Bonzini <bonzini@gnu.org>
14433
14434 * po/it.po: New.
14435
bec30531
AD
144362002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
14437
14438 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
14439
fc6edc45
MA
144402002-01-20 Marc Autret <marc@gnu.org>
14441
14442 * src/files.c (compute_output_file_names): Fix
14443
5e5d5415
MA
144442002-01-20 Marc Autret <marc@gnu.org>
14445
14446 * tests/output.at: New test.
14447 * src/files.c (compute_base_names): Don't map extensions when
14448 the YACC flag is set, use defaults.
14449 Reported by Evgeny Stambulchik.
14450
44ea3fbd
MA
144512002-01-20 Marc Autret <marc@gnu.org>
14452
ba0fe3c7
PE
14453 * src/system.h: Need to define __attribute__ away for non-GCC
14454 compilers as well (i.e., the vendor C compiler).
44ea3fbd
MA
14455 Suggested by Albert Chin-A-Young.
14456
338963d1
TVH
144572002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
14458
14459 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
14460 canonical definition.
14461 * src/system.h: Use the canonical definition for PARAMS (avoids
14462 a conflict with the macro from lib/hash.h).
14463
c57b2479
AD
144642002-01-11 Akim Demaille <akim@epita.fr>
14465
14466 * configure.in: Use AC_FUNC_STRNLEN.
d9e9746c 14467 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
c57b2479 14468
b85810ae
AD
144692002-01-09 Akim Demaille <akim@epita.fr>
14470
14471 * src/files.c, src/files.h (output_infix): New.
14472 (tab_extension): Remove.
14473 (compute_base_names): Compute the former, drop the latter.
14474 * src/output.c (prepare): Insert the muscles `output-infix', and
14475 `output-suffix'.
14476 * src/parse-skel.y (string, string.1): New.
14477 (section.header): Use it.
14478 (section.yacc): Remove.
14479 (prefix): Remove too.
14480 * src/scan-skel.l: Adjust.
14481 * src/bison.simple, src/bison.hairy: Adjust.
14482
cae60122
AD
144832002-01-09 Akim Demaille <akim@epita.fr>
14484
14485 * configure.in (WERROR_CFLAGS): Compute it.
14486 * src/Makefile.am (CFLAGS): Pass it.
14487 * tests/atlocal.in (CFLAGS): Idem.
14488 * src/files.c: Fix a few warnings.
14489 (get_extension_index): Remove, unused.
14490
ae404801
AD
144912002-01-08 Akim Demaille <akim@epita.fr>
14492
14493 * src/getargs.c (AS_FILE_NAME): New.
14494 (getargs): Use it to convert DOSish file names.
14495 * src/files.c (base_name): Rename as full_base_name to avoid
14496 clashes with `base_name ()'.
14497 (filename_split): New.
14498 (compute_base_names): N-th rewrite, using filename_split.
14499
22312b71
AD
145002002-01-08 Akim Demaille <akim@epita.fr>
14501
14502 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
14503 New, stolen from the Fileutils 4.1.
14504 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
14505 * configure.in: Check for the presence of memrchr, and of its
14506 prototype.
14507
a67cef01
TVH
145082002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
14509
14510 * lib/hash.h (__P): Added definition for this macro.
14511 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
14512 BUILT_SOURCES, to ensure they are generated first.
14513 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
14514 %error-verbose to allow bootstrapping with bison 1.30x.
14515
2b25d624
AD
145162002-01-06 Akim Demaille <akim@epita.fr>
14517
14518 * src/reader.c (parse_braces): Don't fetch the next char, the
14519 convention is to fetch on entry.
14520 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
14521 'switch' without a following semicolon.
14522 * tests/regression.at (braces parsing): New.
14523
3460813b
AD
145242002-01-06 Akim Demaille <akim@epita.fr>
14525
14526 Bison is dead wrong in its RR conflict reports.
14527
14528 * tests/torture.at (GNU Cim Grammar): New.
14529 * src/conflicts.c (count_rr_conflicts): Fix.
14530
73784c64
AD
145312002-01-06 Akim Demaille <akim@epita.fr>
14532
14533 Creating package.m4 from configure.ac causes too many problems.
14534
14535 * tests/Makefile.am (package.m4): Create it by hand,
14536 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
14537
25d81090
AD
145382002-01-06 Akim Demaille <akim@epita.fr>
14539
14540 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
14541 skeleton.h.
14542
a9b8959e
PE
145432002-01-04 Paul Eggert <eggert@twinsun.com>
14544
14545 * doc/bison.texinfo (Debugging):
14546 Remove YYSTDERR; it's no longer defined or used.
14547 Also, s/cstdio.h/cstdio/.
14548
25d81090
AD
145492002-01-03 Akim Demaille <akim@epita.fr>
14550
14551 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
14552
1109455c
AD
145532002-01-03 Akim Demaille <akim@epita.fr>
14554
14555 * src/parse-skel.y (process_skeleton): Don't bind the parser's
14556 tracing code to --trace, wait for a better --trace option, with
14557 args.
14558
7ea5e977
AD
145592002-01-03 Akim Demaille <akim@epita.fr>
14560
14561 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
14562 The ISO C++ standard is extremely clear about it: stderr is
14563 considered a macro, not a regular symbol (see table 94 `Header
14564 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
14565 Therefore std:: does not apply to it. It still does with fprintf.
14566 Also, s/cstdio.h/cstdio/.
14567
fab5b110
AD
145682002-01-03 Akim Demaille <akim@epita.fr>
14569
14570 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
14571 for non system headers.
14572
aed7fd9b
AD
145732002-01-02 Akim Demaille <akim@epita.fr>
14574
14575 Equip the skeleton chain with location tracking, runtime trace,
14576 pure parser and scanner.
14577
14578 * src/parse-skel.y: Request a pure parser, locations, and prefix
14579 renaming.
14580 (%union): Having several members with the same type does not help
14581 type mismatches, simplify.
14582 (YYPRINT, yyprint): New.
14583 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
14584 (skel_error): this.
14585 Handle locations.
14586 * src/scan-skel.l: Adjust to these changes.
14587 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
14588 (LOCATION_PRINT, skel_control_t): New.
14589
24fad99e
AD
145902001-12-30 Akim Demaille <akim@epita.fr>
14591
14592 * src/parse-skel.y: Get rid of the shift/reduce conflict:
14593 replace `gb' with BLANKS.
14594 * src/scan-skel.l: Adjust.
14595
a4b36db4
AD
145962001-12-30 Akim Demaille <akim@epita.fr>
14597
14598 * src/system.h: We don't need nor want bcopy.
14599 Throw away MS-DOS crap: we don't need getpid.
14600 * configure.in: We don't need strndup. It was even causing
14601 problems: because Flex includes the headers *before* us,
14602 _GNU_SOURCE is not defined by config.h, and therefore strndup was
14603 not visible.
14604 * lib/xstrndup.c: New.
14605 * src/scan-skel.l: Use it.
14606 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
14607 * src/parse-skel.y: Use %directives instead of #defines.
14608
1239777d
AD
146092001-12-30 Akim Demaille <akim@epita.fr>
14610
14611 * src/skeleton.h: New.
14612 * src/output.c (output_parser, output_master_parser): Remove, dead
14613 code.
14614 * src/output.h (get_lines_number, actions_output, guards_output)
14615 (token_definitions_output): Prototype them.
14616 * src/parse-skel.y: Add the license notice.
14617 Include output.h and skeleton.h.
14618 (process_skeleton): Returns void, and takes a single parameter.
14619 * src/scan-skel.l: Add the license notice.
14620 Include skeleton.h.
14621 Don't use %option yylineno: it seems that then Flex imagines
14622 REJECT has been used, and therefore it won't reallocate its
14623 buffers (which makes no other sense to me than a bug). It results
14624 in warnings for `unused: yy_flex_realloc'.
14625
9b3add5b
RA
146262001-12-30 Robert Anisko <robert.anisko@epita.fr>
14627
14628 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
14629 (MUSCLE_INSERT_PREFIX): ...to there.
14630 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
14631 (MUSCLE_INSERT_PREFIX): Move from here...
14632
14633 * src/bison.hairy: Add a section directive. Put braces around muscle
14634 names. This parser skeleton is still broken, but Bison should not
14635 choke on a bad muscle 'syntax'.
14636 * src/bison.simple: Add a section directive. Put braces around muscle
14637 names.
14638
14639 * src/files.h (strsuffix, stringappend): Add declarations.
14640 (tab_extension): Add declaration.
14641 (short_base_name): Add declaration.
14642
14643 * src/files.c (strsuffix, stringappend): No longer static. These
14644 functions are used in the skeleton parser.
14645 (tab_extension): New.
14646 (compute_base_names): Use the computations done in this function
fab5b110 14647 to guess if the generated parsers should have '.tab' in their
9b3add5b
RA
14648 names.
14649 (short_base_name): No longer static.
14650
14651 * src/output.c (output_skeleton): New.
14652 (output): Disable call to output_master_parser, and give a try to
14653 a new skeleton handling system.
14654 (guards_output, actions_output): No longer static.
14655 (token_definitions_output, get_lines_number): No longer static.
14656
14657 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
14658
fab5b110 14659 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
9b3add5b
RA
14660 parse-skel.y.
14661
14662 * src/parse-skel.y: New file.
14663 * src/scan-skel.l: New file.
14664
b5b61c61
AD
146652001-12-29 Akim Demaille <akim@epita.fr>
14666
14667 %name-prefix is broken.
14668
14669 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
14670 Adjust all dependencies.
14671 * tests/headers.at (export YYLTYPE): Strengthen this test: use
14672 %name-prefix.
14673
14674 Renaming yylval but not yylloc is not consistent. Now we do.
14675
14676 * src/bison.simple: Prefix yylloc if used.
14677 * doc/bison.texinfo (Decl Summary): Document that.
14678
8c9a50be
AD
146792001-12-29 Akim Demaille <akim@epita.fr>
14680
14681 * doc/bison.texinfo: Promote `%long-directive' over
14682 `%long_directive'.
14683 Remove all references to fixed-output-files, yacc is enough.
14684
d99361e6
AD
146852001-12-29 Akim Demaille <akim@epita.fr>
14686
14687 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
14688 user prologue. These are defaults.
14689 * tests/actions.at (Mid-rule actions): Make sure the user can
14690 define YYDEBUG and YYERROR_VERBOSE.
14691
b9cecb91
AD
146922001-12-29 Akim Demaille <akim@epita.fr>
14693
14694 * src/output.c (header_output): Don't forget to export YYLTYPE and
14695 yylloc.
14696 * tests/headers.at (export YYLTYPE): New, make sure it does.
14697 * tests/regression.at (%union and --defines, Invalid CPP headers):
14698 Move to...
14699 * tests/headers.at: here.
14700
aea13e97
AD
147012001-12-29 Akim Demaille <akim@epita.fr>
14702
14703 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
14704
931394cb
AD
147052001-12-29 Akim Demaille <akim@epita.fr>
14706
14707 * tests/actions.at (Mid-rule actions): Output on a single line
14708 instead of several.
14709
704a47c4
AD
147102001-12-29 Akim Demaille <akim@epita.fr>
14711
14712 * doc/bison.texinfo: Formatting changes.
14713
091e20bb
AD
147142001-12-29 Akim Demaille <akim@epita.fr>
14715
14716 Don't store the token defs in a muscle, just be ready to output it
14717 on command. Now possible via `symbols'. Fixes a memory leak.
14718
14719 * src/output.c (token_definitions_output): New.
14720 (output_parser, header_output): Use it.
14721 * src/reader.c (symbols_save): Remove.
14722
cce71710
AD
147232001-12-29 Akim Demaille <akim@epita.fr>
14724
14725 * src/bison.simple: Do not provide a default for YYSTYPE and
14726 YYLTYPE before the user's prologue. Otherwise it's hardly... a
14727 default.
14728
82c035a8
AD
147292001-12-29 Akim Demaille <akim@epita.fr>
14730
14731 Mid-rule actions are simply... ignored!
14732
14733 * src/reader.c (readgram): Be sure to attach mid-rule actions to
14734 the empty-rule associated to the dummy symbol, not to the host
14735 rule.
14736 * tests/actions.at (Mid-rule actions): New.
14737
8419d367
AD
147382001-12-29 Akim Demaille <akim@epita.fr>
14739
14740 Memory leak.
14741
14742 * src/reader.c (reader): Free grammar.
14743
375d5806
AD
147442001-12-29 Akim Demaille <akim@epita.fr>
14745
14746 Memory leak.
14747
14748 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
14749 since it allocates it for each state, although only one is needed.
14750 (allocate_storage): Do it here.
14751
f51cb8ff
AD
147522001-12-29 Akim Demaille <akim@epita.fr>
14753
14754 * src/options.h, src/options.c (create_long_option_table): Rename
14755 as...
14756 (long_option_table_new): this, with a clearer prototype.
14757 (percent_table): Remove, unused,
14758 * src/getargs.c (getargs): Adjust.
14759
29e88316
AD
147602001-12-29 Akim Demaille <akim@epita.fr>
14761
14762 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
14763 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
14764 as states.
14765
b9f71f19
AD
147662001-12-29 Akim Demaille <akim@epita.fr>
14767
14768 * src/lalr.c (build_relations): Rename `states' as `states1'.
14769 Sorry, I don't understand exactly what it is, no better name...
14770
1a2b5d37
AD
147712001-12-29 Akim Demaille <akim@epita.fr>
14772
14773 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
14774 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
14775 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
14776 as rules.
14777
1cca533e
AD
147782001-12-29 Akim Demaille <akim@epita.fr>
14779
14780 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
14781 ago.
14782
c03ae966
AD
147832001-12-29 Akim Demaille <akim@epita.fr>
14784
14785 * src/reader.c, src/reader.h (user_toknums): Remove.
14786 Adjust all users to use symbols[i]->user_token_number.
14787
5a670b1e
AD
147882001-12-29 Akim Demaille <akim@epita.fr>
14789
14790 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
14791 Adjust all users to use symbols[i]->prec or ->assoc.
14792
ad949da9
AD
147932001-12-29 Akim Demaille <akim@epita.fr>
14794
14795 * src/reader.c, src/reader.h (tags): Remove.
14796 Adjust all users to use symbols[i]->tag.
14797
0e78e603
AD
147982001-12-29 Akim Demaille <akim@epita.fr>
14799
14800 * src/gram.h, src/gram.c (symbols): New, similar to state_table
14801 and rule_table.
14802 * src/reader.c (packsymbols): Fill this table.
14803 Drop sprec.
14804 * src/conflicts.c (resolve_sr_conflict): Adjust.
14805 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
14806 single table.
14807 Use symbols[i]->tag instead of tags[i].
14808
213e640e
AD
148092001-12-29 Akim Demaille <akim@epita.fr>
14810
14811 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
14812 In addition, put a comment in there, to replace...
14813 * tests/regression.at (%union and C comments): Remove.
14814
e7b8bef1
AD
148152001-12-29 Akim Demaille <akim@epita.fr>
14816
14817 * tests/regression.at (Web2c Actions): Blindly move the actual
14818 output as expected output. The contents *seem* right to me, but I
14819 can't pretend reading perfectly parser tables... Nonetheless, all
14820 the other tests pass correctly, the table look OK, even though the
14821 presence of `$axiom' is to be noted: AFAICS it is useless (but
14822 harmless).
14823
b68e7744
AD
148242001-12-29 Akim Demaille <akim@epita.fr>
14825
14826 * src/reader.c (readgram): Don't add the rule 0 if there were no
14827 rules read. In other words, add it _after_ having performed
14828 grammar sanity checks.
14829 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
14830
78d5bae9
AD
148312001-12-29 Akim Demaille <akim@epita.fr>
14832
14833 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
14834 visible, and some states have now a different number.
14835
ff442794
AD
148362001-12-29 Akim Demaille <akim@epita.fr>
14837
14838 * src/reader.c (readgram): Bind the initial rule's lineno to that
14839 of the first rule.
14840 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
14841 (Solved SR Conflicts): Adjust rule 0's line number.
14842
610ab194
AD
148432001-12-29 Akim Demaille <akim@epita.fr>
14844
14845 Fix the `GAWK Grammar' failure.
14846
14847 * src/LR0.c (final_state): Initialize to -1 so that we do compute
14848 the reductions of the first state which was mistakenly confused
14849 with the final state because precisely final_state was initialized
14850 to 0.
14851 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
14852 now noticed by Bison.
14853 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
14854 have a reduction on $default.
14855
29d29c8f
AD
148562001-12-29 Akim Demaille <akim@epita.fr>
14857
14858 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
14859 rule line numbers.
14860 * src/closure.c (print_closure): Likewise.
14861 * src/derives.c (print_derives): Likewise.
14862 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
14863 now.
14864
7c6b64d0
AD
148652001-12-29 Akim Demaille <akim@epita.fr>
14866
14867 * src/lalr.c (lookaheads_print): New.
14868 (lalr): Call it when --trace-flag.
14869 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
14870 are dumped.
14871
3d4daee3
AD
148722001-12-29 Akim Demaille <akim@epita.fr>
14873
14874 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
14875 when walking through ritem, even via rule->rhs.
14876 * src/reduce.c (dump_grammar, useful_production, reduce_output)
14877 (useful_production, useless_nonterminals): Likewise.
14878 (reduce_grammar_tables): Likewise, plus update nritems.
14879 * src/nullable.c (set_nullable): Likewise.
14880 * src/lalr.c (build_relations): Likewise.
14881 * tests/sets.at (Nullable): Adjust.
14882 Fortunately, now, the $axiom is no longer nullable.
14883
9e7f6bbd
AD
148842001-12-29 Akim Demaille <akim@epita.fr>
14885
14886 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
14887 the 0-sentinel.
14888 * src/gram.c (ritem_longest_rhs): Likewise.
14889 * src/reduce.c (nonterminals_reduce): Likewise.
14890 * src/print_graph.c (print_graph): Likewise.
14891 * src/output.c (output_rule_data): Likewise.
14892 * src/nullable.c (set_nullable): Likewise.
14893
255ef638
AD
148942001-12-29 Akim Demaille <akim@epita.fr>
14895
14896 * src/output.c: Comment changes.
14897
0d8a7363
AD
148982001-12-27 Paul Eggert <eggert@twinsun.com>
14899
14900 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
14901 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
14902 Sparc, as they were causing more porting problems than the
14903 (minor) performance improvement was worth.
14904
14905 Also, catch up with 1.31's YYSTD.
14906
3db472b9
AD
149072001-12-27 Akim Demaille <akim@epita.fr>
14908
14909 * src/output.c (output_gram): Rely on nritems, not the
14910 0-sentinel. See below.
14911 Use -1 as separator, not 0.
14912 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
14913 Rely on -1 as separator in yyrhs, instead of 0.
14914 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
14915 twice `Now at end of input', therefore there are two lines less to
14916 expect.
14917
b365aa05
AD
149182001-12-27 Akim Demaille <akim@epita.fr>
14919
14920 * tests/regression.at (Unresolved SR Conflicts):
14921 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
14922 below.
14923
30171f79
AD
149242001-12-27 Akim Demaille <akim@epita.fr>
14925
14926 * src/LR0.c (new_state): Recognize the final state by the fact it
14927 is reached by eoftoken.
14928 (insert_start_shifting_state, insert_eof_shifting_state)
14929 (insert_accepting_state, augment_automaton): Remove, since now
14930 these states are automatically computed from the initial state.
14931 (generate_states): Adjust.
14932 * src/print.c: When reporting a rule number to the user, substract
14933 1, so that the axiom rule is rule 0, and the first user rule is 1.
14934 * src/reduce.c: Likewise.
14935 * src/print_graph.c (print_core): For the time being, just as for
14936 the report, depend upon --trace-flags to dump the full set of
14937 items.
14938 * src/reader.c (readgram): Once the grammar read, insert the rule
14939 0: `$axiom: START-SYMBOL $'.
14940 * tests/set.at: Adjust: rule 0 is now displayed, and since the
14941 number of the states has changed (the final state is no longer
14942 necessarily the last), catch up.
14943
75142d45
AD
149442001-12-27 Akim Demaille <akim@epita.fr>
14945
14946 Try to make the use of the eoftoken valid. Given that its value
14947 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
14948 is used instead of > 0 where appropriate, (ii), depend upon nritems
14949 instead of the 0-sentinel.
14950
14951 * src/gram.h, src/gram.c (nritems): New.
14952 Expected to be duplication of nitems, but for the time being...
14953 * src/reader.c (packgram): Assert nritems and nitems are equal.
14954 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
14955 * src/closure.c (print_closure, print_fderives): Likewise.
14956 * src/gram.c (ritem_print): Likewise.
14957 * src/print.c (print_core, print_grammar): Likewise.
14958 * src/print_graph.c: Likewise.
14959
b7c49edf
AD
149602001-12-27 Akim Demaille <akim@epita.fr>
14961
14962 * src/main.c (main): If there are complains after grammar
14963 reductions, then output the report anyway if requested, then die.
14964 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
14965 * src/reader.c (eoftoken): New.
14966 (parse_token_decl): If the token being defined has value `0', it
14967 is the eoftoken.
14968 (packsymbols): No longer hack `tags' to insert `$' by hand.
14969 Be sure to preserve the value of the eoftoken.
14970 (reader): Make sure eoftoken is defined.
14971 Initialize nsyms to 0: now eoftoken is created just like the others.
14972 * src/print.c (print_grammar): Don't special case the eof token.
14973 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
14974 lie anyway, albeit pleasant.
14975 * tests/calc.at: Exercise error messages with eoftoken.
14976 Change the grammar so that empty input is invalid.
14977 Adjust expectations.
14978 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
14979
ec2da99f
AD
149802001-12-27 Akim Demaille <akim@epita.fr>
14981
14982 * configure.in: Check the protos of strchr ans strspn.
14983 Replace strchr if needed.
14984 * src/system.h: Provide the protos of strchr, strspn and memchr if
14985 missing.
14986 * lib/strchr.c: New.
14987 * src/reader.c (symbols_save): Use strchr.
14988
8adfa272
AD
149892001-12-27 Akim Demaille <akim@epita.fr>
14990
14991 * src/print.c, src/print_graph.c (escape): New.
14992 Use it to quote the TAGS outputs.
14993 * src/print_graph.c (print_state): Now errors are in red, and
14994 reductions in green.
14995 Prefer high to wide: output the state number on a line of its own.
14996
80dac38c
AD
149972001-12-27 Akim Demaille <akim@epita.fr>
14998
14999 * src/state.h, src/state.c (reductions_new): New.
15000 * src/LR0.c (set_state_table): Let all the states have a
15001 `reductions', even if reduced to 0.
15002 (save_reductions): Adjust.
15003 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
15004 * src/print.c (print_reductions, print_actions): Adjust.
15005 * src/output.c (action_row): Adjust.
15006
2cec70b9
AD
150072001-12-27 Akim Demaille <akim@epita.fr>
15008
15009 * src/state.h, src/state.c (errs_new, errs_dup): New.
15010 * src/LR0.c (set_state_table): Let all the states have an errs,
15011 even if reduced to 0.
15012 * src/print.c (print_errs, print_reductions): Adjust.
15013 * src/output.c (output_actions, action_row): Adjust.
15014 * src/conflicts.c (resolve_sr_conflict): Adjust.
15015
13ca549a
AD
150162001-12-27 Akim Demaille <akim@epita.fr>
15017
15018 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
15019
5092aba5
AD
150202001-12-27 Akim Demaille <akim@epita.fr>
15021
15022 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
15023 * src/print.c: here.
15024 (lookaheadset, shiftset): New, used as additional storage by
15025 print_reductions.
15026 (print_results): Adjust.
15027 (print_shifts, print_gotos, print_errs): New, extracted from...
15028 (print_actions): here.
15029 * src/print_graph.c (print_actions): Remove dead code.
15030
11e2beca
AD
150312001-12-27 Akim Demaille <akim@epita.fr>
15032
15033 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
15034 `$n' and `@n'.
15035
dac3c910
AD
150362001-12-27 Akim Demaille <akim@epita.fr>
15037
15038 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
15039 (build_relations): Adjust.
15040
d0b0fefa
AD
150412001-12-27 Akim Demaille <akim@epita.fr>
15042
15043 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
15044 duplication.
15045
adc8c848
AD
150462001-12-27 Akim Demaille <akim@epita.fr>
15047
15048 * src/reader.c (packgram): Catch nitems overflows.
15049
14d293ac
AD
150502001-12-27 Akim Demaille <akim@epita.fr>
15051
15052 * src/files.c, src/files.h (guard_obstack): Remove.
15053 * src/output.c (output): Adjust.
15054 * src/reader.c (parse_braces): New, factoring...
15055 (copy_action, copy_guard): these two which are renamed as...
15056 (parse_action, parse_guard): these.
15057 As a voluntary consequence, using braces around guards is now
15058 mandatory.
15059
f499b062
AD
150602001-12-27 Akim Demaille <akim@epita.fr>
15061
15062 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
15063 * src/reader.c (symbol_list): `guard' and `guard_line' are new
15064 members.
15065 (symbol_list_new): Adjust.
15066 (copy_action): action_line is the first line, not the last.
15067 (copy_guard): Just as for actions, store the `action' only, not
15068 the switch/case/break flesh.
15069 Don't parse the user action that might follow the guard, let...
15070 (readgram): do it, i.e., now, there can be an action after a
15071 guard.
15072 In other words the guard is just explicitly optional.
15073 (packgram): Adjust.
15074 * src/output.c (guards_output): New.
15075 (output_parser): Call it when needed.
15076 (output): Also free the guard and attrs obstacks.
15077 * src/files.c, src/files.h (obstack_save): Remove.
15078 (output_files): Remove.
15079 As a result, if one needs the former `.act' file, using an
15080 appropriate skeleton which requires actions and guards is now
15081 required.
15082 * src/main.c (main): Adjust.
15083 * tests/semantic.at: New.
15084 * tests/regression.at: Use `input.y' as input file name.
15085 Avoid 8+3 problems by requiring input.c when the test needs the
15086 parser.
15087
d945f5cd
AD
150882001-12-27 Akim Demaille <akim@epita.fr>
15089
15090 * src/reader.c (symbol_list_new): Be sure to initialize all the
15091 fields.
15092
d200e455
AD
150932001-12-27 Akim Demaille <akim@epita.fr>
15094
15095 All the hacks using a final pseudo state are now useless.
15096
15097 * src/LR0.c (set_state_table): state_table holds exactly nstates.
15098 * src/lalr.c (nLA): New.
15099 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
15100 instead of lookaheadsp from the pseudo state (nstate + 1).
15101
f9507c28
AD
151022001-12-27 Akim Demaille <akim@epita.fr>
15103
15104 * src/output.c (action_row, token_actions): Use a state_t instead
15105 of a integer, and nlookaheads instead of the following state's
15106 lookaheadsp.
15107
065fbd27
AD
151082001-12-27 Akim Demaille <akim@epita.fr>
15109
15110 * src/conflicts.c (log_resolution, flush_shift)
15111 (resolve_sr_conflict, set_conflicts, solve_conflicts)
15112 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
15113 (conflicts_print, print_reductions): Use a state_t instead of an
15114 integer when referring to a state.
15115 As much as possible, depend upon nlookaheads, instead of the
15116 `lookaheadsp' member of the following state (since lookaheads of
15117 successive states are successive, the difference between state n + 1
15118 and n served as the number of lookaheads for state n).
15119 * src/lalr.c (add_lookback_edge): Likewise.
15120 * src/print.c (print_core, print_actions, print_state)
15121 (print_results): Likewise.
15122 * src/print_graph.c (print_core, print_actions, print_state)
15123 (print_graph): Likewise.
15124 * src/conflicts.h: Adjust.
15125
1b177bd7
AD
151262001-12-27 Akim Demaille <akim@epita.fr>
15127
15128 * src/bison.hairy: Formatting/comment changes.
15129 ANSIfy.
15130 Remove `register' indications.
15131 Add plenty of `static'.
15132
7742ddeb
AD
151332001-12-27 Akim Demaille <akim@epita.fr>
15134
15135 * src/output.c (prepare): Drop the muscle `ntbase' which
15136 duplicates ntokens.
15137 * src/bison.simple: Formatting/comment changes.
15138 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
15139 is an undocumented synonym.
15140
1fa14068
AD
151412001-12-22 Akim Demaille <akim@epita.fr>
15142
15143 * src/output.c (output_table_data): Change the prototype to use
15144 `int' for array ranges: some invocations do pass an int, not a
15145 short.
15146 Reported by Wayne Green.
15147
b9752825
AD
151482001-12-22 Akim Demaille <akim@epita.fr>
15149
15150 Some actions of web2c.y are improperly triggered.
15151 Reported by Mike Castle.
15152
15153 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
15154 * tests/regression.at (Web2c): Rename as...
15155 (Web2c Report): this.
15156 (Web2c Actions): New.
15157
776209d6
AD
151582001-12-22 Akim Demaille <akim@epita.fr>
15159
15160 Reductions in web2c.y are improperly reported.
15161 Reported by Mike Castle.
15162
15163 * src/conflicts.c (print_reductions): Fix.
15164 * tests/regression.at (Web2c): New.
15165
275fc3ad
AD
151662001-12-18 Akim Demaille <akim@epita.fr>
15167
15168 Some host fail on `assert (!"foo")', which expands to
15169 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
15170 Reported by Nelson Beebee.
15171
15172 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
15173 `#define it_succeeded 0' and `assert (it_succeeded)'.
15174
897668ee
MA
151752001-12-17 Marc Autret <autret_m@epita.fr>
15176
15177 * src/bison.simple: Don't hard code the skeleton line and filename.
15178 * src/output.c (output_parser): Rename 'line' as 'output_line'.
15179 New line counter 'skeleton_line' (skeleton-line muscle).
15180
ab3399e0
PE
151812001-12-17 Paul Eggert <eggert@twinsun.com>
15182
15183 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
15184 YYDEBUG must be defined to a nonzero value.
15185
15186 * src/bison.simple (yytname): Do not assume that the user defines
15187 YYDEBUG to a properly parenthesized expression.
15188
3877f72b
AD
151892001-12-17 Akim Demaille <akim@epita.fr>
15190
15191 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
15192 nlookaheads is a new member.
15193 Adjust all users.
15194 * src/lalr.h (nlookaheads): Remove this orphan declaration.
15195 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
15196 state.
776209d6 15197
331dbc1b
AD
151982001-12-17 Akim Demaille <akim@epita.fr>
15199
15200 * src/files.h, src/files.c (open_files, close_files): Remove.
15201 * src/main.c (main): Don't open/close files, nor invoke lex_free,
15202 let...
15203 * src/reader.c (reader): Do it.
776209d6 15204
be750e4c
AD
152052001-12-17 Akim Demaille <akim@epita.fr>
15206
15207 * src/conflicts.c (print_reductions): Formatting changes.
776209d6 15208
709ae8c6
AD
152092001-12-17 Akim Demaille <akim@epita.fr>
15210
15211 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
15212 (flush_reduce): New.
15213 (resolve_sr_conflict): Adjust.
776209d6 15214
f87685c3
AD
152152001-12-17 Akim Demaille <akim@epita.fr>
15216
15217 * src/output.c (output_obstack): Be static and rename as...
15218 (format_obstack): this, to avoid any confusion with files.c's
15219 output_obstack.
15220 * src/reader.h (muscle_obstack): Move to...
15221 * src/output.h: here, since it's defined in output.c.
15222
837491d8
AD
152232001-12-17 Akim Demaille <akim@epita.fr>
15224
15225 * src/output.c (action_row, save_column, default_goto)
15226 (sort_actions, matching_state, pack_vector): Better variable
15227 locality.
15228
796d61fb
AD
152292001-12-17 Akim Demaille <akim@epita.fr>
15230
15231 * src/output.c: Various formatting changes.
776209d6 15232
64d15509
AD
152332001-12-17 Akim Demaille <akim@epita.fr>
15234
15235 * src/files.c (output_files): Free the output_obstack.
15236 * src/main.c (main): Call print and print_graph conditionally.
15237 * src/print.c (print): Work unconditionally.
15238 * src/print_graph.c (print_graph): Work unconditionally.
15239 * src/conflicts.c (log_resolution): Output only if verbose_flag.
15240
fbc8ecb7
MA
152412001-12-16 Marc Autret <autret_m@epita.fr>
15242
15243 * src/output.c (actions_output): Fix. When we use %no-lines,
15244 there is one less line per action.
15245
f0440388
MA
152462001-12-16 Marc Autret <autret_m@epita.fr>
15247
15248 * src/bison.simple: Remove a useless #line directive.
15249 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
15250 * src/output.c (get_lines_number): New.
776209d6 15251 (output_parser): Adjust, now takes care about the lines of a
f0440388
MA
15252 output muscles.
15253 Fix line numbering.
15254 (actions_output): Computes the number of lines taken by actions.
15255 (output_master_parser): Insert new skeleton which is the name of
15256 the output parser file name.
15257
a79986b8
MA
152582001-12-15 Marc Autret <autret_m@epita.fr>
15259
15260 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
15261
4ec8e00f
MA
152622001-12-15 Marc Autret <autret_m@epita.fr>
15263
15264 * src/output.c (output_gram): Keep track of the hairy one.
15265
1a4648ff
AD
152662001-12-15 Akim Demaille <akim@epita.fr>
15267
15268 Make `make distcheck' work.
15269
15270 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
15271 system.h which uses libgettext.h.
15272
9c2c67e6
AD
152732001-12-15 Akim Demaille <akim@epita.fr>
15274
15275 * src/nullable.c (set_nullable): Useless rules must be skipped,
15276 otherwise, since we range over their symbols, we might look at a
15277 nonterminal which no longer ``exists'', i.e., it is not counted in
15278 `nvars', hence we overflow our arrays.
15279
93ede233
AD
152802001-12-15 Akim Demaille <akim@epita.fr>
15281
15282 The header can also be produced directly, without any obstack!
15283 Yahoo!
15284
15285 * src/files.c, src/files.h (defines_obstack): Remove.
15286 (compute_header_macro): Global.
15287 (defines_obstack_save): Remove.
15288 * src/reader.c (parse_union_decl): No longer output to
15289 defines_obstack: its content can be found in the `stype' muscle
15290 anyway.
15291 (output_token_translations): Merge into...
15292 (symbols_output): this.
15293 Rename as...
15294 (symbols_save): this.
15295 (reader): Adjust.
15296 * src/output.c (header_output): New.
15297 (output): Call it.
15298
2666f928
AD
152992001-12-15 Akim Demaille <akim@epita.fr>
15300
15301 * src/reader.c (parse_union_decl): Instead of handling two obstack
15302 simultaneously, use one to define the `stype' muscle, and use the
15303 value of the latter to fill defines_obstack.
15304 (copy_comment): Remove.
15305 (copy_comment2): Work for a single obstack.
15306 Rename as...
15307 (copy_comment): this.
15308
428046f8
AD
153092001-12-15 Akim Demaille <akim@epita.fr>
15310
15311 * src/lex.c, src/lex.h (xgetc): No longer static.
15312 * src/reader.c (parse_union_decl): Revamp.
15313
ea52d706
AD
153142001-12-15 Akim Demaille <akim@epita.fr>
15315
15316 Still making progress in separating Bison into (i) input, (ii)
15317 process, (iii) output: now we can directly output the parser file
15318 without using table_obstack at all.
15319
15320 * src/files.c, src/files.h (table_obstack): Bye bye.
15321 (parser_file_name): New.
15322 * src/files.c (compute_output_file_names): Compute it.
15323 * src/output.c (actions_output, output_parser)
15324 (output_master_parser): To a file instead of an obstack.
15325
3f96f4dc
AD
153262001-12-15 Akim Demaille <akim@epita.fr>
15327
15328 Attach actions to rules, instead of pre-outputting them to
15329 actions_obstack.
15330
15331 * src/gram.h (rule_t): action and action_line are new members.
15332 * src/reader.c (symbol_list): Likewise.
15333 (copy_action): Save the actions within the rule.
15334 (packgram): Save them in rule_table.
15335 * src/output.c (actions_output): New.
15336 (output_parser): Use it on `%%actions'.
15337 (output_rule_data): Don't free rule_table.
15338 (output): Do it.
15339 (prepare): Don't save the `action' muscle.
15340 * src/bison.simple: s/%%action/%%actions/.
15341
51576fb3
AD
153422001-12-15 Akim Demaille <akim@epita.fr>
15343
15344 * src/reader.c (copy_action): When --yacc, don't append a `;'
15345 to the user action: let it fail if lacking.
dee049eb 15346 Suggested by Arnold Robbins and Tom Tromey.
51576fb3 15347
2648a72d
AD
153482001-12-14 Akim Demaille <akim@epita.fr>
15349
15350 * src/lex.c (literalchar): Simply return the char you decoded, non
15351 longer mess around with obstacks and int pointers.
15352 Adjust all callers.
15353
92790e5b
AD
153542001-12-14 Akim Demaille <akim@epita.fr>
15355
15356 * src/lex.c (literalchar): Don't escape the special characters,
15357 just decode them, and keep them as char (before, eol was output as
15358 the 2 char string `\n' etc.).
15359 * src/output.c (output_rule_data): Use quotearg to output the
15360 token strings.
15361
927c1557
PE
153622001-12-13 Paul Eggert <eggert@twinsun.com>
15363
15364 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
15365 Do not infringe on the global user namespace when using C++.
15366 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
15367 All uses of `fprintf' and `stderr' changed.
15368
15369 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
15370
ed8e1f68
AD
153712001-12-13 Akim Demaille <akim@epita.fr>
15372
15373 The computation of nullable is broken: it doesn't handle empty
15374 RHS's properly.
15375
15376 * tests/torture.at (GNU AWK Grammar): New.
15377 * tests/sets.at (Nullable): New.
15378 * src/nullable.c (set_nullable): Instead of blindly looping over
15379 `ritems', loop over the rules, and then over their rhs's.
15380
15381 Work around Autotest bugs.
15382
15383 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
15384 frame, because Autotest understand lines starting with a `+' as
15385 traces from the shell. Then, they are not processed properly.
15386 Admittedly an Autotest bug, but we don't have time to wait for
15387 Autotest to catch up.
15388 * tests/regression.at (Broken Closure): Adjust to the new table
15389 frames.
15390 Move to...
15391 * tests/sets.at: here.
15392
cb581495
AD
153932001-12-13 Akim Demaille <akim@epita.fr>
15394
15395 * src/closure.c (closure): Use nrules instead of playing tricks
15396 with BITS_PER_WORD.
15397
2e729273
AD
153982001-12-13 Akim Demaille <akim@epita.fr>
15399
15400 * src/print.c (print_actions): Output the handling of `$' as the
15401 traces do: shifting the token EOF. Before EOF was treated as a
15402 nonterminal.
15403 * tests/regression.at: Adjust some tests.
15404 * src/print_graph.c (print_core): Complete the set of items via
15405 closure. The next-to-final and final states are still unsatisfying,
15406 but that's to be addressed elsewhere.
15407 No longer output the rule numbers, but do output the state number.
15408 A single loop for the shifts + gotos is enough, but picked a
15409 distinct color for each.
15410 (print_graph): Initialize and finalize closure.
15411
107f7dfb
AD
154122001-12-13 Akim Demaille <akim@epita.fr>
15413
15414 * src/reader.c (readgram): Remove dead code, an strip useless
15415 braces.
15416 (get_type): Remove, unused.
15417
9b53a24f
AD
154182001-12-12 Akim Demaille <akim@epita.fr>
15419
15420 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
15421 on that of lib/error.c.
15422
dbfb6dcd
AD
154232001-12-12 Akim Demaille <akim@epita.fr>
15424
15425 Some hosts don't like `/' in includes.
15426
15427 * src/system.h: Include libgettext.h without qualifying the path.
15428 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
15429 $(top_srcdir).
15430
c25fb648
MA
154312001-12-11 Marc Autret <autret_m@epita.fr>
15432
15433 * src/output.c (output_parser): Remove useless muscle.
15434
710ddc4f
MA
154352001-12-11 Marc Autret <autret_m@epita.fr>
15436
15437 * src/bison.simple: Remove #line just before %%epilogue. It
15438 is now handled in ...
15439 * src/reader.c (read_additionnal_code): Add the output of a
15440 #line for the epilogue.
15441
e83d80b8
MA
154422001-12-10 Marc Autret <autret_m@epita.fr>
15443
927c1557 15444 * src/reader.c (copy_definition): Re-use CPP-outed code which
e83d80b8
MA
15445 replace precedent remove.
15446 * src/bison.simple: Remove #line before %%prologue because
15447 %%input-line is wrong at this time.
15448
971d5158
MA
154492001-12-10 Marc Autret <autret_m@epita.fr>
15450
15451 * src/reader.c (symbols_output): Clean up.
927c1557 15452 * src/output.c (output_gram, output): Clean up.
971d5158 15453
5edafffd
AD
154542001-12-10 Akim Demaille <akim@epita.fr>
15455
15456 * src/lalr.c (initialize_lookaheads): New. Extracted from...
15457 * src/LR0.c (set_state_table): here.
15458 * src/lalr.c (lalr): Call it.
15459
0279f8e9
AD
154602001-12-10 Akim Demaille <akim@epita.fr>
15461
15462 * src/state.h (shifts): Remove the `number' member: shifts are
15463 attached to state, hence no longer need to be labelled with a
15464 state number.
15465
190c4f5f
AD
154662001-12-10 Akim Demaille <akim@epita.fr>
15467
15468 Now that states have a complete set of members, the linked list of
15469 shifts is useless: just fill directly the state's shifts member.
15470
15471 * src/state.h (shifts): Remove the `next' member.
15472 * src/LR0.c (first_state, last_state): Remove.
15473 Adjust the callers.
15474 (augment_automaton): Don't look for the shifts that must be added
15475 a shift on EOF: it is those of the state we looked for! But now,
15476 since shifts are attached, it is no longer needed to looking
15477 merely by its id: its number.
15478
2a73b93d
AD
154792001-12-10 Akim Demaille <akim@epita.fr>
15480
15481 * src/LR0.c (augment_automaton): Better variable locality.
15482 Remove an impossible branch: if there is a state corresponding to
15483 the start symbol being shifted, then there is shift for the start
15484 symbol from the initial state.
15485
74392f6a
AD
154862001-12-10 Akim Demaille <akim@epita.fr>
15487
15488 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
15489 only when appropriate: when insert_start_shifting_state' is not
15490 invoked.
15491 * tests/regression.at (Rule Line Numbers): Adjust.
15492
37c82725
AD
154932001-12-10 Akim Demaille <akim@epita.fr>
15494
15495 * src/LR0.c (augment_automaton): Now that all states have shifts,
15496 merge the two cases addition shifts to the initial state.
15497
6a164e0c
AD
154982001-12-10 Akim Demaille <akim@epita.fr>
15499
15500 * src/lalr.c (set_state_table): Move to...
15501 * src/LR0.c: here.
15502 * src/lalr.c (lalr): Don't call it...
15503 * src/LR0.c (generate_states): do it.
15504 * src/LR0.h (first_state): Remove, only the table is used.
15505
7215de24
AD
155062001-12-10 Akim Demaille <akim@epita.fr>
15507
15508 * src/LR0.h (first_shift, first_reduction): Remove.
15509 * src/lalr.c: Don't use first_shift: find shifts through the
15510 states.
15511
80e25d4d
AD
155122001-12-10 Akim Demaille <akim@epita.fr>
15513
15514 * src/LR0.c: Attach shifts to states as soon as they are
15515 computed.
15516 * src/lalr.c (set_state_table): Instead of assigning shifts to
15517 state, just assert that the mapping was properly done.
15518
0ab3728b
AD
155192001-12-10 Akim Demaille <akim@epita.fr>
15520
15521 * src/LR0.c (insert_start_shift): Rename as...
15522 (insert_start_shifting_state): this.
15523 (insert_eof_shifting_state, insert_accepting_state): New.
15524 (augment_automaton): Adjust.
15525 Better locality of the variables.
15526 When looking if the start_symbol is shifted from the initial
15527 state, using `while (... symbol != start_symbol ...)' sounds
15528 better than `while (... symbol < start_symbol ...)': If fail
15529 to see how the order between symbols could be relevant!
15530
78af9bbc
AD
155312001-12-10 Akim Demaille <akim@epita.fr>
15532
15533 * src/getargs.h: Don't declare `spec_name_prefix' and
15534 `spec_file_prefix', declared by src/files.h.
15535 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
15536 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
15537 * src/output.c (prepare): Adjust.
15538 * src/reader.c (symbols_output): Likewise.
15539 * src/vmsgetargs.c: Vaguely adjust, but who cares?
15540
bdef2a41
AD
155412001-12-10 Akim Demaille <akim@epita.fr>
15542
15543 * src/muscle_tab.c (muscle_init): NULL is a better default than
15544 `"0"'.
15545
3735969c
AD
155462001-12-10 Akim Demaille <akim@epita.fr>
15547
15548 * src/reader.c (reader): Calling symbols_output once is enough.
15549
49701457
AD
155502001-12-10 Akim Demaille <akim@epita.fr>
15551
15552 Now that states have a complete set of members, the linked list of
15553 reductions is useless: just fill directly the state's reductions
15554 member.
15555
15556 * src/state.h (struct reductions): Remove member `number' and
15557 `next'.
15558 * src/LR0.c (first_reduction, last_reduction): Remove.
15559 (save_reductions): Don't link the new reductions, store them in
15560 this_state.
15561 * src/lalr.c (set_state_table): No need to attach reductions to
15562 states, it's already done.
15563 * src/output.c (output_actions): No longer free the shifts, then
15564 the reductions, then the states: free all the states and their
15565 members.
15566
0edad749
AD
155672001-12-10 Akim Demaille <akim@epita.fr>
15568
15569 * src/options.c (OPTN, DRTV, BOTH): New.
15570 (option_table): Use them.
15571
0edad749
AD
15572 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
15573 the job of system.h.
15574 * src/options.c: Don't include stdio.h and xalloc.h for the same
15575 reasons.
15576
5449dd0f
AD
155772001-12-10 Akim Demaille <akim@epita.fr>
15578
15579 * src/output.c (output, prepare): Make sure the values of the
15580 muscles `action' and `prologue' are 0-terminated.
15581
a870c567
AD
155822001-12-10 Akim Demaille <akim@epita.fr>
15583
15584 Clean up GCC warnings.
15585
15586 * src/reader.c (copy_action): `buf' is not used.
15587 (parse_skel_decl): Be static.
15588 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
15589 * src/options.h (create_long_option_table): Have a real prototype.
15590 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
15591 (hash_delete_at): Return const void *.
15592 Adjust casts to preserve the const.
15593
80df8768
AD
155942001-12-10 Akim Demaille <akim@epita.fr>
15595
15596 * configure.in: Require 2.52g.
15597 M4 is not needed, but AUTOM4TE is.
15598 * m4/m4.m4: Remove.
15599 * tests/Makefile.am: Adjust.
15600
f693ad14
AD
156012001-12-10 Akim Demaille <akim@epita.fr>
15602
15603 One structure for states is enough, even though theoretically
15604 there are LR(0) states and LALR(1) states.
15605
15606 * src/lalr.h (state_t): Remove.
15607 (state_table): Be state_t **, not state_t *.
15608 * src/state.h (core, CORE_ALLOC): Rename as...
15609 (state_t, STATE_ALLOC): this.
15610 Add the LALR(1) members: shifts, reductions, errs.
15611 * src/LR0.c (state_table): Rename as...
15612 (state_hash): this, to avoid name clashes with the global
15613 `state_table'.
15614 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
15615 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
15616
74ffbcb6
AD
156172001-12-10 Akim Demaille <akim@epita.fr>
15618
15619 Bison dumps core on bash.y.
15620 Reported by Pascal Bart.
15621
15622 * src/warshall.c (bitmatrix_print): New.
15623 (TC): Use it.
ba0fe3c7 15624 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
74ffbcb6
AD
15625 j must be the outer loop.
15626 * tests/regression.at (Broken Closure): New.
15627
07708e19
AD
156282001-12-05 Akim Demaille <akim@epita.fr>
15629
15630 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
15631 its argument.
ba1ecc07 15632 Reported by Peter Hamorsky.
07708e19 15633
92b16366
AD
156342001-12-05 Akim Demaille <akim@epita.fr>
15635
15636 * src/conflicts.c (err_table): Remove.
15637 (resolve_sr_conflict): Adjust.
15638 * src/lalr.h (state_t.reduction_table, state_t.shift_table):
15639 Rename as...
15640 (state_t.reductions, state_t.shifts): this.
15641
076ab033
AD
156422001-12-05 Akim Demaille <akim@epita.fr>
15643
15644 * src/reduce.c (reduce_grammar_tables): No longer disable the
15645 removal of useless rules via CPP but via `if (0)', so that the
15646 compiler still check the code is valid.
15647 For instance, it should have noticed `rline' no longer exists: use
15648 the `line' member of rule_t.
15649 * src/gram.c (dummy, rline): Remove, unused.
15650
3843c413
AD
156512001-12-05 Akim Demaille <akim@epita.fr>
15652
15653 * src/output.c (pack_vector): Use assert, not berror.
15654 * src/main.c (berror): Remove, unused.
15655
43168960
AD
156562001-12-05 Akim Demaille <akim@epita.fr>
15657
15658 New experimental feature: if --verbose --trace output all the
15659 items of a state, not only its kernel.
15660
15661 * src/print.c (print_core): If `trace_flag', then invoke closure
15662 before outputting the items of the state (print_core is no longer
15663 a correct name them).
15664 (print_results): Invoke new_closure/free_closure if needed.
15665
b2872512
AD
156662001-12-05 Akim Demaille <akim@epita.fr>
15667
15668 * src/LR0.c (new_itemsets): Use nshifts only, not shiftcount.
15669 * src/closure.c, src/closure.h (itemsetsize): Rename as...
15670 (nitemset): for consistency with the rest of the project.
15671
23cbcc6c
AD
156722001-12-05 Akim Demaille <akim@epita.fr>
15673
15674 * src/closure.c (print_closure): Improve.
15675 (closure): Use it for printing input and output.
15676
03ec521c
AD
156772001-12-05 Akim Demaille <akim@epita.fr>
15678
15679 * src/closure.c (FIRSTS, FDERIVES): Adjust to reality: they are
15680 indexed by nonterminals.
15681
3a7456dd
AD
156822001-12-05 Akim Demaille <akim@epita.fr>
15683
15684 * src/warshall.c (TC, RTC): De-obsfucate (source reduced to 22% of
15685 what it was!).
15686 * src/warshall.h: Remove accidental duplication of the content.
15687
1cbcf2e7
AD
156882001-12-05 Akim Demaille <akim@epita.fr>
15689
15690 * src/closure.c (set_fderives): De-obfuscate.
15691
84182270
AD
156922001-12-05 Akim Demaille <akim@epita.fr>
15693
15694 * src/closure.c (print_firsts, print_fderives): De-obfuscate.
15695
3f6f053c
AD
156962001-12-05 Akim Demaille <akim@epita.fr>
15697
15698 * src/closure.c (set_firsts): De-obfuscate.
15699
7a5350ba
AD
157002001-12-05 Akim Demaille <akim@epita.fr>
15701
15702 * src/output.c (action_row): De-obfuscate
15703 using the good o' techniques: arrays not pointers, variable
15704 locality, BITISSET, RESETBIT etc.
15705
d954473d
AD
157062001-12-05 Akim Demaille <akim@epita.fr>
15707
15708 Pessimize the code to simplify it: from now on, all the states
15709 have a valid SHIFTS, which NSHIFTS is possibly 0.
15710
15711 * src/LR0.c (shifts_new): Be global and move to..
15712 * src/state.c, src/state.h: here.
15713 * src/conflicts, src/lalr.c, src/output.c, src/print.c,
15714 * src/print_graph: Adjust.
15715
9839bbe5
AD
157162001-12-05 Akim Demaille <akim@epita.fr>
15717
15718 * src/state.h (SHIFT_DISABLE, SHIFT_IS_DISABLED): New.
15719 * src/conflicts.c: Use it.
15720 Restore a few missing `if (!SHIFT_IS_DISABLED)' which were
15721 incorrectly ``simplified''.
15722
9f136c07
AD
157232001-12-05 Akim Demaille <akim@epita.fr>
15724
15725 * src/conflicts.c (flush_shift, resolve_sr_conflict): De-obfuscate
15726 using the good o' techniques: arrays not pointers, variable
15727 locality, BITISSET, RESETBIT etc.
15728
b608206e
AD
157292001-12-05 Akim Demaille <akim@epita.fr>
15730
15731 * src/state.h (SHIFT_SYMBOL): New.
15732 * src/conflicts.c: Use it to deobfuscate.
15733
52afa962
AD
157342001-12-05 Akim Demaille <akim@epita.fr>
15735
15736 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts)
15737 (print_reductions): De-obfuscate using the good o' techniques:
15738 arrays not pointers, variable locality, BITISSET.
15739
e74dc321
AD
157402001-12-05 Akim Demaille <akim@epita.fr>
15741
15742 * src/conflicts.c (print_reductions): Arrays, not pointers.
15743 Use BITISSET.
15744
768fca83
AD
157452001-12-05 Akim Demaille <akim@epita.fr>
15746
15747 * src/conflicts.c (print_reductions): Pessimize, but clarify.
15748
a17e599f
AD
157492001-12-05 Akim Demaille <akim@epita.fr>
15750
15751 * src/conflicts.c (print_reductions): Improve variable locality.
15752
a04bc341
AD
157532001-12-05 Akim Demaille <akim@epita.fr>
15754
15755 * src/conflicts.c (print_reductions): Pessimize, but clarify.
15756
c8ea038e
AD
157572001-12-05 Akim Demaille <akim@epita.fr>
15758
15759 * src/conflicts.c (print_reductions): Improve variable locality.
15760
aa2aab3c
AD
157612001-12-05 Akim Demaille <akim@epita.fr>
15762
15763 * src/state.h (SHIFT_IS_ERROR, SHIFT_IS_GOTO, SHIFT_IS_SHIFT): New.
15764 * src/lalr.c: Use them.
15765
b178c8cc
AD
157662001-12-05 Akim Demaille <akim@epita.fr>
15767
15768 * src/LR0.c (augment_automaton): Formatting changes.
15769 Better variable locality.
15770
f67d13aa
AD
157712001-12-05 Akim Demaille <akim@epita.fr>
15772
15773 * src/lalr.c (matrix_print): New.
15774 (transpose): Use it.
15775 Use arrays instead of pointers.
15776
c2713865
AD
157772001-12-05 Akim Demaille <akim@epita.fr>
15778
15779 * src/lalr.c (maxrhs): Move to...
15780 * src/gram.c, src/gram.h (ritem_longest_rhs): here.
15781 * src/lalr.c (build_relations): Adjust.
15782
9887c18a
AD
157832001-12-05 Akim Demaille <akim@epita.fr>
15784
15785 * src/lalr.c (transpose): Free the memory allocated to the
15786 argument, as it is replaced by the results by the unique caller.
15787 (build_relations): Merely invoke transpose: it handles the memory
15788 deallocation.
15789 Improve variable locality.
15790 Avoid variables used as mere abbreviations.
15791 (compute_lookaheads): Use arrays instead of pointers.
15792
4d4f699c
AD
157932001-12-05 Akim Demaille <akim@epita.fr>
15794
15795 * src/lalr.c (initialize_F): Improve variable locality.
15796 Avoid variables used as mere abbreviations.
15797
80a69750
AD
157982001-12-05 Akim Demaille <akim@epita.fr>
15799
15800 * src/derives.c (print_derives): Display the ruleno.
15801 * src/lalr.c (initialize_F, transpose): Better variable locality
15802 to improve readability.
15803 Avoid variables used as mere abbreviations.
15804
fe961097
AD
158052001-12-05 Akim Demaille <akim@epita.fr>
15806
15807 * src/lalr.c (traverse): Use arrays instead of pointers.
15808
e3e4e814
AD
158092001-12-05 Akim Demaille <akim@epita.fr>
15810
15811 * src/nullable.c (set_nullable): Use a for loop to de-obfuscate
15812 the handling of squeue.
15813 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
15814
630e182b
AD
158152001-12-05 Akim Demaille <akim@epita.fr>
15816
15817 Because useless nonterminals are now kept alive (instead of being
15818 `destroyed'), we now sometimes examine them, and store information
15819 related to them. Hence we need to know their number, and adjust
15820 memory allocations.
15821
15822 * src/reduce.c, src/reduce.h (nuseless_nonterminals): No longer
15823 static.
15824 * src/LR0.c (allocate_itemsets): The memory allocated to
15825 `symbol_count' was used for two different purpose: once to count
15826 the number of occurrences of each symbol, and later reassigned to
15827 `shift_symbol', containing the symbol that can be shifted from a
15828 given state.
15829 Deobfuscate, i.e., allocate, use and free `symbol_count' here
15830 only, and...
15831 (new_itemsets): Allocate `shift_symbol' here.
15832 (allocate_itemsets): symbol_count includes useless nonterminals.
15833 Make room for them.
15834 (free_storage): Use `free', not `XFREE', for pointers that cannot
15835 be null.
15836
81b51460
AD
158372001-12-05 Akim Demaille <akim@epita.fr>
15838
15839 * src/nullable.c (set_nullable): Deobfuscate the handling of
15840 ritem.
15841 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
15842
3067fbef
AD
158432001-12-05 Akim Demaille <akim@epita.fr>
15844
15845 * src/gram.c, src/gram.h (ritem_print): New.
15846 * src/gram.c (dummy): Remove, now there is actual code in gram.c.
15847 (This useless function was defined only to work around VMS linkers
15848 that can't handle compilation units with variables only).
15849 * src/reduce.c (dump_grammar): Use it to trace the construction of
15850 ritem.
15851
c2bea5f9
PE
158522001-12-04 Paul Eggert <eggert@twinsun.com>
15853
7d27c823
PE
15854 * src/bison.simple (union yyalloc): Change member names
15855 to be the same as the stack names.
15856 (yyparse): yyptr is now union yyalloc *, not char *.
15857 (YYSTACK_RELOCATE): Likewise. This avoids a GCC warning,
15858 and may generate better code on some machines.
c2bea5f9
PE
15859 (yystpcpy): Use prototype if __STDC__ is defined, not just
15860 if __cplusplus is defined.
35687a9d 15861
2c8a9dfa
AD
158622001-11-30 Akim Demaille <akim@epita.fr>
15863
15864 * configure.in (WARNING_CFLAGS): Add -Werror when possible.
15865 (CFLAGS): Do not include the WARNING_CFLAGS here, since GNU
15866 Gettext doesn't compile cleanly, and dies with -Werror.
15867 * src/Makefile.am, lib/Makefile.am, tests/atlocal.in (CFLAGS):
15868 Include WARNING_CFLAGS here.
15869 * lib/xstrdup.c: Include xalloc.h, so that xstrdup be declared
15870 before being defined.
15871
f4e421e6
AD
158722001-11-27 Paul Eggert <eggert@twinsun.com>
15873
15874 * lib/quotearg.h (quotearg_n, quotearg_n_style):
15875 First arg is int, not unsigned.
15876 * lib/quotearg.c (quotearg_n, quotearg_n_style): Likewise.
15877 (SIZE_MAX, UINT_MAX): New macros.
15878 (quotearg_n_options): Abort if N is negative.
15879 Avoid overflow check on hosts where size_t is 64 bits and int
15880 is 32 bits, as overflow is impossible there.
15881 Fix off-by-one typo that caused unnecessary reallocation.
15882
7093d0f5
AD
158832001-11-29 Paul Eggert <eggert@twinsun.com>
15884
15885 Name space cleanup in generated parser.
15886
15887 * doc/bison.texinfo (Bison Parser): Discuss system headers
15888 and their effect on the user name space.
15889
15890 * src/bison.simple:
15891 (YYSTACK_ALLOC, YYSTACK_FREE, union yyalloc, YYSTACK_GAP_MAX,
15892 YYSTACK_BYTES, YYSTACK_RELOCATE): Do not define unless necessary,
15893 i.e. unless ! defined (yyoverflow) || defined (YYERROR_VERBOSE).
15894
15895 (YYSIZE_T): New macro. Use it instead of size_t, to avoid infringing
15896 on user names when possible.
15897
15898 (YYSTACK_USE_ALLOCA): Do not define; just use any existing defn.
15899 Simplify test for whather <alloca.h> exists.
15900
15901 (<stdlib.h>): Include if we will use malloc, and if standard C or C++.
15902
15903 (<stdio.h>): Include if YYDEBUG.
15904
15905 (yymemcpy): Renamed from __yy_memcpy. Do not define unless
15906 ! defined (yyoverflow) && ! defined (yymemcpy).
15907
15908 (yymemcpy, yyparse): Rename local variables as needed so that
15909 they all begin with 'yy'.
15910
15911 (yystrlen, yystpcpy): New functions.
15912
15913 (YY_DECL_NON_LSP_VARIABLES): Renamed from _YY_DECL_VARIABLES.
15914 All uses changed.
15915
15916 (yyparse): size_t -> YYSIZE_T. Use yystrlen and yystpcpy
15917 instead of relying on string.h functions. Use YYSTACK_ALLOC
15918 and YYSTACK_FREE instead of malloc and free.
15919
fd51e5ff
AD
159202001-11-30 Akim Demaille <akim@epita.fr>
15921
15922 * src/bison.simple (YYSTYPE, YYLTYPE): Move their definitions
15923 before their first uses.
15924 (YYBISON, YYPURE): Move to the top of the output.
15925
7d13ff5f
AD
159262001-11-30 Akim Demaille <akim@epita.fr>
15927
15928 * tests/reduce.at (Useless Nonterminals): Fix.
15929
892a3995
AD
159302001-11-30 Akim Demaille <akim@epita.fr>
15931
15932 * src/bison.simple (YYSTACK_FREE): Use `do {;} while (0)' as empty
15933 if body instead of `;' to pacify GCC's warnings.
15934
68f1e3ed
AD
159352001-11-30 Akim Demaille <akim@epita.fr>
15936
15937 Instead of mapping the LHS of unused rules to -1, keep the LHS
15938 valid, but flag the rules as invalid.
15939
15940 * src/gram.h (rule_t): `useful' is a new member.
15941 * src/print.c (print_grammar): Adjust.
15942 * src/derives.c (set_derives): Likewise.
15943 * src/reader.c (packgram, reduce_output): Likewise.
15944 * src/reduce.c (reduce_grammar_tables): Likewise.
15945 * tests/reduce.at (Underivable Rules, Useless Rules): New.
15946
d2d1b42b
AD
159472001-11-30 Akim Demaille <akim@epita.fr>
15948
15949 * src/reduce.c (reduce_output): Formatting changes.
15950 * src/print.c (print_results, print_grammar): Likewise.
15951 * tests/regression.at (Rule Line Numbers)
15952 (Solved SR Conflicts, Unresolved SR Conflicts): Adjust.
15953
760b53a8
AD
159542001-11-30 Akim Demaille <akim@epita.fr>
15955
15956 * src/reduce.c (nonterminals_reduce): Instead of throwing away
15957 useless nonterminals, move them at the end of the symbol arrays.
15958 (reduce_output): Adjust.
15959 * tests/reduce.at (Useless Nonterminals): Adjust.
15960
00238958
AD
159612001-11-30 Akim Demaille <akim@epita.fr>
15962
15963 * src/reduce.c: Various comment/formatting changes.
15964 (nonterminals_reduce): New, extracted from...
15965 (reduce_grammar_tables): here.
15966 (reduce_grammar): Call nonterminals_reduce.
15967
396452de
PE
159682001-11-29 Paul Eggert <eggert@twinsun.com>
15969
15970 * src/bison.simple (YYSTACK_REALLOC): Remove.
15971 (YYSTACK_ALLOC): Resurrect this macro, with its old meaning.
15972 (YYSTACK_FREE, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYSTACK_RELOCATE):
15973 New macros.
15974 (union yyalloc): New type.
15975 (__yy_memcpy): Last arg is size_t, not unsigned int, to remove
15976 an arbitrary restriction on hosts where size_t is wider than int.
15977
15978 (yyparse): Don't dump core if alloca or malloc fails; instead, report
15979 a parser stack overflow. Allocate just one block of memory for all
15980 three stacks, instead of allocating three blocks; this typically is
15981 faster and reduces fragmentation.
15982
15983 Do not limit the number of items in the stack to a value that fits
15984 in 'int', as this is an arbitrary limit on hosts with 64-bit
15985 size_t and 32-bit int.
15986
147e184c
MA
159872001-11-29 Marc Autret <autret_m@epita.fr>
15988
15989 * tests/calc.at [AT_DATA_CALC_Y]: Use %error-verbose instead
15990 of defining YYERROR_VERBOSE.
15991 [AT_DATA]: $4 is now out of C declarations in the prologue.
15992
426cf563
MA
159932001-11-28 Marc Autret <autret_m@epita.fr>
15994
15995 * src/reader.c (parse_dquoted_param): New.
15996 (parse_skel_decl): Use it.
15997 * src/lex.h: Add its prototype.
15998 * src/lex.c (literalchar): Become not static.
15999
c7925b99
MA
160002001-11-28 Marc Autret <autret_m@epita.fr>
16001
16002 * src/output.h: And put its extern declaration here.
16003 * src/output.c (error_verbose): Define here.
16004 (prepare): Echo name modification.
16005 * src/getargs.h: Clean its extern declaration.
16006 * src/getargs.c (error_verbose_flag): Remove.
16007 (getargs): Remove case 'e'.
16008 * src/options.c (option_table): 'error-verbose' is now seen as simple
16009 percent option.
16010 Include output.h.
16011
16012 * src/reader.c (read_declarations): Remove case tok_include.
16013 (parse_include_decl): Remove.
16014 * src/lex.h (token_t): Remove tok_include.
16015 * src/options.c (option_table): 'include' is now a simple command line
16016 option.
16017
5b5d1929
MA
160182001-11-28 Marc Autret <autret_m@epita.fr>
16019
16020 * src/bison.simple: Adjust muscle names.
16021 * src/muscle_tab.c (muscle_init): Also rename the muscles.
16022 * src/output.c (prepare): s/_/-/ for the muscles names.
16023 (output_parser): When scanning for a muscle, allow '-' instead of '_'.
16024
8850be4b
MA
160252001-11-28 Marc Autret <autret_m@epita.fr>
16026
16027 * src/bison.simple: Fix debug.
16028 [YYERROR_VERBOSE]: Re-integrate as an internal macro.
16029
4a38e613
AD
160302001-11-28 Akim Demaille <akim@epita.fr>
16031
16032 * src/LR0.c (shifts_new): New.
16033 (save_shifts, insert_start_shift, augment_automaton): Use it.
16034
4b35e1c1
AD
160352001-11-28 Akim Demaille <akim@epita.fr>
16036
16037 * src/closure.c (closure): `b' and `ruleno' denote the same value:
16038 keep ruleno only.
16039
d2b04478
AD
160402001-11-28 Akim Demaille <akim@epita.fr>
16041
16042 * src/closure.c (closure): Instead of looping over word in array
16043 then bits in words, loop over bits in array.
16044
2c4c30aa
AD
160452001-11-28 Akim Demaille <akim@epita.fr>
16046
16047 * src/closure.c (closure): No longer optimize the special case
16048 where all the bits of `ruleset[r]' are set to 0, to make the code
16049 clearer.
16050
576890b7
AD
160512001-11-28 Akim Demaille <akim@epita.fr>
16052
16053 * src/closure.c (closure): `r' and `c' are new variables, used to
16054 de-obfuscate accesses to RULESET and CORE.
16055
cb487d7d
AD
160562001-11-28 Akim Demaille <akim@epita.fr>
16057
16058 * src/reduce.c (reduce_print): Use ngettext.
16059 (dump_grammar): Improve the trace accuracy.
16060
6013d43f
AD
160612001-11-28 Akim Demaille <akim@epita.fr>
16062
16063 * src/reduce.c (dump_grammar): Don't translate trace messages.
16064
cb4956ee
AD
160652001-11-28 Akim Demaille <akim@epita.fr>
16066
16067 * tests/reduce.at (Useless Terminals, Useless Nonterminals): New.
16068 * src/reduce.c (reduce_grammar_tables): Do not free useless tags,
16069 as all tags are free'ed afterwards.
16070 From Enrico Scholz.
16071
648185ab
PE
160722001-11-27 Paul Eggert <eggert@twinsun.com>
16073
16074 * src/bison.simple (YYSTACK_REALLOC): Fix typo that caused us to
16075 use alloca when we didn't want to, and vice versa.
16076
68254a03
MA
160772001-11-27 Marc Autret <autret_m@epita.fr>
16078
9113b58f
AD
16079 * src/muscle_tab.c (muscle_init): Remove 'verbose' muscle
16080 initialization.
68254a03
MA
16081 * src/output.c (prepare): Remove its update.
16082
04d843a2
MA
160832001-11-27 Marc Autret <autret_m@epita.fr>
16084
16085 * tests/torture.at [AT_DATA]: Remove YYERROR_VERBOSE definition.
16086 Use %error-verbose.
16087
d2079671 160882001-11-27 Marc Autret <autret_m@epita.fr>
eeeb962b
MA
16089
16090 * src/bison.simple: Remove YYERROR_VERBOSE using.
16091 Use %%error_verbose.
16092 (yyparse): Likewise.
16093 * src/output.c (prepare): Give its final value.
16094 * src/muscle_tab.c (muscle_init): Init new muscle 'error_verbose'.
16095 * src/getargs.h: Add its extern declaration.
16096 * src/getargs.c (error_verbose_flag): New int.
16097 (getargs): Update to catch new case.
16098 * src/options.c (option_table): 'error-verbose' is a new option.
16099 (shortopts): Update.
16100
e0327bc8
AD
161012001-11-27 Akim Demaille <akim@epita.fr>
16102
16103 * src/system.h: Use intl/libgettext.h.
16104 * src/Makefile.am (INCLUDES): Add -I $(top_srcdir).
16105
000f1a3c
AD
161062001-11-27 Akim Demaille <akim@epita.fr>
16107
16108 * tests/torture.at (Exploding the Stack Size with Malloc):
16109 s/YYSTACK_USE_ALLOCA_ALLOCA/YYSTACK_USE_ALLOCA/.
16110
26cfe0be
AD
161112001-11-27 Akim Demaille <akim@epita.fr>
16112
16113 * src/files.c: Include error.h.
16114 Reported by Hans Aberg.
16115
f6bd5427
MA
161162001-11-26 Marc Autret <autret_m@epita.fr>
16117
d2079671 16118 * src/reader.c (parse_include_decl): New, not yet implemented.
f6bd5427
MA
16119 (read_declarations): Add case tok_include.
16120 * src/getargs.h (include): Add its extern definition.
16121 * src/getargs.c (include): New const char *.
16122 (getargs): Add case '-I'.
16123 * src/options.c (option_table): Add include as command line and
16124 percent option.
16125 * src/lex.h (token_t): Add tok_include.
16126
2ca209c1
AD
161272001-11-26 Akim Demaille <akim@epita.fr>
16128
16129 * src/reader.c (readgram): Make sure rules for mid-rule actions
16130 have a lineno equal to that of their host rule.
16131 Reported by Hans Aberg.
16132 * tests/regression.at (Rule Line Numbers): New.
16133
0e41b407
AD
161342001-11-26 Akim Demaille <akim@epita.fr>
16135
16136 * src/LR0.c (allocate_itemsets): kernel_size contains ints, not
16137 size_ts.
16138
161392001-11-26 Akim Demaille <akim@epita.fr>
16140
16141 * src/complain.c, src/complain.h (error): Remove, provided by
16142 lib/error.[ch].
16143
e0c40012
AD
161442001-11-26 Akim Demaille <akim@epita.fr>
16145
16146 * src/reader.c (read_declarations): Don't abort on tok_illegal,
16147 issue an error message.
16148 * tests/regression.at (Invalid %directive): New.
16149 Reported by Hans Aberg.
16150
5e147124
AD
161512001-11-26 Akim Demaille <akim@epita.fr>
16152
16153 * configure.in: Invoke AC_FUNC_OBSTACK and AC_FUNC_ERROR_AT_LINE.
16154 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
16155
a034c8b8
AD
161562001-11-26 Akim Demaille <akim@epita.fr>
16157
16158 * src/conflicts.c (conflicts_print): Don't complain at all when
16159 there are no reduce/reduce conflicts, and as many shift/reduce
16160 conflicts as expected.
16161 * tests/regression.at (%expect right): Adjust.
16162
c64a20f3
AD
161632001-11-23 Akim Demaille <akim@epita.fr>
16164
16165 * lib/alloca.c: Update, from fileutils.
16166
5b0d29bb
AD
161672001-11-23 Akim Demaille <akim@epita.fr>
16168
16169 * lib/Makefile.am (libbison_a_LIBADD): Add @ALLOCA@.
16170
722c4bfe
AD
161712001-11-23 Akim Demaille <akim@epita.fr>
16172
16173 * src/system.h: Include alloca.h.
16174 * src/main.c (main) [C_ALLOCA]: Call alloca (0).
16175
6255b435
AD
161762001-11-23 Akim Demaille <akim@epita.fr>
16177
16178 * src/print_graph.c (print_actions): Remove `rule', unused.
16179 * src/LR0.c (kernel_size): Contain `int' instead of `size_t' to
16180 pacify GCC's signed < unsigned warnings.
16181 * src/closure.c (itemsetsize): Likewise.
16182 * src/reader.c (symbol_list_new): Static.
16183
b29b2ed5
AD
161842001-11-23 Akim Demaille <akim@epita.fr>
16185
16186 Attaching lineno to buckets is stupid, since only one copy of each
16187 symbol is kept, only the line of the first occurrence is kept too.
16188
16189 * src/symtab.h, src/symtab.c (bucket): Remove the line member.
16190 * src/reader.c (rline_allocated): Remove, unused.
16191 (symbol_list): Have a `line' member.
16192 (symbol_list_new): New.
16193 (readgram): Use it.
16194 * src/print.c (print_grammar): Output the rule line numbers.
16195 * tests/regression.at (Solved SR Conflicts)
16196 (Unresolved SR Conflicts): Adjust.
16197 Reported by Hans Aberg.
16198
a81b1d4a
MA
161992001-11-22 Marc Autret <autret_m@epita.fr>
16200
16201 * src/bison.simple [YYERROR_VERBOSE]: Force its value to be 1 or 0.
16202
c1ecb3c1
MA
162032001-11-22 Marc Autret <autret_m@epita.fr>
16204
16205 * src/muscle_tab.c (muscle_init): Remove initialization of
16206 skeleton muscle.
16207 * src/output.c (output_master_parser): Do it here.
16208
fbe01355
AD
162092001-11-20 Akim Demaille <akim@epita.fr>
16210
16211 * po/sv.po: New.
16212 * configure.in (ALL_LINGUAS): Adjust.
16213 * po/POTFILE.in: Remove `nullable.c' and `derives.c' which no
16214 longer contains strings to translate.
16215
81e895c0
AD
162162001-11-19 Akim Demaille <akim@epita.fr>
16217
16218 * src/conflicts.c (conflicts_print): Add a missing \n.
16219
6bb1878b
AD
162202001-11-19 Akim Demaille <akim@epita.fr>
16221
16222 * src/nullable.c (nullable_print): New.
16223 (set_nullable): Call it when tracing.
16224 Better locality of variables.
16225
d9ec2d07
AD
162262001-11-19 Akim Demaille <akim@epita.fr>
16227
16228 * src/print.c (print_actions): Better locality of variables.
16229
720e5c1b
AD
162302001-11-19 Akim Demaille <akim@epita.fr>
16231
16232 * src/derives.c (print_derives): Fix and enrich.
16233 * src/closure.c (print_fderives): Likewise.
16234
fb908786
AD
162352001-11-19 Akim Demaille <akim@epita.fr>
16236
16237 * src/closure.c (itemsetend): Remove, replaced with...
16238 (itemsetsize): new.
16239
125ecb56
AD
162402001-11-19 Akim Demaille <akim@epita.fr>
16241
16242 * src/LR0.c (kernel_end): Remove, replaced with...
16243 (kernel_size): new.
16244
d8cf039f
AD
162452001-11-19 Akim Demaille <akim@epita.fr>
16246
16247 * src/conflicts.c (set_conflicts): Use arrays instead of pointers
16248 to clarify.
16249
7bec0760
AD
162502001-11-19 Akim Demaille <akim@epita.fr>
16251
16252 * src/closure.c (closure): Use arrays instead of pointers to clarify.
16253
c87d4863
AD
162542001-11-19 Akim Demaille <akim@epita.fr>
16255
16256 * src/closure.c, src/derives.c, src/nullable.c: Adjust various
16257 trace messages.
16258 * src/LR0.c: Likewise.
16259 (allocate_itemsets): Use arrays instead of pointers to clarify.
16260
9bfe901c
AD
162612001-11-19 Akim Demaille <akim@epita.fr>
16262
16263 * src/getargs.c (statistics_flag): Replace with...
16264 (trace_flag): New.
16265 (longopts): Accept --trace instead of --statistics.
16266 * src/getargs.h, src/options.c: Adjust.
16267 * src/LR0.c, src/closure.c, src/derives.c, src/nullable.c,
16268 * src/reduce.c: Use trace_flags instead of the CPP conditional TRACE.
16269
97db7bd4
AD
162702001-11-19 Akim Demaille <akim@epita.fr>
16271
cc72668c 16272 * src/LR0.c (new_itemsets, get_state): Use more arrays and fewer
97db7bd4
AD
16273 pointers to clarify the code.
16274 (save_reductions, save_shifts): Factor common parts of alternatives.
16275
2c5f66ed
AD
162762001-11-19 Akim Demaille <akim@epita.fr>
16277
16278 * src/LR0.c (new_state, get_state): Complete TRACE code.
16279 * src/closure.c: Include `reader.h' to get `tags', needed by the
16280 trace code.
16281 Rename the conditional DEBUG as TRACE.
16282 Output consistently TRACEs to stderr, not stdout.
16283 * src/derives.c: Likewise.
16284 * src/reduce.c: (inaccessable_symbols): Using if is better style
16285 than goto.
16286 Use `#if TRACE' instead of `#if 0' for tracing code.
16287
300f275f
AD
162882001-11-19 Akim Demaille <akim@epita.fr>
16289
16290 * src/system.h (LIST_FREE, shortcpy): New.
16291 * src/LR0.c: Use them.
16292 * src/output.c (free_itemsets, free_reductions, free_shifts):
16293 Remove, replaced by LIST_FREE.
16294
f59c437a
AD
162952001-11-19 Akim Demaille <akim@epita.fr>
16296
16297 * src/state.h (CORE_ALLOC, SHIFTS_ALLOC, ERRS_ALLOC)
16298 (REDUCTIONS_ALLOC): New.
16299 * src/LR0.c, src/conflicts.c: Use them to de-obfuscate memory
16300 allocation.
16301
6986fd9e
AD
163022001-11-19 Akim Demaille <akim@epita.fr>
16303
16304 * src/LR0.c (new_state): Complete trace code.
16305 * src/nullable.c (set_nullable): Don't translate traces.
16306
4bc30f78
AD
163072001-11-19 Akim Demaille <akim@epita.fr>
16308
16309 * src/print_graph.c (print_core): Better locality of variables.
16310 * src/print.c (print_core): Likewise.
16311
08a946e0
AD
163122001-11-19 Akim Demaille <akim@epita.fr>
16313
16314 * src/vcg.c: You do the output, so you are responsible of the
16315 handling of VCG syntax, in particular: use quotearg.
16316 * src/print_graph.c: Don't.
16317 (print_actions): Don't output the actions as part of the nodes,
16318 since that's the job of the edges.
16319 (print_state): Don't output by hand: fill the node description,
9bfe901c 16320 and ask for its output.
08a946e0 16321
f0473484
AD
163222001-11-19 Akim Demaille <akim@epita.fr>
16323
cc72668c
AD
16324 * src/bison.simple (yyparse): When verbosely reporting an error,
16325 no longer put additional quotes around token names.
f0473484
AD
16326 * tests/calc.at: Adjust.
16327
e41dc700
AD
163282001-11-19 Akim Demaille <akim@epita.fr>
16329
16330 * src/symtab.h, src/symtab.c: `line' is a new member of `bucket'.
16331 * src/reader.c (record_rule_lines, rline, rline_allocated): Remove.
16332 * src/output.c: Adjust.
16333
652a871c
AD
163342001-11-19 Akim Demaille <akim@epita.fr>
16335
16336 * src/gram.h (rprec, rprecsym, rassoc): Remove, now part of...
16337 (rule_t): this.
16338 * src/conflicts.c, src/reader.c, src/reduce.c: Adjust.
16339
b2ed6e58
AD
163402001-11-19 Akim Demaille <akim@epita.fr>
16341
16342 * src/gram.h (rule_t): New.
16343 (rule_table): New.
16344 (rrhs, rlhs): Remove, part of state_t.
16345 * src/print_graph.c, src/closure.c, src/conflicts.c, src/derives.c,
16346 * src/lalr.c, src/nullable.c, src/output.c, src/print.c,
16347 * src/reader.c, src/reduce.c: Adjust.
16348
edad7067
AD
163492001-11-19 Akim Demaille <akim@epita.fr>
16350
16351 * src/reader.c (symbols_output): New, extracted from...
16352 (packsymbols): Here.
16353 (reader): Call it.
16354
3feec034
AD
163552001-11-19 Akim Demaille <akim@epita.fr>
16356
16357 * src/lalr.c (set_maxrhs, maxrhs): Remove, replaced with...
16358 (maxrhs): this new function.
16359
ddcd5fdf
AD
163602001-11-19 Akim Demaille <akim@epita.fr>
16361
cc72668c 16362 * src/lalr.c (F): New macro to access the variable F.
ddcd5fdf
AD
16363 Adjust.
16364
bb527fc2
AD
163652001-11-19 Akim Demaille <akim@epita.fr>
16366
cc72668c 16367 * src/lalr.h (LA): New macro to access the variable LA.
bb527fc2
AD
16368 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
16369 * src/lalr.c: Adjust.
16370
a845a697
AD
163712001-11-19 Akim Demaille <akim@epita.fr>
16372
16373 * src/lalr.c (initialize_LA): Only initialize LA. Let...
16374 (set_state_table): handle the `lookaheads' members.
16375
f004bf6a
AD
163762001-11-19 Akim Demaille <akim@epita.fr>
16377
cc72668c
AD
16378 * src/lalr.h (lookaheads): Removed array, whose contents is now
16379 a member of...
f004bf6a
AD
16380 (state_t): this structure.
16381 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
16382 Adjust.
16383
de326cc0
AD
163842001-11-19 Akim Demaille <akim@epita.fr>
16385
cc72668c
AD
16386 * src/lalr.h (consistent): Removed array, whose contents is now
16387 a member of...
de326cc0
AD
16388 (state_t): this structure.
16389 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
16390 Adjust.
16391
90b4416b
AD
163922001-11-19 Akim Demaille <akim@epita.fr>
16393
cc72668c
AD
16394 * src/lalr.h (reduction_table, shift_table): Removed arrays, whose
16395 contents are now members of...
90b4416b
AD
16396 (state_t): this structure.
16397 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
16398 Adjust.
16399
9703cc49
AD
164002001-11-19 Akim Demaille <akim@epita.fr>
16401
16402 * src/lalr.h (state_t): New.
16403 (state_table): Be a state_t * instead of a core **.
16404 (accessing_symbol): Remove, part of state_t.
16405 * src/lalr.c: Adjust.
16406 (set_accessing_symbol): Merge into...
16407 (set_state_table): this.
16408 * src/print_graph.c, src/conflicts.c: Adjust.
16409
d803322e
AD
164102001-11-14 Akim Demaille <akim@epita.fr>
16411
16412 * tests/calc.at, tests/output.at, tests/regression.at,
16413 * tests/testsuite.at, tests/torture.at: Rely on Autotest 2.52g:
16414 now the tests are run in private dirs, therefore AC_CLEANUP and
16415 family can be simplified to 0-ary.
16416 * tests/atlocal.in: Now that we run `elsewhere' than in tests/,
16417 use abs. path to find config.h.
16418 * tests/calc.at (AT_CHECK_CALC): Don't try to check the compiler's
16419 stderr, there can be way too much random noise.
16420 Instead pass -Werror to GCC and rely on the exit status.
16421 Reported by Wolfram Wagner.
16422
3d76b07d
AD
164232001-11-14 Akim Demaille <akim@epita.fr>
16424
16425 * src/bison.simple (yyparse): Let yyls1, yyss1 and yyvs1 be
16426 defined only if yyoverflow is defined, to avoid `warning: unused
16427 variable `yyvs1''.
16428 Reported by The Test Suite.
16429
09b503c8
AD
164302001-11-14 Akim Demaille <akim@epita.fr>
16431
16432 * src/print.c: Include reduce.h.
16433 Reported by Hans Aberg.
16434
164352001-11-14 Akim Demaille <akim@epita.fr>
16436
16437 * src/lex.c, src/lex.h (token_buffer, unlexed_token_buffer):
16438 Revert a previous patch: these are really const.
16439 * src/conflicts.c (conflict_report): Additional useless pair of
16440 braces to pacify GCC's warnings for `if () if () {} else {}'.
16441 * src/lex.c (parse_percent_token): Replace equal_offset with
16442 arg_offset.
16443 arg is const.
16444 Be sure to strdup `arg' when used, since there is no reason for
16445 token_buffer not to change.
16446
0f37a994
AD
164472001-11-14 Akim Demaille <akim@epita.fr>
16448
16449 * src/system.h (EXIT_SUCCESS, EXIT_FAILURE): Ensure a proper
16450 definition.
16451 * src/main.c (main): Use them.
16452 Suggested by Hans Aberg.
16453
d39d93b8
AD
164542001-11-12 Akim Demaille <akim@epita.fr>
16455
16456 * src/system.h (ngettext): Now that we use ngettext, be sure to
16457 provide a default definition when NLS are not used.
16458
9edcd895
AD
164592001-11-12 Akim Demaille <akim@epita.fr>
16460
16461 * doc/bison.texinfo: Use `$' as shell prompt, not `%'.
16462 Use @kbd to denote user input.
16463 (Language and Grammar): ANSIfy the example.
16464 Adjust its layout for info/notinfo.
16465 (Location Tracking Calc): Output error messages to stderr.
16466 Output locations in a more GNUtically correct way.
16467 Fix a couple of Englishos.
16468 Adjust @group/@end group pairs.
16469
7da99ede
AD
164702001-11-12 Akim Demaille <akim@epita.fr>
16471
e3aa65c5 16472 %expect was not functioning at all.
7da99ede
AD
16473
16474 * src/conflicts.c (expected_conflicts): Set to -1.
16475 (conflict_report): Use ngettext.
16476 (conflicts_print): Check %expect and make its violation an error.
16477 * doc/bison.texinfo (Expect Decl): Adjust.
16478 * configure.in (AM_GNU_GETTEXT): Ask for ngettext.
16479 * tests/regression.at (%expect not enough, %expect right)
16480 (%expect too much): New.
16481
ba9dda1a
AD
164822001-11-12 Akim Demaille <akim@epita.fr>
16483
16484 * tests/regression.at (Conflicts): Rename as...
16485 (Unresolved SR Conflicts): this.
16486 (Solved SR Conflicts): New.
16487
337c5bd1
AD
164882001-11-12 Akim Demaille <akim@epita.fr>
16489
16490 * src/reduce.c (print_results): Rename as...
16491 (reduce_output): This.
16492 Output to OUT, passed as argument, instead of output_obstack.
16493 (dump_grammar): Likewise.
16494 (reduce_free): New.
16495 Also free V1.
16496 (reduce_grammar): No longer call reduce_output, since...
16497 * src/print.c (print_results): do it.
16498 * src/main.c (main): Call reduce_free;
16499
c73a41af
AD
165002001-11-12 Akim Demaille <akim@epita.fr>
16501
16502 * src/conflicts.c (print_reductions): Accept OUT as argument.
16503 Output to it, not to output_obstack.
16504 * src/print.c (print_actions): Adjust.
16505
0df87bb6
AD
165062001-11-12 Akim Demaille <akim@epita.fr>
16507
16508 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts): Return
16509 the result instead of using...
16510 (src_total, rrc_total, src_count, rrc_count): Remove.
16511 (any_conflicts): Remove.
16512 (print_conflicts): Split into...
16513 (conflicts_print, conflicts_output): New.
16514 * src/conflicts.h: Adjust.
16515 * src/main.c (main): Invoke both conflicts_output and conflicts_print.
0f37a994 16516 * src/print.c (print_grammar): Issue `\n' between two rules.
0df87bb6
AD
16517 * tests/regression.at (Conflicts): New.
16518 Reported by Tom Lane.
16519
e4d3d4de
AD
165202001-11-12 Akim Demaille <akim@epita.fr>
16521
16522 * tests/regression.at (Invalid input): Remove, duplicate with
16523 ``Invalid input: 1''.
16524
6d7d248e
AD
165252001-11-12 Akim Demaille <akim@epita.fr>
16526
16527 * tests/torture.at (AT_DATA_STACK_TORTURE)
16528 (Exploding the Stack Size with Alloca)
16529 (Exploding the Stack Size with Malloc): New.
16530
e9e4c321
AD
165312001-11-12 Akim Demaille <akim@epita.fr>
16532
16533 * src/bison.simple (YYSTACK_REALLOC): New.
16534 (yyparse) [!yyoverflow]: Use it and free the old stack.
0f37a994 16535 Reported by Per Allansson.
e9e4c321 16536
5f7e0832
AD
165372001-11-12 Pascal Bart <pascal.bart@epita.fr>
16538
16539 * src/bison.simple: Define type yystype instead of YYSTYPE, and
16540 define CPP macro, which substitute YYSTYPE by yystype.
16541 * src/reader.c (parse_union_decl): Output yystype/YYSTYPE as we do
16542 with yyltype/YYLTYPE. This allows inclusion of the generated
16543 header within the parser if the compiler, such as GGC, accepts
16544 multiple equivalent #defines.
16545 From Akim.
16546
e3f1699f
AD
165472001-11-05 Akim Demaille <akim@epita.fr>
16548
16549 * src/reader.c (symbols_output): New, extracted from...
16550 (packsymbols): here.
16551 (reader): Adjust.
16552
65be0866
AD
165532001-11-05 Akim Demaille <akim@epita.fr>
16554
16555 * src/lex.c (parse_percent_token): s/quotearg/quote/.
16556
e4d910bf
AD
165572001-11-05 Akim Demaille <akim@epita.fr>
16558
16559 * tests/regression.at (AT_TEST_CPP_GUARD_H): Adjust the clean up
16560 pattern.
16561
951366c1
AD
165622001-11-05 Akim Demaille <akim@epita.fr>
16563
16564 * src/options.h (struct option_table_struct): set_flags is void*.
16565 * src/options.c (longopts): Support `--output' and `%output'.
16566 (usage): Adjust.
16567 * src/lex.h (tok_setopt): Remove, replaced with...
16568 (tok_intopt, tok_stropt): these new guys.
16569 * src/lex.c (getopt.h): Not needed.
16570 (token_buffer, unlexed_token_buffer): Not const.
16571 (percent_table): Promote `-' over `_' in directive names.
16572 Active `%name-prefix', `file-prefix', and `output'.
16573 (parse_percent_token): Accept possible arguments to directives.
16574 Promote `-' over `_' in directive names.
16575
d8988b2f
AD
165762001-11-04 Akim Demaille <akim@epita.fr>
16577
16578 * doc/bison.texinfo (Decl Summary): Split the list into
16579 `directives for grammars' and `directives for bison'.
16580 Sort'em.
16581 Add description of `%name-prefix', `file-prefix', and `output'.
16582 Promote `-' over `_' in directive names.
16583 (Bison Options): s/%locactions/%locations/. Nice Freudian slip.
16584 Simplify the description of `--name-prefix'.
16585 Promote `-' over `_' in directive names.
16586 Promote `--output' over `--output-file'.
16587 Fix the description of `--defines'.
16588 * tests/output.at: Exercise %file-prefix and %output.
16589
6468d18e
AD
165902001-11-02 Akim Demaille <akim@epita.fr>
16591
16592 * doc/refcard.tex: Update.
16593
6b7e85b9
AD
165942001-11-02 Akim Demaille <akim@epita.fr>
16595
16596 * src/symtab.h (SUNDEF): New.
16597 * src/symtab.c (bucket_new): Init user_token_number to SUNDEF to
16598 stand for `uninitialized', instead of 0.
16599 * src/reader.c (packsymbols, parse_thong_decl): Adjust.
16600 * src/lex.c (lex): Adjust.
16601
16602 * tests/calc.at (_AT_DATA_CALC_Y): Declare a token for EOF.
16603 Number it 0.
16604 Let yylex return it instead of a plain 0.
16605 Reported by Dick Streefland.
16606
cd5aafcf
AD
166072001-11-02 Akim Demaille <akim@epita.fr>
16608
16609 * tests/regression.at (Mixing %token styles): New test.
16610
037ca2f1
AD
166112001-11-02 Akim Demaille <akim@epita.fr>
16612
16613 * src/reader.c (parse_thong_decl): Formatting changes.
16614 (token_translations_init): New, extracted from...
16615 (packsymbols): Here.
16616 Adjust.
16617
270a173c
AD
166182001-11-01 Akim Demaille <akim@epita.fr>
16619
16620 * tests/regression.at (AT_TEST_CPP_GUARD_H): New.
16621 Check that `9foo.y' produces correct cpp guards.
16622 * src/files.c (compute_header_macro): Prepend `BISON_' to CPP
16623 guards.
16624 Reported by Wwp.
16625
561f9a30
AD
166262001-11-01 Akim Demaille <akim@epita.fr>
16627
16628 * tests/regression.at (Invalid input: 2): New.
16629 * src/lex.c (unlexed_token_buffer): New.
16630 (lex, unlex): Adjust: when unlexing, be sure to save token_buffer
16631 too.
16632 Reported by Wwp.
16633
f987e9d2
AD
166342001-11-01 Akim Demaille <akim@epita.fr>
16635
16636 * tests/calc.at: Catch up with 1.30.
16637 * configure.in: Bump to 1.49a.
16638 Adjust to newer Autotest.
16639
0846f581
PB
166402001-10-19 Pascal Bart <pascal.bart@epita.fr>
16641
16642 * src/conflicts.c: Move global variables rrc_total and src_total ...
16643 (print_conflicts): here.
16644 * src/output.c (output): Free global variable user_toknums.
16645 * src/lex.c (token_obstack): Become static.
16646
3c1a79b3
AD
166472001-10-18 Akim Demaille <akim@epita.fr>
16648
16649 * tests/atlocal.in (GCC): Add.
16650 * tests/calc.at: s/m4_match/m4_bmatch/.
16651 s/m4_patsubst/m4_bpatsubst/.
16652 (AT_CHECK_CALC): Check the compiler's stderr only if it's GCC.
16653 * configure.in: AC_SUBST(GCC).
16654
5d52e7d0
MA
166552001-10-14 Marc Autret <autret_m@epita.fr>
16656
16657 * src/options.c (create_long_option_table): Fix.
16658
631aa1d3
AD
166592001-10-10 Akim Demaille <akim@epita.fr>
16660
16661 * src/bison.simple: Be sure to set YYSTACK_USE_ALLOCA.
16662
f6ec6d13
AD
166632001-10-04 Akim Demaille <akim@epita.fr>
16664
16665 * src/reader.c (parse_union_decl): Push the caracters in
16666 union_obstack, not attrs_obstack.
16667
342b8b6e
AD
166682001-10-04 Akim Demaille <akim@epita.fr>
16669
16670 Merge in the branch 1.29.
16671
16672 * src/reader.c (packsymbols): Use a temporary obstack for
16673 `%%tokendef', since output_stack is already used elsewhere.
16674
16675 2001-10-02 Akim Demaille <akim@epita.fr>
16676
16677 Bump 1.29d.
16678
16679 2001-10-02 Akim Demaille <akim@epita.fr>
16680
16681 Version 1.29c.
16682
16683 2001-10-02 Akim Demaille <akim@epita.fr>
16684
16685 * tests/regression.at (Invalid CPP headers): New.
16686 From Alexander Belopolsky.
16687 * src/files.c (compute_header_macro): Map non alnum chars to `_'.
16688
16689 2001-10-02 Akim Demaille <akim@epita.fr>
16690
16691 * tests/regression.at (Invalid input): New.
16692 * src/lex.c (lex): Be sure to set `token_buffer' in any case.
16693 Reported by Shura.
16694
16695 2001-10-02 Akim Demaille <akim@epita.fr>
16696
16697 * tests/calc.at: Now that --debug works, the tests must be adjusted.
16698
16699 2001-10-02 Akim Demaille <akim@epita.fr>
16700
16701 * src/output.c (output_parser): Assert `skeleton'.
16702 * src/files.c (skeleton_find): Look harder for skeletons on DOSish
16703 systems.
16704 From Shura.
16705
16706 2001-10-01 Marc Autret <autret_m@epita.fr>
16707
16708 * src/lex.h: Echo modifications.
16709 * src/lex.c (unlex): Parameter is now token_t.
16710 From Hans Aberg.
16711
16712 2001-10-01 Marc Autret <autret_m@epita.fr>
16713
16714 * src/main.c: Include lex.h.
16715 From Hans Aberg.
16716
16717 2001-09-29 Akim Demaille <akim@epita.fr>
16718
16719 * src/getargs.c (longopts): `--debug' is `-t', not `-d'.
16720
16721 2001-09-28 Akim Demaille <akim@epita.fr>
16722
16723 * tests/testsuite.at: Update to newer Autotest.
16724 * tests/Makefile.am (EXTRA_DIST): bison is not to be shipped.
16725
16726 2001-09-27 Akim Demaille <akim@epita.fr>
16727
16728 Position independent wrapper.
16729
16730 * tests/bison: Remove.
16731 * tests/bison.in: New.
16732 * configure.in: Adjust.
16733
16734 2001-09-27 Paul Eggert <eggert@twinsun.com>
16735
16736 Port quotearg fixes from tar 1.13.24.
16737
16738 * lib/quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
16739 tm to be declared.
16740 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
16741 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
16742
16743 * m4/Makefile.am (EXTRA_DIST): Add mbrtowc.m4.
16744 * m4/mbrtowc.m4: New file.
16745 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Check for mbsinit and stddef.h.
16746 Use jm_FUNC_MBRTOWC instead of AC_CHECK_FUNCS(mbrtowc).
16747
16748 2001-09-27 Akim Demaille <akim@epita.fr>
16749
16750 Bump to 1.29c.
16751
16752 2001-09-27 Akim Demaille <akim@epita.fr>
16753
16754 Version 1.29b.
16755
16756 2001-09-25 Akim Demaille <akim@epita.fr>
16757
16758 * src/system.h: Include `xalloc.h'.
16759 Remove it from the C files.
16760 * src/files.c (output_files): Free the obstacks.
16761 * src/lex.c (init_lex): Rename as...
16762 (lex_init): this.
16763 (lex_free): New.
16764 * src/main.c (main): Use it.
16765
16766 2001-09-24 Marc Autret <autret_m@epita.fr>
16767
16768 * src/vcg.c (open_edge, close_edge, open_node, close_node): Change
16769 to output informations in fout (FILE*).
16770 (open_graph, close_graph): Likewise.
16771 (output_graph, output_edge, output_node): Likewise.
16772 * src/vcg.h: Update function prototypes.
16773 * src/print_graph.c (print_graph): Open output graph file.
16774 (print_actions): Adjust.
16775 * src/files.h: Remove extern declaration.
16776 * src/files.c: Remove graph_obstack declaration.
16777 (open_files): Remove graph_obstack initialization.
16778 (output_files): Remove graph_obstack saving.
16779
16780 2001-09-24 Marc Autret <autret_m@epita.fr>
16781
16782 * src/files.c (compute_output_file_names): Fix.
16783
16784 2001-09-24 Marc Autret <autret_m@epita.fr>,
16785 Akim Demaille <akim@epita.fr>
16786
16787 * src/reader.c (reader): Remove call to free_symtab ().
16788 * src/main.c (main): Call it here.
16789 Include symtab.h.
16790 * src/conflicts.c (initialize_conflicts): Rename as...
16791 (solve_conflicts): this.
16792 * src/print.c (print_core, print_actions, print_state)
16793 (print_grammar): Dump to a file instead a `output_obstack'.
16794 (print_results): Dump `output_obstack', and then proceed with the
16795 FILE *.
16796 * src/files.c (compute_output_file_names, close_files): New.
16797 (output_files): Adjust.
16798 * src/main.c (main): Adjust.
16799
16800 2001-09-23 Marc Autret <autret_m@epita.fr>
16801
16802 * src/files.c (compute_header_macro): Computes header macro name
16803 from spec_defines_file when given.
16804
16805 2001-09-23 Marc Autret <autret_m@epita.fr>
16806
16807 * src/files.c (output_files): Add default extensions.
16808
16809 2001-09-22 Akim Demaille <akim@epita.fr>
16810
16811 * src/conflicts.c (finalize_conflicts): Rename as...
16812 (free_conflicts): this.
16813
16814 2001-09-22 Akim Demaille <akim@epita.fr>
16815
16816 * src/gram.c (gram_free): Rename back as...
16817 (dummy): this.
16818 (output_token_translations): Free `token_translations'.
16819 * src/symtab.c (free_symtab): Free the tag field.
16820
16821 2001-09-22 Akim Demaille <akim@epita.fr>
16822
16823 Remove `translations' as it is always set to true.
16824
16825 * src/gram.h: Adjust.
16826 * src/reader.c (packsymbols, parse_token_decl): Adjust
16827 * src/print.c (print_grammar): Adjust.
16828 * src/output.c (output_token_translations): Adjust.
16829 * src/lex.c (lex): Adjust.
16830 * src/gram.c: Be sure the set pointers to NULL.
16831 (dummy): Rename as...
16832 (gram_free): this.
16833
16834 2001-09-22 Akim Demaille <akim@epita.fr>
16835
16836 * configure.in: Invoke AM_LIB_DMALLOC.
16837 * src/system.h: Use dmalloc.
16838 * src/LR0.c: Be sure to have pointers initialized to NULL.
16839 (allocate_itemsets): Allocate kernel_items only if needed.
16840
16841 2001-09-22 Akim Demaille <akim@epita.fr>
16842
16843 * configure.in: Bump to 1.29b.
16844 * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
16845 * tests/calc.at (_AT_DATA_CALC_Y): #undef malloc so that we don't
16846 need xmalloc.c in calc.y.
16847 From Pascal Bart.
16848
16849 2001-09-21 Akim Demaille <akim@epita.fr>
16850
16851 Version 1.29a.
16852 * Makefile.maint, config/config.guess, config/config.sub,
16853 * config/missing: Update from masters.
16854 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): No longer depend
16855 upon package.m4.
16856 * configure.in (ALL_LINGUAS): Add `tr'.
16857
16858 2001-09-21 Akim Demaille <akim@epita.fr>
16859
16860 * tests/Makefile.am (package.m4): Move to...
16861 ($(srcdir)/$(TESTSUITE)): here.
16862
16863 2001-09-20 Akim Demaille <akim@epita.fr>
16864
16865 * src/complain.c: No longer try to be standalone: use system.h.
16866 Don't assume __STDC__ is defined to 1. Just test if it is defined.
16867 * src/complain.h: Likewise.
16868 * src/reduce.c (useless_nonterminals, inaccessable_symbols):
16869 Remove the unused variable `n'.
16870 From Albert Chin-A-Young.
16871
16872 2001-09-18 Marc Autret <autret_m@epita.fr>
16873
16874 * doc/bison.1: Update.
16875 * doc/bison.texinfo (Bison Options): Update --defines and --graph
16876 descriptions.
16877 (Option Cross Key): Update.
16878 Add --graph.
16879
16880 2001-09-18 Marc Autret <autret_m@epita.fr>
16881
16882 * tests/regression.at: New test (comment in %union).
16883
16884 2001-09-18 Marc Autret <autret_m@epita.fr>
16885
16886 * src/reader.c (parse_union_decl): Do not output '/'. Let copy_comment
16887 do that.
16888 Reported by Keith Browne.
16889
16890 2001-09-18 Marc Autret <autret_m@epita.fr>
16891
16892 * tests/output.at: Add tests for --defines and --graph.
16893
16894 2001-09-18 Marc Autret <autret_m@epita.fr>
16895
16896 * tests/output.at: Removes tests of %{header,src}_extension features.
16897
16898 2001-09-18 Akim Demaille <akim@epita.fr>
16899
16900 * tests/Makefile.am (package.m4): New.
16901 * tests/calc.at (_AT_CHECK_CALC): Just run `calc input'.
16902 (_AT_CHECK_CALC_ERROR): Likewise.
16903 Factor the `, ' part of verbose error messages.
16904
16905 2001-09-18 Marc Autret <autret_m@epita.fr>
16906
16907 * src/getargs.c (longopts): Declare --defines and --graph as options
16908 with optional arguments.
16909 * src/files.h: Add extern declarations.
16910 * src/files.c (spec_graph_file, spec_defines_file): New.
16911 (output_files): Update.
16912 Remove CPP-outed code.
16913
16914 2001-09-18 Marc Autret <autret_m@epita.fr>
16915
16916 Turn off %{source,header}_extension feature.
16917
16918 * src/files.c (compute_exts_from_gf): Update.
16919 (compute_exts_from_src): Update.
16920 (output_files): CPP-out useless code.
16921 * src/files.h: Remove {header,source}_extension extern declarations.
16922 * src/reader.c (parse_dquoted_param): CPP-out.
16923 (parse_header_extension_decl): Remove.
16924 (parse_source_extension_decl): Remove.
16925 (read_declarations): Remove cases tok_{hdrext,srcext}.
16926 * src/lex.c (percent_table): Remove {header,source}_extension entries.
16927 * src/lex.h (token_t): Remove tok_hdrext and tok_srcext.
16928
16929 2001-09-10 Akim Demaille <akim@epita.fr>
16930
16931 * tests/output.at (AT_CHECK_BISON_FLAGS, AT_CHECK_BISON_PERCENT):
16932 (AT_CHECK_BISON_PERCENT_FLAGS): Merge into...
16933 (AT_CHECK_OUTPUT): this.
16934 Merely check ls' exit status, its output is useless.
16935
16936 2001-09-10 Akim Demaille <akim@epita.fr>
16937
16938 * tests/calc.at: Use m4_match.
16939 (_AT_DATA_CALC_Y): Check `yyin != NULL', not `stdin != NULL'.
16940
16941 2001-09-10 Marc Autret <autret_m@epita.fr>,
16942 Akim Demaille <akim@epita.fr>
16943
16944 * src/vcg.h (graph_s): color, textcolor, bordercolor are now
16945 enum color_e.
16946 * src/print_graph.c (print_graph): Initalize graph.layoutalgorithm
16947 to `normal'.
16948 * src/reader.c (parse_token_decl): Initialize token with tok_eof.
16949 * src/lex.h: Adjust prototype.
16950 (token_t): Add `tok_undef'.
16951 * src/lex.c (struct percent_table_struct): Retval is now a token_t.
16952 (parse_percent_token): Now returns token_t.
16953 Add default statement in switch.
16954 (lex): Separate `c' as an input variable, from the token_t result
16955 part.
16956 (unlexed): Is a token_t.
16957
16958 2001-09-10 Akim Demaille <akim@epita.fr>
16959
16960 * configure.in: Bump to 1.29a.
16961
16962 2001-09-07 Akim Demaille <akim@epita.fr>
16963
16964 Version 1.29.
16965
16966 2001-08-30 Akim Demaille <akim@epita.fr>
16967
16968 * tests/atgeneral.m4, tests/atconfig.in, tests/suite.at: Remove.
16969 * m4/atconfig.m4: Remove.
16970 * tests/testsuite.at, tests/atlocal.in, tests/output.at,
16971 * tests/bison: New.
16972 * tests/regression.at, tests/calc.at: Use m4_define, AT_BANNER,
16973 m4_if, m4_patsubst, and m4_regexp.
16974 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Use an
16975 `input' file instead of echo.
16976
16977 2001-08-29 Akim Demaille <akim@epita.fr>
16978
16979 Bump to 1.28e.
16980
16981 2001-08-29 Akim Demaille <akim@epita.fr>
16982
16983 Version 1.28d.
16984
16985 2001-08-29 Paul Eggert <eggert@twinsun.com>
16986
16987 * src/bison.simple (yyparse): Don't take the address of an
16988 item before the start of an array, as that doesn't conform to
16989 the C Standard.
16990
16991 2001-08-29 Robert Anisko <anisko_r@epita.fr>
16992
16993 * doc/bison.texinfo (Location Tracking Calc): New node.
16994
16995 2001-08-29 Paul Eggert <eggert@twinsun.com>
16996
16997 * src/output.c (output): Do not define const, as this now
16998 causes more problems than it cures.
16999
17000 2001-08-29 Akim Demaille <akim@epita.fr>
17001
17002 * doc/bison.texinfo: Modernize `@node' and `@top' use: just name
17003 the nodes.
17004 Be sure to tag the `detailmenu'.
17005
17006 2001-08-29 Akim Demaille <akim@epita.fr>
17007
17008 * Makefile.maint (do-po-update): Wget refuses to overwrite files:
17009 download in a tmp dir.
17010
17011 2001-08-28 Marc Autret <autret_m@epita.fr>
17012
17013 * config/depcomp: New file.
17014
17015 2001-08-28 Marc Autret <autret_m@epita.fr>
17016
17017 * doc/bison.1 (mandoc): Adjust.
17018 From Juan Manuel Guerrero.
17019
17020 2001-08-28 Marc Autret <autret_m@epita.fr>
17021
17022 * src/print_graph.c (print_state): Fix.
17023
17024 2001-08-27 Marc Autret <autret_m@epita.fr>
17025
17026 * src/vcg.h (classname_s, infoname_s, node_s): Constify the
17027 char * members.
17028 Echo modifications to the functions prototypes.
17029 * src/vcg.c (add_classname, add_infoname): Adjust arguments.
17030
17031 2001-08-27 Marc Autret <autret_m@epita.fr>
17032
17033 * src/vcg.c: Include `xalloc.h'.
17034 (add_colorentry): New.
17035 (add_classname): New.
17036 (add_infoname): New.
17037 * src/vcg.h: Add new prototypes.
17038
17039 2001-08-27 Akim Demaille <akim@epita.fr>
17040
17041 * Makefile.maint: Sync. again with CVS Autoconf.
17042
17043 2001-08-27 Akim Demaille <akim@epita.fr>
17044
17045 * Makefile.maint: Formatting changes.
17046 (po-update, cvs-update, update): New targets.
17047 (AMTAR): Remove.
17048
17049 2001-08-27 Akim Demaille <akim@epita.fr>
17050
17051 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
17052 * Makefile.maint: Sync. with CVS Autoconf.
17053
17054 2001-08-27 Marc Autret <autret_m@epita.fr>
17055
17056 * src/vcg.h (struct infoname_s): New.
17057 (struct colorentry_s): New.
17058 (graph_s): New fields {vertical,horizontal}_order in structure.
17059 Add `infoname' field.
17060 Add `colorentry' field;
17061 * src/vcg_defaults.h (G_VERTICAL_ORDER): New.
17062 (G_HORIZONTAL_ORDER): New.
17063 (G_INFONAME): New.
17064 (G_COLORENTRY): New.
17065 * src/vcg.c (output_graph): Add output of {vertical,horizontal}_order.
17066 Add output of `infoname'.
17067 Add output of `colorentry'.
17068
17069 2001-08-27 Marc Autret <autret_m@epita.fr>
17070
17071 * src/reader.c (parse_dquoted_param): Rename variable `index' to `i'.
17072 This one shadowed a global parameter.
17073
17074 2001-08-24 Marc Autret <autret_m@epita.fr>
17075
17076 * src/print_graph.c (node_output_size): Declared POSIX `size_t' type,
17077 instead of `unsigned'.
17078 (print_state): Do not call obstack_object_size () in obstack_grow ()
17079 to avoid macro variables shadowing.
17080
17081 2001-08-23 Marc Autret <autret_m@epita.fr>
17082
17083 * src/lex.c (percent_table): Typo: s/naem/name/.
17084 Add graph option.
17085 Normalize new options declarations.
17086
17087 2001-08-20 Pascal Bart <pascal.bart@epita.fr>
17088
17089 * tests/suite.at: Exercise %header_extension and %source_extension.
17090
17091 2001-08-16 Marc Autret <autret_m@epita.fr>
17092
17093 * src/reader.c (parse_dquoted_param): New.
17094 (parse_header_extension_decl): Use it.
17095 (parse_source_extension_decl): Likewise.
17096
17097 2001-08-16 Marc Autret <autret_m@epita.fr>
17098
17099 * src/vcg.c: Remove includes of `complain.h' and `xalloc.h'.
17100 (get_xxxx_str): Use assert () instead of complain ().
17101 Remove return invokations in default cases.
17102 (get_decision_str): Modify default behaviour. Remove second argument.
17103 Echo modifications on calls.
17104 (output_graph): Fix.
17105
17106 2001-08-16 Marc Autret <autret_m@epita.fr>
17107
17108 * src/getargs.c (usage): Update with ``-g, --graph''.
17109
17110 2001-08-16 Marc Autret <autret_m@epita.fr>
17111
17112 * doc/bison.texinfo (Bison Options): Add items `-g', `--graph'.
17113 (Option Cross Key): Likewise.
17114 * doc/bison.1: Update.
17115
1c8c2190
PB
171162001-09-25 Pascal Bart <pascal.bart@epita.fr>
17117
17118 * src/output.c (output_master_parser): Don't finish action_obstack.
17119 (output_parser): Don't care about the muscle action, here.
17120 (prepare): Copy the action_obstack in the action muscle.
17121 (output): Free action_obstack.
17122
180d45ba
PB
171232001-09-23 Pascal Bart <pascal.bart@epita.fr>
17124
17125 * src/reader.c (parse_union_decl): Add new obstack union_obstack. Which
17126 will contain `%union' declaration.
17127 (parse_union_decl): Delete #line directive output.
17128 (parse_union_decl): Substitute /attrs_obstack/union_obstack for all
17129 informations about %union.
17130 (parse_union_decl): Copy the union_obstack in the muscle stype.
17131 * src/bison.simple: Add new #line directive.
17132 Add typdef %%stype YYSTYPE.
17133
c51d1a19
PB
171342001-09-23 Pascal Bart <pascal.bart@epita.fr>
17135
17136 * src/bison.simple: Add new `#line' directive.
17137
6f9344da
PB
171382001-09-22 Pascal Bart <pascal.bart@epita.fr>
17139
17140 * src/bison.simple: New `#line' directive.
17141 * src/output.c (output_parser): Support new dynamic muscle input_line.
17142
652def80
MA
171432001-09-22 Marc Autret <autret_m@epita.fr>
17144
17145 * src/output.c (output_master_parser): New.
17146 (output_parser): Be more re-entrant.
17147
25b222fa
MA
171482001-09-21 Marc Autret <autret_m@epita.fr>
17149
17150 * src/reader.c (copy_definition, parse_union_decl): Update and use
17151 `linef' muscle.
17152 (copy_action): Likewise.
17153 Use obstack_1grow ().
17154 * src/muscle_tab.c (muscle_init): Add muscle `linef'.
17155
6bc35ae5
MA
171562001-09-21 Marc Autret <autret_m@epita.fr>
17157
17158 * src/options.c (option_table): Adjust.
17159 * src/lex.c (parse_percent_token): Fix.
17160
c0629aa1
PB
171612001-09-20 Pascal Bart <pascal.bart@epita.fr>
17162
17163 * src/options.c (symtab.h): Include it, need by lex.h.
342b8b6e 17164
82b6d266
PB
171652001-09-20 Pascal Bart <pascal.bart@epita.fr>
17166
17167 * src/lex.c (parse_percent_token): Change type of variable `tx', which
17168 is now an option_table_struct*.
17169 (option_strcmp): New function option_strcmp.
17170 (parse_percent_token): Call option_strcmp.
17171 * src/getargs.c (xalloc.h, options.h): Include it.
17172 (getargs): Call create_long_option_table.
17173 (getargs): Free longopts at the end of the function.
17174 (shortopts): Move in options.c.
17175 * src/options.c (create_long_option_table): New function. Convert
17176 information from option_table to option structure.
17177 * src/reader.c (options.h): Include it.
17178
17179 * src/Makefile.am: Adjust.
17180 * src/options.c (option_table): Create from longopts and percent_table.
17181 * src/getargs.c (longopts): Delete.
17182 * src/lex.c (struct percent_table_struct): Delete.
17183 (percent_table): Delete.
17184 (options.h): Include it.
17185 * src/options.c: Create.
17186 * src/options.h: Create.
17187 Declare enum opt_access_e.
17188 Define struct option_table_struct.
17189
75f5aaea
MA
171902001-09-20 Marc Autret <autret_m@epita.fr>
17191
17192 * doc/bison.texinfo: Adjust terminologies about prologue and epilogue
17193 sections of Bison.
17194
f508cb0a
PB
171952001-09-19 Pascal Bart <pascal.bart@epita.fr>
17196
17197 * src/bison.simple: s/%%filename/%%skeleton.
17198 * src/muscle_tab.c (getargs.h): Include it.
17199 (muscle_init): Insert new muscle skeleton.
17200
13105fc1
PB
172012001-09-18 Pascal Bart <pascal.bart@epita.fr>
17202
17203 * src/output.c (output_parser): Delete unused variable actions_dumped.
17204
b0c4483e
PB
172052001-09-07 Pascal Bart <pascal.bart@epita.fr>
17206
17207 * src/output.c (output): Delete call to reader_output_yylsp.
17208 * src/reader.c (reader): Likewise.
ba0fe3c7 17209 * src/reader.h: Delete declaration of reader_output_yylsp.
342b8b6e 17210
11d82f03
MA
172112001-09-02 Marc Autret <autret_m@epita.fr>
17212
17213 * src/reader.c: Include muscle_tab.h.
17214 (parse_union_decl): Update.
17215 (parse_macro_decl): Rename parse_muscle_decl.
17216 Update to use renamed functions and variable.
17217 (read_declarations, copy_action, read_additionnal_code, : Updated
17218 with correct variables and functions names.
17219 (packsymbols, reader): Likewise.
342b8b6e 17220
11d82f03 17221 * src/reader.h (muscle_obstack): Extern declaration update.
342b8b6e 17222
11d82f03
MA
17223 * src/output.c: Include muscle_tab.h
17224 In all functions using macro_insert, change by using muscle_insert ().
17225 (macro_obstack): Rename muscle_obstack.
17226 Echo modifications in the whole file.
17227 (MACRO_INSERT_INT): Rename MUSCLE_INSERT_INT.
17228 (MACRO_INSERT_STRING): Rename MUSCLE_INSERT_STRING.
17229 (MACRO_INSERT_PREFIX): Rename MUSCLE_INSERT_PREFIX.
17230
17231 * src/muscle_tab.h: Update double inclusion macros.
17232 (macro_entry_s): Rename muscle_entry_s.
17233 Update prototypes.
342b8b6e 17234
11d82f03
MA
17235 * src/muscle_tab.c: Include muscle_tab.h.
17236 Rename macro_tabble to muscle_table.
17237 (mhash1, mhash2, mcmp): Use muscle_entry.
17238 (macro_init): Rename muscle_init. Update.
17239 (macro_insert): Rename muscle_insert. Update.
17240 (macro_find): Rename muscle_find. Update.
17241
17242 * src/main.c: Include muscle_tab.h.
17243 (main): Call muscle_init ().
17244 * src/Makefile.am (bison_SOURCES): Echo modifications.
17245
93a37297
MA
172462001-09-02 Marc Autret <autret_m@epita.fr>
17247
f753cd62 17248 Now the files macro_tab.[ch] are named muscle_tab.[ch].
342b8b6e 17249
f753cd62
MA
17250 * src/muscle_tab.c, src/muscle_tab.h: Add files.
17251
172522001-09-02 Marc Autret <autret_m@epita.fr>
17253
17254 * src/macrotab.c, src/macrotab.h: Remove.
93a37297 17255
682d48cd
PB
172562001-09-01 Pascal Bart <pascal.bart@epita.fr>
17257
342b8b6e 17258 * src/reader.c (copy_guard): Use muscle to specify the `#line'
682d48cd
PB
17259 filename.
17260
087c8fda
MA
172612001-09-01 Marc Autret <autret_m@epita.fr>
17262
17263 * tests/calc.at (exp): Now, YYERROR_VERBOSE need to be set
17264 to an explicit value to activate the feature. We do it here.
17265
dda680cb
PB
172662001-08-31 Pascal Bart <pascal.bart@epita.fr>
17267
17268 * src/output.c (prepare): Delete the `filename' muscule insertion.
17269 * src/reader.c (copy_action): Use `filename' muscule with `#line'.
17270 (parse_union_decl): Likewise.
17271 * src/macrotab.c (macro_init): Initialize filename by infile.
17272
9e644e64
MA
172732001-08-31 Marc Autret <autret_m@epita.fr>
17274
17275 * src/bison.simple (YYLSP_NEEDED): New definition.
17276 * src/output.c (prepare): Add macro insertion of `locations_flag'
17277
17da6427
PB
172782001-08-31 Pascal Bart <pascal.bart@epita.fr>
17279
17280 * src/output.c (prepare): Delete insertion of previous muscles,
17281 and insert the `prefix' muscles.
17282 * src/macrotab.c (macro_init): Likewise.
17283 (macro_init): Initialization prefix directive by `yy'.
342b8b6e 17284 * src/bison.simple: Substitute all %%yylex, %%yychar, %%yylval,
17da6427
PB
17285 %%yydebug, %%yyerror, %%yynerrs and %%yyparse by yylex, yychar,
17286 yylval, yydebug, yyerror, yynerrs and yyparse.
342b8b6e 17287 New directive `#define' to substitute yydebug, ... with option
17da6427
PB
17288 name_prefix.
17289
e8cb70b9
PB
172902001-08-31 Pascal Bart <pascal.bart@epita.fr>
17291
17292 * src/main.c (main): Standardize.
17293 * src/output.c (output_table_data, output_parser): Likewise.
17294 * src/macrotab.h, src/macrotab.c, src/bison.simple: Likewise.
17295
63c2d5de
MA
172962001-08-31 Pascal Bart <pascal.bart@epita.fr>, Marc Autret <autret_m@epita.fr>
17297
342b8b6e 17298 * src/reader.c (read_additionnal_code): Rename %%user_code to
63c2d5de
MA
17299 %%epilogue.
17300 * src/output.c (output): Rename %%declarations to %%prologue.
17301 * src/bison.simple: Echo modifications.
342b8b6e 17302
d8cb5183
MA
173032001-08-31 Marc Autret <autret_m@epita.fr>
17304
17305 * src/reader.c (readgram): CleanUp.
17306 (output_token_defines): Likewise.
17307 (packsymbols): Likewise.
17308 (reader): Likewise.
17309 * src/output.c (output): CPP-out useless code.
17310
6c686258
PB
173112001-08-31 Pascal Bart <pascal.bart@epita.fr>
17312
342b8b6e 17313 * src/reader.c (reader): Delete obsolete call to function
6c686258
PB
17314 output_trailers and output_headers.
17315 * src/output.h: Remove obsolete functions prototypes of output_headers
17316 and output_trailers.
17317
8f451ef7
PB
173182001-08-30 Pascal Bart <pascal.bart@epita.fr>
17319
17320 * src/main.c: Include macrotab.h.
342b8b6e 17321 * src/macrotab.h (macro_entry_s): Constify fields.
8f451ef7
PB
17322 Adjust functions prototypes.
17323 * src/macrotab.c (macro_insert): Constify key and value.
17324 (macro_find): Constify key.
17325 (macro_insert): Include 'xalloc.h'
17326 (macro_insert): Use XMALLOC.
17327 (macro_find): Constify return value.
17328 * src/output.c (output_table_data): Rename table to table_data.
17329 (output_parser): Constify macro_key, macro_value.
17330
997b6fd0 173312001-08-30 Marc Autret <autret_m@epita.fr>
2ba3b73c
MA
17332
17333 * src/reader.c (parse_skel_decl): New.
342b8b6e 17334 (read_declarations): Add case `tok_skel', call parse_skel_decl ().
2ba3b73c
MA
17335 * src/lex.h (token_t): New token `tok_skel'.
17336 * src/lex.c (percent_table): Add skeleton option entry.
17337 Standardize.
17338
ff48177d
MA
173392001-08-29 Marc Autret <autret_m@epita.fr>
17340
17341 * src/bison.simple: Add %%user_code directive at the end.
17342 * src/reader.c (read_additionnal_code): New.
17343 (reader): Use it.
17344 * src/output.c (output_program): Remove.
17345 (output): Update.
17346
b33160bf
MA
173472001-08-28 Marc Autret <autret_m@epita.fr>
17348
17349 * src/output.c (output_actions): Clean up.
4e5caae2 17350 (output_gram): CPP-out useless code.
b33160bf
MA
17351 * src/reader.c (reader): Clean up, CPP-out useless code.
17352
d1a2daf7
PB
173532001-08-28 Pascal Bart <pascal.bart@epita.fr>
17354
342b8b6e 17355 * src/output.c (output): Copy attrs_obstack in the '%%definitions'
535c0e75 17356 directive.
d1a2daf7
PB
17357 * src/bison.simple: Add `%%definitions'.
17358
2b763dfe
MA
173592001-08-28 Marc Autret <autret_m@epita.fr>
17360
17361 * config/depcomp: New file.
17362
f1a87ef6
PE
173632001-08-27 Paul Eggert <eggert@twinsun.com>
17364
17365 * src/bison.simple (yyparse): Don't take the address of an
17366 item before the start of an array, as that doesn't conform to
17367 the C Standard.
17368
82e236e2
RA
173692001-08-27 Robert Anisko <robert.anisko@epita.fr>
17370
f1a87ef6 17371 * src/output.c (output): Remove the initialization of the macro
82e236e2
RA
17372 obstack. It was done too late here.
17373
17374 * src/reader.c (parse_macro_decl): Fix. Use of the macro obstack was
17375 completely wrong.
17376 (reader): Initialize the macro obstack here, since we need it to grow
17377 '%define' directives.
17378
17379 * src/reader.h: Declare the macro obstack as extern.
17380
b0cfa28a
RA
173812001-08-27 Robert Anisko <robert.anisko@epita.fr>
17382
17383 * src/output.c (output_parser): Fix. Store single '%' characters in
17384 the output obstack instead of throwing them away.
17385
6fc74234
AD
173862001-08-27 Akim Demaille <akim@epita.fr>
17387
17388 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
17389
9c76d118
RA
173902001-08-25 Robert Anisko <robert.anisko@epita.fr>
17391
17392 * lib/Makefile.am: Adjust.
17393
a8289c62
RA
173942001-08-25 Robert Anisko <robert.anisko@epita.fr>
17395
17396 * src/bison.simple: Update and add '%%' directives.
17397
b6610515
RA
173982001-08-25 Robert Anisko <robert.anisko@epita.fr>
17399
17400 * src/reader.c (reader): Remove calls to 'output_headers' and
17401 'output_trailers'. Remove some C output.
17402 (readgram): Disable a piece of code that was writing a default
17403 definition for 'YYSTYPE'.
17404 (reader_output_yylsp): Remove.
17405 (packsymbols): Output token defintions to a macro.
17406 (copy_definition): Disable C output.
6fc74234 17407
b6610515
RA
17408 * src/reader.c (parse_macro_decl): New function used to parse macro
17409 declarations.
17410 (copy_string2): Put the body of copy_string into this new function.
17411 Add a parameter to let the caller choose whether he wants to copy the
17412 string delimiters or not.
17413 (copy_string): Be a simple call to copy_string2 with the last argument
17414 bound to true.
17415 (read_declarations): Add case for macro definition.
17416 (copy_identifier): New.
6fc74234 17417 (parse_macro_decl): Read macro identifiers using copy_identifier
b6610515
RA
17418 rather than lex.
17419
26f609ff
RA
174202001-08-25 Robert Anisko <robert.anisko@epita.fr>
17421
17422 * src/output.c (prepare): Add prefixed names.
17423 (output_parser): Output semantic actions.
17424 (output_parser): Fix bug on '%%line' directives.
6fc74234 17425
26f609ff
RA
17426 * src/output.c (output_headers): Remove. The C code printed by this
17427 function should now be in the skeletons.
17428 (output_trailers): Remove.
17429 (output): Disable call to 'reader_output_yylsp'.
17430 (output_rule_data): Do not output tables to the table obstack.
17431
17432 * src/output.c: Remove some C dedicated output.
17433 Improve the use of macro and output obstacks.
17434 (output_defines): Remove.
6fc74234 17435
26f609ff
RA
17436 * src/output.c (output_token_translations): Associate 'translate'
17437 table with a macro. No output to the table obstack.
17438 (output_gram): Same for 'rhs' and 'prhs'.
17439 (output_stos): Same for 'stos'.
17440 (output_rule_data): Same for 'r1' and 'r2'.
17441 (token_actions): Same for 'defact'.
17442 (goto_actions): Same for 'defgoto'.
17443 (output_base): Same for 'pact' and 'pgoto'.
17444 (output_table): Same for 'table'.
17445 (output_check): Same for 'check'.
6fc74234 17446
26f609ff
RA
17447 * src/output.c (output_table_data): New function.
17448 (output_short_table): Remove.
17449 (output_short_or_char_table): Remove.
6fc74234 17450
26f609ff
RA
17451 * src/output.c (output_parser): Replace most of the skeleton copy code
17452 with something new. Skeletons are now processed character by character
17453 rather than line by line, and Bison looks for '%%' macros. This is the
17454 first step in making Bison's output process (a lot) more flexible.
17455 (output_parser): Use the macro table.
17456
6f43b113
RA
174572001-08-25 Robert Anisko <robert.anisko@epita.fr>
17458
17459 * src/main.c (main): Initialize the macro table.
17460
dd3127cf
RA
174612001-08-25 Robert Anisko <robert.anisko@epita.fr>
17462
17463 * src/lex.c (percent_table): Add tok_define.
17464 * src/lex.h: Add tok_define.
17465
aa321494
RA
174662001-08-25 Robert Anisko <robert.anisko@epita.fr>
17467
17468 * src/macrotab.c: New file.
17469 * src/macrotab.h: New file.
17470 * src/Makefile.am: Update.
17471
68bd3b6b
RA
174722001-08-25 Robert Anisko <robert.anisko@epita.fr>
17473
17474 * lib/hash.c: New file.
17475 * lib/hash.h: New file.
17476 * lib/Makefile.am: Update.
17477
45f8dd1e
AD
174782001-08-15 Akim Demaille <akim@epita.fr>
17479
17480 Version 1.28c.
17481
40a64a7a 174822001-08-15 Marc Autret <autret_m@epita.fr>
0b8afb77
AD
17483
17484 * src/reader.c (readgram): Indent output macro YYSTYPE.
17485 (packsymbols): Likewise.
17486 (output_token_defines): Likewise.
17487 * src/files.c: Standardize.
17488 (compute_header_macro): New.
17489 (defines_obstack_save): New. Use compute_header_macro.
17490 (output_files): Update. Use defines_obstack_save.
17491
f9a8293a
AD
174922001-08-15 Akim Demaille <akim@epita.fr>
17493
17494 * doc/bison.texinfo (Table of Symbols): Document
17495 YYSTACK_USE_ALLOCA.
17496
150ca7a7
AD
174972001-08-15 Akim Demaille <akim@epita.fr>
17498
17499 * missing: Update from CVS Automake.
17500 * config/config.guess, config/config.sub, config/texinfo.tex:
17501 Update from gnu.org.
17502
69b5cec4
AD
175032001-08-15 Akim Demaille <akim@epita.fr>
17504
17505 * Makefile.maint: Sync with CVS Autoconf.
17506
f2b5126e
PB
175072001-08-14 Pascal Bart <pascal.bart@epita.fr>
17508
69b5cec4 17509 * doc/bison.texinfo: Include GNU Free Documentation License from
f2b5126e
PB
17510 `fdl.texi'.
17511 * doc/fdl.texi: Add to package.
17512
4ecbf796
MA
175132001-08-14 Marc Autret <autret_m@epita.fr>
17514
17515 Turn on %{source,header}_extension features.
17516
69b5cec4 17517 * src/lex.c (percent_table): Un-CPP out header_extension and
4ecbf796
MA
17518 source_extension.
17519 * src/files.c (compute_exts_from_gf): Compare pointers with NULL.
69b5cec4 17520 (compute_exts_from_src): Remove conditions. It restores priorities
4ecbf796
MA
17521 between options.
17522
95fb5662
MA
175232001-08-14 Marc Autret <autret_m@epita.fr>
17524
17525 * src/files.c (compute_base_names): Add extensions computing when
17526 `--file-prefix' used.
17527 Standardize function calls.
17528
78d09da9
MA
175292001-08-13 Marc Autret <autret_m@epita.fr>
17530
69b5cec4 17531 * src/bison.simple (YYSTACK_USE_ALLOCA): Changed to allow users
78d09da9
MA
17532 defining it (defined but null disables alloca).
17533
5a009f2c
MA
175342001-08-13 Marc Autret <autret_m@epita.fr>
17535
17536 * src/bison.simple (_yy_memcpy): CPP reformat.
17537
1e41465a
PB
175382001-08-13 Pascal Bart <pascal.bart@epita.fr>
17539
17540 * tests/atconfig.in (CPPFLAGS): Fix.
17541
c67a198d
PB
175422001-08-10 Pascal Bart <pascal.bart@epita.fr>
17543
79282c6c 17544 * doc/bison.texinfo: Include GNU General Public License from
c67a198d
PB
17545 `gpl.texi'.
17546 * doc/gpl.texi: Add to package.
17547
09a6de7e
MA
175482001-08-10 Marc Autret <autret_m@epita.fr>
17549
17550 * src/print_graph.h: Fix.
17551 * src/reader.c (read_declarations): Use parse_header_extension_decl ().
17552
b77b9ee0
AD
175532001-08-10 Akim Demaille <akim@epita.fr>
17554
17555 * src/system.h: Provide default declarations for stpcpy, strndup,
17556 and strnlen.
17557
3e259915
MA
175582001-08-10 Robert Anisko <anisko_r@epita.fr>
17559
17560 * doc/bison.texinfo (Locations): Update @$ stuff.
17561
ca96bc2d
MA
175622001-08-09 Robert Anisko <anisko_r@epita.fr>
17563
17564 * src/bison.simple (YYLLOC_DEFAULT): Update.
17565 (yyparse): Adjust.
17566
fdc6758b
MA
175672001-08-08 Marc Autret <autret_m@epita.fr>
17568
b77b9ee0 17569 * doc/bison.texinfo: Change @samp{$<@dots{}>} to
fdc6758b
MA
17570 @samp{$<@dots{}>@var{n}} in Section Actions in Mid-Rule.
17571 Reported by Fabrice Bauzac.
957d4dbf 17572
600cad3b
MA
175732001-08-08 Marc Autret <autret_m@epita.fr>
17574
17575 * src/vcg_default.h: Use NULL instead of 0 to initialize pointers.
17576 * src/vcg.c (output_node): Fix.
17577 * src/vcg.h: Cleanup.
17578 * src/print_graph.c: Add comments.
b77b9ee0 17579 (node_output_size): New global variable. Simplify the formatting of
600cad3b 17580 the VCG graph output.
b77b9ee0 17581 (print_actions): Unused code is now used. It notifies the final state
600cad3b 17582 and no action states in the VCG graph. It also give the reduce actions.
b77b9ee0 17583 The `shift and goto' edges are red and the `go to state' edges are
600cad3b
MA
17584 blue.
17585 Get the current node name and node_obstack by argument.
17586 (node_obstack): New variable.
17587 (print_state): Manage node_obstack.
17588 (print_core): Use node_obstack given by argument.
17589 A node is not only computed here but in print_actions also.
17590 (print_graph): CPP out useless code instead of commenting it.
17591
976e528f
AD
175922001-08-07 Pascal Bart <pascal.bart@epita.fr>
17593
17594 * tests/atconfig.in (CPPFLAGS): Fix.
17595
20e8e5ca
AD
175962001-08-07 Akim Demaille <akim@epita.fr>
17597
17598 * src/print_graph.c (quote): New.
17599 (print_core): Use it.
17600
957d4dbf 176012001-08-06 Akim Demaille <akim@epita.fr>, Marc Autret <autret_m@epita.fr>
3e3da797 17602
3e3da797
AD
17603 * src/vcg.c (complain.h): Include it.
17604 Unepitaize `return' invocations.
c4b66126 17605 [NDEBUG] (main): Remove.
79282c6c 17606 * src/vcg.h (node_t, edge_t, graph_t): Constify the char * members.
c4b66126
AD
17607 * src/files.c (open_files): Initialize graph_obstack.
17608 * src/print_graph.c (print_actions): CPP out useless code.
17609 (print_core): Don't output the last `\n' in labels.
17610 Use `quote'.
17611 * src/files.c (output_files): Output the VCG file.
17612 * src/main.c (main): Invoke print_graph ();
3e3da797 17613
957d4dbf 176142001-08-06 Marc Autret <autret_m@epita.fr>
22c2cbc0
AD
17615
17616 Automaton VCG graph output.
17617 Using option ``-g'' or long option ``--graph'', you can generate
17618 a gram_filename.vcg file containing a VCG description of the LALR (1)
17619 automaton of your grammar.
17620
17621 * src/main.c: Call to print_graph() function.
17622 * src/getargs.h: Update.
17623 * src/getargs.c (options): Update to catch `-g' and `--graph' options.
17624 (graph_flag): New flag.
17625 (longopts): Update.
17626 (getargs): Add case `g'.
17627 * src/files.c (graph_obstack): New obstack struct.
17628 (open_files): Initialize new obstack.
17629 (output_files): Saves graph_obstack if required.
17630 * src/files.h (graph_obstack): New extern declaration.
17631 * src/Makefile.am: Add new source files.
17632
927c1557 176332001-08-06 Marc Autret <autret_m@epita.fr>
ce4d5ce0
AD
17634
17635 * src/print_graph.c, src/print_graph.h (graph): New.
17636 * src/vcg.h: New file.
17637 * src/vcg.c: New file, VCG graph handling.
17638
7333d403
AD
176392001-08-06 Marc Autret <autret_m@epita.fr>
17640
17641 Add of %source_extension and %header_extension which specify
17642 the source or/and the header output file extension.
17643
17644 * src/files.c (compute_base_names): Remove initialisation of
17645 src_extension and header_extension.
17646 (compute_exts_from_gf): Update.
17647 (compute_exts_from_src): Update.
17648 (output_files): Update.
17649 * src/reader.c (parse_header_extension_decl): New.
17650 (parse_source_extension_decl): New.
17651 (read_declarations): New case statements for the new tokens.
17652 * src/lex.c (percent_table): Add entries for %source_extension
17653 and %header_extension.
17654 * src/lex.h (token_e): New tokens tok_hdrext and tok_srcext.
17655
84163231
AD
176562001-08-06 Marc Autret <autret_m@epita.fr>
17657
17658 * configure.in: Bump to 1.28c.
17659 * doc/bison.texinfo: Texinfo thingies.
17660
8303fc42
AD
176612001-08-04 Pascal Bart <pascal.bart@epita.fr>
17662
17663 * tests/atconfig.in (CPPFLAGS): Add.
17664 * tests/calc.at (AT_CHECK): Use CPPFLAGS.
17665
70a84437
AD
176662001-08-03 Akim Demaille <akim@epita.fr>
17667
17668 Version 1.28b.
17669
2ce10144
AD
176702001-08-03 Akim Demaille <akim@epita.fr>
17671
17672 * tests/Makefile.am (check-local): Ship testsuite.
17673 * tests/calc.at (_AT_DATA_CALC_Y): Prototype all the functions.
17674 Include `string.h'.
17675
1e3e4bc1
AD
176762001-08-03 Akim Demaille <akim@epita.fr>
17677
17678 * configure.in: Try using -Wformat when compiling.
17679
42b45b7f
AD
176802001-08-03 Akim Demaille <akim@epita.fr>
17681
17682 * configure.in: Bump to 1.28b.
17683
8f13fe33
AD
176842001-08-03 Akim Demaille <akim@epita.fr>
17685
17686 * src/complain.c: Adjust strerror_r portability issues.
17687
b37ba92c
AD
176882001-08-03 Akim Demaille <akim@epita.fr>
17689
17690 Version 1.28a.
17691
b0ce6046
AD
176922001-08-03 Akim Demaille <akim@epita.fr>
17693
17694 * src/getargs.c, src/getarg.h (skeleton)): Constify.
17695 * src/lex.c (literalchar): Avoid name clashes on `buf'.
17696 * src/getargs.c: Include complain.h.
17697 * src/files.c, src/files.h (skeleton_find): Avoid name clashes.
17698 * lib/quotearg.c, lib/quotearg.h: Update from fileutils 4.1.
17699
d01c415b
AD
177002001-08-03 Akim Demaille <akim@epita.fr>
17701
17702 * src/reader.c (readgram): Display hidden chars in error messages.
17703
459dd1a6
AD
177042001-08-03 Akim Demaille <akim@epita.fr>
17705
17706 Update to gettext 0.10.39.
17707
53b74c0c
AD
177082001-08-03 Akim Demaille <akim@epita.fr>
17709
17710 * lib/strspn.c: New.
17711
234a3be3
AD
177122001-08-01 Marc Autret <autret_m@epita.fr>
17713
17714 * doc/bison.texinfo: Update.
17715 * doc/bison.1 (mandoc): Update.
17716 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove .c and .h.
17717 * src/files.c: Support output files extensions computing.
17718 (src_extension): New static variable.
17719 (header_extension): New static variable.
17720 (tr): New function.
17721 (get_extension_index): New function, gets the index of an extension
17722 filename in a string.
17723 (compute_exts_from_gf): New function, computes extensions from the
17724 grammar file extension.
17725 (compute_exts_from_src): New functions, computes extensions from the
17726 C source file extension, file given by ``-o'' option.
17727 (compute_base_names): Update.
17728 (output_files): Update.
17729
847bf1f5
AD
177302001-08-01 Robert Anisko <anisko_r@epita.fr>
17731
d995fee7 17732 * doc/bison.texi: Document @$.
847bf1f5
AD
17733 (Locations): New section.
17734
d074a105
AD
177352001-07-18 Akim Demaille <akim@epita.fr>
17736
17737 * Makefile.maint, GNUmakefile: New, from Autoconf 2.52.
17738 * config/prev-version.txt, config/move-if-change: New.
17739 * Makefile.am: Adjust.
17740
3419715d
AD
177412001-07-08 Pascal Bart <pascal.bart@epita.fr>
17742
17743 * src/bison.simple (yyparse): Suppress warning `comparaison
17744 between signed and unsigned'.
17745
62ab6972
AD
177462001-07-05 Pascal Bart <pascal.bart@epita.fr>
17747
17748 * src/getargs.h (raw_flag): Remove.
17749 * src/getargs.c: Die on `-r'/`--raw'.
17750 * src/lex.c (parse_percent_token): Die on `%raw'.
17751 * src/reader.c (output_token_defines): Suppress call to `raw_flag'.
17752 * tests/calc.at: Suppress test with option `--raw'.
17753
1e24cc5b
AD
177542001-07-14 Akim Demaille <akim@epita.fr>
17755
17756 * config/: New.
17757 * configure.in: Require Autoconf 2.50.
17758 Update to gettext 0.10.38.
17759
32dfccf8
AD
177602001-03-16 Akim Demaille <akim@epita.fr>
17761
17762 * doc/bison.texinfo: ANSIfy the examples.
17763
cd5bd6ac
AD
177642001-03-16 Akim Demaille <akim@epita.fr>
17765
17766 * getargs.c (skeleton): New variable.
17767 (longopts): --skeleton is a new option.
17768 (shortopts, getargs): -S is a new option.
17769 * getargs.h: Declare skeleton.
17770 * output.c (output_parser): Use it.
17771
5141b016
AD
177722001-03-16 Akim Demaille <akim@epita.fr>
17773
17774 * m4/strerror_r.m4: New.
17775 * m4/error.m4: Run AC_FUNC_STRERROR_R.
17776 * lib/error.h, lib/error.c: Update.
17777
447992b9
AD
177782001-03-16 Akim Demaille <akim@epita.fr>
17779
17780 * src/getargs.c (longopts): Clean up.
17781
274d42ce
AD
177822001-02-21 Akim Demaille <akim@epita.fr>
17783
17784 * src/reader.c (gensym): `gensym_count' is your own.
17785 Use a static buf to create the symbol name, as token_buffer is no
17786 longer a buffer.
17787
22c821f3
AD
177882001-02-08 Akim Demaille <akim@epita.fr>
17789
17790 * src/conflicts.c (conflict_report): Be sure not to append to res
17791 between two calls, which could happen if both first sprintf were
17792 skipped, but not the first cp += strlen.
17793
18569462
AD
177942001-02-08 Akim Demaille <akim@epita.fr>
17795
17796 * lib/memchr.c, lib/stpcpy.c, lib/strndup.c, lib/strnlen.c:
17797 New, from fileutils 4.0.37.
17798 * configure.in: Require Autoconf 2.49c. I took some time before
17799 making this decision. This is the only way out for portability
17800 issues in Bison, it would mean way too much duplicate effort to
17801 import in Bison features implemented in 2.49c since 2.13.
17802 AC_REPLACE_FUNCS and AC_CHECK_DECLS the functions above.
17803
0d8f3c8a
AD
178042001-02-02 Akim Demaille <akim@epita.fr>
17805
17806 * lib/malloc.c, lib/realloc.c: New, from the fileutils 4.0.37.
66075dcf 17807 * lib/xalloc.h, lib/xmalloc.c: Update.
0d8f3c8a 17808
f17bcd1f
AD
178092001-01-19 Akim Demaille <akim@epita.fr>
17810
17811 Get rid of the ad hoc handling of token_buffer in the scanner: use
17812 the obstacks.
17813
17814 * src/lex.c (token_obstack): New.
17815 (init_lex): Initialize it. No longer call...
17816 (grow_token_buffer): this. Remove it.
17817 Adjust all the places which used it to use the obstack.
17818
511e79b3
AD
178192001-01-19 Akim Demaille <akim@epita.fr>
17820
17821 * src/lex.h: Rename all the tokens:
17822 s/\bENDFILE\b/tok_eof/g;
17823 s/\bIDENTIFIER\b/tok_identifier/g;
17824 etc.
17825 Let them be enums, not #define, to ease debugging.
17826 Adjust all the code.
17827
0d6508ef
AD
178282001-01-18 Akim Demaille <akim@epita.fr>
17829
17830 * src/lex.h (MAXTOKEN, maxtoken, grow_token_buffer): Remove, private.
17831 * src/lex.c (maxtoken, grow_token_buffer): Static.
17832
6deb4447
AD
178332001-01-18 Akim Demaille <akim@epita.fr>
17834
17835 Since we now use obstacks, more % directives can be enabled.
17836
17837 * src/lex.c (percent_table): Also accept `%yacc',
17838 `%fixed_output_files', `%defines', `%no_parser', `%verbose', and
17839 `%debug'.
17840 Handle the actions for `%semantic_parser' and `%pure_parser' here,
17841 instead of returning a token.
17842 * src/lex.h (SEMANTIC_PARSER, PURE_PARSER): Remove, unused.
17843 * src/reader.c (read_declarations): Adjust.
17844 * src/files.c (open_files): Don't call `compute_base_names', don't
17845 compute `attrsfile' since they depend upon data which might be
17846 *in* the input file now.
17847 (output_files): Do it here.
17848 * src/output.c (output_headers): Document the fact that this patch
17849 introduces a guaranteed SEGV for semantic parsers.
17850 * doc/bison.texinfo: Document them.
17851 * tests/suite.at: Exercise these %options.
17852
ff4423cc
AD
178532000-12-20 Akim Demaille <akim@epita.fr>
17854
17855 Also handle the output file (--verbose) with obstacks.
17856
17857 * files.c (foutput): Remove.
17858 (output_obstack): New.
17859 Adjust all dependencies.
17860 * src/conflicts.c: Return a string.
17861 * src/system.h (obstack_grow_string): Rename as...
17862 (obstack_sgrow): this. Be ready to work with non literals.
17863 (obstack_fgrow4): New.
17864
956dba3a
AD
178652000-12-20 Akim Demaille <akim@epita.fr>
17866
17867 * src/files.c (open_files): Fix the computation of short_base_name
17868 in the case of `-o foo.tab.c'.
17869
337bab46
AD
178702000-12-20 Akim Demaille <akim@epita.fr>
17871
17872 * src/reader.c (copy_string, copy_comment, copy_comment2, copy_at)
17873 (copy_dollar): Now that everything uses obstacks, get rid of the
17874 FILE * parameters.
17875
5d3214b8
AD
178762000-12-20 Akim Demaille <akim@epita.fr>
17877
17878 * src/files.c (open_files): Actually the `.output' file is based
17879 on the short_base_name, not base_name.
17880 * tests/suite.at (Checking output file names): Adjust.
17881
29092a57
AD
178822000-12-20 Akim Demaille <akim@epita.fr>
17883
17884 * src/bison.s1: Remove, we now use directly...
17885 * src/bison.simple: this.
17886 * src/Makefile.am: Use pkgdata instead of data.
17887
ea5607fd
AD
178882000-12-20 Akim Demaille <akim@epita.fr>
17889
17890 * src/files.c (guard_obstack): New.
17891 (open_files): Initialize it.
17892 (output_files): Dump it...
17893 * src/files.h: Export it.
17894 * src/reader.c (copy_guard): Use it.
17895
27110317
AD
178962000-12-19 Akim Demaille <akim@epita.fr>
17897
17898 * src/files.c (outfile, defsfile, actfile): Removed as global
17899 vars.
17900 (open_files): Don't compute them.
17901 (output_files): Adjust.
17902 (base_name, short_base_name): Be global.
17903 Adjust dependencies.
17904
19c50364
AD
179052000-12-19 Akim Demaille <akim@epita.fr>
17906
17907 * src/files.c (strsuffix): New.
17908 (stringappend): Be just like strcat but allocate.
17909 (base_names): Eve out from open_files.
17910 Try to simplify the rather hairy computation of base_name and
17911 short_base_name.
17912 (open_files): Use it.
17913 * tests/suite.at (Checking output file names): New test.
17914
573c1d9f
AD
179152000-12-19 Akim Demaille <akim@epita.fr>
17916
17917 * src/system.h (obstack_grow_literal_string): Rename as...
17918 (obstack_grow_string): this.
17919 * src/output.c (output_parser): Recognize `%% actions' instead of
17920 `$'.
17921 * src/bison.s1: s/$/%% actions/.
17922 * src/bison.hairy: Likewise.
17923
ef7ddedd
AD
179242000-12-19 Akim Demaille <akim@epita.fr>
17925
17926 * src/output.c (output_parser): Compute the `#line' lines when
17927 there are.
17928 * src/Makefile.am (bison.simple): Be a simple copy of bison.s1.
17929 Suggested by Hans Aberg.
17930
ff61dabd
AD
179312000-12-19 Akim Demaille <akim@epita.fr>
17932
17933 Let the handling of the skeleton files be local to the procedures
17934 that use it.
17935
17936 * src/files.c (xfopen, xfclose, skeleton_find, guardfile): No
17937 longer static.
17938 (fparser, open_extra_files): Remove.
17939 (open_files, output_files): Don't take care of fparser.
17940 * src/files.h: Adjust.
17941 * src/output.c (output_parser): Open and close the file to the
17942 skeleton.
17943 * src/reader.c (read_declarations): When %semantic_parser, open
17944 fguard.
17945
55b96341
AD
179462000-12-19 Akim Demaille <akim@epita.fr>
17947
17948 * src/file.h (BISON_SIMPLE, BISON_HAIRY): Move from here...
17949 * src/system.h (BISON_SIMPLE, BISON_HAIRY): ... to here.
17950
358c15b7
AD
179512000-12-19 Akim Demaille <akim@epita.fr>
17952
17953 * src/files.c (open_files): Yipee! We no longer need all the code
17954 looking for `/tmp' since we have no tmp file.
17955
7de3329e
AD
179562000-12-19 Akim Demaille <akim@epita.fr>
17957
17958 * src/system.h (EXT_TAB, EXT_OUTPUT, EXT_STYPE_H, EXT_GUARD_C):
17959 New macros.
17960 * src/files.c (open_files): Less dependency on MSDOS etc.
17961
3abcd459
AD
179622000-12-14 Akim Demaille <akim@epita.fr>
17963
17964 * src/bison.s1 (YYLLOC_DEFAULT): New macro.
17965 Provide a default definition.
17966 Use it when executing the default @ action.
17967 * src/reader.c (reader_output_yylsp): No longer include
17968 `timestamp' and `text' in the default YYLTYPE.
17969
2a91a95e
AD
179702000-12-12 Akim Demaille <akim@epita.fr>
17971
17972 * src/reader.c (copy_definition, parse_union_decl, copy_action)
17973 (copy_guard): Quote the file names.
17974 Reported by Laurent Mascherpa.
17975
14d3eb9b
AD
179762000-12-12 Akim Demaille <akim@epita.fr>
17977
17978 * src/output.c (output_headers, output_program, output): Be sure
17979 to escape special characters when outputting filenames.
17980 (ACTSTR_PROLOGUE, ACTSTR_EPILOGUE): Remove.
17981 (output_headers): Don't depend on them, Use ACTSTR.
17982
d7045ec6
AD
179832000-11-17 Akim Demaille <akim@epita.fr>
17984
17985 * lib/obstack.h: Formatting changes.
17986 (obstack_grow, obstack_grow0): Don't cast WHERE at all: it
17987 prevents type checking.
17988 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
17989 cast the value to (void *): assigning a `foo *' to a `void *'
17990 variable is valid.
17991 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
17992 * src/reader.c (parse_union_decl): Typo: use obstack_1grow to
17993 append characters.
17994
6fd54b73
AD
179952000-11-17 Akim Demaille <akim@epita.fr>
17996
17997 * tests/Makefile.am (suite.m4, regression.m4, calc.m4): Rename
17998 as...
17999 (suite.m4, regression.m4, calc.m4): these.
18000 * tests/atgeneral.m4: Update from CVS Autoconf.
18001
4c50eae6
AD
180022000-11-17 Akim Demaille <akim@epita.fr>
18003
18004 * tests/regression.m4 (%union and --defines): New test,
18005 demonstrating a current bug in the obstack implementation.
18006
a35f64ea
AD
180072000-11-17 Akim Demaille <akim@epita.fr>
18008
18009 * src/bison.s1 (_YY_DECL_VARIABLES, YY_DECL_VARIABLES): New
18010 macros.
18011 Use them to declare the variables which are global or local to
18012 `yyparse'.
18013
7de23534
AD
180142000-11-17 Akim Demaille <akim@epita.fr>
18015
18016 * acconfig.h: Remove, no longer used.
18017
aa7815f5
AD
180182000-11-07 Akim Demaille <akim@epita.fr>
18019
18020 * src: s/Copyright (C)/Copyright/g.
18021
5af1f549
AD
180222000-11-07 Akim Demaille <akim@epita.fr>
18023
18024 * src/reader.c (reader): #define YYLSP_NEEDED to 1 instead of just
18025 defining.
18026 * src/bison.s1: s/#ifdef YYLSP_NEEDED/#if YYLSP_NEEDED/.
18027
553e2b22
AD
180282000-11-07 Akim Demaille <akim@epita.fr>
18029
18030 * src/bison.s1 (YYLEX): Use #if instead of #ifdef.
18031 Merge in a single CPP if/else.
18032
8a4f41d6
AD
180332000-11-07 Akim Demaille <akim@epita.fr>
18034
18035 * src/output.c (output): Remove useless variables.
18036 * lib/obstack.c (obstack_grow, obstack_grow0): Rename the second
18037 argument `data' for consistency with the prototypes.
18038 Qualify it `const'.
18039 (obstack_copy, obstack_copy0): Rename the second argument as
18040 `address' for consistency. Qualify it `const'.
18041 * lib/obstack.h (obstack_copy, obstack_copy0, obstack_grow)
18042 (obstack_grow0, obstack_ptr_grow, obstack_ptr_grow_fast): Qualify
18043 `const' their input argument (`data' or `address').
18044 Adjust the corresponding macros to include `const' in casts.
18045
095a3fb5
AD
180462000-11-03 Akim Demaille <akim@epita.fr>
18047
18048 * src/Makefile.am (INCLUDES): s/PFILE/BISON_SIMPLE/.
18049 s/PFILE1/BISON_HAIRY/.
18050 Adjust dependencies.
18051
d1cdce7c
AD
180522000-11-03 Akim Demaille <akim@epita.fr>
18053
090c5ebf 18054 For some reason, this was not applied.
d1cdce7c
AD
18055
18056 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
18057 `unlink': it's no longer used.
18058
9311529b
AD
180592000-11-03 Akim Demaille <akim@epita.fr>
18060
18061 * src/files.c (skeleton_find): New function, eved out of...
18062 (open_files, open_extra_files): here.
18063
d8880f69
AD
180642000-11-03 Akim Demaille <akim@epita.fr>
18065
18066 Don't use `atexit'.
18067
18068 * src/files.c (obstack_save): New function.
18069 (done): Rename as...
18070 (output_files): this.
18071 Use `obstack_save'.
18072 * src/main.c (main): Don't use `atexit' to register `done', since
18073 it no longer has to remove tmp files, just call `output_files'
18074 when there are no errors.
18075
0dbb648e
AD
180762000-11-02 Akim Demaille <akim@epita.fr>
18077
18078 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
18079 `unlink': it's no longer used.
18080 * src/files.h: Formatting changes.
18081
896fe5c1
AD
180822000-11-02 Akim Demaille <akim@epita.fr>
18083
18084 Remove the last uses of mktemp and unlink/delete.
18085
18086 * src/files.c (fdefines, ftable): Removed.
18087 (defines_ostack, table_obstack): New.
18088 Adjust dependencies of the former into uses of the latter.
18089 * src/output.c (output_short_or_char_table, output_short_table):
18090 Convert to using obstacks.
18091 * src/reader.c (copy_comment2): Accept one FILE * and two
18092 obstacks.
18093 (output_token_defines, reader_output_yylsp): Use obstacks.
18094 * src/system.h (obstack_fgrow3): New.
1f65350a 18095 * po/POTFILES.in: Adjust.
896fe5c1 18096
dd60faec
AD
180972000-11-01 Akim Demaille <akim@epita.fr>
18098
18099 Change each use of `fattrs' into a use of `attrs_obstack'.
18100
18101 * src/reader.c (copy_at): Typo: s/yylloc/yyloc/.
18102 * src/files.c (fattrs): Remove.
18103 (attrs_obstack): New.
18104 Adjust all dependencies.
18105 (done): If SEMANTIC_PARSER, dump attrs_obstack into attrsfile.
18106
8c7ebe49
AD
181072000-11-01 Akim Demaille <akim@epita.fr>
18108
18109 Introduce obstacks.
18110 Change each use of `faction' into a use of `action_obstack'.
18111
18112 * lib/obstack.h, lib/obstack.c: New files.
18113 * src/files.c (faction): Remove.
18114 (action_obstack): New.
18115 Adjust all dependencies.
18116
77aee789
AD
181172000-10-20 Akim Demaille <akim@epita.fr>
18118
18119 * lib/quote.h (PARAMS): New macro. Use it.
18120
43591cec
AD
181212000-10-16 Akim Demaille <akim@epita.fr>
18122
18123 * src/output.c (output_short_or_char_table): New function.
18124 (output_short_table, output_token_translations): Use it.
18125 (goto_actions): Use output_short_table.
18126
1e9798d5
AD
181272000-10-16 Akim Demaille <akim@epita.fr>
18128
18129 * src/symtab.c (bucket_new): New function.
18130 (getsym): Use it.
18131
18132 * src/output.c (output_short_table): New argument to display the
18133 comment associated with the table.
18134 Adjust dependencies.
18135 (output_gram): Use it.
18136 (output_rule_data): Nicer output layout for YYTNAME.
18137
f282676b
AD
181382000-10-16 Akim Demaille <akim@epita.fr>
18139
18140 * src/lex.c (read_typename): New function.
18141 (lex): Use it.
18142 * src/reader.c (copy_dollar): Likewise.
18143
550a72a3
AD
181442000-10-16 Akim Demaille <akim@epita.fr>
18145
18146 * src/reader.c (copy_comment2): Expect the input stream to be on
18147 the `/' which is suspected to open a comment, instead of being
18148 called after `//' or `/*' was read.
18149 (copy_comment, copy_definition, parse_union_decl, copy_action)
18150 (copy_guard): Adjust.
18151
131e2fef
AD
181522000-10-16 Akim Demaille <akim@epita.fr>
18153
18154 * src/reader.c (parse_expect_decl): Use `skip_white_space' and
18155 `read_signed_integer'.
18156
79282c5a
AD
181572000-10-16 Akim Demaille <akim@epita.fr>
18158
18159 * src/reader.c (copy_dollar): New function.
18160 (copy_guard, copy_action): Use it.
18161
ff4a34be
AD
181622000-10-16 Akim Demaille <akim@epita.fr>
18163
18164 * lib/quote.h, lib/quote.c, lib/quotearg.h, lib/quotearg.c:
18165 * m4/prereq.m4, m4/c-bs-a.m4, m4/mbstate.m4:
18166 New files, from Fileutils 4.0.27.
18167 * src/main.c (printable_version): Remove.
18168 * src/lex.c, src/reader.c: Use `quote'.
18169
181702000-10-04 Akim Demaille <akim@epita.fr>
18171
18172 * lib/error.c, lib/error.h: New files, needed by xmalloc.c.
18173
14ded682
AD
181742000-10-04 Akim Demaille <akim@epita.fr>
18175
18176 * doc/bison.texinfo: Various typos spotted by Neil Booth.
18177
8e03724b
AD
181782000-10-04 Akim Demaille <akim@epita.fr>
18179
18180 When a literal string is used to define two different tokens,
18181 `bison -v' segfaults.
18182 Reported by Piotr Gackiewicz, and fixed by Neil Booth.
18183
18184 * tests/regression.m4: New file.
18185 Include the core of the sample provided by Piotr Gackiewicz.
18186 * src/reader.c (parse_token_decl): Diagnose bad cases, and proceed
18187 properly.
18188
a9e64249
AD
181892000-10-04 Akim Demaille <akim@epita.fr>
18190
18191 * src/reader.c (parse_expect_decl): Keep `count' within the size
18192 of `buffer'.
18193 From Neil Booth.
18194
da9abf43
AD
181952000-10-02 Paul Eggert <eggert@twinsun.com>
18196
18197 * bison.s1 (yyparse): Assign the default value
18198 unconditionally, to avoid a GCC warning and make the parser a
18199 tad smaller.
18200
c33638bb
AD
182012000-10-02 Akim Demaille <akim@epita.fr>
18202
18203 * src/getargs.c (getargs): Don't dump `--help' on unrecognized
18204 options.
18205
444c570a
AD
182062000-10-02 Akim Demaille <akim@epita.fr>
18207
18208 * src/derives.c, src/print.c, src/reduce.c: To ease the
18209 translation, move some `\n' out of the translated strings.
18210
89cab50d
AD
182112000-10-02 Akim Demaille <akim@epita.fr>
18212
18213 The location tracking mechanism is precious for parse error
18214 messages. Nevertheless, it is enabled only when `@n' is used in
18215 the grammar, which is a different issue (you can use it in error
18216 message, but not in the grammar per se). Therefore, there should
18217 be another means to enable it.
18218
18219 * src/getargs.c (getargs): Support `--locations'.
18220 (usage): Report it.
18221 * src/getargs.h (locationsflag): Export it.
18222 * src/lex.c (percent_table): Support `%locations'.
18223 * src/reader.c (yylsp_needed): Remove this variable, now replaced
18224 with `locationsflag'.
18225 * doc/bison.texinfo: Document `--locations' and `%locations'.
18226 Sort the options.
18227 * tests/calc.m4: Test it.
18228
18229 For regularity of the names, replace each
18230 (nolineflag, toknumflag, rawtokenumflag, noparserflag): with...
18231 (no_lineflag, token_tableflag, rawflag, no_parserflag): this.
18232 In addition replace each `flag' with `_flag'.
18233
d6c2cba0
AD
182342000-10-02 Akim Demaille <akim@epita.fr>
18235
18236 Also test parse error messages, including with YYERROR_VERBOSE.
18237
18238 * tests/calc.m4 (calc.y): Add support for `exp = exp' (non
18239 associative).
18240 Use it to check the computations.
18241 Use it to check `nonassoc' is honored.
18242 (AT_DATA_CALC_Y): Equip `calc.y' with YYERROR_VERBOSE when passed
18243 `--yyerror-verbose'.
18244 (_AT_CHECK_CALC): Adjust to this option.
18245 (_AT_CHECK_CALC_ERROR): New macro to check parse error messages.
18246
5a35a6cb
AD
182472000-10-02 Akim Demaille <akim@epita.fr>
18248
18249 Test also `--verbose', `--defines' and `--name-prefix'. Testing
18250 the latter demonstrates a flaw in the handling of non debugging
18251 parsers introduced by myself on 2000-03-16: `#define yydebug 0'
18252 was used in order to simplify:
18253
18254 #if YYDEBUG
18255 if (yydebug)
18256 {
18257 ...
18258 }
18259 #endif
18260
18261 into
18262
18263 if (yydebug)
18264 {
18265 ...
18266 }
18267
18268 unfortunately this leads to a CPP conflict when
18269 `--name-prefix=foo' is used since it produces `#define yydebug
18270 foodebug'.
18271
18272 * src/bison.s1 [!YYDEBUG]: Do not define yydebug.
18273 (YYDPRINTF): New macro.
18274 Spread its use.
18275 * tests/calc.m4 (AT_CHECK_CALC): Do require a title, build it from
18276 the bison options.
18277 Also test `--verbose', `--defines' and `--name-prefix'.
18278
71da9eea
AD
182792000-10-02 Akim Demaille <akim@epita.fr>
18280
18281 Improve the readability of the produced parsers.
18282
18283 * src/bison.s1: Formatting changes.
18284 Improve the comment related to the `$' mark.
18285 (yydefault): Don't fall through to `yyresume': `goto' there.
18286 * src/output.c (output_parser): When the `$' is met, skip the end
18287 of its line.
18288 New variable, `number_of_dollar_signs', to check there's exactly
18289 one `$' in the parser skeleton.
18290
95e36146
AD
182912000-10-02 Akim Demaille <akim@epita.fr>
18292
18293 * lib/xstrdup.c: New file, from the fileutils.
18294 * src/reader.c (parse_token_decl, get_type_name, parse_type_decl)
18295 (parse_assoc_decl, parse_thong_decl, get_type): Use `xstrdup'
18296 instead of strlen + xmalloc + strcpy.
18297 * src/symtab.c (copys): Remove, use xstrdup instead.
18298
d7020c20
AD
182992000-10-02 Akim Demaille <akim@epita.fr>
18300
18301 * src/gram.h (associativity): New enum type which replaces the
18302 former CPP macros `RIGHT_ASSOC', `LEFT_ASSOC' and `NON_ASSOC' with
18303 `right_assoc', `left_assoc' and `non_assoc'.
18304 Adjust all dependencies.
18305 * src/reader.c: Formatting changes.
18306 (LTYPESTR): Don't define it, use it as a literal in
18307 `reader_output_yylsp'.
18308 * src/symtab.h (symbol_class): New enum type which replaces the
18309 former CPP macros `SUNKNOWN', `STOKEN and `SNTERM' with
18310 `sunknown', `stoken and `snterm'.
18311
1916f98e
AD
183122000-10-02 Akim Demaille <akim@epita.fr>
18313
18314 * src/getargs.c (fixed_outfiles): Rename as...
18315 (yaccflag): for consistency and accuracy.
18316 Adjust dependencies.
18317
d7913476
AD
183182000-10-02 Akim Demaille <akim@epita.fr>
18319
18320 Use the more standard files `xalloc.h' and `xmalloc.c' instead of
18321 Bison's `allocate.c' and `alloc.h'. This patch was surprisingly
18322 difficult and introduced a lot of core dump. It turns out that
18323 Bison used an implementation of `xmalloc' based on `calloc', and
18324 at various places it does depend upon the initialization to 0. I
18325 have not tried to isolate the pertinent places, and all the former
18326 calls to Bison's `xmalloc' are now using `XCALLOC'. Someday,
18327 someone should address this issue.
18328
18329 * src/allocate.c, src/alloc.h, m4/bison-decl.m4: Remove.
18330 * lib/xmalloc.c, lib/xalloc.h, m4/malloc.m4, m4/realloc.m4: New
18331 files.
18332 Adjust dependencies.
18333 * src/warshall.h: New file.
18334 Propagate.
18335
340ef489
AD
183362000-10-02 Akim Demaille <akim@epita.fr>
18337
18338 Various anti-`extern in *.c' changes.
18339
18340 * src/system.h: Include `assert.h'.
18341
b2ca4022
AD
183422000-10-02 Akim Demaille <akim@epita.fr>
18343
18344 * src/state.h (nstates, final_state, first_state, first_shift)
18345 (first_reduction): Move their exportation from here...
18346 * src/LR0.h: to here.
18347 Adjust dependencies.
18348 * src/getargs.c (statisticsflag): New variable.
18349 Add support for `--statistics'.
18350 Adjust dependencies.
18351
18352 Remove a lot of now useless `extern' statements in most files.
18353
403b315b
AD
183542000-10-02 Akim Demaille <akim@epita.fr>
18355
18356 * src/LR0.h: New file.
18357 Propagate its use.
18358
07a58c13
AD
183592000-10-02 Akim Demaille <akim@epita.fr>
18360
18361 * src/print.h: New file.
18362 Propagate its use.
18363 * src/print.c: Formatting and ordering changes.
18364 (verbose, terse): Replace with...
18365 (print_results): this new function.
18366 Adjust dependencies.
18367
0619caf0
AD
183682000-10-02 Akim Demaille <akim@epita.fr>
18369
18370 * src/conflicts.c (conflict_report): New function.
18371 (conflict_log, verbose_conflict_log): Replace with...
18372 (print_conflicts): this function.
18373 Adjust dependencies.
18374 * src/conflicts.h: New file.
18375 Propagate its inclusion.
18376
3519ec76
AD
183772000-10-02 Akim Demaille <akim@epita.fr>
18378
18379 * src/nullable.h: New file.
18380 Propagate its inclusion.
18381 * src/nullable.c: Formatting changes.
18382
015acc48
AD
183832000-10-02 Akim Demaille <akim@epita.fr>
18384
18385 * src/reduce.h: New file.
18386 Propagate its inclusion.
18387 * src/reduce.c: Topological sort and other formatting changes.
18388 (bool, TRUE, FALSE): Move their definition to...
18389 * src/system.h: here.
18390
8963a27b
AD
183912000-10-02 Akim Demaille <akim@epita.fr>
18392
18393 * src/files.c: Formatting changes.
18394 (tryopen, tryclose, openfiles): Rename as...
18395 (xfopen, xfclose, open_files): this.
18396 (stringappend): static.
18397 * src/files.h: Complete the list of exported symbols.
18398 Propagate its use.
18399
a70083a3
AD
184002000-10-02 Akim Demaille <akim@epita.fr>
18401
18402 * src/reader.h: New file.
18403 Propagate its use instead of tedious list of `extern' and
18404 prototypes.
18405 * src/reader.c: Formatting changes, topological sort,
18406 s/register//.
18407
abadc117
AD
184082000-10-02 Akim Demaille <akim@epita.fr>
18409
18410 * src/lex.h: Prototype `lex.c' exported functions.
18411 * src/reader.c: Adjust.
18412 * src/lex.c: Formatting changes.
18413 (safegetc): Rename as...
18414 (xgetc): this.
18415
720d742f
AD
184162000-10-02 Akim Demaille <akim@epita.fr>
18417
18418 * src/lalr.h: New file.
18419 Propagate its inclusion instead of prototypes and `extern'.
18420 * src/lalr.c: Formatting changes, topological sorting etc.
18421
f2acea59
AD
184222000-10-02 Akim Demaille <akim@epita.fr>
18423
18424 * src/output.c (token_actions): Introduce a temporary array,
18425 YYDEFACT, that makes it possible for this function to use
18426 output_short_table.
18427
d019d655
AD
184282000-10-02 Akim Demaille <akim@epita.fr>
18429
18430 `user_toknums' is output as a `short[]' in `output.c', while it is
18431 defined as a `int[]' in `reader.c'. For consistency with the
18432 other output tables, `user_toknums' is now defined as a table of
18433 shorts.
18434
18435 * src/reader.c (user_toknums): Be a short table instead of an int
18436 table.
18437 Adjust dependencies.
18438
18439 Factor the short table outputs.
18440
18441 * src/output.c (output_short_table): New function.
18442 * src/output.c (output_gram, output_stos, output_rule_data)
18443 (output_base, output_table, output_check): Use it.
18444
6c89f1c1
AD
184452000-10-02 Akim Demaille <akim@epita.fr>
18446
18447 * src/output.c (output): Topological sort of the functions, in
18448 order to get rid of the `static' prototypes.
18449 No longer use `register'.
18450 * src/output.h: New file.
18451 Propagate its inclusion in files explicitly prototyping functions
18452 from output.c.
18453
d9efd181
AD
184542000-09-21 Akim Demaille <akim@epita.fr>
18455
18456 * src/atgeneral.m4: Update from Autoconf.
18457
c29240e7 184582000-09-21 Akim Demaille <akim@epita.fr>
2fa6973e
AD
18459
18460 * src/closure.h: New file.
18461 * src/closure.c: Formatting changes, topological sort over the
18462 functions, use of closure.h.
18463 (initialize_closure, finalize_closure): Rename as...
18464 (new_closure, free_closure): these. Adjust dependencies.
18465 * src/LR0.c: Formatting changes, topological sort, use of
18466 cloture.h.
18467 (initialize_states): Rename as...
18468 (new_states): this.
18469 * src/Makefile.am (noinst_HEADERS): Adjust.
18470
499daa50
AD
184712000-09-20 Akim Demaille <akim@epita.fr>
18472
18473 * src/acconfig.h: Don't protect config.h against multiple
18474 inclusion.
18475 Don't define PARAMS.
18476 * src/system.h: Define PARAMS.
18477 Remove some of the ad-hoc CPP magic for DOS, VMS etc.: this is the
18478 purpose of config.h. system.h must not try to fix wrong
18479 definitions in config.h.
18480
cc84fd5d
AD
184812000-09-20 Akim Demaille <akim@epita.fr>
18482
18483 * src/derives.h: New file.
18484 * src/main.c, src/derives.h: Use it.
18485 Formatting changes.
18486 * src/Makefile.am (noinst_HEADERS): Adjust.
18487
db5b3a89
AD
184882000-09-20 Akim Demaille <akim@epita.fr>
18489
18490 * tests/atgeneral.m4: Update from Autoconf.
18491 * tests/calc.m4 (_AT_DATA_CALC_Y, AT_DATA_CALC_Y, _AT_CHECK_CALC)
18492 (AT_CHECK_CALC): New macros.
18493 Use these macros to test bison with options `', `--raw',
18494 `--debug', `--yacc', `--yacc --debug'.
18495
ceed8467
AD
184962000-09-19 Akim Demaille <akim@epita.fr>
18497
18498 * src/output.c: Formatting changes.
18499 * src/machine.h: Remove, leaving its contents in...
18500 * src/system.h: here.
18501 Include stdio.h.
18502 Adjust all dependencies on stdio.h and machine.h.
18503 * src/getargs.h: New file.
18504 Let all `extern' declarations about getargs.c be replaced with
18505 inclusion of `getargs.h'.
18506 * src/Makefile.am (noinst_HEADERS): Adjust.
18507
18508 * tests/calc.m4 (yyin): Be initialized in main, not on the global
18509 scope.
18510 (yyerror): Returns void, not int.
18511 * doc/bison.texinfo: Formatting changes.
18512
05a1d24b
AD
185132000-09-19 Akim Demaille <akim@epita.fr>
18514
18515 * tests/calc.m4 (calc.y): Do not assign to stdin, as it's not
18516 portable.
18517
cbd25751
AD
185182000-09-18 Akim Demaille <akim@epita.fr>
18519
18520 * configure.in: Append WARNING_CFLAGS to CFLAGS.
18521 * src/Makefile.am (INCLUDES): Don't.
18522 Be ready to fetch headers in lib/.
18523
13863333
AD
185242000-09-18 Akim Demaille <akim@epita.fr>
18525
18526 * doc/bison.texinfo: Update the copyright.
18527 ANSIfy and GNUify the examples.
18528 Remove the old menu.
18529
0d533154
AD
185302000-09-18 Akim Demaille <akim@epita.fr>
18531
18532 First set of tests: use the `calc' example from the documentation.
18533
18534 * src/bison.s1 (yyparse): Condition the code using `yytname' which
18535 is defined only when YYDEBUG is.
18536 * m4/atconfig.m4 (AT_CONFIG): Adjust to Autoconf 2.13.
18537 * src/files.c (tryopen, tryclose): Formatting changes.
18538 Move to the top and be static.
18539 * src/reader.c (read_signed_integer): Likewise.
18540 * tests/calc.m4: New file.
18541 * Makefile.am, suite.m4: Adjust.
18542 * m4/atconfig.m4: Set BISON_SIMPLE and BISON_HAIRY.
18543
e79137ac
AD
185442000-09-18 Akim Demaille <akim@epita.fr>
18545
18546 Add support for an Autotest test suite for Bison.
18547
18548 * m4/m4.m4, m4/atconfig.m4: New files.
18549 * m4/Makefile.am (EXTRA_DIST): Adjust.
18550 * tests/suite.m4, tests/Makefile.am, tests/atgeneral.m4: New
18551 files.
18552 * src/getargs.c: Display a more standard --version message.
18553 * src/reader.c (reader): Formatting changes.
18554 No longer depend upon VERSION_STRING.
18555 * configure.in: No longer use `dnl'.
18556 Set up the test suite and the new directory `tests/.
18557 (VERSION_STRING): Remove.
18558
27821bff
AD
185592000-04-14 Akim Demaille <akim@epita.fr>
18560
18561 * src/reader.c (copy_comment2): New function, same as former
18562 `copy_comment', but outputs into two FILE *.
18563 (copy_comment): Use it.
18564 (parse_union_decl): Use it.
18565 (get_type, parse_start_decl): Use the same `invalid' message.
18566 (parse_start_decl, parse_union_decl): Use the same `multiple'
18567 message.
18568 (parse_union_decl, copy_guard, copy_action): Use the same
18569 `unmatched' message.
18570 * m4/Makefile.am (EXTRA_DIST): Add `warning.m4'.
18571
cfe5fbc0
AD
185722000-03-31 Akim Demaille <akim@epita.fr>
18573
18574 * src/files.c (tryopen, tryclose): Move to the top.
18575 Be static.
18576
cb7db13e
AD
185772000-03-31 Akim Demaille <akim@epita.fr>
18578
18579 * src/main.c (main): Don't call `done', exit does it.
18580
a0f6b076
AD
185812000-03-31 Akim Demaille <akim@epita.fr>
18582
36281465
AD
18583 * allocate.c: s/return (foo)/return foo/.
18584 * lalr.c: Likewise.
18585 * LR0.c: Likewise.
18586 * output.c: Likewise.
18587 * reader.c: Likewise.
18588 * symtab.c: Likewise.
18589 * vmsgetargs.c: Likewise.
18590
185912000-03-31 Akim Demaille <akim@epita.fr>
18592
18593 Clean up the error reporting functions.
a0f6b076
AD
18594
18595 * src/report.c: New file.
18596 * src/report.h: Likewise.
18597 * src/Makefile.am: Adjust.
18598 * m4/error.m4: New file.
18599 * m4/Makefile.am: Adjust.
18600 * configure.in (jm_PREREQ_ERROR): Call it.
18601 * src/main.c (int_to_string, banner, fatal_banner, warn_banner):
18602 Remove.
18603 (fatal, fatals): Remove. All callers use complain.c::fatal.
18604 (warn, warni, warns, warnss, warnss): Remove. All callers use
18605 complain.c::complain.
18606 (toomany): Remove, use fatal instead.
18607 * src/files.c (done): No argument, use complain_message_count.
18608 * src/main.c (main): Register `done' to `atexit'.
18609
18610 * src/getargs.c (usage): More `fputs', less `fprintf'.
18611
18539825
AD
186122000-03-28 Akim Demaille <akim@epita.fr>
18613
18614 * lib/: New directory.
18615 * Makefile.am (SUBDIRS): Adjust.
18616 * configure.in: Adjust.
18617 (LIBOBJS): Although not used yet, AC_SUBST it, otherwise it's
18618 useless.
18619 * src/alloca.c: Moved to lib/.
18620 * src/getopt.c: Likewise.
18621 * src/getopt1.c: Likewise.
18622 * src/getopt.h: Likewise.
18623 * src/ansi2knr.c: Likewise.
18624 * src/ansi2knr.1: Likewise.
18625 * src/Makefile.am: Adjust.
18626 * lib/Makefile.am: New file.
18627
9f306f2a
AD
186282000-03-28 Akim Demaille <akim@epita.fr>
18629
18630 * src/getargs.c (usage): Refresh the help message.
18631
0ba347b6
AD
186322000-03-17 Akim Demaille <akim@epita.fr>
18633
18634 * src/getopt1.c: Updated from textutils 2.0e
18635 * src/getopt.c: Likewise.
18636 * src/getopt.h: Likewise.
18637
dbe7f271
AD
186382000-03-17 Akim Demaille <akim@epita.fr>
18639
18640 * src/Makefile.am (bison.simple): Fix the awk program: quote only
18641 the file name, not the whole `#line LINE FILE'.
18642
75bbe78d
AD
186432000-03-17 Akim Demaille <akim@epita.fr>
18644
18645 On syntax errors, report the token on which we choked.
18646
aa5fd0ee
AD
18647 * src/bison.s1 (yyparse): In the label yyerrlab, when
18648 YYERROR_VERBOSE, add yychar in msg.
75bbe78d 18649
7b306f52
AD
186502000-03-17 Akim Demaille <akim@epita.fr>
18651
aa5fd0ee 18652 * src/reader.c (copy_at): New function.
7b306f52
AD
18653 (copy_guard): Use it.
18654 (copy_action): Use it.
18655
e87b5700
AD
186562000-03-17 Akim Demaille <akim@epita.fr>
18657
18658 Be kind to translators, save some useless translations.
18659
aa5fd0ee 18660 * src/main.c (banner): New function.
e87b5700
AD
18661 (fatal_banner): Use it.
18662 (warn_banner): Use it.
18663
ae3c3164
AD
186642000-03-17 Akim Demaille <akim@epita.fr>
18665
aa5fd0ee
AD
18666 * src/reader.c (copy_definition): Use copy_string and
18667 copy_comment. Removed now unused `match', `ended',
18668 `cplus_comment'.
ae3c3164
AD
18669 (copy_comment, copy_string): Moved, to be visible from
18670 copy_definition.
18671
4dc58e7c
AD
186722000-03-17 Akim Demaille <akim@epita.fr>
18673
aa5fd0ee
AD
18674 * src/reader.c (copy_string): Declare `static inline'. No
18675 problems with inline, since it is checked by configure.
4dc58e7c
AD
18676 (copy_comment): Likewise.
18677
0a6384c4
AD
186782000-03-17 Akim Demaille <akim@epita.fr>
18679
aa5fd0ee 18680 * src/reader.c (packsymbols): Formatting changes.
0a6384c4 18681
3cef001a
AD
186822000-03-17 Akim Demaille <akim@epita.fr>
18683
aa5fd0ee 18684 * src/reader.c (copy_comment): New function, factored out from:
3cef001a
AD
18685 (copy_action): Use it. Removed now unused `match', `ended',
18686 `cplus_comment'.
18687 (copy_guard): Likewise.
18688
ca36d2ef
AD
186892000-03-17 Akim Demaille <akim@epita.fr>
18690
aa5fd0ee 18691 * src/reader.c (copy_string): New function, factored out from:
ca36d2ef
AD
18692 (copy_action): Use it.
18693 (copy_guard): Likewise.
18694
6666f98f
AD
186952000-03-17 Akim Demaille <akim@epita.fr>
18696
18697 Change the handling of @s so that they behave exactly like $s.
18698 There is now a pseudo variable @$ (readble and writable), location
18699 of the lhs of the rule (by default ranging from the location of
18700 the first symbol of the rhs, to the location of the last symbol,
18701 or, if the rhs is empty, YYLLOC).
18702
18703 * src/bison.s1 [YYLSP_NEEDED] (yyloc): New variable, twin of
18704 yyval.
18705 (yyparse): When providing a default semantic action, provide a
18706 default location action.
18707 (after the $): No longer change `*YYLSP', just stack YYLOC the
18708 same way you stack YYVAL.
18709 * src/reader.c (read_declarations): Use warns.
18710 (copy_guard, case '@'): Also recognize `@$', expanded as `YYLOC'.
18711 (copy_action, case '@'): Likewise.
18712 Use a standard error message, to save useless work from
18713 translators.
18714
41aca2e0
AD
187152000-03-17 Akim Demaille <akim@epita.fr>
18716
aa5fd0ee
AD
18717 * src/bison.s1: Formatting and cosmetics changes.
18718 * src/reader.c: Likewise.
41aca2e0
AD
18719 Update the Copyright notice.
18720
dc08c1d5
AD
187212000-03-17 Akim Demaille <akim@epita.fr>
18722
aa5fd0ee
AD
18723 * src/bison.s1 (#line): All set to `#line' only, since the
18724 Makefile now handles them.
dc08c1d5 18725
9ee3c97b
AD
187262000-03-16 Akim Demaille <akim@epita.fr>
18727
18728 * src/output.c (output_rule_data): Output the documentation of
18729 some of the tables.
18730 (Copyright notice): Update.
18731 Formatting changes.
18732
0de741ca
AD
187332000-03-16 Akim Demaille <akim@epita.fr>
18734
18735 * src/bison.s1 [!YYDEBUG]: Define yydebug to 0. This allows to
18736 remove most `#if YYDEBUG != 0', since `if (yydebug)' is enough.
18737 One `#if YYDEBUG' remains, since it uses variables which are
18738 defined only if `YYDEBUG != 0'.
18739
bb10be54
AD
187402000-03-16 Akim Demaille <akim@epita.fr>
18741
18742 * src/bison.s1 (yyparse): Reorganize the definitions of the stacks
18743 and related variables so that the similarities are highlighted.
18744
b07b484a
AD
187452000-03-16 Akim Demaille <akim@epita.fr>
18746
18747 * src/bison.s1: Properly indent CPP directives.
18748
361f60b3
AD
187492000-03-16 Akim Demaille <akim@epita.fr>
18750
18751 * src/bison.s1: Properly indent the `alloca' CPP section.
18752
8c44d3ec
AD
187532000-03-16 Akim Demaille <akim@epita.fr>
18754
18755 Do not hard code values of directories in `configure.in'.
18756 Update the `configure' tool chain.
18757
18758 * configure.in (XPFILE, XPFILE1, LOCALEDIR): Remove, handled by
18759 src/makefile.am.
18760 (VERSION_STRING): Use the third arg of AC_DEFINE_UNQUOTED.
18761 (AC_OUTPUT): Add m4/Makefile.
18762 Bump to bison 1.28a, 1.29 has never been released.
18763 * acconfig.h (XPFILE, XPFILE1, LOCALEDIR): Remove, since they are
18764 handled via src/Makefile.am.
18765 (VERSION_STRING, PROTOTYPES, ENABLE_NLS, HAVE_CATGETS,
18766 HAVE_GETTEXT, HAVE_LC_MESSAGES, HAVE_STPCPY): Remove, handled by
18767 autoheader.
18768 * Makefile.am (SUBDIRS): Add m4.
18769 (ACLOCAL_AM_FLAGS): New variable.
18770 (AUTOMAKE_OPTIONS): Add check-news.
18771 * src/Makefile.am (bison.simple): Use awk to replace #line lines with
18772 the proper line number and file name.
18773 (DEFS): Propagate the location of bison library files and of the
18774 locale files.
18775 (INCLUDES): Added `-I ..' so that one can compile with srcdir !=
18776 builddir.
18777 * acinclude.m4: Remove, replaced by the directory m4.
18778 * m4/Makefile.am (EXTRA_DIST): New variable.
18779 * m4/gettext.m4: New file, from the fileutils.
18780 * m4/lcmessage.m4: Likewise
18781 * m4/progtest.m4: Likewise.
18782 * m4/bison-decl.m4: New file, extracted from former acinclude.m4.
18783
f95997e7
AD
187842000-03-10 Akim Demaille <akim@epita.fr>
18785
18786 * src/closure.c:
18787 Formatting changes of various comments.
18788 Respect the GNU coding standards at various places.
18789 Don't use `_()' when no translation is needed.
18790
187911999-12-13 Jesse Thilo <jthilo@gnu.org>
18792
18793 * src/files.c:
18794 OS/2 honors TMPDIR environment variable.
18795
187961999-12-13 Jesse Thilo <jthilo@gnu.org>
18797
18798 * doc/bison.texinfo: Tweaked spelling and grammar.
18799 Updated ISBN.
18800 Removed reference to price of printed copy.
18801 Mention BISON_SIMPLE and BISON_HAIRY.
18802
188031999-12-13 Jesse Thilo <jthilo@gnu.org>
18804
18805 * configure.in, NEWS:
18806 Bison 1.29 released.
18807
188081999-10-27 Jesse Thilo <jthilo@gnu.org>
18809
18810 * doc/.cvsignore, doc/Makefile.am, doc/refcard.tex:
18811 Added reference card.
18812
188131999-07-26 Jesse Thilo <jthilo@gnu.org>
18814
18815 * po/ru.po: Added Russian translation.
18816
188171999-07-26 Jesse Thilo <jthilo@gnu.org>
18818
18819 * configure.in: Added Russian translation.
18820
188211999-07-06 Jesse Thilo <jthilo@gnu.org>
18822
18823 * configure.in, NEWS, README:
18824 Released version 1.28.
18825
188261999-06-14 Jesse Thilo <jthilo@gnu.org>
18827
18828 * src/system.h:
18829 Squashed redefinition warning on some systems.
18830
18831 * src/getargs.c, src/Makefile.am, src/reader.c, src/version.c:
18832 Have configure build version string instead of relying on ANSI string
18833 concatentation.
18834
188351999-06-14 Jesse Thilo <jthilo@gnu.org>
18836
18837 * po/POTFILES.in: Got rid of version.c.
18838
188391999-06-14 Jesse Thilo <jthilo@gnu.org>
18840
18841 * acconfig.h, configure.in:
18842 Have configure build version string instead of relying on ANSI string
18843 concatentation.
18844
188451999-06-08 Jesse Thilo <jthilo@gnu.org>
18846
18847 * doc/bison.1:
18848 Dropped mention of `+' for long-named options.
18849
188501999-05-30 Jesse Thilo <jthilo@gnu.org>
18851
18852 * src/files.c: Added <unistd.h> for unlink().
18853
18854 * src/Makefile.am, src/system.h:
18855 I18n fixes.
18856
188571999-05-30 Jesse Thilo <jthilo@gnu.org>
18858
18859 * README: Added a FAQ list.
18860
18861 * configure.in, acconfig.h:
18862 I18n fixes.
18863
188641999-05-30 Jesse Thilo <jthilo@gnu.org>
18865
18866 * doc/FAQ, doc/Makefile.am:
18867 Added a FAQ list.
18868
188691999-05-19 Jesse Thilo <jthilo@gnu.org>
18870
18871 * src/alloc.h, src/symtab.h, src/version.c:
18872 Protected inclusion of "config.h" with HAVE_CONFIG_H.
18873
188741999-04-18 Jesse Thilo <jthilo@gnu.org>
18875
18876 * src/.cvsignore, src/Makefile.am:
18877 Reorganized: sources in `src', documentation in `doc'.
18878
18879 * src/lex.c (literalchar):
18880 fixed the code for escaping double quotes (thanks
18881 Jonathan Czisny.)
18882
188831999-04-18 Jesse Thilo <jthilo@gnu.org>
18884
18885 * po/de.po, po/es.po, po/fr.po, po/nl.po, po/POTFILES.in:
18886 Adjusted paths to reflect directory reorganization.
18887
188881999-04-18 Jesse Thilo <jthilo@gnu.org>
18889
18890 * doc/.cvsignore, doc/Makefile.am:
18891 Reorganized: sources in `src', documentation in `doc'.
18892
188931999-04-18 Jesse Thilo <jthilo@gnu.org>
18894
18895 * configure.in:
18896 Updated AC_INIT file to reflect directory reorganization.
18897
18898 * configure.in, .cvsignore, Makefile.am, POTFILES.in:
18899 Reorganized: sources in `src', documentation in `doc'.
18900
189011999-04-13 Jesse Thilo <jthilo@gnu.org>
18902
18903 * src/allocate.c:
18904 Don't declare calloc() and realloc() if not necessary.
18905
189061999-04-13 Jesse Thilo <jthilo@gnu.org>
18907
18908 * configure.in, acconfig.h, acinclude.m4:
18909 Don't declare calloc() and realloc() if not necessary.
18910
189111999-03-23 Jesse Thilo <jthilo@gnu.org>
18912
18913 * po/.cvsignore: Added i18n support.
18914
189151999-03-23 Jesse Thilo <jthilo@gnu.org>
18916
18917 * acconfig.h, configure.in, Makefile.am:
18918 Added i18n support.
18919
189201999-03-22 Jesse Thilo <jthilo@gnu.org>
18921
18922 * src/bison.s1: Fixed #line numbers.
18923
189241999-03-15 Jesse Thilo <jthilo@gnu.org>
18925
18926 * po/es.po, po/fr.po, po/nl.po, po/de.po:
18927 Added PO files from Translation Project.
18928
189291999-03-03 Jesse Thilo <jthilo@gnu.org>
18930
18931 * Makefile.am:
18932 Added support for non-ANSI compilers (ansi2knr).
18933
189341999-02-16 Jesse Thilo <jthilo@gnu.org>
18935
18936 * configure.in: Bumped version number to 1.27.
18937
18938 * Makefile.am:
18939 Added `bison.simple' to list of files removed by `make distclean'.
18940
189411999-02-12 Jesse Thilo <jthilo@gnu.org>
18942
18943 * src/files.c, src/files.h:
18944 Defined locations of parser files in config.h instead of Makefile.
18945
189461999-02-12 Jesse Thilo <jthilo@gnu.org>
18947
18948 * acconfig.h, acinclude.m4, configure.in, Makefile.am:
18949 Defined locations of parser files in config.h instead of Makefile.
18950
189511999-02-09 Jesse Thilo <jthilo@gnu.org>
18952
18953 * Makefile.am:
18954 Removed inappropriate use of $< macro.
18955
189561999-02-05 Jesse Thilo <jthilo@gnu.org>
18957
18958 * po/Makefile.in.in, po/POTFILES.in:
18959 Add `po' directory skeleton.
18960
189611999-01-27 Jesse Thilo <jthilo@gnu.org>
18962
18963 * README: Document help-bison list.
18964
18965 * configure.in: Add check for mkstemp().
18966
189671999-01-20 Jesse Thilo <jthilo@gnu.org>
18968
18969 * src/conflicts.c, src/LR0.c, src/output.c, src/reader.c:
18970 Hush a few compiler warnings.
18971
18972 * src/files.c:
18973 Add tryclose(), which verifies that fclose was successful.
18974 Hush a couple of compiler warnings.
18975
189761999-01-20 Jesse Thilo <jthilo@gnu.org>
18977
18978 * Makefile.am, OChangeLog:
18979 ChangeLog is now automatically generated. Include the old version as
18980 OChangeLog.
18981
189821999-01-14 Jesse Thilo <jthilo@gnu.org>
18983
18984 * 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:
18985 Update FSF address.
18986
189871999-01-14 Jesse Thilo <jthilo@gnu.org>
18988
18989 * doc/bison.texinfo: Fix formatting glitch.
18990
18991 * doc/bison.texinfo: Update FSF address.
18992
189931999-01-14 Jesse Thilo <jthilo@gnu.org>
18994
18995 * acconfig.h: Update FSF address.
18996
189971999-01-08 Jesse Thilo <jthilo@gnu.org>
18998
18999 * src/system.h:
19000 Don't define PACKAGE here, since config.h defines it.
19001
190021998-12-30 Jesse Thilo <jthilo@gnu.org>
19003
19004 * src/reader.c: Update copyright date.
19005
19006 * src/main.c:
19007 Ditch sprintf to statically-sized buffers in fatal/warn functions in
19008 favor of output directly to stderr (avoids buffer overruns).
19009
19010 * src/reader.c: Some checks for premature EOF.
19011
19012 * 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:
19013 Use prototypes if the compiler understands them.
19014
19015 * src/files.c: Honor TMPDIR on Unix hosts.
19016 Use prototypes if the compiler understands them.
19017
19018 * src/reader.c:
19019 Fix a couple of buffer overrun bugs.
19020 Use prototypes if the compiler understands them.
19021
19022 * src/system.h: Include unistd.h and ctype.h.
19023 Use #ifdef instead of #if for NLS symbols.
19024
190251998-12-30 Jesse Thilo <jthilo@gnu.org>
19026
19027 * doc/bison.texinfo:
19028 Delete comment "consider using @set for edition number, etc..." since
19029 we now are doing so.
19030
190311998-12-30 Jesse Thilo <jthilo@gnu.org>
19032
19033 * configure.in:
19034 Use prototypes if the compiler understands them.
19035
19036 * NEWS: Document 1.26 highlights.
19037
19038 * Makefile.am: Require Automake 1.3 or later.
19039
19040 * acconfig.h:
19041 Use prototypes if the compiler understands them.
19042
190431998-12-29 Jesse Thilo <jthilo@gnu.org>
19044
19045 * src/version.c:
19046 Use VERSION symbol from automake for version number.
19047
190481998-12-29 Jesse Thilo <jthilo@gnu.org>
19049
19050 * acconfig.h, configure.in, version.cin:
19051 Use VERSION symbol from automake for version number.
19052
190531998-11-28 Jesse Thilo <jthilo@gnu.org>
19054
19055 * Makefile.am:
19056 Distribute original version of simple parser (bison.s1), not built
19057 version (bison.simple).
19058
190591998-11-28 Jesse Thilo <jthilo@gnu.org>
19060
19061 * doc/bison.texinfo: Add info dir entry.
19062
19063 * doc/bison.texinfo:
19064 Let automake put version number into documentation.
19065
190661998-11-26 Jesse Thilo <jthilo@gnu.org>
19067
19068 * src/bison.cld, src/build.com, src/vmshlp.mar:
19069 Add non-RCS files from /gd/gnu/bison.
19070
190711998-11-26 Jesse Thilo <jthilo@gnu.org>
19072
19073 * doc/bison.1:
19074 Document the BISON_HAIRY and BISON_SIMPLE variables.
19075
190761998-11-25 Jesse Thilo <jthilo@gnu.org>
19077
19078 * src/version.c: Build version.c automatically.
19079
19080 * src/reader.c:
19081 Fix token numbering (used to start at 258, not 257).
19082
19083 * src/system.h: Include config.h.
19084
19085 * src/getargs.c: Update bug report address.
19086
19087 * src/alloca.c, src/getopt1.c, src/getopt.c, src/getopt.h:
19088 Get latest copies of alloca.c, getopt.c, getopt.h, getopt1.c from gnu.org.
19089
190901998-11-25 Jesse Thilo <jthilo@gnu.org>
19091
19092 * Makefile.am:
19093 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
19094
19095 * configure.in, version.cin:
19096 Build version.c automatically.
19097
19098 * AUTHORS: Add AUTHORS file.
19099
19100 * README: Update bug report address.
19101
19102 * bison.simple:
19103 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
19104
19105 * configure.in, Makefile.am, Makefile.in, stamp-h.in:
19106 Add automake stuff.
19107
191081998-11-25 Jesse Thilo <jthilo@gnu.org>
19109
19110 * doc/bison.texinfo: Clean up some formatting.
19111
191121998-05-05 Richard Stallman <rms@gnu.org>
19113
19114 * doc/bison.texinfo:
19115 Explain better why to make a pure parser.
19116
191171998-01-05 Richard Stallman <rms@gnu.org>
19118
19119 * src/files.c (openfiles):
19120 [_WIN32 && !__CYGWIN32__] Use TEMP or Temp to
19121 find a temporary directory, if possible. Do not unlink files while
19122 they are open.
19123
191241997-08-25 Richard Stallman <rms@gnu.org>
19125
19126 * src/reader.c (stack_offset;):
19127 Change some warni to warns.
19128
19129 * src/lex.c (literalchar): Use warns, not warni.
19130
191311997-06-28 Richard Stallman <rms@gnu.org>
19132
19133 * src/bison.s1: Add a Bison version comment.
19134
19135 * src/main.c (fatal, warn, berror):
19136 Use program_name.
19137
191381997-06-28 Richard Stallman <rms@gnu.org>
19139
19140 * Makefile.in (bison_version): New variable.
19141 (dist): Use that variable.
19142 (bison.s1): Substitute the Bison version into bison.simple.
19143
19144 * bison.simple: Add a Bison version comment.
19145
191461997-06-18 Richard Stallman <rms@gnu.org>
19147
19148 * src/main.c (fatal, warn, berror):
19149 Make error messages standard.
19150 (toomany): Improve error message text.
19151
19152 * 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:
19153 new.h renamed to alloc.h.
19154
191551997-06-18 Richard Stallman <rms@gnu.org>
19156
19157 * Makefile.in: new.h renamed to alloc.h.
19158
191591997-05-24 Richard Stallman <rms@gnu.org>
19160
19161 * src/lex.c (literalchar):
19162 Fix the code for escaping \, " and '.
19163
19164 (lex): Avoid trouble when there are many chars
19165 to discard in a char literal with just several chars in it.
19166
191671997-05-17 Richard Stallman <rms@gnu.org>
19168
19169 * src/bison.s1:
19170 Use malloc, if using alloca is troublesome.
19171 (YYSTACK_USE_ALLOCA): New flag macro.
19172 Define it for some systems and compilers.
19173 (YYSTACK_ALLOC): New macro.
19174 (yyparse): Use YYSTACK_ALLOC to allocate stack.
19175 If it was malloc'd, free it.
19176
191771997-05-17 Richard Stallman <rms@gnu.org>
19178
19179 * bison.simple:
19180 Use malloc, if using alloca is troublesome.
19181 (YYSTACK_USE_ALLOCA): New flag macro.
19182 Define it for some systems and compilers.
19183 (YYSTACK_ALLOC): New macro.
19184 (yyparse): Use YYSTACK_ALLOC to allocate stack.
19185 If it was malloc'd, free it.
19186
191871997-04-23 Richard Stallman <rms@gnu.org>
19188
19189 * src/bison.s1:
19190 (alloca) [__hpux]: Always define as __builtin_alloca.
19191
191921997-04-23 Richard Stallman <rms@gnu.org>
19193
19194 * bison.simple:
19195 (alloca) [__hpux]: Always define as __builtin_alloca.
19196
191971997-04-22 Richard Stallman <rms@gnu.org>
19198
19199 * src/bison.s1:
19200 [__hpux]: Include alloca.h (right for HPUX 10)
19201 instead of declaring alloca (right for HPUX 9).
19202
19203 * src/bison.s1 (__yy_memcpy):
19204 Declare arg `count' as unsigned int.
19205 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
19206
192071997-04-22 Richard Stallman <rms@gnu.org>
19208
19209 * bison.simple:
19210 [__hpux]: Include alloca.h (right for HPUX 10)
19211 instead of declaring alloca (right for HPUX 9).
19212
19213 * bison.simple (__yy_memcpy):
19214 Declare arg `count' as unsigned int.
19215 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
19216
192171997-01-03 Richard Stallman <rms@gnu.org>
19218
19219 * src/allocate.c: [__STDC__ or _MSC_VER]:
19220 Declare calloc and realloc to return void *.
19221
192221997-01-02 Richard Stallman <rms@gnu.org>
19223
19224 * src/system.h:
19225 [_MSC_VER]: Include stdlib.h and process.h.
19226 [_MSC_VER] (getpid): Define as macro--translate it to _getpid.
19227
19228 * src/main.c (main): Return FAILURE as a value.
19229 (printable_version): Declare arg as int, not char.
19230
192311997-01-02 Richard Stallman <rms@gnu.org>
19232
19233 * Makefile.in (dist):
19234 Explicitly check for symlinks, and copy them.
19235
192361996-12-19 Richard Stallman <rms@gnu.org>
19237
19238 * src/files.c:
19239 [_MSC_VER] (XPFILE, XPFILE1): Define, if not already defined.
19240
192411996-12-18 Paul Eggert <eggert@gnu.org>
19242
19243 * src/bison.s1 (yyparse):
19244 If __GNUC__ and YYPARSE_PARAM are both defined,
19245 declare yyparse to have a void * argument.
19246
192471996-12-18 Paul Eggert <eggert@gnu.org>
19248
19249 * bison.simple (yyparse):
19250 If __GNUC__ and YYPARSE_PARAM are both defined,
19251 declare yyparse to have a void * argument.
19252
192531996-12-17 Richard Stallman <rms@gnu.org>
19254
19255 * src/reduce.c (nbits): Add some casts.
19256
192571996-08-12 Richard Stallman <rms@gnu.org>
19258
19259 * src/bison.s1: Test _MSDOS as well as _MSDOS_.
19260
192611996-08-12 Richard Stallman <rms@gnu.org>
19262
19263 * bison.simple: Test _MSDOS as well as _MSDOS_.
19264
192651996-07-31 Richard Stallman <rms@gnu.org>
19266
19267 * src/bison.s1:
19268 [__sun && __i386]: Include alloca.h.
19269
192701996-07-31 Richard Stallman <rms@gnu.org>
19271
19272 * bison.simple:
19273 [__sun && __i386]: Include alloca.h.
19274
192751996-07-30 Richard Stallman <rms@gnu.org>
19276
19277 * src/bison.s1: Comment change.
19278
19279 * src/bison.s1: Test _MSDOS_, not MSDOS.
19280
192811996-07-30 Richard Stallman <rms@gnu.org>
19282
19283 * bison.simple: Comment change.
19284
19285 * bison.simple: Test _MSDOS_, not MSDOS.
19286
192871996-06-01 Richard Stallman <rms@gnu.org>
19288
19289 * 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:
19290 Insert `_' macro around many string constants.
19291
19292 * src/main.c:
19293 Insert `_' macro around many string constants.
19294
19295 (main): Call setlocale, bindtextdomain and textdomain.
19296
19297 * src/system.h: [HAVE_LOCALE_H]: Include locale.h.
19298 [! HAVE_LOCALE_H] (setlocale): Define as no-op.
19299 [ENABLE_NLS]: Include libintl.h.
19300 [ENABLE_NLS] (gettext): Define.
19301 [! ENABLE_NLS] (bintextdomain, textdomain, _): Consolation definitions.
19302 (N_, PACKAGE, LOCALEDIR): New macros.
19303
193041996-06-01 Richard Stallman <rms@gnu.org>
19305
19306 * POTFILES.in: New file.
19307
19308 * Makefile.in (allocate.o):
19309 Define target explicitly.
19310
19311 * Makefile.in (CFLAGS): Set to @CFLAGS@.
19312 (LDFLAGS): Set to @LDFLAGS@.
19313 (configure): Run autoconf only if preceding `cd' succeeds.
19314 (bison.s1): Redirect output to temporary file then move the
19315 temporary to the target, rather than redirecting directly to bison.s1.
19316 (clean): Remove config.status and config.log.
19317 (distclean): Don't remove config.status here.
19318
193191996-05-12 Richard Stallman <rms@gnu.org>
19320
19321 * src/bison.s1:
19322 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
19323
193241996-05-12 Richard Stallman <rms@gnu.org>
19325
19326 * bison.simple:
19327 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
19328
193291996-05-11 Richard Stallman <rms@gnu.org>
19330
19331 * src/bison.s1 (__yy_memcpy):
19332 Really reorder the args, as was supposedly done on Feb 14 1995.
19333 (yyparse): Calls changed accordingly.
19334
193351996-05-11 Richard Stallman <rms@gnu.org>
19336
19337 * Makefile.in (dist): Don't use $(srcdir).
19338
19339 * bison.simple (__yy_memcpy):
19340 Really reorder the args, as was supposedly done on Feb 14 1995.
19341 (yyparse): Calls changed accordingly.
19342
193431996-01-27 Richard Stallman <rms@gnu.org>
19344
19345 * src/output.c (output_rule_data):
19346 Test YYERROR_VERBOSE in the conditional
19347 around the definition of ttyname.
19348
193491995-12-29 Richard Stallman <rms@gnu.org>
19350
19351 * src/bison.s1:
19352 Fix line numbers in #line commands.
19353
193541995-12-29 Richard Stallman <rms@gnu.org>
19355
19356 * bison.simple:
19357 Fix line numbers in #line commands.
19358
193591995-12-27 Richard Stallman <rms@gnu.org>
19360
19361 * src/bison.s1 (YYPARSE_PARAM_DECL):
19362 In C++, make it always null.
19363 (YYPARSE_PARAM_ARG): New macro.
19364 (yyparse): Use YYPARSE_PARAM_ARG.
19365
193661995-12-27 Richard Stallman <rms@gnu.org>
19367
19368 * bison.simple (YYPARSE_PARAM_DECL):
19369 In C++, make it always null.
19370 (YYPARSE_PARAM_ARG): New macro.
19371 (yyparse): Use YYPARSE_PARAM_ARG.
19372
193731995-11-29 Richard Stallman <rms@gnu.org>
19374
19375 * doc/bison.texinfo:
19376 Describe literal string tokens, %raw, %no_lines, %token_table.
19377
193781995-11-29 Daniel Hagerty <hag@gnu.org>
19379
19380 * doc/bison.texinfo: Fixed update date
19381
193821995-10-16 Richard Stallman <rms@gnu.org>
19383
19384 * src/version.c: Version 1.25.
19385
193861995-10-16 Richard Stallman <rms@gnu.org>
19387
19388 * NEWS: *** empty log message ***
19389
193901995-10-16 Richard Stallman <rms@gnu.org>
19391
19392 * doc/bison.1, doc/bison.rnh:
19393 Add new options.
19394
193951995-10-15 Richard Stallman <rms@gnu.org>
19396
19397 * src/vmsgetargs.c, src/getargs.c:
19398 Added -n, -k, and -raw switches.
19399 (noparserflag, toknumflag, rawtoknumflag): New variables.
19400
19401 * src/symtab.h (SALIAS):
19402 New #define for adding aliases to %token.
19403 (struct bucket): Added `alias' field.
19404
19405 * src/reduce.c (reduce_grammar):
19406 Revise error message.
19407 (print_notices): Remove final `.' from error message.
19408
19409 * src/reader.c (reader_output_yylsp):
19410 New function.
19411 (readgram): Use `#if 0' around code that accepted %command
19412 inside grammar rules: The documentation doesn't allow it,
19413 and it will fail since the %command processors scan for the next %.
19414 (parse_token_decl): Extended the %token
19415 declaration to allow a multi-character symbol as an alias.
19416 (parse_thong_decl): New function.
19417 (read_declarations): Added %thong declarations.
19418 (read_declarations): Handle NOOP to deal with allowing
19419 % declarations as another means to specify the flags.
19420 (readgram): Allow %prec prior to semantics embedded in a rule.
19421 (skip_to_char, read_declarations, copy_definition)
19422 (parse_token_decl, parse_start_decl, parse_type_decl)
19423 (parse_assoc_decl, parse_union_decl, parse_expect_decl)
19424 (get_type_name, copy_guard, copy_action, readgram)
19425 (get_type, packsymbols): Revised most error messages.
19426 Changed `fatal' to `warnxxx' to avoid aborting for error.
19427 Revised and use multiple warnxxx functions to avoid using VARARGS1.
19428 (read_declarations): Improve the error message for
19429 an invalid character. Do not abort.
19430 (read_declarations, copy_guard, copy_action): Use
19431 printable_version to avoid unprintable characters in printed output.
19432 (parse_expect_decl): Error if argument to %expect exceeds 10 digits.
19433 (parse_token_decl, parse_assoc_decl, parse_type_decl, get_type):
19434 Allow the type of a non-terminal can be given
19435 more than once, as long as all specifications give the same type.
19436
19437 * src/output.c:
19438 (output_headers, output_trailers, output, output_gram)
19439 (output_rule_data): Implement noparserflag variable.
19440 Implement toknumflag variable.
19441 (output): Call reader_output_yylsp to output LTYPESTR.
19442
19443 * src/main.c (main):
19444 If reader sees an error, don't process the grammar.
19445 (fatals): Updated to not use VARARGS1.
19446 (printable_version, int_to_string, warn, warni, warns, warnss)
19447 (warnsss): New error reporting functions. Avoid abort for error.
19448
19449 * src/lex.h:
19450 Added THONG and NOOP for alias processing.
19451 Added SETOPT for the new code that allows setting options with %flags.
19452
19453 * src/lex.c:
19454 Include getopt.h. Add some extern decls.
19455 (safegetc): New function to deal with EOF gracefully.
19456 (literalchar); new function to deal with reading \ escapes.
19457 (lex): Use literalchar.
19458 (lex): Implemented "..." tokens.
19459 (literalchar, lex, parse_percent_token): Made tokenbuffer
19460 always contain the token. This includes growing the token
19461 buffer while reading an integer.
19462 (parse_percent_token): Replaced if-else statement with percent_table.
19463 (parse_percent_token): Added % declarations as another
19464 way to specify the flags -n, -l, and -r. Also added hooks for
19465 -d, -k, -y, -v, -t, -p, -b, -o, but implementation requires
19466 major changes to files.c.
19467 (lex) Retain in the incoming stream a character following
19468 an incorrect '/'.
19469 (skip_white_space, lex): Revised most error messages
19470 and changed fatal to warn to avoid aborting.
19471 (percent_table): Added %thong declarations.
19472
19473 * src/gram.h: Comment changes.
19474
19475 * src/files.c (openfiles, open_extra_files, done):
19476 Add faction flag
19477 and actfile file. Handle noparserflag. Both for -n switch.
19478
19479 * src/conflicts.c (resolve_sr_conflict):
19480 Remove use of alloca.
19481
194821995-06-01 Jim Meyering <meyering@gnu.org>
19483
19484 * doc/bison.texinfo: *** empty log message ***
19485
194861995-05-06 Richard Stallman <rms@gnu.org>
19487
19488 * src/bison.s1: Comment change.
19489
194901995-05-06 Richard Stallman <rms@gnu.org>
19491
19492 * bison.simple: Comment change.
19493
194941995-05-03 Richard Stallman <rms@gnu.org>
19495
19496 * src/version.c: Version now 1.24.
19497
19498 * src/bison.s1: Change distribution terms.
19499
19500 * src/version.c: Version now 1.23.
19501
195021995-05-03 Richard Stallman <rms@gnu.org>
19503
19504 * doc/bison.texinfo:
19505 Rewrite "Conditions for Using Bison".
19506 Update version to 1.24.
19507
195081995-05-03 Richard Stallman <rms@gnu.org>
19509
19510 * bison.simple: Change distribution terms.
19511
195121995-02-23 Richard Stallman <rms@gnu.org>
19513
19514 * src/files.c: Test __VMS_POSIX as well as VMS.
19515
195161995-02-14 Jim Meyering <meyering@gnu.org>
19517
19518 * src/bison.s1 (__yy_memcpy):
19519 Renamed from __yy_bcopy to avoid
19520 confusion. Reverse FROM and TO arguments to be consistent with
19521 those of memcpy.
19522
195231995-02-14 Jim Meyering <meyering@gnu.org>
19524
19525 * bison.simple (__yy_memcpy):
19526 Renamed from __yy_bcopy to avoid
19527 confusion. Reverse FROM and TO arguments to be consistent with
19528 those of memcpy.
19529
195301994-11-10 David J. MacKenzie <djm@gnu.org>
19531
19532 * NEWS: reformat
19533
19534 * NEWS: New file.
19535
19536 * Makefile.in (DISTFILES): Include NEWS.
19537
19538 * Makefile.in (DISTFILES):
19539 Include install-sh, not install.sh.
19540
19541 * configure.in: Update to Autoconf v2 macro names.
19542
195431994-10-05 David J. MacKenzie <djm@gnu.org>
19544
19545 * Makefile.in: fix typo
19546
19547 * Makefile.in (prefix, exec_prefix):
19548 Let configure set them.
19549
195501994-09-28 David J. MacKenzie <djm@gnu.org>
19551
19552 * Makefile.in: Set datadir to $(prefix)/share.
19553
195541994-09-15 Richard Stallman <rms@gnu.org>
19555
19556 * src/bison.s1:
19557 Update copyright notice and GPL version.
19558
195591994-09-15 Richard Stallman <rms@gnu.org>
19560
19561 * bison.simple:
19562 Update copyright notice and GPL version.
19563
195641994-07-12 Richard Stallman <rms@gnu.org>
19565
19566 * src/reduce.c, src/reader.c:
19567 entered into RCS
19568
195691994-05-05 David J. MacKenzie <djm@gnu.org>
19570
19571 * Makefile.in: entered into RCS
19572
195731994-03-26 Richard Stallman <rms@gnu.org>
19574
19575 * src/bison.s1: entered into RCS
19576
195771994-03-26 Richard Stallman <rms@gnu.org>
19578
19579 * bison.simple: entered into RCS
19580
195811994-03-25 Richard Stallman <rms@gnu.org>
19582
19583 * src/main.c: entered into RCS
19584
195851994-03-24 Richard Stallman <rms@gnu.org>
19586
19587 * src/conflicts.c: entered into RCS
19588
195891994-01-02 Richard Stallman <rms@gnu.org>
19590
19591 * Makefile.in: *** empty log message ***
19592
195931993-11-21 Richard Stallman <rms@gnu.org>
19594
19595 * src/bison.s1: *** empty log message ***
19596
195971993-11-21 Richard Stallman <rms@gnu.org>
19598
19599 * doc/bison.texinfo: entered into RCS
19600
19601 * doc/bison.texinfo: *** empty log message ***
19602
196031993-11-21 Richard Stallman <rms@gnu.org>
19604
19605 * bison.simple: *** empty log message ***
19606
196071993-10-25 David J. MacKenzie <djm@gnu.org>
19608
19609 * doc/bison.texinfo: *** empty log message ***
19610
196111993-10-19 Richard Stallman <rms@gnu.org>
19612
19613 * src/bison.s1: *** empty log message ***
19614
196151993-10-19 Richard Stallman <rms@gnu.org>
19616
19617 * bison.simple: *** empty log message ***
19618
196191993-10-14 Richard Stallman <rms@gnu.org>
19620
19621 * src/bison.s1: *** empty log message ***
19622
196231993-10-14 Richard Stallman <rms@gnu.org>
19624
19625 * bison.simple: *** empty log message ***
19626
196271993-09-14 David J. MacKenzie <djm@gnu.org>
19628
19629 * doc/bison.texinfo: *** empty log message ***
19630
196311993-09-13 Noah Friedman <friedman@gnu.org>
19632
19633 * Makefile.in: *** empty log message ***
19634
196351993-09-10 Richard Stallman <rms@gnu.org>
19636
19637 * src/conflicts.c: *** empty log message ***
19638
19639 * src/system.h: entered into RCS
19640
196411993-09-10 Richard Stallman <rms@gnu.org>
19642
19643 * doc/bison.1: entered into RCS
19644
196451993-09-06 Noah Friedman <friedman@gnu.org>
19646
19647 * src/version.c: entered into RCS
19648
196491993-09-06 Noah Friedman <friedman@gnu.org>
19650
19651 * Makefile.in: *** empty log message ***
19652
196531993-07-30 David J. MacKenzie <djm@gnu.org>
19654
19655 * Makefile.in: *** empty log message ***
19656
196571993-07-24 Richard Stallman <rms@gnu.org>
19658
19659 * src/bison.s1: *** empty log message ***
19660
196611993-07-24 Richard Stallman <rms@gnu.org>
19662
19663 * bison.simple: *** empty log message ***
19664
196651993-07-08 David J. MacKenzie <djm@gnu.org>
19666
19667 * Makefile.in: *** empty log message ***
19668
196691993-07-04 Richard Stallman <rms@gnu.org>
19670
19671 * src/bison.s1: *** empty log message ***
19672
196731993-07-04 Richard Stallman <rms@gnu.org>
19674
19675 * bison.simple: *** empty log message ***
19676
196771993-06-26 David J. MacKenzie <djm@gnu.org>
19678
19679 * src/getargs.c: entered into RCS
19680
196811993-06-26 David J. MacKenzie <djm@gnu.org>
19682
19683 * doc/bison.texinfo: *** empty log message ***
19684
19685 * doc/bison.1: New file.
19686
196871993-06-25 Richard Stallman <rms@gnu.org>
19688
19689 * src/getargs.c: New file.
19690
196911993-06-16 Richard Stallman <rms@gnu.org>
19692
19693 * src/bison.s1: *** empty log message ***
19694
196951993-06-16 Richard Stallman <rms@gnu.org>
19696
19697 * bison.simple: *** empty log message ***
19698
196991993-06-03 Richard Stallman <rms@gnu.org>
19700
19701 * src/bison.s1: New file.
19702
197031993-06-03 Richard Stallman <rms@gnu.org>
19704
19705 * doc/bison.texinfo: *** empty log message ***
19706
197071993-06-03 Richard Stallman <rms@gnu.org>
19708
19709 * bison.simple: New file.
19710
197111993-05-19 Richard Stallman <rms@gnu.org>
19712
19713 * doc/bison.texinfo: New file.
19714
197151993-05-07 Noah Friedman <friedman@gnu.org>
19716
19717 * Makefile.in: *** empty log message ***
19718
197191993-04-28 Noah Friedman <friedman@gnu.org>
19720
19721 * src/reader.c: *** empty log message ***
19722
197231993-04-23 Noah Friedman <friedman@gnu.org>
19724
19725 * src/alloc.h: entered into RCS
19726
197271993-04-20 David J. MacKenzie <djm@gnu.org>
19728
19729 * src/version.c: *** empty log message ***
19730
19731 * src/files.c, src/allocate.c:
19732 entered into RCS
19733
19734 * src/reader.c: *** empty log message ***
19735
19736 * src/lex.c: entered into RCS
19737
19738 * src/conflicts.c: New file.
19739
19740 * src/symtab.c: entered into RCS
19741
19742 * src/alloc.h: New file.
19743
19744 * src/LR0.c: entered into RCS
19745
197461993-04-18 Noah Friedman <friedman@gnu.org>
19747
19748 * src/reader.c: New file.
19749
19750 * src/version.c: *** empty log message ***
19751
197521993-04-18 Noah Friedman <friedman@gnu.org>
19753
19754 * Makefile.in: *** empty log message ***
19755
197561993-04-17 Noah Friedman <friedman@gnu.org>
19757
19758 * Makefile.in: *** empty log message ***
19759
197601993-04-15 Richard Stallman <rms@gnu.org>
19761
19762 * src/main.c, src/files.c:
19763 New file.
19764
197651993-04-15 Noah Friedman <friedman@gnu.org>
19766
19767 * configure.in: entered into RCS
19768
19769 * configure.in: *** empty log message ***
19770
19771 * configure.in: New file.
19772
197731993-04-14 Richard Stallman <rms@gnu.org>
19774
19775 * Makefile.in: New file.
19776
197771993-04-13 Richard Stallman <rms@gnu.org>
19778
19779 * src/version.c: New file.
19780
197811993-03-25 Richard Stallman <rms@gnu.org>
19782
19783 * src/output.c: entered into RCS
19784
197851992-09-25 Richard Stallman <rms@gnu.org>
19786
19787 * configure.bat: entered into RCS
19788
197891992-06-22 Richard Stallman <rms@gnu.org>
19790
19791 * src/vmsgetargs.c: entered into RCS
19792
197931992-06-22 Richard Stallman <rms@gnu.org>
19794
19795 * doc/bison.rnh: entered into RCS
19796
197971992-04-20 David J. MacKenzie <djm@gnu.org>
19798
19799 * README: entered into RCS
19800
198011992-01-22 Richard Stallman <rms@gnu.org>
19802
19803 * src/machine.h: entered into RCS
19804
198051991-12-21 Richard Stallman <rms@gnu.org>
19806
19807 * src/lalr.c, src/closure.c:
19808 entered into RCS
19809
198101991-12-20 Richard Stallman <rms@gnu.org>
19811
19812 * src/state.h: entered into RCS
19813
198141991-12-18 Richard Stallman <rms@gnu.org>
19815
19816 * src/print.c, src/nullable.c, src/derives.c:
19817 entered into RCS
19818
198191991-11-03 David J. MacKenzie <djm@gnu.org>
19820
19821 * src/warshall.c, src/types.h, src/symtab.h, src/lex.h, src/gram.c, src/gram.h, src/files.h:
19822 entered into RCS
19823
198241988-09-09 Richard Stallman <rms@gnu.org>
19825
19826 * src/bison.hairy: entered into RCS
19827
198281987-12-16 Richard Stallman <rms@gnu.org>
19829
19830 * REFERENCES: entered into RCS
dc546b0f 19831
f294a2c2 19832
04098407 19833 -----
f294a2c2 19834
04098407 19835 Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996,
95021767
JD
19836 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
19837 Free Software Foundation, Inc.
f294a2c2 19838
04098407
PE
19839 Copying and distribution of this file, with or without
19840 modification, are permitted provided the copyright notice and this
19841 notice are preserved.
e9071366
AD
19842
19843$Id$