]> git.saurik.com Git - bison.git/blame - ChangeLog
%define push_pull -> %define api.push_pull. Discussed starting at
[bison.git] / ChangeLog
CommitLineData
c373bf8b
JD
12007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
2
3 %define push_pull -> %define api.push_pull. Discussed starting at
4 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00005.html>.
5 * data/push.c: Expect the new name.
6 * data/yacc.c: Likewise.
7 * doc/bison.texinfo (Push Decl): Update.
8 (Decl Summary): Update %define entry.
9 (Push Parser Function): Update.
10 (Pull Parser Function): Update.
11 (Parser Create Function): Update.
12 (Parser Delete Function): Update.
13 * tests/calc.at (Simple LALR Calculator): Update.
14 * tests/input.at (%define enum variables): Update.
15 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
16 (Push Parsing: Multiple impure instances): Update.
17 (Push Parsing: Unsupported Skeletons): Update.
18 * tests/torture.at (Exploding the Stack Size with Alloca): Update.
19 (Exploding the Stack Size with Malloc): Update.
20
21 * NEWS (2.3a+): Add an entry for the push parser, and clean up the
22 other entries some.
23
32f19b6b
JD
242007-10-27 Joel E. Denny <jdenny@ces.clemson.edu>
25
26 For the XML output's terminal element, rename @number to @token-number,
27 and add @symbol-number. In the nonterminal element, rename @number to
28 @symbol-number. Discussed starting at
29 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00040.html>.
30 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Update for
31 renames.
32 (xsl:template match="nonterminal"): Likewise.
33 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Likewise.
34 (xsl:template match="nonterminal"): Likewise.
35 * src/print-xml.c (print_grammar): Implement.
36
255a6b90
JD
372007-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
38
39 * data/xslt/xml2dot.xsl (xsl:template match="automaton/state"): After
40 2007-10-11 change, the child elements here are items not rules.
41 (<xsl:template match="item"): New.
42 (xsl:template match="rule"): Update for new reduced itemset.
43 (xsl:template match="point"): Remove.
44 (xsl:template match="empty"): For consistency with --graph, don't
45 output "/* empty */".
46 * data/xslt/xml2text.xsl (xsl:template match="terminal"): When invoking
47 line-wrap, don't pass a negative value as first-line-length since this
48 won't work with the following changes.
49 (xsl:template name="line-wrap"): Simplify slightly.
50 (xsl:template name="ws-search"): Eliminate recursion.
51 * src/print_graph.c (print_core): Don't print a reduction's lookahead
52 set next to an item whose dot is not at the end of the RHS even if it
53 happens to be associated with the same rule.
54
88c78747
JD
552007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
56
31984206
JD
57 Add %define lr.keep_unreachable_states.
58 * NEWS (2.3a+): Mention it in the entry for unreachable state removal.
59 * doc/bison.texinfo (Decl Summary): Mention it in the %define entry.
60 * src/main.c (main): Implement it.
61 * tests/conflicts.at (Unreachable States After Conflict Resolution):
62 Extend to test it, and fix a typo.
63
642007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
65
66 * NEWS (2.3a+): Add entry for recent .output file lookahead set fix.
88c78747
JD
67 * doc/bison.texinfo (Understanding): Remove a bogus lookahead set in
68 the example .output text.
69 * tests/regression.at (Extra lookahead sets in report): Improve wording
70 of comments.
71
b7a70162
WP
722007-10-17 Wojciech Polak <polak@gnu.org>
73
74 * src/print-xml.c (print_grammar): Renamed
75 <terminal> and <nonterminal> attributes:
76 "type" to "number" and "symbol" to "name".
77 * data/xslt/xml2text.xsl (xsl:template match="terminal"):
78 Use new attribute names.
79 (xsl:template match="nonterminal"): Likewise.
80 * data/xslt/xml2xhtml.xsl: Likewise.
81
a0de5091
JD
822007-10-17 Joel E. Denny <jdenny@ces.clemson.edu>
83
84 * doc/bison.texinfo (Bison Options): Add entry for --print-datadir.
85 (Option Cross Key): Likewise.
86
87 * src/print-xml.c (print_core): Don't print a reduction's lookahead set
88 next to an item whose dot is not at the end of the RHS even if it
89 happens to be associated with the same rule.
90 * src/print.c (print_core): Likewise.
91 * tests/conflicts.at (Unresolved SR Conflicts): Update output.
92 (Resolved SR Conflicts): Update output.
93 * tests/regression.at (Extra lookahead sets in report): New test case.
94
4c20d18d
WP
952007-10-11 Wojciech Polak <polak@gnu.org>
96
97 * src/print-xml.c (print_core): Remove item set
98 redundancy.
99 * data/xslt/bison.xsl (bison:ruleNumber): New key.
100 Improve processing time. Suggested by Joel E. Denny.
101 * data/xslt/xml2dot.xsl (xsl:template name="escape"):
102 Write xsl:param "required" attribute as comment.
103 * data/xslt/xml2text.xsl (xsl:template match="item"): New.
104 (xsl:template match="rule"): Support new reduced itemset.
105 (xsl:template match="point"): Remove.
106 * data/xslt/xml2xhtml.xsl: Likewise.
107
f506ad1c
JD
1082007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
109
110 * src/getargs.c (version): Update copyright year.
111
21f1b063
JD
1122007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
113
114 Make xml2dot.xsl and --graph produce the same output.
115 * data/xslt/xml2dot.xsl (xsl:template match="rule"): Use a `&#10;'
116 instead of a `\n'. That is, don't add escapes yet or they'll be doubly
117 escaped later.
118 (xsl:template name="output-node"): Use the new escape template instead
119 of the string-replace template directly.
120 (xsl:template name="output-edge"): Likewise.
121 (xsl:template name="escape"): New, escapes backslashes and newlines in
122 addition to quotation marks.
123 * src/graphviz.c (start_graph, output_node, output_edge): Add
124 whitespace to output for legibility.
125
126 Make xml2text.xsl and --report produce the same output, and remove the
127 XML "conflicts" element since a conflict summary is easily extracted
128 from the automaton.
129 * data/xslt/bison.xsl: New.
130 (xsl:template match="state" mode="bison:count-conflicts): New.
131 * data/xslt/xml2text.xsl: Import bison.xsl.
132 (xsl:template match="bison-xml-report"): Instead of styling the
133 "conflicts" element, style the "automaton" element with mode
134 "conflicts". Unlike the former, the latter lists S/R and R/R
135 conflicts for a state on the same line.
136 (xsl:template match="conflicts"): Remove.
137 (xsl:template match="conflict"): Remove.
138 (xsl:template match="terminal"): Line-wrap the list of rules in which
139 the terminal is used.
140 (xsl:template match="nonterminal"): Likewise for nonterminals.
141 (xsl:template match="automaton" mode="conflicts"): New.
142 (xsl:template match="state" mode="conflicts"): New.
143 (xsl:template name="line-wrap"): New.
144 (xsl:template name="ws-search"): New.
145 * data/xslt/xml2xhtml.xsl: Import bison.xsl.
146 (xsl:template match="bison-xml-report"): Instead of styling the
147 "conflicts" element, style the "automaton" element with mode
148 "conflicts."
149 (xsl:template match="conflicts"): Remove.
150 (xsl:template match="conflict"): Remove.
151 (xsl:template match="automaton" mode="conflicts"): New.
152 (xsl:template match="state" mode="conflicts): New.
153 * src/conflicts.c (conflicts_output_xml): Remove.
154 * src/conflicts.h (conflicts_output_xml): Remove prototype.
155 * src/print-xml.c (print_xml): Don't invoke conflicts_output_xml.
156 * src/print.c (print_grammar): Consistently wrap at the 66th column so
157 the corresponding XSLT is easier. Also, never wrap between a word and
158 the comma that follows it.
159
793fbca5
JD
1602007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
161
162 Improve C++ namespace support. Discussed starting at
163 <http://lists.gnu.org/archive/html/help-bison/2007-09/msg00016.html>.
164 * data/c++.m4: (b4_namespace_ref, b4_namespace_open,
165 b4_namespace_close): New macros that interpret the %define variable
166 "namespace" so its value can contain "::" to indicate nested
167 namespaces.
168 * data/glr.cc (b4_namespace): Don't define, and replace all uses with
169 the above macros.
170 * data/lalr1.cc (b4_namespace): Likewise.
171 * data/location.cc (b4_namespace): Likewise.
172 * doc/bison.texinfo (Decl Summary): Move `%define push_pull' entry
173 inside a new table in the general %define entry. Document `%define
174 namespace' there as well. Point the %name-prefix entry to it since it
175 explains it more completely in the case of C++.
176 (C++ Bison Interface): Mention `%define namespace' instead of
177 %name-prefix.
178 (Table of Symbols): Remove the `%define push_pull' entry. The %define
179 entry suffices.
180 * tests/c++.at (Relative namespace references): New test case.
181 (Absolute namespace references): New test case.
182 (Syntactically invalid namespace references): New test case.
183 * tests/input.at (C++ namespace reference errors): New test case.
184
35b8730d
JD
1852007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
186
187 Add syncline support and location accessor to internal %define
188 interfaces.
189 * data/bison.m4 (b4_percent_define_get_loc): New.
190 (b4_percent_define_get_syncline): New.
191 (b4_percent_define_flag_if): Use b4_percent_define_get_loc.
192 (b4_percent_define_default): Record defining location as line 1 rather
193 than 0 for the sake of synchronizing #line's, and define
194 b4_percent_define_syncline(VARIABLE).
195 (b4_percent_define_check_values): Use b4_percent_define_get_loc.
196 * src/muscle_tab.c (muscle_syncline_grow): New.
197 (muscle_code_grow): Use muscle_syncline_grow.
198 (muscle_percent_define_insert): Use muscle_percent_define_get_loc, and
199 define b4_percent_define_syncline(VARIABLE).
200 (muscle_percent_define_get_loc): New.
201 (muscle_percent_define_get_syncline): New.
202 (muscle_percent_define_flag_if): Use muscle_percent_define_get_loc, and
203 remove some unused variables.
204 (muscle_percent_define_default): Record defining location as line 1
205 rather than 0 for the sake of synchronizing #line's, and define
206 b4_percent_define_syncline(VARIABLE).
207 (muscle_percent_define_check_values): Use
208 muscle_percent_define_get_loc.
209 * src/muscle_tab.h (muscle_percent_define_get_loc): Prototype.
210 (muscle_percent_define_get_syncline): Prototype.
211 * tests/skeletons.at (%define Boolean variables: invalid skeleton
212 defaults): Update output for location change.
213 (Complaining during macro argument expansion): Extend to test
214 b4_percent_define_get_loc and b4_percent_define_get_syncline errors.
215
7dc4a694
JD
2162007-10-07 Joel E. Denny <jdenny@ces.clemson.edu>
217
218 Fix some error-reporting macro bugs.
219 * data/bison.m4 (b4_cat): New.
220 (b4_error, b4_error_at): Use b4_cat to send error directives directly
221 to stdout so they don't become arguments to other macros. Update
222 comments and add examples.
223 (b4_warn, b4_warn_at, b4_complain, b4_complain_at): Update comments and
224 add examples.
225 (b4_fatal, b4_fatal_at): Likewise, and invoke m4_exit(1) immediately
226 after printing the error directive so that M4 doesn't report subsequent
227 problems that are induced by this problem.
228 * src/scan-skel.l: Recognize @` digraph outside of directive arguments
229 instead of just in them. Recognize @\n in both places. Both expand to
230 the empty string. Needed by b4_cat.
231 * tests/skeletons.at (Complaining during macro argument expansion):
232 New test case.
233 (Fatal errors make M4 exit immediately): New test case.
234
d4bd2295
JD
2352007-10-04 Joel E. Denny <jdenny@ces.clemson.edu>
236
237 Implement --print-datadir.
238 * src/getargs.c (usage): Mention.
239 (PRINT_DATADIR_OPTION): New anonymous enum member.
240 (long_options): Add entry for it.
241 (getargs): Add case for it calling compute_pkgdatadir.
242 * src/output.c (output_skeleton): Encapsulate data directory
243 computation from here...
244 (prepare): ... and from here...
245 (compute_pkgdatadir): ... into this new function.
246 * src/output.h (compute_pkgdatadir): Prototype.
247
34cdeddf
JD
2482007-09-29 Joel E. Denny <jdenny@ces.clemson.edu>
249
250 * src/print-xml.c (escape_bufs): New static global variable
251 replacing...
252 (xml_escape_n): ... the static local variable buf here.
253 (print_xml): Free memory for escape_bufs.
254 * src/reduce.c (reduce_xml): XML-escape terminal symbol tags.
255
d782395d
JD
2562007-09-25 Joel E. Denny <jdenny@ces.clemson.edu>
257
258 Replace `%push-parser' and `%push-pull-parser' with
259 `%define push_pull "push"' and `%define push_pull "both"'.
260 `%define push_pull "pull"' is the default.
261 * doc/bison.texinfo (Push Decl, Push Parser Function,
262 Pull Parser Function, Parser Create Function, Parser Delete Function):
263 Update declarations.
264 (Decl Summary, Table of Symbols): Replace %push-parser and
265 %push-pull-parser entries with a %define push_pull entry.
266 * data/bison.m4 (b4_percent_define_check_values): New macro.
267 (b4_pull_if, b4_push_if, b4_use_push_for_pull_if): Move these
268 definitions...
269 * data/c.m4 (b4_identification): ... and the YYPUSH and YYPULL cpp
270 definitions...
271 * data/push.c: ... to here and compute them from the value of the
272 %define variable push_pull.
273 * data/c-skel.m4: Instead of choosing the push.c skeleton for push
274 parsing requests here...
275 * data/yacc.c: ... hack this to switch to push.c any time
276 b4_use_push_pull_flag or the %define variable push_pull is set. This
277 will go away when we mv push.c yacc.c.
278 * data/c++-skel.m4, data/glr.c, data/java-skel.m4: Don't report that
279 push parsing is not supported since unused %define variables are
280 reported anyway.
281 * src/getargs.c, src/getargs.h (pull_parser, push_parser): Remove.
282 * src/muscle_tab.h (muscle_percent_define_check_values): Update
283 comments for consistency with b4_percent_define_check_values.
284 * src/output.c (prepare): Don't insert b4_pull_flag and b4_push_flag
285 muscles.
286 * src/parse-gram.y (PERCENT_PUSH_PARSER, PERCENT_PUSH_PULL_PARSER):
287 Remove.
288 (prologue_declaration): Remove %push-parser and %push-pull-parser
289 rules.
290 * src/scan-gram.l (%push-parser, %push-pull-parser): Remove rules.
291 * tests/calc.at: Update declarations.
292 * tests/input.at (%define enum variables): New test case.
293 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update
294 declaration.
295 (Push Parsing: Multiple impure instances): Update declaration.
296 (Push Parsing: Unsupported Skeletons): New test case.
297 * tests/torture.at (Exploding the Stack Size with Alloca): Update
298 declaration.
299 (Exploding the Stack Size with Malloc): Update declaration.
300
3f999f78
WP
3012007-09-24 Wojciech Polak <polak@gnu.org>
302
303 Add XSLT transformations.
304
305 * data/xslt/xml2dot.xsl: Transform XML into DOT.
306 * data/xslt/xml2text.xsl: Transform XML into plain text.
307 * data/xslt/xml2xhtml.xsl: Transform XML into XHTML.
308 * data/Makefile.am (xsltdir): New variable.
309 (dist_xslt_DATA): Add xslt/*.xsl files.
310
a4f75309
PE
3112007-09-23 Paul Eggert <eggert@cs.ucla.edu>
312
313 * src/conflicts.c (log_resolution): Fix indenting bugs I introduced.
314 Problem reported by Wojciech Polak.
315 * src/print-xml.c (xml_puts): Work even if LEVEL exceeds INT_MAX/2.
316 (xml_printf): Undo change I made on 21 September; that is,
317 indent 2 spaces, not 1.
318
ad5feac4
JD
3192007-09-23 Joel E. Denny <jdenny@ces.clemson.edu>
320
321 Pacify ./configure --enable-gcc-warnings.
322 * src/print-xml.c, src/print-xml.h (xml_puts): Make third argument
323 `char const *' instead of `char *'.
324 * src/state.c (state_rule_lookahead_tokens_print_xml): Remove unused
325 local variable `sep'.
326
41d7a5f2
PE
3272007-09-21 Paul Eggert <eggert@cs.ucla.edu>
328
329 * src/gram.c (rule_rhs_print_xml): Now static, since it isn't used
330 elsewhere.
331 * src/print-xml.c: Prefer "const" after types; that's more consistent.
332 (xml_printf): Indent just 1 space for level.
333 (e_char, xlate_char): Remove.
334 (xml_escape_string): Rewrite to avoid undefined behavior (used
335 storage that was freed from the stack).
336 (xml_escape_n): Don't bother checking for subscript error.
337
3f999f78
WP
3382007-09-21 Wojciech Polak <polak@gnu.org>
339
340 Add Bison XML Automaton Report.
41d7a5f2
PE
341
342 Add support for an -x option to generate an XML report.
343 It is not documented yet.
344 * src/print-xml.c: New file.
345 * src/print-xml.h: Likewise.
346 * lib/timevar.def (TV_XML): New var.
347 * src/Makefile.am (bison_SOURCES): Add print-xml.c, print-xml.h.
348 * src/conflicts.c: Include print-xml.h.
349 (solved_conflicts_xml_obstack): New var.
350 (log_resolution, conflicts_solve, conflicts_free):
351 Add support for XML report.
352 (conflicts_output_val): New function.
353 * src/conflicts.h (conflicts_output_val): New decl.
354 * src/files.c (spec_xml_file): New var.
355 (compute_output_file_names, output_file_names_free): Add XML support.
356 * src/files.h (spec_xml_file): New decl.
357 * src/getargs.c (xml_flag): New var.
358 (usage, short_options, long_options, getargs): Add XML support.
359 * src/getargs.h (xml_flag): New decl.
360 * src/gram.c: Include print-xml.h.
361 (rule_lhs_print_xml, rule_rhs_print_xml):
362 (grammar_rules_partial_print_xml, grammar_rules_print_xml):
363 New functions.
364 * src/gram.h: Declare external ones.
365 * src/main.c: Include print-xml.h.
366 (main): Add XML support.
367 * src/reduce.c: Include print-xml.h.
368 (reduce_xml): New function.
369 * src/reduce.h: Declare it.
370 * src/state.c: Include print-xml.h.
371 (state_new): Add XML support.
372 (state_rule_lookahead_tokens_print_xml): New function.
373 * src/state.h: Declare it.
374 (struct state): New member solved_conflicts_xml.
375 * src/symtab.c (symbol_class_get_string): New function.
376 * src/symtab.h: Declare it.
377
6d8e724d
PE
3782007-09-21 Paul Eggert <eggert@cs.ucla.edu>
379
380 * GNUmakefile: Switch to coreutils's version.
381 * bootstrap: Likewise.
382 * Makefile.cfg: Adjust to new GNUmakefile.
383 * README-hacking: Likewise.
384
385 Import from gnulib:
386
387 2006-08-18 Paul Eggert <eggert@cs.ucla.edu>
388 Bruno Haible <bruno@clisp.org>
389
390 * m4/bison-i18n.m4 (BISON_I18N): Also handle the case where yacc exists
391 and is a script that invokes bison. Tighten the code. Add comments.
392
922bdd7f
JD
3932007-08-28 Joel E. Denny <jdenny@ces.clemson.edu>
394
395 Spell "boolean" as "Boolean". Reported by Akim Demaille.
396 * data/bison.m4 (b4_percent_define_flag_if): Fix complaint.
397 * doc/bison.texinfo (Decl Summary): Fix.
398 * src/muscle_tab.c (muscle_percent_define_flag_if): Fix complaint.
399 * tests/input.at (Boolean %define variables): Update output.
400 * tests/skeletons.at (%define boolean variables: invalid skeleton
401 defaults): Rename to...
402 (%define Boolean variables: invalid skeleton defaults): ... this and
403 update output.
404
1b17b01d
JD
4052007-08-17 Joel E. Denny <jdenny@ces.clemson.edu>
406
407 In impure push mode, don't allow more than one yypstate to be allocated
408 since multiple impure parsers would corrupt yynerrs.
409 * data/push.c (yypstate_allocated): New static global variable
410 initialized to 0.
411 (yypull_parse): If yypstate_new returns 0, don't report it as memory
412 exhaustion if yypstate_allocated is 1, but still return 2.
413 (yypstate_new): Invoke yyerror and return 0 if yypstate_allocated is
414 already 1. Otherwise, set it to 1.
415 (yypstate_delete): Set it to 0.
416 * tests/push.at (Push Parsing: Multiple impure instances): New test
417 case.
418
9987d1b3
JD
4192007-08-17 Bob Rossi <bob@brasko.net>
420
421 * doc/bison.texinfo (Push Decl): Document the push parser.
422 (Table of Symbols): Ditto.
423 (Pure Decl): Ditto.
424 (Decl Summary): Ditto.
425 (Multiple Parsers, Push Parser Function, Pull Parser Function,
426 Parser Create Function, Parser Delete Function):
427 Add new push parser symbols.
428 (Table of Symbols): Document push-parser, push-pull-parser,
429 yypush_parse, yypull_parse, yypstate_new and yypstate_delete.
430
f16b0819
PE
4312007-08-15 Paul Eggert <eggert@cs.ucla.edu>
432
433 Update to GPLv3.
434 * doc/gpl-3.0.texi: New file.
435 * doc/gpl.texi: Remove.
436 * COPYING, GNUmakefile, HACKING, Makefile.am, Makefile.cfg:
437 * Makefile.maint, NEWS, PACKAGING, README, README-alpha:
438 * README-hacking, TODO, bootstrap, bootstrap.conf:
439 * configure.ac, data/Makefile.am, data/README, data/bison.m4:
440 * data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4:
441 * data/glr.c, data/glr.cc, data/java-skel.m4, data/java.m4:
442 * data/lalr1.cc, data/lalr1.java, data/location.cc:
443 * data/push.c, data/yacc.c, data/m4sugar/m4sugar.m4:
444 * djgpp/Makefile.maint, djgpp/README.in, djgpp/config.bat:
445 * djgpp/config.sed, djgpp/config.site, djgpp/config_h.sed:
446 * djgpp/djunpack.bat, djgpp/subpipe.c, djgpp/subpipe.h:
447 * djgpp/testsuite.sed, doc/Makefile.am, doc/bison.texinfo:
448 * doc/fdl.texi, doc/refcard.tex, etc/Makefile.am, etc/README:
449 * etc/bench.pl.in, examples/Makefile.am, examples/extexi:
450 * examples/calc++/Makefile.am, lib/Makefile.am, lib/abitset.c:
451 * lib/abitset.h, lib/bbitset.h, lib/bitset.c, lib/bitset.h:
452 * lib/bitset_stats.c, lib/bitset_stats.h, lib/bitsetv-print.c:
453 * lib/bitsetv-print.h, lib/bitsetv.c, lib/bitsetv.h:
454 * lib/ebitset.c, lib/ebitset.h, lib/get-errno.c:
455 * lib/get-errno.h, lib/lbitset.c, lib/lbitset.h:
456 * lib/libiberty.h, lib/main.c, lib/subpipe.c, lib/subpipe.h:
457 * lib/timevar.c, lib/timevar.def, lib/timevar.h:
458 * lib/vbitset.c, lib/vbitset.h, lib/yyerror.c:
459 * m4/c-working.m4, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4:
460 * m4/timevar.m4, src/LR0.c, src/LR0.h, src/Makefile.am:
461 * src/assoc.c, src/assoc.h, src/closure.c, src/closure.h:
462 * src/complain.c, src/complain.h, src/conflicts.c:
463 * src/conflicts.h, src/derives.c, src/derives.h, src/files.c:
464 * src/files.h, src/flex-scanner.h, src/getargs.c:
465 * src/getargs.h, src/gram.c, src/gram.h, src/graphviz.c:
466 * src/lalr.c, src/lalr.h, src/location.c, src/location.h:
467 * src/main.c, src/muscle_tab.c, src/muscle_tab.h:
468 * src/nullable.c, src/nullable.h, src/output.c, src/output.h:
469 * src/parse-gram.c, src/parse-gram.h, src/parse-gram.y:
470 * src/print.c, src/print.h, src/print_graph.c:
471 * src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c:
472 * src/reduce.h, src/relation.c, src/relation.h:
473 * src/revision.h, src/scan-code.h, src/scan-code.l:
474 * src/scan-gram.h, src/scan-gram.l, src/scan-skel.h:
475 * src/scan-skel.l, src/state.c, src/state.h, src/symlist.c:
476 * src/symlist.h, src/symtab.c, src/symtab.h, src/system.h:
477 * src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h:
478 * tests/Makefile.am, tests/actions.at, tests/c++.at:
479 * tests/calc.at, tests/conflicts.at, tests/cxx-type.at:
480 * tests/existing.at, tests/glr-regression.at:
481 * tests/headers.at, tests/input.at, tests/java.at:
482 * tests/local.at, tests/output.at, tests/push.at:
483 * tests/reduce.at, tests/regression.at, tests/sets.at:
484 * tests/skeletons.at, tests/synclines.at, tests/testsuite.at:
485 * tests/torture.at:
486 Update to GPLv3.
487
728c4be2
JD
4882007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
489
490 Get rid of broken %no-parser, -n, and --no-parser implementation and
491 documentation.
492 * TODO: Don't mention them.
493 * doc/bison.1: Likewise.
494 * doc/bison.texinfo (Decl Summary): Likewise.
495 (Bison Options): Likewise.
496 (Option Cross Key): Likewise.
497 * src/getargs.c (no_parser_flag): Remove global variable.
498 (usage): Don't print description of -n and --no-parser.
499 (long_options): Remove --no-parser entry here.
500 (getargs): Remove -n case in the switch here.
501 * src/getargs.h (no_parser_flag): Remove extern.
502 * tests/regression.at (Web2c Actions): Remove comment that mentions
503 --no-parser.
504
5d31a216
JD
5052007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
506
507 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Do not
508 name user variables starting with `yy'. Just pass NULL instead of a
509 dummy local &yylval to yypush_parse.
510 * tests/torture.at (AT_DATA_STACK_TORTURE): Do not name user variables
511 starting with `yy'.
512
a2ea208d
JD
5132007-08-03 Joel E. Denny <jdenny@ces.clemson.edu>
514
515 * data/yacc.c (yyexhaustedlab): Define it when YYERROR_VERBOSE is
516 true since it's then always used regardless of whether yyoverflow is
517 defined. Reported by Christian Burger at
518 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00031.html>.
519 * THANKS: Add Christian Burger.
520
91661ebb
JD
521 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
522 node names: say "Decl Summary" not "Bison Declaration Summary".
523
cbd50549
JD
5242007-07-28 Joel E. Denny <jdenny@ces.clemson.edu>
525
526 * src/muscle_tab.c (muscle_percent_define_flag_if): In order to
527 determine whether this function has already complained about an invalid
528 value for a %define boolean variable, don't check whether Bison has
529 ever examined the value. As written, the check was a tautology.
530 Instead, record and check for this complaint using a separate muscle.
531
eb1b0740
JD
5322007-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
533
534 Fix push parsing memory leak reported by Brandon Lucia at
535 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00032.html>.
536 * THANKS: Add Brandon Lucia.
537 * data/push.c (yypstate_delete): Free the stack if it was reallocated
538 but the parse never completed and thus freed it.
539 * tests/Makefile.am (TESTSUITE_AT): Add push.at.
540 * tests/testsuite.at: Include push.at.
541 * test/push.at: New.
542 (Push Parsing: Memory Leak for Early Deletion): New test case.
543
9d774aff
JD
5442007-07-17 Joel E. Denny <jdenny@ces.clemson.edu>
545
546 Improve handling of multiple S/R conflicts in the same state and of S/R
547 conflicts involving multiple reductions.
548 * src/conflicts.c (resolve_sr_conflict): Don't assign the error action
549 set for a state here or Bison will abort if it is reassigned on a
550 later conflicted reduction in the same state.
551 Similarly, don't finalize and assign the solved conflicts report here
552 or it will be lost if it is reassigned on a later conflicted reduction
553 in the same state.
554 (set_conflicts): Instead, assign them both here after all S/R conflicts
555 in the state have been fully examined.
556 * src/print.c (shift_set): Rename to...
557 (no_reduce_set): ... this.
558 (print_reductions): Update for rename, and add %nonassoc error action
559 tokens to no_reduce_set so that, when printing the first remaining
560 reduction on an error action token, the reduction is enclosed in
561 brackets.
562 (print_results): Update for rename.
563 * tests/conflicts.at (Solved conflicts report for multiple reductions
564 in a state): New test case.
565 (%nonassoc error actions for multiple reductions in a state): New test
566 case.
567
568 * src/main.c (main): Don't depend on C99 features.
569
10159d2a
JD
5702007-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
571
572 * build-aux/.cvsignore: Add compile.
b541ffdf
JD
573 * lib/.cvsignore: Add charset.alias, ref-add.sed, ref-del.sed, and
574 uniwidth.
10159d2a 575
953b3935
JD
5762007-07-10 Joel E. Denny <jdenny@ces.clemson.edu>
577
578 * bootstrap (slurp): Create target directories that don't exist.
579 Specifically, we need lib/uniwidth/ because of recent Gnulib changes.
580
6ce2d93a
JD
5812007-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
582
583 * LR0.c (new_itemsets): Fix wording in comments: say item index rather
584 than item number.
585 * closure.c (closure): Likewise.
586 * state.h (reductions): Comment sorting of rules.
587 (state): Comment sorting of items.
588
ce3448d5
JD
5892007-07-02 Joel E. Denny <jdenny@ces.clemson.edu>
590
591 Fix C++ test cases after recent Gnulib changes. Discussed starting at
592 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00000.html>.
593 * examples/calc++/Makefile.am (DEFAULT_INCLUDES): Override Automake's
594 definition in order to avoid Gnulib headers since we don't use config.h
595 here.
596 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Use AT_DATA_GRAMMAR
597 rather than AT_DATA so that config.h is included.
598
8a86eef0
JD
5992007-07-01 Joel E. Denny <jdenny@ces.clemson.edu>
600
601 * data/glr.c (yy_yypstack, yypstates, yypdumpstack): Use YYFPRINTF
602 instead of fprintf. Guard these functions with #if YYDEBUG instead of
603 #ifdef YYDEBUG for consistency with all other uses of YYDEBUG in Bison
604 and so that YYFPRINTF is guaranteed to be defined here.
605
b1a81613
JD
6062007-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
607
608 * src/muscle_tab.c (muscle_percent_define_invalid_value): Replace
609 with...
610 (muscle_percent_define_check_values): ... this more helpful function.
611 Again, it's not used yet, but it will be.
612 * src/muscle_tab.h: Likewise.
613
71b61d4d
JD
614 Improve some comments in parser table construction.
615 * src/LR0.c (new_itemsets): Explain sorting of itemset and kernel_base.
616 (generate_states): Don't mention ruleset, which is internal to closure.
617 * src/closure.c (closure): Explain sorting of core and itemset, which
618 is required for this function to behave correctly.
619 * src/closure.h (closure): Mention sorting.
620
2a6b783d
JD
6212007-05-28 Joel E. Denny <jdenny@ces.clemson.edu>
622
623 * src/lalr.c (state_lookahead_tokens_count): For code readability,
624 move the check for disabled transitions to an aver since conflict
625 resolution hasn't happened yet.
626
627 * src/lalr.c (state_lookahead_tokens_count): Remove the check that
628 labels a state as inconsistent just because it has error transitions.
629 The original form of this check appeared in revision 1.1 of lalr.c,
630 which was committed on 1991-12-21. Now (at least), changing the
631 consistency label on such a state appears to have no useful effect in
632 any of the places it is examined, which I enumerate below. The key
633 point to understanding each item in this enumeration is that a state
634 with an error transition is labelled consistent in the first place only
635 if it has no rules, so the check cannot matter for states that have
636 rules. (1) Labelling a state as inconsistent will cause set_conflicts
637 to try to identify its conflicts, and a state must have *rules* to have
638 conflicts. (2) Labelling a state as inconsistent will affect how
639 action_row sets the default *rule* for the state. (3) Labelling a
640 state as inconsistent will cause build_relations to add lookback edges
641 to *rules* in that state.
642 * src/state.h (struct state): Word the comment for member consistent
643 more carefully.
644
14462c2b
JD
6452007-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
646
647 Don't depend on C99 features.
648 * src/conflicts.c (conflicts_update_state_numbers): Fix for-loop.
649 * src/lalr.c (lalr_update_state_numbers): Fix for-loop.
650 * src/reader.c (check_and_convert_grammar): Fix for-loop.
651 * src/state.c (state_mark_reachable_states): Fix for-loop.
652 (state_remove_unreachable_states): Fix for-loop.
653
654 Don't widen struct state with member reachable just to temporarily
655 record reachability. Instead, use a local bitset.
656 * src/state.h (struct state): Remove member.
657 * src/state.c (state_new): Don't initialize it.
658 (state_mark_reachable_states): Rename to...
659 (state_record_reachable_states): ... this, and use bitset.
660 (state_remove_unreachable_states): Use bitset.
661
5a43d418
JD
6622007-05-26 Joel E. Denny <jdenny@ces.clemson.edu>
663
664 * src/Makefile.am (yacc): Quote target action commands properly so
665 that the yacc script isn't corrupt. Reported by Hans Aberg at
666 <http://lists.gnu.org/archive/html/bug-bison/2007-05/msg00003.html>.
667
0c650a20
JD
668 * data/glr.c (yylval): As in yacc.c, don't extern in the header for
669 the case of pure parsers. Reported by Frans Englich at
670 <http://lists.gnu.org/archive/html/help-bison/2007-05/msg00018.html>.
671 * THANKS: Add Frans Englich.
672
61fee93e
JD
673 * NEWS (2.3a+): In the %code entry, reference section `Bison
674 Declaration Summary' from the manual now since the %code summary has
675 moved there.
676 * doc/bison.texinfo (Prologue Alternatives): Mention that directives
677 in the rules section must be terminated by semicolons.
678
f124d423
JD
6792007-05-20 Joel E. Denny <jdenny@ces.clemson.edu>
680
681 Extend the front-end API for %define variables to more completely
682 mirror the back-end. This will be useful in the future.
683 * data/bison.m4 (b4_percent_define_get, b4_percent_define_ifdef):
684 Update comments to mention the new front-end counterparts of these
685 macros.
686 * src/muscle_tab.c (MUSCLE_COMMON_DECODE): New macro with common code
687 for muscle_string_decode and muscle_location_decode.
688 (muscle_string_decode): New static function.
689 (muscle_location_decode): Use MUSCLE_COMMON_DECODE.
690 (muscle_percent_define_get, muscle_percent_define_ifdef): New
691 functions.
692 (muscle_percent_define_flag_if): Use muscle_percent_define_ifdef and
693 muscle_percent_define_get to mimic the b4_percent_define_flag_if
694 implementation more closely.
695 (muscle_percent_define_invalid_value): New function.
696 * src/muscle_tab.h (muscle_percent_define_get,
697 muscle_percent_define_ifdef, muscle_percent_define_invalid_value):
698 Prototype.
699
75ad86ee
JD
7002007-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
701
702 * NEWS (2.3a+): Mention yesterday's state-removal change.
703 (2.3a): Remove the %language entry, which was added after 2.3a.
704 * src/LR0.c, src/closure.c, src/closure.h, src/conflicts.c,
705 src/conflicts.h, src/lalr.c, src/lalr.h, src/print.c,
706 src/print_graph.c, src/state.c, src/state.h, tests/conflicts.at,
707 tests/existing.at: Update copyright date.
708
5967f0cf
JD
7092007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
710
711 If conflict resolution makes states unreachable, remove those states,
712 report rules that are then unused, and don't report conflicts in those
713 states.
714 * src/conflicts.c, src/conflicts.h (conflicts_update_state_numbers):
715 New global function.
716 * src/lalr.c, src/lalr.h (lalr_update_state_numbers): New global
717 function.
718 * src/main.c (main): After conflict resolution, remove the unreachable
719 states and update all data structures that reference states by number.
720 * src/state.c (state_new): Initialize each state's reachable member to
721 false.
722 (state_mark_reachable_states): New static function.
723 (state_remove_unreachable_states): New global function.
724 * src/state.h (struct state): Add member bool reachable.
725 (state_remove_unreachable_states): Prototype.
726 * tests/conflicts.at (Unreachable States After Conflict Resolution):
727 New test case.
728 * tests/existing.at (GNU pic Grammar): Update test case output now that
729 an unused rule is discovered.
730
b09f4f48
JD
7312007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
732
733 Minor code cleanup in parser table construction.
734 * src/LR0.c (new_itemsets): Use item_number_is_symbol_number.
735 (new_itemsets, save_reductions): Update for rename to nitemset.
736 * src/closure.c (nritemset): Rename to...
737 (nitemset): ... this since the "r" appears to meaningless and isn't
738 used in the comments.
739 (closure): Update for rename.
740 * src/closure.h (nritemset): Update extern to...
741 (nitemset): ... this.
742 * src/lalr.c (LA): Fix a typo in comments.
743 * src/print.c (print_core): Update for rename to nitemset.
744 * src/print_graph.c (print_graph): Likewise.
745 * src/state.h: Fix some typos in header comments.
746
bbb44d83
PE
7472007-04-04 Paul Eggert <eggert@cs.ucla.edu>
748
9b33de72
PE
749 * THANKS: Use ASCII for Sebastien Fricker's name. Bison source
750 still sticks to ASCII. Sorry!
751
bbb44d83
PE
752 * README-hacking: New file, taken mostly from coreutils, with changes
753 for Bison. Contains much of the contents of:
754 * README-cvs: Remove.
755 * bootstrap: Sync from gnulib.
756 * build-aux/.cvsignore: Remove *.t, mkinstalldirs.
757 * lib/.cvsignore: Add wchar.h, wctype.h. Remove exit.h.
758
29553547
JD
7592007-03-10 Joel E. Denny <jdenny@ces.clemson.edu>
760
761 * doc/bison.texinfo (Destructor Decl): Fix typo reported by Sebastian
762 Setzer.
763 (Java Differences): Fix some typos.
764 * THANKS: Add Sebastian Setzer.
765
01b477c6
PB
7662007-03-07 Paolo Bonzini <bonzini@gnu.org>
767
768 * data/java.m4 (b4_single_class_if): Remove.
769 (b4_abstract_if): Look at "%define abstract".
770 (b4_lexer_if): New.
771 (b4_union_name): Rename...
772 (b4_yystype): ... to this. Map to "%define stype".
773 (b4_rhs_value, b4_parse_param_decl, b4_lex_param_decl,
774 b4_maybe_throws): Fix quoting.
775 (b4_lex_param_call): Move below to keep b4_*_param_decl close.
776 * data/lalr1.java (Lexer interface): Always define.
777 (Lexer interface within parser class): Remove.
778 (YYLexer class): New, used when "%code lexer" is present.
779 (constructor): When "%code lexer" is used, pass %lex-param
780 to the lexer constructor.
781 (yylex, yyparse): Remove %lex-param from method invocations
782 (YYStack, yyaction, yyparse): Rename b4_union_name to b4_yystype.
783
784 * doc/bison.texinfo (Java Bison Interface): Mention "%define
785 abstract". Rename "%define union_name" to "%define stype".
786 Rename method names according to previous patch.
787 (Java Scanner Interface): Describe "%code lexer" instead of
788 "%pure-parser" and "%define single_class".
789 (Java Differences): Mention "%code lexer".
790
791 * tests/java.at (_AT_DATA_JAVA_CALC_Y): Remove final argument.
792 Include scanner here, using macros from tests/local.at.
793 (AT_DATA_CALC_Y): Remove final argument.
794 (_AT_CHECK_JAVA_CALC): Likewise.
795 (AT_CHECK_JAVA_CALC): Likewise. Test all four combinations
796 of %locations and %error-verbose.
797 (main): Test with and without %lex-param.
798 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_LEXPARAM_IF.
799 (AT_BISON_OPTION_POPDEFS): Pop it.
800
122bea3a
JMG
8012007-03-07 Juan Manuel Guerrero <juan.guerrero@gmx.de>
802
803 DJGPP spefic issue. Inhibit the use of disallowed characters for
804 file name genertion on Win98, WinXP, etc. These are |<>":?*\
805 and concern testsuite case 46.
806 * Makefile.am: djgpp/testsuite.sed added to EXTRA_DIST
807 * djgpp/testsuite.sed: Inhibit the use of disallowed characters.
808 * djgpp/config.bat: Inhibit the use of disallowed characters.
809
9611cfa2
JD
8102007-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
811
812 Miscellaneous %define and %code cleanup.
813 * data/bison.m4 (b4_percent_define_flag_if): Correct comments on how
814 values are interpreted.
815 * doc/bison.texinfo (Decl Summary): Clean up and extend %define
816 documentation a little more.
817 * src/muscle_tab.c (MUSCLE_USER_NAME_CONVERT,
818 muscle_percent_define_insert, muscle_percent_code_grow): New
819 functions/macros.
820 * src/muscle_tab.h (muscle_percent_define_insert,
821 muscle_percent_code_grow): Prototype.
822 * src/parse-gram.y (prologue_declaration): Use
823 muscle_percent_define_insert and muscle_percent_code_grow when parsing
824 %define and %code directives.
825
826 Make it easy to share %define boolean variables between the front-end
827 and back-end. Though not used yet, this will be useful in the future.
828 * data/bison.m4 (b4_check_user_names): Rewrite comments to talk about
829 Bison uses of names rather than just skeleton uses of names.
830 (b4_percent_define_get, b4_percent_define_ifdef): Rename
831 b4_percent_define_skeleton_variables(VARIABLE) to
832 b4_percent_define_bison_variables(VARIABLE).
833 (b4_percent_code_get, b4_percent_code_ifdef): Rename
834 b4_percent_code_skeleton_qualifiers(QUALIFIER) to
835 b4_percent_code_bison_qualifiers(QUALIFIER).
836 (b4_check_user_names_wrap): Update for renames.
837 * src/muscle_tab.c, src/muscle_tab.h (muscle_percent_define_flag_if,
838 muscle_percent_define_default): New functions mimicking
839 b4_percent_define_flag_if and b4_percent_define_default.
840
841 For %define variables, report locations for invalid values and
bbb44d83 842 redefinitions.
9611cfa2
JD
843 * data/bison.m4 (b4_percent_define_flag_if): Read
844 b4_percent_define_loc(VARIABLE) to report the location of an invalid
845 value for VARIABLE.
846 (b4_percent_define_default): Save a special location in
847 b4_percent_define_loc(VARIABLE) in case the default value for VARIABLE
848 must later be reported as invalid.
849 * src/muscle_tab.c (muscle_location_grow, muscle_location_decode): New
850 functions.
851 (muscle_percent_define_insert): Record the location of VARIABLE in
852 muscle percent_define_loc(VARIABLE), and use it to report the previous
853 location for a redefinition.
854 (muscle_percent_define_flag_if): Update like b4_percent_define_flag_if.
855 (muscle_percent_define_default): Update like b4_percent_define_default.
856 (muscle_grow_user_name_list): Rename to...
857 (muscle_user_name_list_grow): ... this for consistency and use
858 muscle_location_grow.
859 * src/muscle_tab.h (muscle_location_grow): Prototype.
860 * tests/input.at (%define errors): Update expected output.
861 * tests/skeletons.at (%define boolean variables: invalid skeleton
862 defaults): New test case.
863
0bf92491
JD
8642007-02-28 Joel E. Denny <jdenny@ces.clemson.edu>
865
866 * src/print.c (lookahead_set, state_default_rule): Remove.
867 (print_reductions): Replace state_default_rule invocation with
868 equivalent use of yydefact, which was computed in token_actions in
869 tables.c.
870 (print_results): Don't allocate lookahead_set.
871
d3b12988
PB
8722007-02-27 Paolo Bonzini <bonzini@gnu.org>
873
874 * data/lalr1.java: Prefix all private members with yy.
875
f57a7536
JD
8762007-02-24 Joel E. Denny <jdenny@ces.clemson.edu>
877
878 Use YYFPRINTF instead of fprintf where appropriate. Reported by
9b33de72 879 Sebastien Fricker at
f57a7536 880 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00035.html>.
9b33de72 881 * THANKS: Add Sebastien Fricker.
f57a7536
JD
882 * data/glr.c, data/push.c, data/yacc.c (yy_reduce_print): Implement.
883 * doc/bison.texinfo (Tracing): Make it clearer that YYFPRINTF must
884 accept a variable number of arguments.
885
6404a5bf
JD
8862007-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
887
888 * bootstrap: Remove occurrences of .#bootmp from lib/Makefile.
889
e4e09639
JMG
8902007-02-13 Juan Manuel Guerrero <juan.guerrero@gmx.de>
891
892 * djgpp/config.bat: Adjustments concerning the use of autoconf 2.61.
893 * djgpp/config.sed: Adjustments concerning the use of autoconf 2.61.
894 * djgpp/config.site: Adjustments concerning the use of autoconf 2.61.
895
d7e0a1a7
PE
8962007-02-11 Paul Eggert <eggert@cs.ucla.edu>
897
898 Undo my 2007-02-07 change, switching back to the c-strcase module
899 introduced in the 2007-02-03 change. Bruno Haible reported that
900 the 2007-02-07 change would be dangerous in Turkish if we add a
901 language whose name contains "i", since "i" is not lowercase "I"
902 in Turkish.
903 * bootstrap.conf (gnulib_modules): Add c-strcase. Remove strcase.
904 * lib/.cvsignore: Add c-ctype.c, c-ctype.h, c-strcase.h,
905 c-strcasecomp.c, c-strncasecmp.c. Remove strcasecmp.c, strncasecmp.c.
906 * m4/.cvsignore: Remove strcase.m4.
907 * src/getargs.c: Revert 2007-02-07 change, as follows.
908 Include c-strcase.h.
909 (language_argmatch): Use c_strcasecmp rather than strcasecmp.
910
deee93a1
JD
9112007-02-11 Bruno Haible <bruno@clisp.org>
912
913 Enable the Java related testsuite tests when the only Java compiler
914 found is a gcj < 4.3. Discussed at
915 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00016.html>.
916 * configure.ac (gt_JAVACOMP): Don't specify a target_version.
917
574add85
JD
9182007-02-11 Joel E. Denny <jdenny@ces.clemson.edu>
919
920 * data/Makefile.am: Update copyright date.
921 * data/push.c (yypull_parse): Report memory exhaustion and return 2 if
922 yypstate_new returns NULL.
923 (yypstate_new): Return NULL if malloc does.
924 * src/reader.c (packgram): Move translation of rule actions from the
925 beginning of packgram to...
926 (check_and_convert_grammar): ... here right before packgram is invoked
927 so it's easier to write more complete comments, and remove redundant
928 code.
929
e785ccf7
JD
9302007-02-10 Joel E. Denny <jdenny@ces.clemson.edu>
931
932 As in semantic actions, make @$ in %initial-action, %destructor, and
933 %printer imply %locations.
934 * src/scan-code.l (SC_SYMBOL_ACTION): Set locations_flag = true when
935 scanning @$.
936 * tests/actions.at (AT_CHECK_ACTION_LOCATIONS): New macro supporting...
937 (@$ in %initial-action implies %locations,
938 @$ in %destructor implies %locations,
939 @$ in %printer implies %locations): ... these new test cases.
940
1cfe1ed7
PE
9412007-02-07 Paul Eggert <eggert@cs.ucla.edu>
942
943 Undo most of the 2007-02-03 change, switching to the strcase module
944 now that gnulib strcase has been fixed.
945 * bootstrap.conf (gnulib_modules): Remove c-strcase. Add strcase.
946 * lib/.cvsignore: Remove c-ctype.c, c-ctype.h, c-strcase.h,
947 c-strcasecomp.c, c-strncasecmp.c. Add strcasecmp.c, strncasecmp.c
948 * m4/.cvsignore: Add strcase.m4.
949 * src/getargs.c: Revert 2007-02-03 change, as follows.
950 Don't include c-strcase.h.
951 (language_argmatch): Use strcasecmp rather than c_strcasecmp.
952 strcasecmp has "unspecified behavior" outside the POSIX locale,
953 but it works fine in practice if at least one argument is ASCII,
954 as is the case in Bison.
955
0049ec86
PB
9562007-02-07 Paolo Bonzini <bonzini@gnu.org>
957
958 * tests/java.at: Skip tests if only one of javac/java is present.
959 Reported by Joel E. Denny.
960 * tests/atlocal.in: Adjust copyright years.
961
9622007-02-05 Paolo Bonzini <bonzini@gnu.org>
963
964 * data/lalr1.java (Stack): Work around old verifiers that disallow
965 access to the private fields of an inner class, from the outer class.
966 We can make Stack's fields public because user code doesn't have access
967 to the instance of Stack used by parse(). Reported by Paul Eggert.
968
2c2b7220
PE
9692007-02-03 Paul Eggert <eggert@cs.ucla.edu>
970
971 * .cvsignore: Add javacomp.sh, javaexec.sh. Is this really
972 the right spot for these files?
973 * bootstrap.conf (gnulib_modules): Add c-strcase.
974 * lib/.cvsignore: Add c-ctype.c c-ctype.h, c-strcasecomp.c,
975 c-strncasecmp.c.
976 * src/getargs.c: Include c-strcase.h.
977 (language_argmatch): Use c_strcasecmp rather than strcasecmp,
978 to avoid unspecified behavior.
979
b2b81dae
JD
9802007-02-01 Joel E. Denny <jdenny@ces.clemson.edu>
981
982 * doc/bison.texinfo (Decl Summary): Correct typo.
983
c1d19e10
PB
9842007-01-30 Paolo Bonzini <bonzini@gnu.org>
985
986 * data/bison.m4 (b4_percent_define_flag_if): Don't treat 0 as false.
987 Complain if the value does not match empty, "true" or "false".
988 * data/c++.m4: Adjust default definitions of %define variables.
989 * data/java.m4: Adjust default definitions of %define variables.
990 * doc/bison.texinfo (Decl Summary): Adjust the %define entry according
991 to above behavior.
992 * tests/input.at (Boolean %define variables): Test new behavior.
993
8405b70c
PB
9942007-01-29 Paolo Bonzini <bonzini@gnu.org>
995
996 * NEWS: Mention java.
997 * TODO: Remove things that are done.
998 * bootstrap.conf: Add javacomp-script and javaexec-script.
999 * configure.ac: Invoke gt_JAVACOMP and gt_JAVAEXEC.
1000
1001 * data/Makefile.am: Add new files.
1002 * data/java-skel.m4: New.
1003 * data/java.m4: New.
1004 * data/lalr1.java: New.
1005
1006 * doc/bison.texinfo: Put "A Complete C++ Example" under
1007 C++ Parsers. Add Java Parsers. Put C++ Parsers and Java Parsers
1008 under Other Languages.
1009
1010 * src/getargs.c (valid_languages): Add Java.
1011 * src/getargs.h (struct bison_language): Update size of string fields.
1012
1013 * tests/Makefile.am: Add java.at.
1014 * tests/atlocal.in: Add CONF_JAVA and CONF_JAVAC.
1015 * tests/java.at: New.
1016 * tests/testsuite.at: Include it.
1017
3eb82471
JD
10182007-01-28 Joel E. Denny <jdenny@ces.clemson.edu>
1019
1020 Clean up.
1021 * src/scan-skel.l (at_directive_perform): Add at_directive_argc and
1022 at_directive_argv arguments so these no longer have to be global
1023 variables. Also, update the implementation for the following changes.
1024 (fail_for_at_directive_too_many_args,
1025 fail_for_at_directive_too_few_args): Add at_directive_name argument.
1026 (at_directive_name): Remove as at_directive_argv[0] will be used for
1027 this now.
1028 (AT_DIRECTIVE_ARGC_MAX): Increment to make space in at_directive_argv
1029 for the directive name.
1030 (at_directive_argc, at_directive_argv): Make these local within
1031 skel_lex instead of global.
1032 (INITIAL): Update directive start action for above changes.
1033 (SC_AT_DIRECTIVE_ARG): Rename to...
1034 (SC_AT_DIRECTIVE_ARGS): ... this, and update for above changes.
1035 (SC_AT_DIRECTIVE_SKIP_WS): Update.
1036 (scan_skel): Move yylex_destroy to...
1037 (skel_scanner_free): ... here.
1038 * tests/skeletons.at (installed skeleton file name): Rename to...
1039 (installed skeleton file names): ... this.
1040
148d66d8
JD
10412007-01-27 Joel E. Denny <jdenny@ces.clemson.edu>
1042
1043 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
1044 node names: say "Table of Symbols" not "Bison Symbols", and say "Decl
1045 Summary" not "Directives".
1046 * doc/bison.texinfo (Decl Summary, Calc++ Parser): Cross-reference the
1047 %code entry in "Decl Summary" rather than the one in "Table of Symbols"
1048 since the former is now the more complete one.
1049 (Prologue Alternatives): Likewise and do the same for %defines.
1050 (Table of Symbols): Add summary of %code, add summary of %define, and
1051 move full %code documentation to...
1052 (Decl Summary): ... here for consistency with other entries in these
1053 sections.
1054 Move %define entry in order to keep this list alphabetized.
1055 Reword %define entry a little to put less emphasis on the skeleton
1056 concept, which most users shouldn't have to think about.
1057
665f0c24
PE
10582007-01-26 Paul Eggert <eggert@cs.ucla.edu>
1059
1060 Adjust to recent gnulib changes.
1061 * lib/.cvsignore: Remove stpcpy.h, strndup.h, strnlen.h.
1062 Add string.h, string_.h, unistd_.h, wchar_.h.
1063 * m4/.cvsignore: Add gnulib-common.m4, string_h.m4, wchar.m4.
1064 * src/system.h: Don't include <stpcpy.h>; this is now done by
1065 <string.h>.
1066
592d0b1e
PB
10672007-01-23 Paolo Bonzini <bonzini@gnu.org>
1068
1069 Simplify implementation of unqualified %code, implement macros for
1070 uniform treatment of boolean %define flags. Document %define.
1071 * data/bison.m4 (b4_percent_define_ifdef, b4_percent_define_flag_if,
1072 b4_percent_code_ifdef): New.
1073 (b4_percent_code_get): Map unqualified %code to b4_percent_code().
1074 * data/c++.m4: Define default value for global_tokens_and_yystype.
1075 * data/glr.cc: Likewise.
1076 * data/location.cc: Use b4_percent_define_flag_if.
1077
148d66d8 1078 * doc/bison.texinfo (Decl Summary): Document %define.
592d0b1e
PB
1079
1080 * src/parse-gram.y (Unqualified %code): Change muscle name to
1081 b4_percent_code().
1082 (content.opt): Default to empty.
1083
a7867f53
JD
10842007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
1085
1086 Implement support for relative and absolute skeleton file names.
1087 Discussed starting at
1088 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00071.html>.
1089 * doc/bison.texinfo (Decl Summary): Document in %skeleton entry.
1090 (Bison Options): Document in --skeleton entry.
1091 * src/output.c (output_skeleton): Use strncpy rather than strcpy since
1092 full_skeleton can't necessarily hold all of pkgdatadir.
1093 If the specified skeleton file name contains a `/', don't prepend
1094 pkgdatadir.
1095 * src/parse-gram.y (prologue_declaration): If the specified skeleton
1096 file name contains a `/', prepend the grammar file directory.
1097 * tests/Makefile.am (TESTSUITE_AT): Add skeletons.at.
1098 * skeletons.at: New file.
1099 (relative skeleton file names): New test case.
1100 (installed skeleton file names): New test case.
1101 * tests/testsuite.at: Include skeletons.at.
1102
1103 * bootstrap: Update copyright to 2007.
1104
830c9b18
PB
11052007-01-17 Paolo Bonzini <bonzini@gnu.org>
1106
1107 * bootstrap: Remove occurrences of .#bootmp from the files.
1108
a8c2e813
AD
11092007-01-17 Akim Demaille <akim@epita.fr>
1110
1111 * doc/bison.texinfo (Calc++ Parser): Don't try to alias
1112 nonterminals.
1113 Use per-type %printer.
1114
279cabb6
JD
11152007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
1116
1117 * NEWS, data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4,
1118 data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
1119 djgpp/config.site, src/files.c, src/files.h, src/main.c,
1120 src/muscle_tab.c, src/muscle_tab.h, src/parse-gram.y, src/reader.h,
1121 src/scan-skel.h, src/scan-skel.l, tests/actions.at, tests/calc.at,
1122 tests/glr-regression.at, tests/input.at, tests/local.at,
1123 tests/output.at, tests/torture.at: Update copyright to 2007.
1124
bb32f4f2
AD
11252007-01-16 Akim Demaille <akim@epita.fr>
1126
1127 * doc/bison.texinfo (Calc++ Parsing Driver): Let "parse" return an
1128 error code.
1129 (Calc++ Scanner): Exit with failure if we can't open the input
1130 file.
1131 Accept "-" standing for stdin.
1132 (Calc++ Top Level): Print the result only if the parsing was
1133 successful.
1134
7cff04b5
AD
11352007-01-16 Akim Demaille <akim@epita.fr>
1136
1137 * data/lalr1.cc (yy_reduce_print_): Add a missing end-of-line.
1138
a4e25e1d
JD
11392007-01-15 Paolo Bonzini <bonzini@gnu.org>
1140 and Joel E. Denny <jdenny@ces.clemson.edu>
1141
1142 Clean up %define and %code implementation in M4 some. Most
1143 importantly, rename all related macros to be in the b4_percent_define
1144 and b4_percent_code namespaces. Also, complete support for `.' in
1145 %define variable names and %code qualifiers.
1146 * data/bison.m4 (b4_check_user_names): Check for special
1147 "SKELETON-NAMESPACE(name)" macros instead of using two nested
1148 m4_foreach loops.
1149 (b4_get_percent_define, b4_get_percent_code): Rename to...
1150 (b4_percent_define_get, b4_percent_code_get): ... these.
1151 Extend documentation with examples.
1152 For SKELETON-NAMESPACE (as documented for b4_check_user_names), use
1153 b4_percent_define_skeleton_variables and
1154 b4_percent_code_skeleton_qualifiers.
1155 Expect any value for the %define variable `foo' to be stored in the
1156 macro named `b4_percent_define(foo)'; expect any %code blocks for the
1157 qualifier `foo' to be stored in a macro named `b4_percent_code(foo)';
1158 expect any unqualified %code blocks to be stored in a macro named
1159 `b4_percent_code_unqualified'.
1160 Use m4_indir so that %define variable names and %code qualifiers can
1161 contain `.', which is allowed by the grammar parser.
1162 (b4_percent_define_default): New macro to set a default value for a
1163 %define variable.
1164 (m4_wrap): Update wrapped code, and fix some underquoting.
1165 (b4_check_user_names_wrap): Update and define outside the m4_wrap.
1166 Expect grammar uses of %define variables and %code qualifiers to be
1167 defined in b4_percent_define_user_variables and
1168 b4_percent_code_user_qualifiers.
1169 * data/c++.m4: Use b4_percent_define_default rather than
1170 m4_define_default. Fix some underquoting. Skeleton usage of %define
1171 variable define_location_comparison now implies skeleton usage of
1172 %define variable filename_type.
1173 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
1174 data/push.c, data/yacc.c: Update macro names.
1175 * src/parse-gram.y (prologue_declaration, grammar_declaration): Update
1176 muscle names.
1177
e37c665c
JMG
11782007-01-14 Juan Manuel Guerrero <juan.guerrero@gmx.de>
1179
1180 DJGPP specific issues.
1181
1182 * djgpp/config.site: Set ac_cv_path_mkdir to a sane DJGPP specific
1183 default. Set gl_cv_absolute_wctype_h to a sane DJGPP specific default.
1184
7d2d521f
JD
11852007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
1186
1187 * tests/glr-regression.at: Use AT_PARSER_CHECK rather than AT_CHECK to
1188 run parsers in all tests so that Valgrind is invoked during
1189 maintainer-check-valgrind.
1190 (Duplicate representation of merged trees): Free all semantic values.
1191 (Duplicated user destructor for lookahead): Likewise.
1192
e0ac9b4b
JD
11932007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
1194
1195 * tests/local.at (AT_PARSER_CHECK): Add a PRE argument to specify a
1196 command-line prefix.
1197 * tests/torture.at (Exploding the Stack Size with Alloca): Stderr is
1198 ignored, so use that PRE to set --log-fd=1 in VALGRIND_OPTS so we don't
1199 miss Valgrind messages.
1200 (Exploding the Stack Size with Malloc): Likewise.
1201
78143faa
JD
12022007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
1203
1204 Ignore YYSTACK_USE_ALLOCA for push parsers since the stacks can't be
1205 locals. Reported by Juan Manuel Guerrero at
1206 <http://lists.gnu.org/archive/html/bug-bison/2007-01/msg00000.html>.
1207 * data/push.c: Enclose the #ifdef YYSTACK_USE_ALLOCA in b4_push_if.
1208 Fix some indentation also.
1209 * tests/torture.at (Exploding the Stack Size with Alloca): Add comment
1210 explaining this issue.
1211
7ecec4dd
JD
12122007-01-09 Paolo Bonzini <bonzini@gnu.org>
1213 and Joel E. Denny <jdenny@ces.clemson.edu>
1214
1215 Simplify union and prologue handling, and escape union and lex/parse
1216 params with digraphs.
1217 * data/bison.m4 (b4_pre_prologue, b4_post_prologue): Set their default
1218 values to the empty string since these are no longer guaranteed
1219 initialized by the front-end.
1220 * data/glr.c, data/glr.cc, data/lalr1.cc, data/push.c, data/yacc.c: Add
1221 braces around b4_user_stype since this is no longer done by the
1222 front-end.
1223 * src/files.c, src/files.h (pre_prologue_obstack,
1224 post_prologue_obstack): Remove.
1225 * src/muscle_tab.c (muscle_pair_list_grow): Don't duplicate header
1226 comments here. Use MUSCLE_OBSTACK_SGROW so that values are escaped
1227 with digraphs. This fixes lex params and parse params.
1228 * src/muscle_tab.h (muscle_pair_list_grow): Update comments.
1229 * src/output.c (prepare): Remove muscle insertion of the prologues.
1230 (output): Remove freeing of pre_prologue_obstack and
1231 post_prologue_obstack.
1232 * src/parse-gram.y (prologue_declaration): Use muscle_code_grow rather
1233 than prologue_augment for prologue parsing so you don't need prologue
1234 obstacks.
5c80250c
JD
1235 (grammar_declaration): For %union RHS, use `braceless' instead of
1236 "{...}" so that braces are already stripped and code is escaped with
1237 digraphs.
7ecec4dd
JD
1238 * src/reader.c (prologue_augment): Remove.
1239 (reader): Remove initialization of pre_prologue_obstack and
1240 post_prologue_obstack.
1241 * src/reader.h (prologue_augment): Remove.
1242
1243 * data/c.m4: Remove stray parenthesis.
1244
16dc6a9e
JD
12452007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
1246
1247 Remove quotes from variables names in %define directives and from
1248 qualifiers in %code directives, and restrict the characters that are
1249 allowed in them to M4-friendly ones. For %define, continue to support
1250 the quoted form as a deprecated feature. Discussed starting at
1251 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00023.html>.
1252 * NEWS (2.3a+): Add entry for the change to %define. Update entry for
1253 %code.
1254 * doc/bison.texinfo (Prologue Alternatives): Update.
91661ebb
JD
1255 (Decl Summary): In %defines entry, update mention of `%code requires'
1256 and `%code provides'.
16dc6a9e
JD
1257 (C++ Location Values): Update %define uses.
1258 (Calc++ Parser Interface): Likewise.
1259 (Calc++ Parser): Likewise, and update `%code requires' uses.
148d66d8 1260 (Table of Symbols): Update %code documentation.
16dc6a9e
JD
1261 * src/parse-gram.y (prologue_declaration): For %define variables, use
1262 `variable' instead of `STRING'.
1263 (grammar_declaration): For %code qualifiers, use `ID' instead of
1264 `STRING'.
1265 (variable): New nonterminal that takes an `ID' or a `STRING'.
1266 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update %code
1267 and %define uses.
1268 * tests/calc.at (_AT_DATA_CALC_Y): Update %define use.
1269 * tests/input.at (Reject unused %code qualifiers): Update %code uses.
1270 (%define errors): Update %define uses.
1271
e9813cd4
JD
12722007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
1273
1274 * src/parse-gram.y (prologue_declaration): Use MUSCLE_INSERT_STRING
1275 instead of muscle_insert for %define values so that M4-special
1276 characters are replaced with digraphs.
1277 * tests/input.at (%define errors): Extend to check weird values.
1278
6afc30cc
JD
12792007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
1280
1281 Instead of having skeletons declare all valid %define variables and
1282 %code qualifiers, provide macros that retrieve the associated values
1283 and build these lists automatically. Thus Bison will now warn when a
1284 variable or qualifier is not used by the skeleton in the current
1285 invocation regardless of whether it might sometimes be used by that
1286 skeleton in other invocations. Also, move all %define value macros to
1287 the b4_percent_define_ namespace, and remove the %define "NAME" {CODE}
1288 form, which is replaced by %code.
1289 * data/bison.m4 (b4_check_for_unrecognized_names): Rename to...
1290 (b4_check_user_names): ... this, and change the series of valid name
1291 arguments to a single list argument for names used in the skeleton
1292 similar to the existing list argument for names used in the grammar.
1293 Warn instead of complaining.
1294 (b4_get_percent_define, b4_get_percent_code): New to retrieve %define
1295 values and %code code, to format %code code properly, and to build
1296 lists of all %define variables and %code qualifiers used in the
1297 skeleton: b4_skeleton_percent_define_variables and
1298 b4_skeleton_percent_code_qualifiers.
1299 (b4_check_percent_define_variables, b4_check_percent_code_qualifiers):
1300 Remove, and...
1301 (m4_wrap): ... m4_wrap b4_check_user_names invocations instead so that
1302 the skeleton names lists can finish building first. In place of
1303 b4_used_percent_define_variables and b4_used_percent_code_qualifiers,
1304 expect the lists b4_user_percent_define_variables and
1305 b4_user_percent_code_qualifiers.
1306 * data/c++.m4: Where setting default values for b4_parser_class_name,
1307 b4_location_type, b4_filename_type, b4_namespace, and
1308 b4_define_location_comparison, update their names to the
1309 b4_percent_define_ namespace.
1310 * data/glr.c: Don't use b4_check_percent_define_variables and
1311 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
1312 * data/glr.cc, data/lalr1.cc: Likewise, and use b4_get_percent_define.
1313 (b4_parser_class_name, b4_namespace): Define these using
a4e25e1d 1314 b4_get_percent_define for parser_class_name and namespace.
6afc30cc
JD
1315 * data/location.cc: Use b4_get_percent_define.
1316 * data/push.c: Don't use b4_check_percent_define_variables and
1317 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
1318 * data/yacc.c: Likewise, and don't call m4_exit in
1319 b4_use_push_for_pull_if or m4_wrap code will never execute.
1320 * src/muscle_tab.c, src/muscle_tab.h (muscle_grow_used_name_list):
1321 Rename to...
1322 (muscle_grow_user_name_list): ... this for consistency with the
1323 terminology used in bison.m4.
1324 * src/parse-gram.y (prologue_declaration): Prepend "percent_define_" to
1325 %define variable names, and rename muscle used_percent_define_variables
1326 to user_percent_define_variables.
1327 (grammar_declaration): Rename muscle used_percent_code_qualifiers to
1328 user_percent_code_qualifiers.
1329 (content): Remove.
1330 (content.opt): Replace content RHS with STRING RHS so %define "NAME"
1331 {CODE} form is no longer accepted.
1332 * tests/input.at (Reject bad %code qualifiers): Rename to...
1333 (Reject unused %code qualifiers): ... this, and update test output.
1334 (%define error): Update test output.
1335
7eb8a0bc
JD
13362007-01-07 Joel E. Denny <jdenny@ces.clemson.edu>
1337
1338 Check for unrecognized %define variables similar to checking for
1339 unrecognized %code qualifiers. Check for redefined %define variables.
1340 * data/bison.m4 (b4_check_for_unrecognized_names): New macro that
1341 generalizes...
1342 (b4_check_percent_code_qualifiers): ... this, which now wraps it.
1343 (b4_check_percent_define_variables): New, also wraps it.
1344 * data/glr.c: Unless glr.cc is wrapping glr.c, declare no valid %define
1345 variables using b4_check_percent_define_variables.
1346 * data/glr.cc, data/lalr1.cc: Declare the valid %define variables as
1347 all those exercised in the test suite and all those listed in the
1348 `Default values' section of c++.m4. Are there others?
1349 * data/push.c, data/yacc.c: Declare no valid %define variables.
1350 * src/muscle_tab.c, src/muscle_tab.h (muscle_find_const): New function,
1351 similar to muscle_find, but it works even when the muscle stores a
1352 const value.
1353 (muscle_grow_used_name_list): New function for constructing the used
1354 name list muscles that b4_check_for_unrecognized_names requires.
1355 * src/parse-gram.y (prologue_declaration): Warn if a variable is
1356 %define'd more than once. Define the b4_used_percent_define_variables
1357 muscle with muscle_grow_used_name_list.
1358 (grammar_declaration): Abbreviate %code code with
1359 muscle_grow_used_name_list.
1360 * tests/input.at (%define errors): New.
1361
3fc65ead
JD
13622007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
1363
1364 Provide warn_at, complain_at, and fatal_at function callbacks to the
1365 skeletons, and use this for %code qualifier complaints.
1366 * data/bison.m4 (b4_error_at): New, invoked by...
1367 (b4_warn_at, b4_complain_at, b4_fatal_at): ... these new macros to wrap
1368 the skeleton scanner's new @warn_at(...@), @complain_at(...@), and
1369 @fatal_at(...@) directives.
1370 (b4_check_percent_code_qualifiers): Rewrite to expect locations for
1371 qualifiers in b4_used_percent_code_qualifiers and to use
1372 b4_complain_at.
1373 * src/location.c, src/location.h (boundary_set_from_string): New global
1374 function.
1375 * src/muscle_tab.c, src/muscle_tab.h (muscle_boundary_grow): New global
1376 function.
1377 * src/parse-gram.y (grammar_declaration): Add locations for qualifiers
1378 to b4_used_percent_code_qualifiers.
1379 * src/scan-skel.l (fail_for_at_directive_too_few_args): New static
1380 function.
1381 (AT_DIRECTIVE_ARGC_MAX): Increase for boundary arguments.
1382 (lineno): Rename to...
1383 (out_lineno): ... this so I don't misunderstand it again.
1384 (SC_AT_DIRECTIVE_SKIP_WS): Don't increment out_lineno for newlines
1385 here; these newlines are in the input but not the output file.
1386 (SC_AT_DIRECTIVE_ARG): Likewise. Extract directive execution to...
1387 (at_directive_perform): ... this new static function, and add handling
1388 of new @warn_at(...@), @complain_at(...@), and @fatal_at(...@)
1389 directives.
1390 * tests/input.at (Reject bad %code qualifiers): Update test output with
1391 locations and extend.
1392
1393 * tests/output.at (Output file name: [, Output file name: ]): Remove
1394 bogus comment about these tests failing.
1395
1c7b7e1d
JD
13962007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
1397
1398 Clean up b4_check_percent_code_qualifiers a little.
1399 * data/bison.m4 (b4_check_percent_code_qualifiers): Expect qualifiers
1400 in b4_used_percent_code_qualifiers to be double-M4-quoted. Rewrite
1401 documentation and add examples.
1402 * src/parse-gram.y (grammar_declaration): Double-M4-quote those
1403 qualifiers here.
1404
08af01c2
JD
14052007-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
1406
1407 Don't use m4_divert since it makes m4_divert_push and m4_divert_pop
1408 unreliable -- especially when they're hidden inside another macro.
1409 * data/bison.m4, data/c++-skel.m4, data/c++.m4, data/c-skel.m4,
1410 data/c.m4: Remove m4_divert(-1).
1411 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
1412 data/push.c, data/yacc.c: Likewise, and replace m4_divert(0) with
1413 m4_divert_push(0) and m4_divert_pop(0).
279cabb6 1414 * src/output.c (output_skeleton): Don't add an m4_divert_push(0) and
08af01c2
JD
1415 an m4_wrap([m4_divert_pop(0)]) to the M4. Diversion -1, which is
1416 pushed and popped by m4sugar, should be first on the stack.
1417
1418 Provide warn, complain, and fatal function callbacks to the skeletons.
1419 This provides more flexibility than m4_fatal, improves the error
1420 message format, and captures messages for translation. Discussed
1421 starting at
1422 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00063.html>.
1423 * data/bison.m4 (b4_error): New, invoked by...
1424 (b4_warn, b4_complain, b4_fatal): ... these new macros to wrap the
1425 skeleton scanner's new @warn(...@), @complain(...@), and @fatal(...@)
1426 directives. Because these M4 macros might be called when the current
1427 diversion is -1 or 0, m4_divert_push and m4_divert_pop is used; thus
1428 the previous removal of uses of m4_divert, which caused trouble.
1429 (b4_check_percent_code_qualifiers): Use b4_complain instead of
1430 m4_fatal to report unrecognized %code qualifiers.
1431 * data/c++-skel.m4: Use b4_complain instead of m4_fatal to report C++
1432 push parser requests.
1433 * data/glr.c: Use b4_complain instead of m4_fatal to report
1434 non-deterministic push parser requests.
1435 Update @output usage to @output(...@) form.
1436 * data/glr.cc, data/lalr1.cc: Use b4_fatal instead of m4_fatal to
1437 report missing %defines. Update @output usage to @output(...@) form.
1438 * data/location.cc, data/push.c, data/yacc.c: Update @output usage to
1439 @output(...@) form.
1440 * src/main.c (main): Invoke skel_scanner_free.
1441 * src/scan-skel.h (skel_scanner_free): Prototype new function.
1442 * src/scan-skel.l (FLEX_NO_OBSTACK): Don't define; we now need the
1443 obstack_for_string from flex-scanner.h.
1444 (YY_DECL): Use to declare skel_lex static.
1445 (decode_at_digraphs): Remove; now handled in the new
1446 SC_AT_DIRECTIVE_ARG start condition.
1447 (fail_for_at_directive_too_many_args, fail_for_invalid_at): New static
1448 functions.
1449 (at_directive_name, AT_DIRECTIVE_ARGC_MAX, at_directive_argc,
1450 at_directive_argv): New static globals.
1451 (INITIAL): Use fail_for_invalid_at.
1452 Don't parse `@output file_name\n' or `@basename(...@)'. Instead,
1453 recognize the start of a generalized `@directive(...@)' form and
1454 start...
1455 (SC_AT_DIRECTIVE_ARG): ... this new start condition to parse the
1456 directive args (using the new obstack_for_string), to decode the
1457 contained @ diagraphs, and to perform the directive. It recognizes
1458 @basename(...@), @warn(...@), @complain(...@), @fatal(...@), and
1459 @output(...@).
1460 (SC_AT_DIRECTIVE_SKIP_WS): New start condition started by
1461 SC_AT_DIRECTIVE_ARG to skip whitespace after the argument delimiter,
1462 `@,'.
1463 (scan_skel): Initialize obstack_for_string on the first call.
1464 (skel_scanner_free): New function to free obstack_for_string.
1465 * tests/input.at (Reject bad %code qualifiers): Update test output.
1466
8e0a5e9e
JD
14672007-01-04 Joel E. Denny <jdenny@ces.clemson.edu>
1468
1469 Consolidate the 4 prologue alternative directives (%code, %requires,
1470 %provides, and %code-top) into a single %code directive with an
1471 optional qualifier field. Discussed at
1472 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00012.html>.
1473 * NEWS (2.3a+): Rewrite the existing entry for the prologue
1474 alternatives.
1475 * doc/bison.texinfo (Prologue Alternatives): Update.
1476 (Decl Summary): Update to %code "requires" and %code "provides".
1477 (Calc++ Parser): Update to %code "requires".
148d66d8 1478 (Table of Symbols): Remove entries for %requires, %provides, and
8e0a5e9e
JD
1479 %code-top. Rewrite %code entry, and add a %code "QUALIFIER" entry.
1480 * data/bison.m4 (b4_user_provides, b4_user_requires): Remove as these
1481 are replaced by b4_percent_code_provides and b4_percent_code_requires,
1482 which are skeleton-specific.
1483 (b4_check_percent_code_qualifiers): New. A skeleton can use this to
1484 declare what %code qualifiers it supports and to complain if any other
1485 qualifiers were used in the grammar.
1486 * data/glr.cc: Update to use b4_user_code([b4_percent_code_requires])
1487 and b4_user_code([b4_percent_code_provides]) in place of
1488 b4_user_requires and b4_user_provides.
1489 * data/glr.c, data/lalr1.cc, data/push.c, data/yacc.c: Likewise.
1490 Add b4_user_code([b4_percent_code_top]) and
1491 b4_user_code([b4_percent_code]).
1492 Invoke b4_check_percent_code_qualifiers.
1493 * src/parse-gram.y (PERCENT_CODE_TOP, PERCENT_PROVIDES,
1494 PERCENT_REQUIRES): Remove.
1495 (grammar_declaration): Remove RHS's for %code-top, %provides, and
1496 %requires. Rewrite the %code RHS as the unqualified form defining the
1497 muscle b4_percent_code. Add another RHS for the qualified %code form,
1498 which defines muscles of the form b4_percent_code_QUALIFIER and the
1499 b4_used_percent_code_qualifiers muscle.
1500 * src/scan-gram.l (PERCENT_CODE_TOP, PERCENT_PROVIDES,
1501 PERCENT_REQUIRES): Remove.
1502 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update to use
1503 %code "requires" and %code "provides".
1504 * tests/input.at (Reject bad %code qualifiers): New.
1505
95021767
JD
15062007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
1507
1508 Use the new code_props interface for destructors and printers.
1509 * src/symtab.h (symbol, semantic_type): Remove destructor_location and
1510 printer_location members, and change the type of the destructor and
1511 printer members to code_props.
1512 (symbol_destructor_set, symbol_destructor_get, symbol_printer_set,
1513 symbol_printer_get, semantic_type_destructor_set,
1514 semantic_type_printer_set, default_tagged_destructor_set,
1515 default_tagless_destructor_set, default_tagged_printer_set,
1516 default_tagless_printer_set): Use code_props in arguments and return
1517 types in place of char const * and location.
1518 (symbol_destructor_location_get, symbol_printer_location_get): Remove
1519 since the locations are now contained in the return of
1520 symbol_destructor_get and symbol_printer_get.
1521 * src/output.c (symbol_destructors_output, symbol_printers_output):
1522 Replace with...
1523 (symbol_code_props_output): ... this to eliminate duplicate code.
1524 (output_skeleton): Update to use symbol_code_props_output.
1525 * src/reader.c (symbol_should_be_used): Update use of
1526 symbol_destructor_get.
1527 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
1528 Update uses of the various _destructor_set and _printer_set functions.
1529 * src/symtab.c: (default_tagged_destructor_location,
1530 default_tagless_destructor_location, default_tagged_printer_location,
1531 default_tagless_printer_location): Remove since we...
1532 (default_tagged_destructor, default_tagless_destructor,
1533 default_tagged_printer, default_tagless_printer): ... change the type
1534 of these to code_props.
1535 (symbol_new, semantic_type_new, symbol_destructor_set,
1536 semantic_type_destructor_set, symbol_destructor_get,
1537 symbol_printer_set, semantic_type_printer_set, symbol_printer_get,
1538 symbol_check_alias_consistency, default_tagged_destructor_set,
1539 default_tagless_destructor_set, default_tagged_printer_set,
1540 default_tagless_printer_set): Update.
1541 (symbol_destructor_location_get, symbol_printer_location_get): Remove.
1542 (SYMBOL_CODE_PRINT): New similar to SYMBOL_ATTR_PRINT but for
1543 code_props members.
1544 (symbol_print): Use SYMBOL_CODE_PRINT.
1545
f6857bbf
JD
15462007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
1547
1548 Use the new code_props interface for rule actions.
1549 * src/symlist.h (symbol_list): Replace action, action_location, and
1550 used members with a code_props action_props member.
1551 * src/reader.c (symbol_should_be_used, grammar_rule_check,
1552 grammar_midrule_action, grammar_current_rule_merge_set,
1553 grammar_current_rule_symbol_append, packgram): Update.
1554 * src/scan-code.h (translate_rule_action): Remove, no longer used.
1555 * src/scan-code.l (handle_action_dollar): Update.
1556 (translate_rule_action): Remove, no longer used.
1557 * src/symlist.c (symbol_list_sym_new, symbol_list_syms_print): Update.
1558
7c0c6181
JD
15592007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
1560
1561 Use the new code_props interface in parse-gram.y.
1562 * src/parse-gram.y (prologue_declaration, braceless, epilogue.opt):
1563 Update all uses of translate_* functions to use the new code_props
1564 interface and to use gram_scanner_last_string_free and
1565 code_scanner_last_string_free where possible.
1566 (grammar_declaration): symbol_list_destructor_set and
1567 symbol_list_printer_set now perform the translation, so don't do it
1568 here. Use gram_scanner_last_string_free where possible.
1569 * src/scan-code.h, src/scan-code.l (translate_symbol_action,
1570 translate_code): Remove, no longer used.
1571 * src/symlist.h, src/symlist.c (symbol_list_destructor_set,
1572 symbol_list_printer_set): Perform code translation here rather than
1573 depending on the caller to do so.
1574
1575 * src/symlist.h (struct symbol_list): Correct some documentation typos.
1576 * src/scan-gram.h (gram_last_string): Remove declaration.
1577 * src/scan-gram.l (last_string): Declare it static.
1578
28e52c0d
JD
15792007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
1580
1581 Encapsulate code properties and related functionality for the various
1582 destructors, printers, and actions into a code_props structure and
1583 interface. This patch merely implements code_props in scan-code.h and
1584 scan-code.l. Future patches will rewrite other modules to use it.
1585 Discussed starting at
1586 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00020.html>.
1587 * src/location.h (EMPTY_LOCATION_INIT): Define so that it's easier to
1588 consistently initialize const structs that have an empty location
1589 field.
1590 * src/location.c (empty_location): Initialize with EMPTY_LOCATION_INIT
1591 to ensure consistency.
1592 * src/scan-code.h (code_props): New structure.
1593 (code_props_none_init, CODE_PROPS_NONE_INIT, code_props_none): New
1594 function, macro, and const global variable for initializing a
1595 code_props with no code.
1596 (code_props_plain_init, code_props_symbol_action_init,
1597 code_props_rule_action_init, code_props_translate_code): The rest of
1598 the new code_props functional interface. Among other things, the init
1599 functions set the code_props kind field so that
1600 code_props_translate_code will know whether to behave like
1601 translate_symbol_action, translate_rule_action, or translate_code.
1602 These old translate functions must remain until all other modules are
1603 updated to use the new code_props interface.
1604 (code_scanner_last_string_free): New function similar to
1605 gram_scanner_last_string_free.
1606 (code_scanner_free): Add documentation.
1607 * src/scan-code.l: Implement the new interface.
1608 (code_lex): Make it static, add a code_props* argument, and remove the
1609 rule argument.
1610 (last_string): New static global similar to the one in scan-gram.l.
1611 (SC_RULE_ACTION): Update to use the code_props* argument to code_lex
1612 instead of rule.
1613 (SC_SYMBOL_ACTION): For $$, set the is_value_used member of the
1614 code_props since Bison may one day use this information for destructors
1615 and printers.
1616 (<*><<EOF>>): Use STRING_FINISH so that last_string is set.
1617 (handle_action_dollar): Use symbol_list_n_get and set used flag
1618 directly since symbol_list_n_used_set is removed.
1619 (translate_action): Add a code_props* argument and remove the rule,
1620 action, and location arguments. Pass the code_props* on to code_lex.
1621 (translate_rule_action, translate_symbol_action, translate_code):
1622 Rewrite as wrappers around the new code_props interface.
1623 * src/symlist.h, src/symlist.c (symbol_list_n_used_set): Remove since
1624 it would eventually need to break the encapsulation of code_props.
1625
96034983
JD
16262007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
1627
1628 * etc/.cvsignore: New.
1629
945e396c
JD
16302007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
1631
1632 Add maintainer-push-check to run maintainer-check using push parsing in
1633 place of pull parsing where available.
1634 * Makefile.am (maintainer-push-check): New.
1635 * data/bison.m4 (b4_use_push_for_pull_if): New.
1636 * data/push.c: Redefine b4_push_if and b4_use_push_for_pull_if
1637 appropriately based on their existing values.
1638 (yypush_parse): Don't print push-parser-specific diagnostics if push
1639 parsing is being used in place of pull parsing.
1640 * data/yacc.c: If push parsing should replace pull parsing, redirect to
1641 push.c.
1642 * src/output.c (prepare): Check BISON_USE_PUSH_FOR_PULL environment
1643 variable, and insert b4_use_push_for_pull_flag into muscles.
1644 * tests/Makefile.am (maintainer-push-check): New.
1645
7d596384
JD
16462006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
1647
1648 * data/push.c (yypush_parse): Set yynew = 1 at the end of a parse
1649 (whether successful or failed) so that yypush_parse can be invoked
1650 again to start a new parse using the same yypstate.
1651 * tests/torture.at (AT_DATA_STACK_TORTURE): For push mode, extend to
1652 check multiple yypull_parse invocations on the same yypstate. For pull
1653 mode, extend to check multiple yyparse invocations.
1654 (Exploding the Stack Size with Alloca): Extend to try with
1655 %push-pull-parser.
1656 (Exploding the Stack Size with Malloc): Likewise.
1657
1658 * tests/calc.at (Simple LALR Calculator): Don't specify
1659 %skeleton "push.c" since %push-pull-parser implies that now.
1660 * tests/headers.at (export YYLTYPE): Don't check for the push
1661 declarations. Otherwise, this test case can't be used to see if push
1662 mode can truly emulate pull mode.
1663 * tests/input.at (Torturing the Scanner): Likewise.
1664 * tests/local.at (AT_YACC_OR_PUSH_IF, AT_PUSH_IF): Remove.
1665 (AT_YYERROR_SEES_LOC_IF): Rather than AT_YACC_OR_PUSH_IF, use
1666 AT_YACC_IF, which now includes the case of push mode since %skeleton
1667 need not be used for push mode. This will be more intuitive once
1668 push.c is renamed to yacc.c.
1669
7172e23e
JD
16702006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
1671
1672 For push mode, convert yyparse from a macro to a function, invoke yylex
1673 instead of passing a yylexp argument to yypull_parse, and don't
1674 generate yypull_parse or yyparse unless %push-pull-parser is declared.
1675 Discussed starting at
1676 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00163.html>.
1677 * data/bison.m4 (b4_pull_if): New.
1678 * data/c.m4 (b4_identification): Define YYPULL similar to YYPUSH.
1679 * data/push.c: Improve M4 quoting a little.
1680 (b4_generate_macro_args, b4_parenthesize): Remove.
1681 (yyparse): If there's a b4_prefix, #define this to b4_prefix[parse]
1682 any time a pull parser is requested.
1683 Don't #define this as a wrapper around yypull_parse. Instead, when
1684 both push and pull are requested, make it a function that does that
1685 same thing.
1686 (yypull_parse): If there's a b4_prefix, #define this to
1687 b4_prefix[pull_parse] when both push and pull are requested.
1688 Don't define this as a function unless both push and pull are
1689 requested.
1690 Remove the yylexp argument and hard-code yylex invocation instead.
1691 * etc/bench.pl.in (bench_grammar): Use %push-pull-parser instead of
1692 %push-parser.
1693 * src/getargs.c (pull_parser): New global initialized to true.
1694 * getargs.h (pull_parser): extern it.
1695 * src/output.c (prepare): Insert pull_flag muscle.
1696 * src/parse-gram.y (PERCENT_PUSH_PULL_PARSER): New token.
1697 (prologue_declaration): Set both push_parser and pull_parser = true for
1698 %push-pull-parser. Set push_parser = true and pull_parser = false for
1699 %push-parser.
1700 * src/scan-gram.l: Don't accept %push_parser as an alternative to
1701 %push-parser since there's no backward-compatibility concern here.
1702 Scan %push-pull-parser.
1703 * tests/calc.at (Simple LALR(1) Calculator): Use %push-pull-parser
1704 instead of %push-parser.
1705 * tests/headers.at (export YYLTYPE): Make yylex static, and don't
1706 prototype it in the module that calls yyparse.
1707 * tests/input.at (Torturing the Scanner): Likewise.
1708 * tests/local.at (AT_PUSH_IF): Check for %push-pull-parser as well.
1709
2e7944cb
JD
17102006-12-26 Joel E. Denny <jdenny@ces.clemson.edu>
1711
1712 Update etc/bench.pl. Optimize push mode a little (the yyn change
1713 deserves most of the credit).
1714 * Makefile.am (SUBDIRS): Add etc subdirectory.
1715 * configure.ac (AC_CONFIG_FILES): Add etc/bench.pl and etc/Makefile.
1716 * data/push.c (b4_declare_parser_state_variables): Move yyn, yyresult,
1717 yytoken, yyval, and yyloc declarations to...
1718 (yyparse or yypush_parse): ... here to improve performance. For
1719 yypush_parse invocations after the first, be sure to assign yyn its old
1720 value again.
1721 (yypstate_new): Don't bother initializing the yyresult field since the
1722 initial value isn't used.
1723 (yyn, yyresult, yytoken, yyval, yyloc): For each NAME in this list,
1724 remove the #define that, in push mode, set it to yyps->NAME.
1725 * etc/Makefile.am: New.
1726 * etc/bench.pl: Remove and build it instead from...
1727 * etc/bench.pl.in: ... this new file. Use @abs_top_builddir@ to invoke
1728 "tests/bison" from the build directory by default rather than just
1729 invoking "bison" from $PATH.
1730 (calc_grammar): Update push parser code: don't declare yylval globally,
1731 don't define yyparse_wrapper, and don't #define yyparse.
1732 (bench_grammar): Update to check all working combinations of yacc.c,
1733 push.c, impure, pure, pull, and push.
1734
c3d50342
JD
17352006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
1736
1737 For push mode, add pull wrappers around yypush_parse.
1738 * data/push.c: (b4_generate_macro_args, b4_parenthesize): New macros.
1739 (yypull_parse): New function wrapping yypush_parse.
1740 (yyparse): New #define wrapping yypull_parse.
1741 * tests/calc.at (_AT_DATA_CALC_Y): Call yyparse even when %push-parser
1742 is declared.
1743 * tests/headers.at (export YYLTYPE): Make yylex global. For push mode,
1744 prototype yylex in the module that calls yyparse, and don't prototype
1745 yyparse there. Otherwise, the yyparse expansion won't compile.
1746 * tests/input.at (Torturing the Scanner): Likewise.
1747
94ebeba5
JD
17482006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
1749
1750 Enable push parsers to operate in impure mode. Thus, %push-parser no
1751 longer implies %pure-parser. The point of this change is to move
1752 towards being able to test the push parser code by running the entire
1753 test suite as if %push-parser had been declared.
1754 * data/push.c (yypush_parse): For impure mode, remove the
1755 yypushed_char, yypushed_val, and yypushed_loc arguments.
1756 Instead, declare these as local variables initialized to the global
1757 yychar, yylval, and yylloc.
1758 For the first yypush_parse invocation only, restore the initial values
1759 of these global variables when it's time to read a token since they
1760 have been overwritten.
1761 * src/parse-gram.y (prologue_declaration): Don't set pure_parser for
1762 %push-parser.
1763 * tests/calc.at (Simple LALR(1) Calculator): Always declare
1764 %pure-parser along with %push-parser since this test case was designed
1765 for pure push parsers.
1766 * tests/local.at (AT_PURE_OR_PUSH_IF): Remove unused.
1767 (AT_YACC_OR_PUSH_IF): New.
1768 (AT_YYERROR_SEES_LOC_IF): Fix enough that the test suite passes, but
1769 add a note that it's still wrong for some cases (as it has been for a
1770 while).
1771 (AT_PURE_LEX_IF): Use AT_PURE_IF instead of AT_PURE_OR_PUSH_IF since
1772 %push-parser no longer implies %pure-parser.
1773
a0633178
JD
17742006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
1775
1776 Remove some unnecessary differences between the pull parser code and
1777 the push parser code. This patch enables yynerrs in push mode.
1778 * data/push.c: Reformat M4 a little.
1779 (b4_yyerror_range): Remove and convert all uses to just yyerror_range.
1780 (b4_declare_scanner_communication_variables): Don't omit yynerrs just
1781 because push mode is on. Instead, if pure mode is on, move yynerrs
1782 to...
1783 (b4_declare_parser_state_variables): ... here.
1784 (yynerrs, yyerror_range): For push mode, #define each NAME in this list
1785 to yyps->NAME so it can be used in yypush_parse.
1786 (yypush_parse): Don't omit uses of yynerrs in push mode.
1787
8646b6a3
JD
17882006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
1789
1790 Fix bug such that the first pushed token's value and location are
1791 sometimes overwritten (sometimes by %initial-action) before being used.
1792 * data/push.c (yypush_parse): Rename arguments yynchar, yynlval, and
1793 yynlloc to yypushed_char, yypushed_val, and yypushed_loc for clarity.
1794 For the first yypush_parse invocation, initialize yychar to YYEMPTY to
1795 more closely mimic the pull parser logic.
1796 Don't copy the pushed token to yychar, yylval, and yylloc until it's
1797 time to read a token, which is after any initialization of yylval and
1798 yylloc.
1799 (gottoken): Rename label to...
1800 (yyread_pushed_token): ... for clarity and to avoid infringing on the
1801 user namespace.
1802
9baf4d74
JD
18032006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
1804
1805 Rearrange initialization of the parser state variables so that the
1806 skeleton doesn't have to have a copy for pull mode and another for push
1807 mode. This patch also fixes at least a bug such that yylloc was not
1808 initialized (with b4_location_initial_line and
1809 b4_location_initial_column) upon calling yypush_parse. However, that
1810 initialization now overwrites the first token's location;
1811 %initial-action assigning @$ already did the same thing, and both bugs
1812 will be fixed in a later patch.
1813 * data/push.c (b4_yyssa): Remove and convert all uses to just yyssa.
1814 (b4_declare_parser_state_variables): Remove initialization of yytoken,
1815 yyss, yyvs, yyls, and yystacksize.
1816 (yypstate_new): Remove initialization of some yypstate fields: yystate,
1817 yyerrstatus, yytoken, yyss, yyvs, yyls, yystacksize, yyssp, yyvsp, and
1818 yylsp.
1819 (yyssa, yyvsa, yylsa): For push mode, #define each NAME in this list to
1820 yyps->NAME so it can be used in yypush_parse.
1821 (yyparse or yypush_parse): For yypush_parse, don't print the
1822 "Starting parse" diagnostic for invocations after the first.
1823 Add initialization of yytoken, yyss, yyvs, yyls, and yystacksize; for
1824 yypush_parse, only do it for the first invocation.
1825 Allow yystate, yyerrstatus, yyssp, yyvsp, yylsp, and yylloc
1826 initialization to occur in yypush_parse but only on the first
1827 invocation.
1828
23522164
JD
18292006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
1830
1831 * data/push.c: Add CPP guards around push parser declarations in both
1832 the header and the code file.
1833 In the code file, move the push parser declarations to the same place
1834 they appear in the header file.
1835 Clean up the M4 some, especially the inconsistent underquoting in
1836 some b4_c_function_def and b4_c_function_decl uses.
1837
bb010fe5
JD
18382006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
1839
1840 Encapsulate the push parser state variables into an M4 macro so the
1841 push skeleton doesn't have to list them again for pull mode's yyparse.
1842 For push mode, remove yypush_parse's local equivalents of these
1843 variables to eliminate unnecessary copying between the two sets at
1844 run-time. This patch also fixes at least a bug related to multiple
1845 %initial-action invocations in push mode.
1846 * data/push.c (b4_declare_parser_variables): Rename to...
1847 (b4_declare_scanner_communication_variables): ... this for clarity and
1848 update both uses.
1849 (b4_declare_yyparse_variables): Remove and move its contents to the one
1850 spot where it was invoked.
1851 (b4_declare_parser_state_variables): New macro containing the parser
1852 state variables required by push mode.
1853 (struct yypstate): Replace all fields but yynew with
1854 b4_declare_parser_state_variables.
1855 (yystate, yyn, yyresult, yyerrstatus, yytoken, yyss, yyssp, yyvs,
1856 yyvsp, yyls, yylsp, yystacksize, yyval, yyloc): For push mode, #define
1857 each NAME in this list to yyps->NAME so it can be used in yypush_parse.
1858 (yyparse or yypush_parse): For yyparse in pull mode, replace local
1859 parser state variable declarations with
1860 b4_declare_parser_state_variables.
1861 Don't initialize parser state variables when calling yypush_parse since
1862 yypstate_new already does that.
1863 Invoke the user's initial action only upon the first yypush_parse
1864 invocation.
1865 Remove all code that copies between the local parser state variables
1866 and the yypstate.
1867
2d212f8c
JD
18682006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
1869
1870 * data/push.c (union yyalloc): Rename yyss, yyvs, and yyls fields to
1871 prevent a name collision in a future patch where these names will
1872 sometimes be #define'd.
1873 (YYSTACK_RELOCATE): Add an argument to select a union yyalloc field
1874 since it no longer has the same name as the existing argument.
1875 (yyparse or yypush_parse): Update all uses of YYSTACK_RELOCATE.
1876
e6e704dc
JD
18772006-12-19 Paolo Bonzini <bonzini@gnu.org>
1878 and Joel E. Denny <jdenny@ces.clemson.edu>
1879
1880 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
1881 that the argument is case-insensitive, and there's no `=' here.
1882 For the %skeleton entry, mention that %language is better.
1883 (Bison Options): Likewise for --language and --skeleton. Move the
1884 --skeleton entry so that the `Tuning the parser' section is sorted
1885 alphabetically on long options.
1886 (C++ Bison Interface): Don't use the word skeleton. Don't explain the
1887 %language directive in detail here; cross-reference the %language
1888 documentation instead.
1889 (Calc++ Parser): Use `%require "@value{VERSION}"' rather than
1890 `%require "2.3b"' so that the example is always up-to-date.
148d66d8 1891 (Table of Symbols): Add entries for %language and %skeleton.
e6e704dc
JD
1892 * examples/extexi (normalize): Instead of replacing every %require
1893 argument with the current Bison version, just substitute for
1894 `@value{VERSION}'. This guarantees that we're testing what actually
1895 appears in the documentation.
1896 * examples/calc++/Makefile.am ($(calc_extracted)): Use `$(VERSION)'
1897 rather than `@VERSION@'.
1898
0e021770
PE
18992006-12-18 Paul Eggert <eggert@cs.ucla.edu>
1900
fd575f05
PE
1901 * NEWS: Reword the %language news a bit, and put it earlier.
1902
0e021770
PE
1903 * src/getargs.c (skeleton_arg): Last arg is now location const *.
1904 Rewrite to simplify the logic.
1905 (language_argmatch): Likewise.
fd575f05
PE
1906 (program_name): We now own this var.
1907 * src/getargs.h (struct bison_language): Use char[] rather than
1908 const char *.
0e021770
PE
1909
1910 * doc/bison.texinfo (Decl Summary, Bison Options): Don't claim
1911 Java is supported.
1912 * src/complain.c (program_name): Remove decl; no longer needed.
1913 * src/main.c (program_name): Remove; now belongs to getargs.
1914
19152006-12-18 Paolo Bonzini <bonzini@gnu.org>
1916
1917 * NEWS: Document %language.
1918
1919 * data/Makefile.am (dist_pkgdata_DATA): Add c-skel.m4, c++-skel.m4.
1920
1921 * data/c-skel.m4, data/c++-skel.m4: New files.
1922 * data/glr.c: Complain on push parsers.
1923
1924 * doc/bison.texinfo (C++ Parser Interface): Prefer %language
1925 over %skeleton.
148d66d8 1926 (Decl Summary): Document %language and %skeleton.
0e021770
PE
1927 (Command line): Document -L.
1928
1929 * examples/extexi: Rewrite %require directive.
1930 * examples/calc++/Makefile.am: Pass VERSION to extexi.
1931
1932 * src/files.c (compute_exts_from_gc): Look in language structure
1933 for .y extension.
1934 (compute_file_name_parts): Check whether .tab should be added.
1935 * src/getargs.c (valid_languages, skeleton_prio, language_prio):
1936 (language, skeleton_arg, language_argmatch): New.
1937 (long_options): Add --language.
1938 (getargs): Use skeleton_arg, add -L/--language.
1939 * src/getargs.h: Include location.h.
1940 (struct bison_language, language, skeleton_arg, language_argmatch): New.
1941 * src/output.c (prepare): Pick default skeleton from struct language.
1942 Don't dispatch C skeletons here.
1943 * src/parse-gram.y (PERCENT_LANGUAGE): New.
1944 (prologue_declaration): Add "%language" rule, use skeleton_arg.
1945 * src/scan-gram.l ("%language"): New rule.
1946
1947 * tests/calc.at: Test %skeleton and %language.
1948 * tests/local.at (AT_SKEL_CC_IF): Look for %language.
1949 (AT_GLR_IF): Look for %skeleton "glr.cc".
1950 (AT_LALR1_CC_IF, AT_GLR_CC_IF): Rewrite.
1951 (AT_YACC_IF): Reject %language.
1952
5691bf57
PE
19532006-12-18 Paul Eggert <eggert@cs.ucla.edu>
1954
db06f0ce
PE
1955 * src/symtab.h (struct semantic_type): Remove the tag 'semantic_type',
1956 since it wasn't used; only the typedef name 'semantic_type' is needed.
1957 Also, omit trailing white space.
1958
5691bf57
PE
1959 * bootstrap: Sync from coreutils.
1960 (gnulib_extra_files): Add build-aux/announce.gen.
1961 (slurp): Adjust .gitignore files like .cvsignore files.
1962 * build-aux/announce-gen: Remove from CVS, since bootstrap
1963 now creates this.
1964
791934e4
JD
19652006-12-16 Joel E. Denny <jdenny@ces.clemson.edu>
1966
1967 Make %push-parser imply %pure-parser. This fixes several bugs; see
1968 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00148.html>.
1969 * src/parse-gram.y (prologue_declaration): For %push-parser, also set
1970 pure_parser = true.
1971 * data/push.c: Don't bother testing b4_push_if when deciding whether
1972 to expand b4_declare_parser_variables globally.
1973 (yypush_parse): Likewise in here.
1974
1975 * data/push.c (yypush_parse): Add b4_parse_param to arguments.
1976 (yy_reduce_print): Reformat M4 for readability.
1977
ee5abb37
JD
19782006-12-15 Bob Rossi <bob@brasko.net>
1979 and Joel Denny <jdenny@ces.clemson.edu>
1980
1981 * data/push.c (yypstate): Add typedef, and update all uses of
1982 struct yypstate to just yypstate.
1983 * tests/calc.at (_AT_DATA_CALC_Y): Update here as well.
1984
16ca01f9
JD
19852006-12-14 Bob Rossi <bob@brasko.net>
1986
1987 * data/push.c (yypush_parse): Declare prototype regardless of
1988 %locations option.
1989
ab8e7e1a
JD
19902006-12-14 Bob Rossi <bob@brasko.net>
1991
1992 * data/push.c (yyparse): Remove the prototype and the #define when in
1993 push-parser mode.
1994
9bf32be3
JD
19952006-12-13 Bob Rossi <bob@brasko.net>
1996
1997 * data/push.c (yypstate_init): Rename to...
1998 (yypstate_new): ... this and use b4_c_function_def.
1999 (yypstate_delete): New.
2000 (yypush_parse): Change parameters yynval and yynlloc to be const.
2001 * tests/calc.at (_AT_DATA_CALC_Y): Use new yypstate_new and
2002 yypstate_delete functions.
2003
f02e2948
JD
20042006-12-13 Joel E. Denny <jdenny@ces.clemson.edu>
2005
2006 * configure.ac (AC_PREREQ): Require Autoconf 2.61 because of our
2007 strange test case titles. Reported by Bob Rossi.
2008
38eb7751
PE
20092006-12-13 Paul Eggert <eggert@cs.ucla.edu>
2010
2011 * TODO: Add pointer to Sylvain Schmitz's work on static detection
2012 of potential ambiguities in GLR grammers.
2013
bd9d212b
JD
20142006-12-12 Joel E. Denny <jdenny@ces.clemson.edu>
2015
2016 * tests/testsuite.at (AT_CHECK): When checking if $1 starts with
2017 `bison ', use m4_index instead of m4_substr since chopping up a string
2018 containing M4-special characters causes problems here.
2019
2020 Fix a couple of bugs related to special characters in user-specified
2021 file names, and make it easier for skeletons to compute output file
2022 names with the same file name prefix as Bison-computed output file
2023 names.
2024 * data/glr.cc, data/push.c, data/yacc.c: In @output, use
2025 b4_parser_file_name and b4_spec_defines_file instead of
2026 @output_parser_name@ and @output_header_name@, which are now redundant.
2027 * data/glr.c, data/lalr1.cc: Likewise. Also, in header #include's, use
2028 b4_parser_file_name, b4_spec_defines_file, and the new
2029 @basename(FILENAME@) instead of @output_parser_name@ and
2030 @output_header_name@, which inappropriately escaped the file names as
2031 C string literals.
2032 * src/files.c (all_but_ext): Remove static qualifier.
2033 (compute_output_file_names): Move `free (all_but_ext)' to...
2034 (output_file_names_free): ... here since all_but_ext is needed later.
2035 * src/files.h (all_but_ext): Extern.
2036 * src/muscle_tab.h (MUSCLE_INSERT_STRING_RAW): New macro that does
2037 exactly what MUSCLE_INSERT_STRING used to do.
2038 (MUSCLE_INSERT_STRING): Use MUSCLE_OBSTACK_SGROW so that M4-special
2039 characters are escaped properly.
2040 * src/output.c (prepare): Define muscle file_name_all_but_ext as
2041 all_but_ext.
2042 For pkgdatadir muscle, maintain previous functionality by using
2043 MUSCLE_INSERT_STRING_RAW instead of MUSCLE_INSERT_STRING. The problem
2044 is that b4_pkgdatadir is used inside m4_include in the skeletons, so
2045 digraphs would never be expanded. Hopefully no one has M4-special
2046 characters in his Bison installation path.
2047 * src/scan-skel.l: Don't parse @output_header_name@ and
2048 @output_parser_name@ anymore since they're now redundant.
2049 In @output, use decode_at_digraphs.
2050 Parse a new @basename command that invokes last_component.
2051 (decode_at_digraphs): New.
2052 (BASE_QPUTS): Remove unused.
2053 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): New macro.
2054 (Output file name): New tests.
2055
3f7ca628
JD
20562006-12-09 Joel E. Denny <jdenny@ces.clemson.edu>
2057
2058 Warn about output files that are generated by the skeletons and that
2059 conflict with other output files.
2060 * data/glr.c: Don't generate the header file here when glr.cc does.
2061 * src/files.c (file_names, file_names_count): New static globals.
2062 (compute_output_file_names): Invoke output_file_name_check for files
2063 not generated by the skeletons and remove existing checks.
2064 (output_file_name_check): New function that warns about conflicting
2065 output file names.
2066 (output_file_names_free): Free file_names.
2067 * src/files.h (output_file_name_check): Declare.
2068 * src/scan-skel.l: Invoke output_file_name_check for files generated by
2069 the skeletons.
2070 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): New.
2071 (Conflicting output files): New tests.
2072
178e123e
PE
20732006-12-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2074
2075 * doc/bison.texinfo: Fix a couple of typos.
2076
20772006-12-08 Bob Rossi <bob@brasko.net>
8def5cd0
JD
2078
2079 * data/push.c: (yypvarsinit, yypvars, struct yypvars, yypushparse):
2080 Rename to...
2081 (yypstate_init, yypstate, struct yypstate, yypush_parse): ... these and
2082 update all uses.
2083 (b4_yyssa, b4_yyerror_range, yypstate_init): Rename pv to yyps.
2084 (yypush_parse): Rename yypvars argument to yyps and remove redundant
2085 local pv.
2086 (yypstate_init, yypush_parse): Declare in Bison-generated header file.
2087 * tests/calc.at (_AT_DATA_CALC_Y): Use newly named functions.
2088
ea17f233
JD
20892006-12-07 Bob Rossi <bob@brasko.net>
2090 and Joel Denny <jdenny@ces.clemson.edu>
2091
2092 * data/push.c (yypvarsinit): Change return type from void* to struct
2093 yypvars*. No longer cast to void* on return.
2094 (struct yypvars): Remove yylen since it need not be remembered between
2095 yypushparse invocations.
2096 (yypushparse): Don't copy between yylen and pv->yylen.
2097
55a30bda
JD
20982006-12-05 Bob Rossi <bob@brasko.net>
2099
2100 * data/push.c (yychar_set, yylval_set, yylloc_set): Delete.
2101 (yypushparse): Add yynchar, yynlval, yynlloc parameters.
2102 (b4_declare_parser_variables): Do not declare yynerrs for push mode.
2103 (struct yypvars): Remove b4_declare_parser_variables.
2104 (yypvarsinit): Remove init code for removed variables.
2105 (global scope): Do not declare b4_declare_parser_variables if
2106 push or pure mode.
2107 (yypushparse): Add b4_declare_parser_variables.
2108 Init new local variables, and remove init code for removed
2109 yypvars variables.
2110 (yyparse): Delete.
2111 * tests/calc.at (_AT_DATA_CALC_Y): Call yypushparse for push mode
2112 and yyparse for other modes.
2113 (AT_CHECK_CALC_LALR): Added '%skeleton "push.c"' for push tests.
2114 * tests/local.at (AT_PUSH_IF, AT_PURE_OR_PUSH_IF): Added.
2115 (AT_YYERROR_SEES_LOC_IF): push-parser makes this false.
2116 (AT_PURE_LEX_IF): True if pure or push parser.
2117
85894313
JD
21182006-12-05 Joel E. Denny <jdenny@ces.clemson.edu>
2119
2120 Document Yacc prologue alternatives and default %destructor's and
2121 %printer's as experimental. Don't mention Java yet. Discussed at
2122 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00002.html>.
2123 * NEWS (2.3a+): Say they're experimental. Remove any mention of Java.
2124 (2.3a): Annotate this entry to say the old forms of these features were
2125 also experimental.
2126 * doc/bison.texinfo (Prologue Alternatives, Freeing Discarded Symbols,
148d66d8 2127 Table of Symbols): Say they're experimental. Comment out any mention
85894313
JD
2128 of Java (we'll want this back eventually).
2129
02975b9a
JD
21302006-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
2131
2132 Support a file name argument to %defines. Deprecate `=' in
2133 %file-prefix, %name-prefix, and %output. Discussed at
2134 <http://lists.gnu.org/archive/html/help-bison/2006-09/msg00001.html>.
2135 * NEWS (2.3a+): Mention.
148d66d8 2136 * doc/bison.texinfo (Decl Summary, Table of Symbols): Add entry for new
02975b9a
JD
2137 form of %defines, and remove `=' from entries for %file-prefix,
2138 %name-prefix, and %output.
2139 * src/parse-gram.y (prologue_declaration): Implement.
2140 * tests/calc.at (Simple LALR Calculator, Simple GLR Calculator, Simple
2141 LALR1 C++ Calculator, Simple GLR C++ Calculator): Remove the `=' from
2142 all but one occurrence of %name-prefix.
2143 * tests/headers.at (export YYLTYPE): Remove the `=' from %name-prefix.
2144 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Likewise.
2145 * tests/output.at (AT_CHECK_OUTPUT): Remove the `=' from all but one
2146 occurrence of each of %file-prefix and %output. Add check for %defines
2147 with argument.
2148 * tests/reduce.at (Useless Terminals, Useless Nonterminals,
2149 Useless Rules, Reduced Automaton, Underivable Rules, Empty Language):
2150 Remove the `=' from %output.
2151
287b314e
JD
21522006-11-21 Joel E. Denny <jdenny@ces.clemson.edu>
2153
2154 Don't escape $ in test case titles since Autoconf 2.61 now does that
2155 correctly.
2156 * tests/actions.at (Default %printer and %destructor are not for error
2157 or $undefined): Here.
2158 (Default %printer and %destructor are not for $accept): Here.
2159 * tests/input.at (Invalid $n and @n): Here.
2160
3ebecc24
JD
21612006-11-20 Joel E. Denny <jdenny@ces.clemson.edu>
2162
2163 Rename <!> to <>. Discussed starting at
2164 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00039.html>.
2165 * NEWS (2.3a+): Update.
148d66d8 2166 * doc/bison.texinfo (Freeing Discarded Symbols, Table of Symbols):
3ebecc24
JD
2167 Update.
2168 * src/parse-gram.y (TYPE_TAG_NONE, generic_symlist_item): Implement.
2169 * src/scan-gram.l (INITIAL): Implement.
2170 * src/symlist.c (symbol_list_default_tagless_new): Update comment.
2171 * src/symlist.h (symbol_list, symbol_list_default_tagless_new): Update
2172 comment.
2173 * tests/actions.at (Default tagless %printer and %destructor,
2174 Default tagged and per-type %printer and %destructor,
2175 Default %printer and %destructor are not for error or $undefined,
2176 Default %printer and %destructor are not for $accept,
2177 Default %printer and %destructor for mid-rule values): Update.
2178 * tests/input.at (Default %printer and %destructor redeclared,
2179 Unused values with default %destructor): Update.
2180
26b8a438
JD
21812006-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
2182
2183 Don't let %prec take a nonterminal.
2184 * src/reader.c (grammar_current_rule_prec_set): Make the %prec symbol a
2185 token.
2186 * tests/input.at (%prec takes a token): New test checking that %prec
2187 won't take a nonterminal.
2188
07c39ae9
JD
21892006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
2190
405d53b7
JD
2191 * tests/testsuite.at (AT_CHECK): Don't miss an exit value of 0 because
2192 it was double-quoted.
07c39ae9
JD
2193 * src/Makefile.am (YACC): Use --warnings=all,error so that Bison's own
2194 grammar is maintained with Bison's highest standards.
2195 * src/getargs.c: Fix some typos in Doxygen comments.
2196
580b8926
JD
21972006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
2198
2199 Fix memory leaks in scanners generated by at least Flex 2.5.9 and
2200 later. Reported by Paul Eggert in
2201 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00014.html>.
2202 * src/flex-scanner.h (yylex_destroy): Define for Flex before 2.5.9.
2203 * src/scan-code.l (translate_action): Don't bother invoking
2204 yy_delete_buffer (YY_CURRENT_BUFFER) before creating the first buffer.
2205 (code_scanner_free): Instead of invoking
2206 yy_delete_buffer (YY_CURRENT_BUFFER) directly, invoke yylex_destroy,
2207 which frees more.
2208 * src/scan-gram.l (gram_scanner_free): Likewise.
2209 * src/scan-skel.l (scan_skel): Likewise.
2210
4502eadc
JD
22112006-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
2212
2213 * src/files.c (tr): Change return type to void.
2214 * src/muscle_tab.c (muscle_insert): Free storage in case muscle_grow
2215 has been called previously for the same key.
2216 (muscle_find): Return storage instead of value so that
2217 --enable-gcc-warnings doesn't produce warnings that the return discards
2218 const. aver that the value and storage are the same since storage
2219 could potentially be NULL when value is not.
2220 * tests/testsuite.at (AT_CHECK): Treat an unspecified exit value the
2221 same as 0.
2222
7746c8f6
PE
22232006-11-08 Paul Eggert <eggert@cs.ucla.edu>
2224
2225 * bootstrap.conf (excluded_files): Exclude m4/codeset.m4 (undoing
2226 the earlier change today), m4/intl.m4, m4/intldir.m4. This gives
2227 us a slightly cleaner distribution, and also works.
2228 * m4/.cvsignore: Add inline.m4, wint_t.m4 to accommodate recent
2229 gnulib changes.
2230
eb095650
PE
22312006-11-08 Joel E. Denny <jdenny@ces.clemson.edu>
2232 and Paul Eggert <eggert@cs.ucla.edu>
2233
2234 Don't let Bison leak memory except when it complains.
2235 * src/files.h (parser_file_name, spec_verbose_file, spec_graph_file):
2236 (spec_defines_file, dir_prefix): Now char *, not const char *,
2237 since they are freed.
2238 * src/files.c: Likewise.
2239 (all_but_ext, all_but_tab_ext, src_extension, header_extension):
2240 Likewise.
2241 (tr): Now operates in-place. All uses changed.
2242 (compute_exts_from_gf, compute_exts_from_src): Don't leak temporary
2243 values.
2244 (compute_file_name_parts, compute_output_file_names): Don't store
2245 read-only data in variables that will be freed.
2246 (compute_output_file_names): Free all_but_ext, all_but_tab_ext,
2247 src_extension, and header_extension.
2248 (output_file_names_free): New public function to free
2249 spec_verbose_file, spec_graph_file, spec_defines_file,
2250 parser_file_name, and dir_prefix.
2251 * src/getargs.c (getargs): Don't store read-only data in variables that
2252 will be freed.
2253 * src/main.c (main): Invoke output_file_names_free, code_scanner_free
2254 (which previously existed but was unused), and quotearg_free.
2255 * src/muscle_tab.h (muscle_insert): value arg is now a `char const *'.
2256 * src/muscle_tab.c: Likewise.
2257 (muscle_entry): Make the value char const *,
2258 and add a new storage member that is char * and can be freed.
2259 (muscle_entry_free): New private function.
2260 (muscle_init): Use it instead of free.
2261 (muscle_insert, muscle_grow): Update and use new storage member.
2262 (muscle_code_grow): Free the string passed to muscle_grow
2263 since it's not needed anymore.
2264 * src/parse-gram.y (%union): Make `chars' member a `char const *', and
2265 add a new `char *code' member.
2266 ("{...}"): Declare semantic type as code.
2267 * src/scan-code.h (translate_rule_action):
2268 (translate_symbol_action, translate_code, translate_action): Return
2269 `char const *' rather than `char *' since external code should not free
2270 these strings.
2271 * src/scan-code.l: Likewise.
2272 * src/scan-gram.l (<SC_BRACED_CODE>): Use val->code for BRACED_CODE,
2273 which is "{...}" in the parser.
2274 * tests/Makefile.am (maintainer-check-valgrind): Set
2275 VALGRIND_OPTS='--leak-check=full --show-reacheable=yes' before invoking
2276 Valgrind.
2277 * tests/calc.at (_AT_DATA_CALC_Y): fclose the FILE* so Valgrind doesn't
2278 complain.
2279 * tests/testsuite.at (AT_CHECK): Redefine so that running Bison and
2280 expecting a non-zero exit status sets --leak-check=summary and
2281 --show-reachable=no for Valgrind. Bison unabashedly leaks memory in
2282 this case, and we don't want to hear about it.
2283
ac564be4
PE
22842006-11-08 Paul Eggert <eggert@cs.ucla.edu>
2285
2286 * bootstrap (runtime-po/Makevars): Derive from po/Makevars
2287 instead of from the template, to simplify configuration a bit.
2288 * bootstrap.conf (excluded_files): Don't exclude m4/codeset.m4
2289 and m4/wint_t.m4, as they are needed with the latest gnulib.
2290
17bd8a73
JD
22912006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
2292
2293 Disable unset/unused mid-rule value warnings by default, and recognize
2294 --warnings=midrule-values to enable them. Discussed starting at
2295 <http://lists.gnu.org/archive/html/help-bison/2006-10/msg00030.html>.
2296 * NEWS (2.3a+): Mention.
2297 * src/getargs.c, src/getargs.h (warnings_args, warnings_types, enum
2298 warnings): Add entry for midrule-values subargument.
2299 * src/reader.c (symbol_should_be_used): Don't return true just because
2300 the value is a set/used mid-rule value unless
2301 --warnings=midrule-values was specified.
2302 * tests/input.at (Unused values, Unused values before symbol
2303 declarations): Run tests with and without --warnings=midrule-values.
2304
2305 * src/reader.c (check_and_convert_grammar): Use symbol_list_free rather
2306 than LIST_FREE directly.
2307
89eb3c76
JD
23082006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
2309
2310 Finish implementing --warnings=error, which should not be implied by
2311 --warnings=all (or by its synonyms -W and --warnings without
2312 subarguments).
2313 * src/complain.c (set_warning_issued): New function to report that
2314 warnings are being treated as errors and to record an error if so.
2315 Invoke...
2316 (warn_at, warn): ... here.
2317 * src/getargs.c (warnings_args, warnings_types): Reorder so that
2318 "error - warnings are errors" does not appear above "all - all of the
2319 above".
2320 (getargs): For -W and --warnings without subarguments, don't let
2321 FLAGS_ARGMATCH set warnings_error in warnings_flag.
2322 * src/getargs.h (enum warnings): Unset warnings_error in warnings_all.
2323
ba7560e2
JD
23242006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
2325
2326 * src/getargs.c (flags_argmatch): Don't cause segmentation fault for
2327 empty subargument list. For example: `bison --warnings= parser.y'.
2328
31283fc3
JD
23292006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
2330
2331 * data/push.c, data/yacc.c: Make sure there's a newline at the end of
2332 the parser header file so that gcc doesn't warn.
2333
12e35840
JD
23342006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
2335
2336 Split the default %destructor/%printer into two kinds: <*> and <!>.
2337 Discussed starting at
2338 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00060.html>.
2339 * NEWS (2.3a+): Mention.
2340 * doc/bison.texinfo (Freeing Discarded Symbols): Document this and the
2341 previous change today related to mid-rules.
148d66d8 2342 (Table of Symbols): Remove %symbol-default and add <*> and <!>.
3ebecc24 2343 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): Remove.
12e35840
JD
2344 (TYPE_TAG_ANY): Add as <*>.
2345 (TYPE_TAG_NONE): Add as <!>.
2346 (generic_symlist_item): Remove RHS for %symbol-default and add RHS's
2347 for <*> and <!>.
2348 * src/scan-gram.l (PERCENT_SYMBOL_DEFAULT): Remove.
2349 (TYPE_TAG_ANY, TYPE_TAG_NONE): Add.
2350 * src/symlist.c (symbol_list_default_new): Split into tagged and
2351 tagless versions.
2352 (symbol_list_destructor_set, symbol_list_printer_set): Split
2353 SYMLIST_DEFAULT case into SYMLIST_DEFAULT_TAGGED and
2354 SYMLIST_DEFAULT_TAGLESS.
2355 * src/symlist.h: Update symbol_list_default*_new prototypes.
2356 (symbol_list.content_type): Split enum value SYMLIST_DEFAULT into
2357 SYMLIST_DEFAULT_TAGGED and SYMLIST_DEFAULT_TAGLESS.
2358 * src/symtab.c (default_destructor, default_destructor_location,
2359 default_printer, default_printer_location): Split each into tagged and
2360 tagless versions.
2361 (symbol_destructor_get, symbol_destructor_location_get,
2362 symbol_printer_get, symbol_printer_location_get): Implement tagged
2363 default and tagless default cases.
2364 (default_destructor_set, default_printer_set): Split each into tagged
2365 and tagless versions.
2366 * src/symtab.h: Update prototypes.
2367 * tests/actions.at (Default %printer and %destructor): Rename to...
2368 (Default tagless %printer and %destructor): ... this, and extend.
2369 (Per-type %printer and %destructor): Rename to...
2370 (Default tagged and per-type %printer and %destructor): ... this, and
2371 extend.
2372 (Default %printer and %destructor for user-defined end token): Extend.
2373 (Default %printer and %destructor are not for error or $undefined):
2374 Update.
2375 (Default %printer and %destructor are not for $accept): Update.
2376 (Default %printer and %destructor for mid-rule values): Extend.
2377 * tests/input.at (Default %printer and %destructor redeclared): Extend.
2378 (Unused values with default %destructor): Extend.
2379
f91b1629
JD
23802006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
2381
2382 Don't apply the default %destructor/%printer to an unreferenced midrule
2383 value. Mentioned at
2384 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00104.html>.
2385 * src/symtab.c (dummy_symbol_get): Name all dummy symbols initially
2386 like $@n instead of just @n so that the default %destructor/%printer
2387 logic doesn't see them as user-defined symbols.
2388 (symbol_is_dummy): Check for both forms of the name.
2389 * src/reader.c (packgram): Remove the `$' from each midrule symbol
2390 name for which the midrule value is referenced in any action.
2391 * tests/actions.at (Default %printer and %destructor for mid-rule
2392 values): New test.
2393 * tests/regression.at (Rule Line Numbers, Web2c Report): Update output
2394 for change to dummy symbol names.
2395
519d0004
JD
23962006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
2397
2398 Warn about unset midrule $$ if the corresponding $n is used.
2399 * src/reader.c (symbol_should_be_used): Check midrule parent rule for
2400 $n usage.
2401 (packgram): Before invoking grammar_rule_check on any rule, make sure
2402 all actions have already been scanned in order to set `used' flags.
2403 Otherwise, checking that a midrule's $$ is set will not always work
2404 properly because the midrule check must forward-reference the midrule's
2405 parent rule.
2406 * tests/input.at (AT_CHECK_UNUSED_VALUES): Extend to check the new
2407 warning.
2408
a501eca9
JD
24092006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
2410
2411 More improvements to the documentation of the prologue alternatives:
2412 * NEWS (2.3a+): Mention the new `Prologue Alternatives' section in the
2413 Bison manual.
2414 * doc/bison.texinfo (Prologue Alternatives): Correct some errors. Add
2415 some text to clarify the relative importance of the new directives and
2416 to show how these directives may be viewed as code labels.
2417
2cbe6b7f
JD
24182006-10-16 Joel E. Denny <jdenny@ces.clemson.edu>
2419
2420 Similar to the recently removed %before-header, add %code-top as the
2421 alternative to the pre-prologue. Mentioned at
2422 <http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00063.html>.
2423 Also, let the prologue alternatives appear in the grammar section.
2424 * src/parse-gram.y (PERCENT_CODE_TOP): New token.
2425 (prologue_declaration): Move the existing prologue alternatives to...
2426 (grammar_declaration): ... here and add %code-top.
2427 * src/scan-gram.l (PERCENT_CODE_TOP): New token.
2428
2429 Clean up and extend documentation for the prologue alternatives.
2430 * NEWS (2.3a+): Describe prologue alternatives.
2431 * doc/bison.texinfo (Prologue): Move discussion of prologue
2432 alternatives to...
2433 (Prologue Alternatives): ... this new section, and extend it to discuss
2434 all 4 directives in detail.
148d66d8
JD
2435 (Table of Symbols): Clean up discussion of prologue alternatives and
2436 add %code-top.
2cbe6b7f 2437
e557d3ea
JMG
24382006-10-16 Juan Manuel Guerrero <juan.guerrero@gmx.de>
2439
2440 DJGPP specific issues.
2441
2442 * djgpp/config.bat: config.hin has been moved to lib. Adjust
2443 config.bat accordingly.
2444 * djgpp/config.sed: Adjust config.sed for the use of autoconf 2.60.
2445 * djgpp/config.site: Likewise.
2446
136a0f76
PB
24472006-10-16 Paolo Bonzini <bonzini@gnu.org>
2448
27bd5d67
PB
2449 Replace %*-header with %provides, %requires, %code. See discussion at
2450 http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00002.html
2451
136a0f76
PB
2452 * data/bison.m4 (b4_user_requires, b4_user_provides): New.
2453 (b4_user_start_header): Remove.
2454 * data/glr.c: Use new macros instead of b4_*start_header
2455 and b4_*end_header.
2456 * data/glr.cc: Likewise.
2457 * data/lalr1.cc: Likewise.
2458 * data/push.c: Likewise.
2459 * data/yacc.c: Likewise.
2460
2461 * doc/bison.texinfo: Remove %before-header, rename
2462 %{start,end,after}-header to %requires, %provides, %code.
2463
2464 * src/parse-gram.y: Likewise (also rename token names accordingly).
2465 * src/scan-gram.l: Likewise.
2466 * tests/actions.at: Likewise.
2467
10f429ef
PE
24682006-10-14 Paul Eggert <eggert@cs.ucla.edu>
2469
2470 * lib/Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS).
2471 Problem reported by Joel E. Denny.
2472
24732006-10-14 Jim Meyering <jim@meyering.net>
2474
2475 (Sync from coreutils.)
2476 Work also when the working directory (with e.g. coreutils sources)
2477 is version controlled with git, rather than CVS.
2478 * bootstrap (CVS_only_file): Test for the existence of README-cvs,
2479 rather than CVS.
2480 In messages and comments, say e.g., "checked-out sources",
2481 rather than "CVS sources".
2482 (version_controlled_file): New function. Work for git as well as
2483 for CVS. Don't use grep's -q option.
2484 (slurp): Call it here, in place of CVS-specific code.
2485
c4bd5bf7
JD
24862006-10-14 Joel E. Denny <jdenny@ces.clemson.edu>
2487
2488 Fix testsuite for ./configure --enable-gcc-warnings:
2489 * configure.ac (gcc-warnings): Move -Wall before -Wno-sign-compare.
2490 Otherwise, gcc 4.1.0 (at least) warns about sign comparisons in
2491 __AT_CHECK_PRINTER_AND_DESTRUCTOR in tests/actions.at.
2492 * test/input.at (Torturing the Scanner): #include <stdlib.h> for abort.
2493 * test/regression.at (Diagnostic that expects two alternatives):
2494 Likewise.
2495
46356ea4
PE
24962006-10-12 Paul Eggert <eggert@cs.ucla.edu>
2497
231ed89a
PE
2498 * bootstrap.conf (gnulib_modules): Add config-h.
2499 * djgpp/subpipe.c: Include <config.h> unconditionally; don't
2500 worry about HAVE_CONFIG_H.
2501 * lib/abitset.c: Likewise.
2502 * lib/bitset.c: Likewise.
2503 * lib/bitset_stats.c: Likewise.
2504 * lib/bitsetv-print.c: Likewise.
2505 * lib/bitsetv.c: Likewise.
2506 * lib/ebitset.c: Likewise.
2507 * lib/get-errno.c: Likewise.
2508 * lib/lbitset.c: Likewise.
2509 * lib/subpipe.c: Likewise.
2510 * lib/timevar.c: Likewise.
2511 * lib/vbitset.c: Likewise.
2512 * lib/bitset.c: Include "bitset.h" first, to test interface.
2513 * lib/bitset_stats.c: Include "bitset_stats.h" first.
2514 * lib/bitsetv-print.c: Include "bitsetv-print.h" first.
2515 * lib/bitsetv.c: Include "bitsetv.h" first.
2516 * lib/get-errno.c: Include "get-errno.h" first.
2517 * m4/.cvsignore: Add config-h.m4.
2518 * tests/actions.at (Default %printer and %destructor for ...):
2519 Adjust expected line numbers in output to reflect removal of #if
2520 HAVE_CONFIG_H lines.
2521 * tests/glr-regression.at (Missed %merge type warnings when ...):
2522 Likewise.
2523 * tests/regression.at (Braced code in declaration in rules section):
2524 Likewise.
2525 * tests/atlocal.in (CPPFLAGS): Don't define HAVE_CONFIG_H.
2526 * tests/local.at (AT_DATA_GRAMMAR_PROLOGUE):
2527 Include <config.h> unconditionally.
2528
46356ea4
PE
2529 * bootstrap: Sync from coreutils, as follows:
2530
2531 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
2532
2533 * bootstrap (symlink_to_gnulib): Fix bug: the dot_dots shell
2534 variable was sometimes used without being initialized. This
2535 messed up the installation of the INSTALL file in some cases.
2536
2537 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
2538
2539 * bootstrap (usage, main program, symlink_to_gnulib): Add option
2540 --copy. Inspired by a suggestion from Bruno Haible.
2541
2542 2006-10-03 Jim Meyering <jim@meyering.net>
2543
2544 * bootstrap: Undo last change to this file, since now gnulib-tool
2545 sticks with the automake default in generating dependencies.
2546
dd4bf078
PE
25472006-10-12 Paul Eggert <eggert@cs.ucla.edu>
2548
cf2a5f7c
PE
2549 * configure.ac: Use AC_PROG_CC_STDC; this is more modern than
2550 the old AC_PROG_CC / AM_PROG_CC_STDC combination.
2551
2552 * doc/bison.1: Add copyright notice.
2553
2554 * data/glr.c: Don't include <stdarg.h>; not used.
2555
35fe0834
PE
2556 * NEWS: The -g and --graph options now output graphs in Graphviz
2557 DOT format, not VCG format.
2558 * doc/bison.1: Likewise.
2559 * doc/bison.texinfo (Understanding, Bison Options): Likewise.
fcab4a2e
PE
2560 * THANKS: Add Satya Kiran Popuri, who proposed the initial version
2561 of this change in
2562 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00158.html>.
35fe0834
PE
2563 * TODO: Remove Graphviz entry.
2564 * src/Makefile.am (bison_SOURCES): Add graphviz.c and graphviz.h;
2565 remove vcg.c, vcg.h, vcg_defaults.h.
2566 * src/vcg.c, src/vcg.h, src/vcg_defaults.h: Remove.
2567 * src/graphviz.c, src/graphviz.h: New files.
2568 * src/files.c (compute_output_file_names): Output .dot, not .vcg.
2569 * src/files.h: Make comment more generic.
2570 * src/main.c (main): Likewise.
2571 * src/print_graph.h: Likewise.
2572 * src/getargs.c (usage): Make usage description more generic.
2573 * src/print_graph.c: Include graphviz.h rather than vcg.h.
2574 (static_graph, fgraph): Remove. All uses changed to pass
2575 arguments instead of sharing a static var.
2576 (print_core, print_actions, print_state, print_graph):
2577 Output graphviz format rather than VCG format.
2578 * tests/.cvsignore: Remove *.vcg; add *.dot.
2579 * tests/output.at: Expect *.dot files, not *.vcg files.
2580
dd4bf078
PE
2581 * data/Makefile.am (dist_pkgdata_DATA): Add bison.m4; this
2582 accommodates the 2006-10-08 change.
2583
efdd7421
PE
25842006-10-11 Bob Rossi <bob@brasko.net>
2585
2586 * data/push.c (yypushparse, yypvarsinit, yypvars): Wrap in b4_push_if.
2587 (b4_yyssa, b4_yyerror_range): New macros.
2588 (struct yypvars): Remove yyssa_ptr and yyerror_range_ptr fields.
2589 (yypvarsinit): Remove init of removed fields.
2590 (yypushparse): Remove use of removed fields; use new macros instead.
2591
96a1981a
PE
25922006-10-11 Paul Eggert <eggert@cs.ucla.edu>
2593
2594 * data/push.c (yypushparse): Fix memory leak if yymsg is malloced
2595 in a push parser. Reindent slightly to match yacc.c better.
2596
25972006-10-11 Bob Rossi <bob@brasko.net>
2598
46356ea4
PE
2599 * data/push.c (struct yypvars): Remove yymsgbuf, yymsgbuf_ptr, yymsg,
2600 yymsg_alloc fields.
2601 (yypvarsinit, yypushparse): Remove init of removed fields.
2602 (yypushparse): Use yymsgbuf instead of yymsgbuf_ptr.
96a1981a 2603
c1630a8b
PE
26042006-10-09 Paul Eggert <eggert@cs.ucla.edu>
2605
2606 * THANKS: Add Paolo Bonzini and Bob Rossi.
2607
90b9908d
PB
26082006-10-08 Paolo Bonzini <bonzini@gnu.org>
2609
2610 * data/c.m4 (b4_copyright, b4_epilogue, b4_location_initial_column,
2611 b4_location_initial_line, p4_parse_param, b4_ints_in, b4_flag_if,
2612 b4_define_flag_if and uses, b4_basename, b4_syncline, b4_user_code,
2613 b4_define_user_cde and uses): Remove.
2614 (b4_comment, b4_prefix, b4_sync_start): New.
2615 * data/bison.m4: New file, with most of the content removed from c.m4.
2616 * src/muscle_tab.h: Use "do {...} while(0)" throughout.
2617 * src/output.c (output_skeleton): Pass bison.m4.
2618 (prepare): Pass glr_flag and nondeterministic_flag. Pass prefix
2619 only if specified.
2620
cf806753
PE
26212006-10-05 Paul Eggert <eggert@cs.ucla.edu>
2622
2623 Fix test failure reported by Tom Lane in
2624 <http://lists.gnu.org/archive/html/bug-bison/2006-10/msg00000.html>
2625 and try to make such failures easier to catch in the future.
2626 * data/glr.c (YYTRANSLATE): Don't check for nonpositive arg;
2627 that's now the caller's responsibility.
2628 (yyprocessOneStack, yyrecoverSyntaxError, yyparse):
2629 Set yychar = YYEOF if it's negative.
2630 * tests/actions.at (yylex): Abort if asked to read past EOF.
2631 * tests/conflicts.at (yylex): Likewise.
2632 * tests/cxx-type.at (yylex): Likewise.
2633 * tests/glr-regression.at (yylex): Likewise.
2634 * tests/input.at (yylex): Likewise.
2635 * tests/regression.at (yylex): Likewise.
2636 * tests/torture.at (yylex): Likewise.
2637
0e2f006a
PE
26382006-10-01 Paul Eggert <eggert@cs.ucla.edu>
2639
2640 Fix problems with translating English-language diagnostics.
2641 * bootstrap: Fix bug introduced in recent bootstrap changes, with
2642 respect to bison-runtime pot generation. The YY_ stuff
2643 wasn't being captured.
2644 * bootstrap.conf (XGETTEXT_OPTIONS_RUNTIME): New var.
2645 * po/POTFILES.in: Add src/location.c, src/scan-code.l.
2646 * runtime-po/POTFILES.in: Add data/push.c.
2647
e3ddc1e3
PE
26482006-09-29 Paul Eggert <eggert@cs.ucla.edu>
2649
2650 Merge bootstrap changes from coreutils.
2651
2652 2006-09-28 Jim Meyering <jim@meyering.net>
2653
2654 Automatically generated dependencies are important even
2655 when all of the sources in a directory come from gnulib.
2656 * bootstrap (gnulib_tool): Remove the "no-dependencies" automake
2657 option that gnulib-tool adds to what becomes our lib/gnulib.mk.
2658
2659 2006-09-23 Jim Meyering <jim@meyering.net>
2660
2661 * bootstrap (gnulib_tool_options): Add "--local-dir gl".
2662
2663 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
2664
2665 * bootstrap: Add support for --force.
2666 (usage): New function. Describe usage less tersely.
2667 (CVS_only_file): New var.
2668
01e972b3
PE
26692006-09-21 Paul Eggert <eggert@cs.ucla.edu>
2670
2671 * data/push.c (YYPUSH_MORE): Make it an enum instead.
2672 (yypushparse): Use YYPUSH_MORE instead of the mystery constant.
2673 Adjust white space and comments to match GNU style better.
2674
c63d3e90
PE
26752006-09-20 Bob Rossi <bob@brasko.net>
2676
2677 * data/push.c (yyresult_get): Remove function.
2678 (YYPUSH_MORE): Add #define.
2679 (yypushparse): Modify return value.
2680
e70f46d1
PE
26812006-09-20 Paul Eggert <eggert@cs.ucla.edu>
2682
2683 * stamp-h.in: Remove; no longer needed.
2684 * .cvsignore: Replace autom4te.cache and config.cache with *.cache.
2685 Remove config.h, config.hin, intl (no longer created).
2686 * lib/.cvsignore: Add config.h, config.hin, configmake.h, inttypes.h,
2687 stamp-h1.
2688
2689 Sync bootstrap from coreutils, as follows:
2690
2691 2006-09-18 Paul Eggert <eggert@cs.ucla.edu>
2692
2693 * bootstrap (symlink_to_gnulib): New function.
2694 (cp_mark_as_generated): Use it, to prefer symlinks-to-gnulib
2695 to copies-of-gnulib.
2696 (cp_mark_as_generated, slurp, gnulib_files):
2697 Avoid making a copy if it's the same as the old version.
2698 (gnulib_files): Add support for this variable (used by Bison).
2699
a92be413
PE
27002006-09-20 Paul Eggert <eggert@cs.ucla.edu>
2701
2702 * src/getargs.c (usage): Rework to use conventions similar to
2703 coreutils, to make translation a bit easier and the code a bit
2704 smaller. Problem reported by Tim Van Holder.
2705
4f82b42a
PE
27062006-09-15 Paul Eggert <eggert@cs.ucla.edu>
2707
3b2942e6
PE
2708 Use some of gnulib's new modules, taken from coreutils.
2709
2710 * bootstrap: Sync from coreutils, except add support for gnulib_files.
2711 * bootstrap.conf: New file.
2712 (gnulib_modules): Add configmake, inttypes, unistd.
2713 (XGETTEXT_OPTIONS): Add complain, complain_at,
2714 fatal, fatal_at, warn, warn_at, unexpected_end.
2715 * configure.ac (AC_CONFIG_HEADERS): config.h is now in lib, not here.
2716 (gl_USE_SYSTEM_EXTENSIONS): Remove; gl_EARLY now does this.
2717 (gl_EARLY): Add.
2718 (AM_STDBOOL_H): Remove; gl_INIT now dows this.
2719 (gl_INIT): Add
2720 (GNULIB_AUTOCONF_SNIPPET): Remove.
2721 (AM_GNU_GETTEXT): Add; require formatstring macros since that's
2722 the pickiest.
2723 * lib/.cvsignore: Add inttypes_.h.
2724 * lib/Makefile.am: Include gnulib.mk first so we can append to it.
2725 (AM_CFLAGS): Add WERROR_CFLAGS, to be more like coreutils.
2726 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES): Remove
2727 no-longer-necessary initializations.
2728 (lib_SOURCES): Remove, replacing by libbison_a_SOURCES.
2729 * lib/subpipe.c: Include <unistd.h> unconditionally, now that we
2730 use the unistd module.
2731 * src/system.h: Likewise.
2732 * m4/.cvsignore: Remove *_gl.m4, gnulib.m4, inttypes_h.m4, uintmax_t.m4,
2733 ulonglong.m4. Add gettext.m4, gnulib-cache.m4, gnulib-comp.m4,
2734 gnulib-tool.m4, inttypes-h.m4, inttypes-pri.m4, inttypes.m4.
2735 * src/Makefile.am (DEFS): Remove, since configmake does this for us.
2736 (AM_CPPFLAGS): Remove -I../lib, since Automake does that for us.
2737 * src/system.h: Include inttypes.h unconditionally, now that we
2738 use the inttypes module. Don't bother to include stdint.h, since
2739 inttypes.h now does that for us.
2740 (LOCALEDIR): Remove, now that we use the configmake module.
2741 * src/getargs.c: Include configmake.h.
2742 * src/main.c: Likewise.
2743 * src/output.c: Likewise.
2744 * tests/atlocal.in (CPPFLAGS): Include from $abs_top_builddir/lib,
2745 not from $abs_top_builddir, since config.h moved.
2746
2747
4f82b42a
PE
2748 Port to GCC 2.95. First two problems reported by Michael Deutschmann in
2749 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00018.html>.
2750
2751 * src/parse-gram.y (symbol_declaration): Don't put statements
2752 before declarations; it's not portable to C89.
2753 * src/scan-code.l (handle_action_at): Likewise.
2754
2755 * src/scan-code.l: Always initialize braces_level; the old code
2756 left it uninitialized and therefore had undefined behavior.
2757
2758 Don't attempt to redefine 'assert', since it runs afoul of
2759 systems where standard headers (mistakenly) include <assert.h>.
2760 Instead, define and use our own alternative, called 'aver'.
2761 * src/reader.c: Don't include assert.h, since we no longer
2762 use assert.
2763 * src/scan-code.l: Likewise.
2764 * src/system.h (assert): Remove, replacing with....
2765 (aver): New function, taking a bool arg. All uses changed.
2766 * src/tables.c (pack_vector): Ensure that aver arg is bool,
2767 not merely an integer.
2768
31c10e38
PE
27692006-09-15 Bob Rossi <bob@brasko.net>
2770
2771 * data/Makefile.am (dist_pkgdata_DATA): Add push.c.
2772 * data/c.m4 (YYPUSH): New.
2773 (b4_push_if): New macro. Use it instead of #ifdef YYPUSH.
2774 * src/getargs.c (push_parser): New var.
2775 * src/getargs.h (push_parser): New declaration.
2776 * src/output.c (prepare): Add macro insertion of `push_flag'.
2777 * src/parse-gram.y (PERCENT_PUSH_PARSER): New token.
2778 (prologue_declaration): Parse %push-parser.
2779 * src/scan-gram.l: Scan new PERCENT_PUSH_PARSER token.
2780 * tests/calc.at (_AT_CHECK_CALC_ERROR): Add "Return" and "Now" to
2781 list of removed lines from the traces observed.
2782 (AT_CHECK_CALC_LALR): Added push parser tests.
2783
fa7b79c0
PE
27842006-09-13 Paul Eggert <eggert@cs.ucla.edu>
2785
21fe08ca
PE
2786 * NEWS: Version 2.3a.
2787 * configure.ac (AC_INIT): Likewise.
2788
e8ec4d9b
PE
2789 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Remove
2790 "#define YYSTYPE int" that caused "make maintainer-check" to fail
2791 due to header ordering dependencies. I don't know why the #define
2792 was there.
2793
fa7b79c0
PE
2794 Fix glr.cc and lalr1.cc's use of YYDEBUG so that there's zero
2795 runtime cost when YYDEBUG is not defined, and so that some tests
2796 that used to fail now work. Problem and initial suggestion by
2797 Paolo Bonzini.
2798 * data/c++.m4 (b4_parse_param_cons): Omit leading ','.
2799 * data/glr.cc (b4_parser_class_name):
2800 Initialize yycdebug_ only if YYDEBUG. Also, initialize yydebug_.
2801 (debug_level, set_debug_level): Affect yydebug_, not ::yydebug.
2802 (yydebug_) [YYDEBUG]: New member.
2803 (yycdebug_): Now defined only if YYDEBUG.
2804 * data/lalr1.cc (yydebug_, yycdebug_): Now defined only if YYDEBUG.
2805 (YYCDEBUG) [!YYDEBUG]: Don't use yydebug_ and yycdebug_.
2806 (b4_parser_class_name): Initialize yydebug_ and yycdebug_ only
2807 if YYYDEBUG.
2808 (debug_stream, set_debug_stream, debug_level, set_debug_level):
2809 Define only if YYDEBUG.
2810 * tests/calc.at (_AT_DATA_CALC_Y) [!YYDEBUG]: Omit call to
2811 set_debug_level.
2812 * tests/regression.at (_AT_DATA_DANCER_Y) [!YYDEBUG]: Likewise.
2813 * tests/calc.at (AT_CHECK_CALC_GLR_CC): Uncomment calls to
2814 AT_CHECK_CALC_GLR_CC that are working now.
2815
4ec13d60
PE
28162006-09-12 Paul Eggert <eggert@cs.ucla.edu>
2817
2818 * data/glr.cc (YYERROR_VERBOSE, YYTOKEN_TABLE): Remove.
2819 We don't need them in glr.cc, and glr.c defines them.
2820 Defining YYERROR_VERBOSE to 0 here breaks glr.c, since glr.c
2821 assumes that defining it to anything is the same as defining
2822 it to 1. Problem reported by Paolo Bonzini.
2823
8e1687ae
PE
28242006-09-12 Paolo Bonzini <bonzini@gnu.org> (tiny change)
2825
2826 * data/c.m4 (b4_null, b4_case): Define.
2827 * src/output.c (prepare_symbols): Use b4_null.
2828 (user_actions_output): Use b4_case.
2829
3dc5e96b
PE
28302006-09-11 Paul Eggert <eggert@cs.ucla.edu>
2831
aef3da86
PE
2832 * data/glr.c (b4_shared_declarations): Put start-header first,
2833 before any #includes that we generate, so that feature-test
2834 macros work. Problem reported by Michael Deutschmann in
2835 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00004.html>.
2836 * data/lalr1.cc: Likewise.
2837 * doc/bison.texinfo (Prologue): Document that feature-test macros
2838 should be defined before any Bison declarations.
2839 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Put defns
2840 that depend on location.hh after, not before, Bison decls, since
2841 we now include location.hh after the first user prologue.
2842
3dc5e96b
PE
2843 * doc/bison.texinfo (Calc++ Parser): Fix memory leak reported by
2844 Sander Brandenburg in
2845 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00002.html>.
2846 Also, fix minor white space and comment issues.
aef3da86
PE
2847 (Prologue): Mention that it's better to define feature-test macros
2848 before Bison declarations. Problem reported by Michael Deutschmann.
2849
2850 * README-cvs: Fix typo: "&" should be "&&". Problem reported
2851 by Jim Meyering.
2852 * m4/.cvsignore: Add argmatch.m4. Remove obstack.m4, strerror_r.m4.
2853 This adjusts to recent gnulib changes.
3dc5e96b 2854
b2a0b7ca
JD
28552006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
2856
2857 Finish implementation of per-type %destructor/%printer. Discussed
2858 starting at
2859 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>
2860 and
2861 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>.
2862 * NEWS (2.3+): Add a description of this feature to the default
2863 %destructor/%printer description.
2864 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise.
2865 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
2866 Invoke semantic_type_destructor_set or semantic_type_printer_set when a
2867 list node contains a semantic type.
2868 * src/symtab.c, src/symtab.h: Extend with a table that associates
2869 semantic types with their %destructor's and %printer's.
2870 (semantic_type_from_uniqstr, semantic_type_get,
2871 semantic_type_destructor_set, semantic_type_printer_set): New functions
2872 composing the public interface of that table.
2873 (symbol_destructor_get, symbol_destructor_location_get,
2874 symbol_printer_get, symbol_printer_location_get): If there's no
2875 per-symbol %destructor/%printer, look up the per-type before trying
2876 the default.
2877 * tests/actions.at (Per-type %printer and %destructor): New test case.
2878 * tests/input.at (Default %printer and %destructor redeclared):
2879 Extend to check that multiple occurrences of %symbol-default in a
2880 single %destructor/%printer declaration is an error.
2881 (Per-type %printer and %destructor redeclared, Unused values with
2882 per-type %destructor): New test cases.
2883
3be03b13
JD
28842006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
2885
2886 Require default %destructor/%printer to be declared using
2887 %symbol-default instead of an empty symbol list, and start working on
2888 new per-type %destructor/%printer. Discussed at
2889 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00007.html>.
2890 * NEWS (2.3+): Add %symbol-default to example.
2891 * bison.texinfo (Freeing Discarded Symbols): Likewise.
148d66d8 2892 (Table of Symbols): Add entry for %symbol-default.
3be03b13
JD
2893 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): New token.
2894 (generic_symlist, generic_symlist_item): New nonterminals for creating
2895 a list in which each item is a symbol, semantic type, or
2896 %symbol-default.
2897 (grammar_declaration): Use generic_symlist in %destructor and %printer
2898 declarations instead of symbols.1 or an empty list.
2899 (symbol_declaration, precedence_declaration, symbols.1): Update actions
2900 for changes to symbol_list.
2901 * src/reader.c: Update for changes to symbol_list.
2902 * src/scan-code.l: Likewise.
2903 * src/scan-gram.l: Scan new PERCENT_SYMBOL_DEFAULT token.
2904 * src/symlist.c, src/symlist.h: Extend such that a list node may
2905 represent a semantic type or a %symbol-default in addition to just an
2906 ordinary symbol. Add switched functions for setting %destructor's and
2907 %printer's.
2908 * tests/actions.at, tests/input.at: Add %symbol-default to all default
2909 %destructor/%printer declarations.
2910
3508ce36
JD
29112006-08-23 Joel E. Denny <jdenny@ces.clemson.edu>
2912
2913 Whether the default %destructor/%printer applies to a particular symbol
2914 isn't a question of whether the user *declares* that symbol (in %token,
2915 for example). It's a question of whether the user by any means
2916 *defines* the symbol at all (by simply using a char token, for
2917 example). $end is defined by Bison whereas any other token with token
2918 number 0 is defined by the user. The error token is always defined by
2919 Bison regardless of whether the user declares it with %token, but we
2920 may one day let the user define error as a nonterminal instead.
2921 * NEWS (2.3+): Say "user-defined" instead of "user-declared".
2922 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise, and document
2923 the meaning of "user-defined".
2924 * tests/actions.at (Default %printer and %destructor for user-declared
2925 end token): Rename to...
2926 (Default %printer and %destructor for user-defined end token): ...
2927 this.
2928
2929 * src/symtab.c (symbol_destructor_get, symbol_printer_get): In the
2930 computation of whether to apply the default, don't maintain a list of
2931 every Bison-defined symbol. Instead, just check for a first character
2932 of '$', which a user symbol cannot have, and check for the error token.
2933
9350499c
JD
29342006-08-21 Joel E. Denny <jdenny@ces.clemson.edu>
2935
2936 Don't apply the default %destructor or %printer to the error token,
2937 $undefined, or $accept. This change fits the general rule that the
2938 default %destructor and %printer are only for user-declared symbols,
2939 and it solves several difficulties that are described in the new test
2940 cases listed below.
2941 * src/symtab.c (symbol_destructor_get, symbol_printer_get): Implement.
2942 * tests/actions.at (Default %printer and %destructor are not for error
2943 or $undefined, Default %printer and %destructor are not for $accept):
2944 New test cases.
2945
4d7370cb
JD
29462006-08-19 Joel E. Denny <jdenny@ces.clemson.edu>
2947
2948 Allow %start after the first rule.
2949 * src/reader.c (grammar_current_rule_begin): Don't set the start symbol
2950 when parsing the first rule.
2951 (check_and_convert_grammar): Search for it here after all grammar
2952 declarations have been parsed. Skip midrules, which have dummy LHS
2953 nonterminals.
2954 * src/symtab.c (symbol_is_dummy): New function.
2955 * src/symtab.h (symbol_is_dummy): Declare it.
2956 * tests/input.at (%start after first rule): New test.
2957
6d0ef4ec
JD
29582006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
2959
2960 Redo some of the previous commit: add back the ability to use
2961 non-aliased/undeclared string literals since it might be useful to
2962 those declaring %token-table.
2963 * src/reader.c (check_and_convert_grammar): Undo changes in previous
2964 commit: don't worry about complaints from symbols_pack.
2965 * src/symtab.c (symbol_new, symbol_class_set,
2966 symbol_check_alias_consistency): Undo changes in previous commit: count
2967 each string literal as a new symbol and token, assign it a symbol
2968 number, and don't complain about non-aliased string literals.
2969 (symbols_pack): Since symbol_make_alias still does not decrement symbol
2970 and token counts but does still set aliased tokens to the same number,
2971 symbol_pack_processor now leaves empty slots in the symbols array.
2972 Remove those slots.
2973 * tests/regression.at (Undeclared string literal): Remove test case
2974 added in previous commit since non-aliased string literals are allowed
2975 again.
2976 (Characters Escapes, Web2c Actions): Undo changes in previous commit:
2977 remove unnecessary string literal declarations.
2978 * tests/sets.at (Firsts): Likewise.
2979
965537bc
JD
29802006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
2981
2982 Don't allow an undeclared string literal, but allow a string literal to
2983 be used before its declaration.
2984 * src/reader.c (check_and_convert_grammar): Don't invoke packgram if
2985 symbols_pack complained.
2986 * src/symtab.c (symbol_new): Don't count a string literal as a new
2987 symbol.
2988 (symbol_class_set): Don't count a string literal as a new token, and
2989 don't assign it a symbol number since symbol_make_alias does that.
2990 (symbol_make_alias): It's not necessary to decrement the symbol and
2991 token counts anymore. Don't assume that an alias declaration occurs
2992 before any uses of the identifier or string, and thus don't assert that
2993 one of them has the highest symbol number so far.
2994 (symbol_check_alias_consistency): Complain if there's a string literal
2995 that wasn't declared as an alias.
2996 (symbols_pack): Bail if symbol_check_alias_consistency failed since
2997 symbol_pack asserts that every token has been assigned a symbol number
2998 although undeclared string literals have not.
2999 * tests/regression.at (String alias declared after use, Undeclared
6d0ef4ec 3000 string literal): New test cases.
965537bc
JD
3001 (Characters Escapes, Web2c Actions): Declare string literals as
3002 aliases.
3003 * tests/sets.at (Firsts): Likewise.
3004
47aee066
JD
30052006-08-14 Joel E. Denny <jdenny@ces.clemson.edu>
3006
3007 In the grammar scanner, STRING_FINISH unclosed constructs and return
3008 them to the parser in order to improve error messages.
3009 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER,
3010 SC_BRACED_CODE, SC_PROLOGUE): Implement.
3011 * tests/input.at (Unclosed constructs): New test case.
3012 * tests/regression.at (Invalid inputs): Update now that unclosed %{ is
3013 seen.
3014
3015 * src/scan-gram.h, src/scan-gram.l (gram_last_braced_code_loc): Remove
3016 unused global.
3017
1f6b3679
JD
30182006-08-13 Joel E. Denny <jdenny@ces.clemson.edu>
3019
3020 Handle string aliases for character tokens correctly.
3021 * src/symtab.c (symbol_user_token_number_set): If the token has an
3022 alias, check and set its alias's user token number instead of its own,
3023 which is set to indicate the alias. Previously, every occurrence of
3024 the character token in the grammar overwrote that alias indicator with
3025 the character code.
3026 * tests/input.at (String aliases for character tokens): New test.
3027
219741d8
JD
30282006-08-12 Joel E. Denny <jdenny@ces.clemson.edu>
3029
3030 * src/parse-gram.y: Add `%expect 0' so we don't overlook conflicts.
3031
11daa4e7
PE
30322006-08-11 Paul Eggert <eggert@cs.ucla.edu>
3033
3034 * bootstrap: Put in need-ngettext argument to AM_GNU_GETTEXT,
3035 to prevent failures when building on older platforms.
3036 Check for autopoint failure.
3037 Set XGETTEXT_OPTIONS to values that check for C format strings,
3038 so that translators are warned about them (this also helps
3039 prevent core dumps).
3040
3041 * lib/subpipe.c (create_subpipe): Use new gnulib pipe_safer
3042 function, since it simplifies our code a bit.
3043
3044 * configure.ac (AC_ARG_ENABLE): Use -Wextra -Wno-sign-compare
3045 rather than -W, so we don't get bogus warnings about sign comparisons.
3046 Add -Wpointer-arith, since that warning is useful (it reports code
3047 that does not conform to C89 and that some compilers reject).
3048 * data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c: Undo latest change,
3049 since it's no longer needed.
3050
f9bfc42a
JD
30512006-08-10 Joel E. Denny <jdenny@ces.clemson.edu>
3052
3053 Clean up scanners a bit.
3054 * src/flex-scanner.h (FLEX_NO_OBSTACK): New macro that blocks obstack
3055 definitions so gcc won't warn when obstack_for_string is unused.
3056 * src/scan-code.l: config.h and system.h are already #include'd by
3057 scan-code-c.c, so get rid of them here.
3058 * src/scan-gram.l: Likewise.
3059 * src/scan-skel.l: Likewise, and use flex-scanner.h without obstack
3060 definitions rather than duplicating the rest of it.
3061 * src/scan-gram-c.c, scan-skel-c.c: #include "system.h".
3062
06e8700a
JD
30632006-08-09 Joel E. Denny <jdenny@ces.clemson.edu>
3064
3065 Suppress signed/unsigned comparison warnings for yycheck.
3066 * data/c.m4 (b4_safest_int_type): New macro.
3067 * data/glr.c, data/lalr1.cc: Wherever you compare yycheck[i] against
3068 a signed int type, cast it to b4_safest_int_type first.
3069 * data/yacc.c: Likewise.
3070 (b4_safest_int_type): Overwrite the one from c.m4 since b4_int_type is
3071 also overwritten.
3072
9c437126
PE
30732006-08-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
3074
3075 * doc/bison.texinfo: Fix some typos.
3076
284d8a13
PE
30772006-08-02 Paul Eggert <eggert@cs.ucla.edu>
3078
3079 * m4/.cvsignore: Add inttypes_h.m4,lib-ld.m4, lib-prefix.m4,
3080 po.m4, stdint_h.m4, uintmax_t.m4, ulonglong.m4, warning.m4.
3081
3082 * bootstrap (gnulib_tool): Stop using --assume-autoconf;
3083 the latest gnulib does this a different way.
3084 (get_translations): Sharuzzaman Ahmat Raslan reported that the ms
3085 translation was patched, so stop omitting it.
3086
ec5479ce
JD
30872006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
3088
3089 Enable declaration of default %printer/%destructor. Make the parser
3090 use these for all user-declared grammar symbols for which the user does
3091 not declare a specific %printer/%destructor. Thus, the parser uses it
3092 for token 0 if the user declares it but not if Bison generates it as
3093 $end. Discussed starting at
3094 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>,
3095 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>,
3096 and
3097 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>.
3098 * NEWS (2.3+): Mention.
3099 * doc/bison.texinfo (Actions in Mid-Rule): It's no longer impossible to
3100 declare a %destructor for a mid-rule's semantic value. It's just
3101 impossible to declare one specific to it.
3102 (Freeing Discarded Symbols): Mention that @$ can be used in %destructor
3103 code. Describe default %destructor form.
3104 * src/parse-gram.y (grammar_declaration): Parse default
3105 %printer/%destructor declarations.
3106 * src/output.c (symbol_destructors_output): Use symbol_destructor_get
3107 and symbol_destructor_location_get rather than accessing the destructor
3108 and destructor_location members of struct symbol.
3109 (symbol_printers_output): Likewise but for %printer's.
3110 * src/reader.c (symbol_should_be_used): Likewise but for %destructor's
3111 again.
3112 * src/symtab.c (default_destructor, default_destructor_location,
3113 default_printer, default_printer_location): New static global
3114 variables to record the default %destructor and %printer.
3115 (symbol_destructor_get, symbol_destructor_location_get,
3116 symbol_printer_get, symbol_printer_location_get): New functions to
3117 compute the appropriate %destructor and %printer for a symbol.
3118 (default_destructor_set, default_printer_set): New functions to set the
3119 default %destructor and %printer.
3120 * src/symtab.h: Prototype all those new functions.
3121 * tests/actions.at (Default %printer and %destructor): New test to
3122 check that the right %printer and %destructor are called, that they're
3123 not called for $end, and that $$ and @$ work correctly.
3124 (Default %printer and %destructor for user-declared end token): New
3125 test to check that the default %printer and %destructor are called for
3126 a user-declared end token.
3127 * tests/input.at (Default %printer and %destructor redeclared, Unused
3128 values with default %destructor): New tests to check related grammar
3129 warnings and errors.
3130
868d2d96
JD
31312006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
3132
3133 Clean up handling of %destructor for the end token (token 0).
3134 Discussed starting at
3135 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>
3136 and
3137 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00013.html>.
3138
3139 Make the skeletons consistent in how they pop the end token and invoke
3140 its %destructor.
3141 * data/glr.c (yyrecoverSyntaxError, yyparse): Don't pop the start
3142 state, which has token number 0, since this would invoke the
3143 %destructor for the end token.
3144 * data/lalr1.cc (yy::parser::parse): Don't check for the final state
3145 until after shifting the end token, or else it won't be popped.
3146 * data/yacc.c (yyparse): Likewise.
3147
3148 * data/glr.c (yyparse): Clear the lookahead after shifting it even when
3149 it's the end token. Upon termination, destroy an unshifted lookahead
3150 even when it's the end token.
3151 * data/lalr1.cc (yy::parser::parse): Likewise.
3152 * data/yacc.c (yyparse): Likewise.
3153
3154 * src/reader.c (packgram): Don't check rule 0. This suppresses unused
3155 value warnings for the end token when the user gives the end token a
3156 %destructor.
3157
3158 * tests/actions.at (Printers and Destructors): Test all the above.
3159
62a9592d
PE
31602006-07-24 Paul Eggert <eggert@cs.ucla.edu>
3161
3162 Update to latest gnulib and gettext versions.
3163 * bootstrap (gnulib-modules): Remove hard-locale, stdio-safer.
3164 Add fopen-safer.
3165 (gnulib_files): Add m4/warning.m4. Don't worry about files
3166 overwritten by autopoint.
3167 Replace gt_INTL_SUBDIR_CORE with an empty body in m4/gettext_gl.m4.
3168 Suppress "id", "ms", "tr" translations for now, since gettext 0.15
3169 rejects them.
3170 Don't use autoreconf; instead, invoke autopoint etc. by hand,
3171 so that we can remove the intl files at a better time.
3172 (intl_files_to_remove): Remove aclocal.m4, since it gets
3173 rebuilt anyway. Remove m4/inttypes_h.m4, m4/inttypes.m4,
3174 m4/isc-posix.m4, m4/lib-ld.m4, m4/lib-prefix.m4, m4/po.m4,
3175 m4/stdint_h.m4, m4/uintmax_t.m4, m4/ulonglong.m4.
3176 Add m4/inttypes-h.m4, m4/lock.m4, m4/visibility.m4.
3177 Remove datarootdir hack; no longer needed.
3178 * configure.ac: Use gl_WARNING_CFLAGS rather than BISON_WARNING.
3179 (AM_GNU_GETTEXT_VERSION): Bump from 0.12 to 0.15.
3180 * lib/.cvsignore: Remove hard-locale.c, hard-locale.h, strdup.c,
3181 strdup.h.
3182 * m4/.cvsignore: Remove hard-locale.m4, strdup.m4.
3183 * m4/warning.m4: Remove from CVS, since we now use gnulib's version.
3184
10d6970f
PE
31852006-07-20 Paul Eggert <eggert@cs.ucla.edu>
3186
3187 * bootstrap: Adjust to today's change to gnulib-tool by invoking
3188 it with --assume-autoconf='latest-stable'.
3189
50a33993
JD
31902006-07-13 Joel E. Denny <jdenny@ces.clemson.edu>
3191
3192 * src/parse-gram.y (grammar_declaration): Don't confuse Doxygen (at
3193 least 1.4.7 and 1.4.4) by putting a #line between `typedef union
3194 YYSTYPE' and `{'.
3195 * src/muscle_tab.h (muscle_grow): Replace the header comments with
3196 those from muscle_tab.c since the old ones are misleading.
3197
2ce4ed68
AD
31982006-07-13 Akim Demaille <akim@epita.fr>
3199
3200 Support %define "KEY" {VALUE}.
3201 * src/scan-code.h, src/scan-code.l (translate_action)
3202 (translate_rule_action, translate_symbol_action, translate_code):
3203 Return char *, not const char *.
3204 * src/parse-gram.y (declaration): Rename as...
3205 (prologue_declaration): this.
3206 (string_content): Remove this nonterminal, use STRING.
3207 (braceless, content, content.opt): New nonterminal.
3208 Use them.
3209 (%define): Now accept content.opt, i.e., accept also BRACED_CODE
3210 as value.
3211 * src/scan-gram.l (getargs.h): Don't include it.
3212
db7e5eb5
PE
32132006-07-12 Paul Eggert <eggert@cs.ucla.edu>
3214
3215 * data/lalr1.cc (YYCDEBUG): Use 'if (yydebug_) (*yycdebug_)'
3216 rather than a for-loop that declares a local bool variable. This
3217 should work around a compatibility problem with a Cray x1e C++
3218 compiler reported by Hung Nguyen in
3219 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00022.html>.
3220 The for-loop was introduced in the 2004-11-17 change but I don't
3221 know why it was needed.
3222
a5d80ba5
AD
32232006-07-12 Akim Demaille <akim@epita.fr>
3224
3225 * data/c.m4: Comment changes.
3226
23eb2a69
AD
32272006-07-10 Akim Demaille <akim@lrde.epita.fr>
3228
3229 * src/complain.c (error_message, ERROR_MESSAGE): New.
3230 To factor...
3231 (fatal_at, fatal, warn_at, warn, complain_at, complain): these.
3232 * src/complain.h, src/complain.c (warning_issued): Remove, unused.
3233
ddc8ede1
PE
32342006-07-09 Paul Eggert <eggert@cs.ucla.edu>
3235
3236 * NEWS: Instead of %union, you can define and use your own union type
3237 YYSTYPE if your grammar contains at least one <type> tag.
3238 Your YYSTYPE need not be a macro; it can be a typedef.
3239 * doc/bison.texinfo (Value Type, Multiple Types, Location Type):
3240 (Union Decl, Decl Summary): Document this.
3241 * data/glr.c (YYSTYPE): Implement this.
3242 * data/glr.cc (YYSTYPE): Likewise.
3243 * data/lalr1.cc (YYSTYPE): Likewise.
3244 * data/yacc.c (YYSTYPE): Likewise.
3245 * src/output.c (prepare): Output tag_seen_flag.
3246 * src/parse-gram.y (declaration, grammar_declaration):
3247 Use 'union_seen' rather than 'typed' to determine whether
3248 %union has been seen, since grammars can now be typed without
3249 %union.
3250 (symbol_declaration, type.opt, symbol_def):
3251 Keep track of whether a tag has been seen.
3252 * src/reader.c (union_seen, tag_seen): New vars.
3253 (typed): remove.
3254 * src/reader.h (union_seen, tag_seen, typed): Likewise.
3255 * src/scan-code.l (untyped_var_seen): New variable.
3256 (handle_action_dollar): Adjust to above changes.
3257 (handle_action_dollar, handle_action_at):
3258 Improve overflow checking for outlandish numbers.
3259 * tests/input.at (AT_CHECK_UNUSED_VALUES): Redo test to
3260 avoid new diagnostics generated by above changes.
3261 * tests/regression.at (YYSTYPE typedef): Add test to check
3262 for type tags without %union.
3263
3264 * src/symlist.c (symbol_list_length): Return int, not unsigned
3265 int, since callers expect int. This may need to get revisited
3266 once we have proper integer overflow checking.
3267
3268 * src/scan-gram.h (gram_scanner_cursor): Remove decl, since this
3269 object is now static.
3270
3271 * src/getargs.c (flags_argmatch): Return void, not int,
3272 to pacify ./configure --enable-gcc-warnings.
3273
3274 * src/flex-scanner.h (STRING_FREE): Don't use FLEX_PREFIX (last_string)
3275 since last_string is already defined to FLEX_PREFIX (last_string).
3276
7b42569e
AD
32772006-07-09 Akim Demaille <akim@lrde.epita.fr>
3278
3279 Implement --warnings/-W.
3280 * src/getargs.c (report_argmatch, trace_argmatch): Remove,
3281 replaced by...
3282 (flags_argmatch, FLAGS_ARGMATCH): this new function and macro.
3283 Adjust callers.
3284 * src/getargs.h, src/getargs.c (warnings, warnings_flags)
3285 (warnings_args, warnings_types): New.
3286 (getargs, short_options, long_options): Accept -W/--warnings.
3287 Sort the options by alphabetical order, upper case letter right
3288 before its lower case.
3289
3b452f4e
JD
32902006-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
3291
3292 Change %merge result type clash warnings to errors. Discussed at
3293 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00026.html>.
3294 * src/reader.c (record_merge_function_type): Use complain_at.
3295 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
3296 declared later): Update test case results.
3297
b8a41559
AD
32982006-07-09 Akim Demaille <akim@lrde.epita.fr>
3299
3300 * src/getargs.h, src/getargs.c: Swap --report and --trace handling
3301 to be in alphabetical order.
3302 (trace_args): Spelling fixes.
3303
cd9e1ba2
PE
33042006-07-09 Paul Eggert <eggert@cs.ucla.edu>
3305
3306 * data/yacc.c (YYID, yy_stack_print): Prefix local vars with "yy"
3307 so they don't collide with user-defined macros.
3308 (yy_stack_print): Don't assume that yytype_int16 promotes to int;
3309 this was never guaranteed, and now that we're using gnulib stdint,
3310 which defines int_fast16_t to long int, the problem is exposed.
3311
cb48f191
PE
33122006-07-08 Paul Eggert <eggert@cs.ucla.edu>
3313
b8445a15
PE
3314 * data/c.m4 (b4_basename): Simplify a bit, since we don't
3315 need the full POSIX semantics (and weren't implementing them
3316 anyway).
3317
cb48f191
PE
3318 Adjust to Autoconf 2.60 and today's gnulib.
3319 * bootstrap (gnulib_modules): Add stdint.
3320 Remove special case for m4/onceonly_2_57.m4, since gnulib-tool
3321 no longer copies it.
3322 (intl_files_to_remove): Remove m4/longlong.m4 and m4/wchar_t.m4,
3323 since stdint needs the former and wcwidth (which is now required
3324 by mbswidth) needs the latter.
3325 Append 'datarootdir = @datarootdir@' to po/Makefile.in.in, to
3326 work around a compatibility glitch between gettext 0.14.6 and
3327 Autoconf 2.60.
3328 * configure.ac (AC_PREREQ): Require Autoconf 2.60.
3329 Do not check for uintptr_t, since new stdint module does the right
3330 thing.
3331 * lib/.cvsignore: Remove alloca.c, alloca.h, alloca_.h.
3332 Add stdint.h, stdint_.h, wcwidth.h.
3333 * m4/.cvsignore: Remove alloca.m4, onceonly.m4.
3334 Add absolute-header.m4, double-slash-root.m4, longlong.m4,
3335 stdint.m4, wchar_t.m4, wcwidth.m4.
3336 * src/files.c: Include <dirname.h> and <stdio-safer.h> in the
3337 usual order for ../lib/*.h files.
3338 (file_name_split): Use last_component, not base_name, to adjust
3339 to gnulib changes.
3340 * src/parse-gram.h: Include <strverscmp.h> in the usual order
3341 for ../lib/*.h files.
3342 (YYTYPE_INT16, YYTYPE_INT8, YYTYPE_UINT16, YYTYPE_UINT8):
3343 Define unconditionally, since we now assume the stdint module.
3344 * src/scan-skel.l: Include <dirname.h>.
3345 (BASE_QPUTS): Use last_component, not base_name.
3346 * src/system.h: Include <unlocked-io.h> in the usual order
3347 for ../lib/*.h files. Include <stdint.h> unconditionally,
3348 since we now use the stdint module.
3349 (uintptr_t): Declare if UINTPTR_MAX is not defined, not
3350 HAVE_UINTPTR_T, since we now use the stdint module.
3351 (base_name): Remove decl, since files now include <dirname.h>
3352 to get the decl.
3353
cd48d21d
AD
33542006-07-08 Akim Demaille <akim@lrde.epita.fr>
3355
3356 * data/c.m4 (b4_location_initial_column, b4_location_initial_line):
3357 New, default to 1.
3358 * data/yacc.c, data/glr.c, data/location.cc: Use them.
3359 * NEWS, doc/bison.texinfo: The initial column and line are 1 by
3360 default.
3361 * tests/calc.at: Adjust.
3362
8ec0a172
AD
33632006-07-08 Akim Demaille <akim@lrde.epita.fr>
3364
b8445a15 3365 * data/c.m4 (b4_basename): New.
8ec0a172
AD
3366 (b4_syncline): Also output the location of its invocation (from
3367 the skeleton).
3368 (b4_user_action, b4_define_user_action, b4_user_actions)
3369 (b4_user_initial_action, b4_user_post_prologue, b4_user_start_header)
3370 (b4_user_stype): New.
3371 * data/yacc.c, data/glr.c, data/lalr1.cc, data/glr.cc: Use them.
3372
4a678af8
JD
33732006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
3374
3375 In the grammar file, the first column is 1 not 0 on the first line as
3376 on every other line.
3377 * src/parse-gram.y (%initial-action): Initialize @$ correctly.
3378 * tests/input.at (Torturing the Scanner): Update output.
3379
3380 * src/scan-gram.l (scanner_cursor): Declare it static.
3381
dd60572a
JD
33822006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
3383
3384 In warnings, say "previous declaration" rather than "first
3385 declaration".
3386 * src/symtab.c (redeclaration): Do that here.
3387 * src/reader.c (record_merge_function_type): In the case of a result
3388 type clash, report the previous declaration rather than the very first
3389 one in the grammar file.
3390 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
3391 declared later): Add a third declaration to check this behavior.
3392 * tests/input.at (Incompatible Aliases): Update output.
3393
2073e1b6
AD
33942006-06-27 Akim Demaille <akim@epita.fr>
3395
3396 * doc/Doxyfile.in: New.
3397 * doc/Makefile.am: Use it.
3398 * src/lalr.h, src/symtab.h: Initial doxygenation.
3399
8ee5b538
JD
34002006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
3401
3402 Don't miss %merge result type warnings just because the LHS types are
fab044e6
JD
3403 declared after the %merge. This continues the effort of the previous
3404 patch.
8ee5b538
JD
3405 * src/reader.c (get_merge_function): Don't set the merger type yet.
3406 (record_merge_function_type): New function for setting the merger type
3407 and checking for clashes.
3408 (grammar_current_rule_merge_set): Set the location of the %merge for
3409 the current rule.
3410 (packgram): Invoke record_merge_function_type for each rule now that
3411 all symbol type declarations have been parsed.
3412 * src/reader.h (merger_list.type_declaration_location): New member
3413 storing the location of the first %merge from which the type for this
3414 merging function was derived.
3415 * src/symlist.h (symbol_list.merger_declaration_location): New member
3416 storing the location of a rule's %merge, if any.
3417 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
3418 declared later): New test to catch the error fixed by the above patch.
3419
ffa4ba3a
JD
34202006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
3421
3422 Get action warnings (grammar_rule_check) right even when symbol
fab044e6
JD
3423 declarations appear after the rules. Discussed at
3424 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00108.html>
3425 and
3426 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00151.html>.
3427 Don't mistake the type of $$ in a midrule to be that of its parent
3428 rule's $$.
ffa4ba3a
JD
3429 * src/reader.c (grammar_current_rule_end): Don't invoke
3430 grammar_rule_check yet since not all symbol declarations may have been
3431 parsed yet.
3432 (grammar_midrule_action): Likewise.
3433 Don't record whether the midrule's $$ has been used yet since actions
3434 haven't been translated yet.
3435 Record the midrule's parent rule and its RHS index within the parent
3436 rule.
3437 (grammar_current_rule_action_append): Don't translate the action yet
3438 since not all symbol declarations may have been parsed yet and, thus,
3439 warnings about types for $$, $n, @$, and @n can't be reported yet.
3440 (packgram): Translate the action and invoke grammar_rule_check now that
3441 all symbol declarations have been parsed.
3442 * src/scan-code.l (handle_action_dollar): Now that this is invoked
3443 after parsing the entire grammar file, the symbol list here in the case
3444 of a midrule is actually the midrule's empty RHS, so reference its
3445 parent rule's RHS where necessary.
3446 On the other hand, now that you can already know it's a midrule, you
3447 aren't forced to think $$ has the same type as its parent rule's $$.
3448 (handle_action_at): In the case of a midrule, reference the parent rule
3449 where necessary.
3450 * src/symlist.c (symbol_list_new): Initialize new midrule-related
3451 members.
3452 (symbol_list_length): Now that this is invoked after all rules have
3453 been parsed, a NULL symbol (rather than a NULL symbol list node)
3454 terminates a rule. symbol_list_print already does this correctly.
3455 * src/symlist.h (symbol_list.midrule_parent_rule,
3456 symbol_list.midrule_parent_rhs_index): New members so that midrules can
3457 remember their relationships with their parents.
3458 * tests/input.at (Type Clashes): Extend to catch the midrule $$ error
3459 fixed by the above patch.
3460 (_AT_UNUSED_VALUES_DECLARATIONS, AT_CHECK_UNUSED_VALUES): New m4 macros
3461 implementing...
3462 (Unused values): ... this old test case and...
3463 (Unused values before symbol declarations): ... this new test case.
3464 This one is the same as `Unused values' except that all symbol
3465 declarations appear after the rules in order to catch the rest of the
3466 errors fixed by the above patch.
3467
e256e17f
JD
34682006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
3469
300a1930
JD
3470 More cleanup.
3471 * src/reader.c (current_rule): Declare it static since it's no longer
3472 used outside this file.
3473 (grammar_current_rule_action_append): Remove redundant arguments from
3474 translate_rule_action invocation.
3475 * src/reader.h (current_rule): Remove this unused extern.
3476 * src/scan-code.h (translate_rule_action): Remove redundant arguments.
3477 * src/scan-code.l (translate_rule_action): Likewise.
e256e17f 3478
381ecb06
JD
34792006-06-25 Joel E. Denny <jdenny@ces.clemson.edu>
3480
3481 Clean up yesterday's patch.
3482 * parse-gram.y (rhs): Move grammar_midrule_action invocation from here
3483 to...
3484 * src/reader.c (grammar_current_rule_action_append): ... here for
3485 consistency with grammar_current_rule_symbol_append.
3486 * tests/regression.at (Braced code in declaration in rules section):
3487 Make yyerror and yylex static as usual.
3488
4210cd0b
JD
34892006-06-24 Joel E. Denny <jdenny@ces.clemson.edu>
3490
3491 Fix bug that mistakes braced code in a declaration in the rules section
3492 to be a rule action. Mentioned at
3493 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00105.html>.
3494 * src/scan-gram.l: Move midrule action detection from the start of the
3495 scanning of any braced code to...
3496 * src/parse-gram.y (rhs): ... the parsing of braced code as a rule
3497 action. For readability, use $2 and @2 rather than the equivalent
3498 global variables.
3499 * tests/regression.at (Braced code in declaration in rules section):
3500 New test to catch the error fixed by the above patch.
3501
3502 Work on code readability some.
3503 * src/scan-code.l (current_rule): Get rid of this misleading and
3504 redundant declaration: it's actually extern'ed in reader.h.
3505 (YY_DECL, code_lex, handle_action_dollar, handle_action_at,
3506 translate_action): Add a rule argument and use it instead of the global
3507 current_rule.
3508 (translate_rule_action): This already receives current_rule through an
3509 argument, so pass it on to translate_action instead of assigning
3510 current_rule to current_rule.
3511 (translate_symbol_action, translate_code): Pass rule = NULL to
3512 translate_action.
3513
34f98f46
JD
35142006-06-23 Joel E. Denny <jdenny@ces.clemson.edu>
3515
3516 Rename %before-definitions to %start-header and %after-definitions to
3517 %end-header. Don't use these declarations to separate pre-prologue
3518 blocks from post-prologue blocks. Add new order-independent
3519 declarations %before-header and %after-header as alternatives to the
3520 traditional Yacc pre-prologue and post-prologue blocks. Discussed at
3521 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00110.html>.
3522 * NEWS (2.3+): Update for these changes.
3523 * data/glr.c (b4_before_definitions): Update to...
3524 (b4_start_header): ... this.
3525 (b4_after_definitions): Update to...
3526 (b4_end_header): ... this.
3527 * data/glr.cc: Likewise.
3528 * data/lalr1.cc: Likewise.
3529 * data/yacc.c: Likewise.
3530 * doc/bison.texinfo (The prologue): Update names, and replace remaining
3531 prologue blocks with %*-header declarations.
3532 (Calc++ Parser): Likewise.
91661ebb 3533 (Decl Summary): Update names.
148d66d8 3534 (Table of Symbols): Update description.
34f98f46
JD
3535 * src/parse-gram.y (PERCENT_AFTER_DEFINITIONS): Update to...
3536 (PERCENT_END_HEADER): ... this.
3537 (PERCENT_BEFORE_DEFINITIONS): Update to...
3538 (PERCENT_START_HEADER): ... this.
3539 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
3540 (declaration): Update token names and m4 macro names.
3541 When parsing %end-header and %start-header, invoke translate_code
3542 before muscle_code_grow, and no longer set global booleans to remember
3543 whether these declarations have been seen.
3544 Parse new %after-header and %before-header.
3545 * src/reader.c (before_definitions, after_definitions): Remove.
3546 (prologue_augment): Accept a new bool argument to specify whether to
3547 augment the pre-prologue or post-prologue.
3548 * src/reader.h (before_definitions, after_definitions): Remove these
3549 extern's.
3550 (prologue_augment): Add new bool argument.
3551 * src/scan-gram.l (PERCENT_AFTER_DEFINITIONS): Update to...
3552 (PERCENT_END_HEADER): ... this.
3553 (PERCENT_BEFORE_DEFINITIONS): Update to...
3554 (PERCENT_START_HEADER): ... this.
3555 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
3556 * tests/actions.at (Printers and Destructors): Update names.
3557
31b2b07e
JD
35582006-06-22 Joel E. Denny <jdenny@ces.clemson.edu>
3559
3560 Add comparison operators for C++ location classes. Discussed at
3561 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00092.html>.
3562 * data/c++.m4 (b4_define_location_comparison): New boolean %define
3563 declaration indicating whether filename_type has an operator==. If
3564 filename_type is `std::string', it defaults to `1', `0' otherwise.
3565 * data/location.cc: Iff b4_define_location_comparison is `1', add
3566 operator== and operator!= for class position and for class location.
3567
3568 Some minor fixes.
3569 * src/scan-action.l: Remove unused file.
3570 * src/symtab.c (symbol_printer_set): Use printer_location not
3571 destructor_location.
3572 * src/symtab.h (struct symbol): Replace incorrect source comment for
3573 printer members.
3574 * tests/input.at (Incompatible Aliases): Update output with correct
3575 printer location.
3576
9bc0dd67
JD
35772006-06-20 Joel E. Denny <jdenny@ces.clemson.edu>
3578
3579 Don't put the pre-prologue in the header file. For the yacc.c code
3580 file and the glr.c header and code files, move the pre-prologue before
3581 the token definitions. Add new %before-definitions and
3582 %after-definitions to declare code that will go in both the header file
3583 and code file. Discussed at
3584 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00000.html>,
3585 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00016.html>,
3586 and
3587 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00055.html>.
3588 * NEWS (2.3+): Describe these changes.
3589 * data/glr.c (b4_pre_prologue): Move from within to before...
3590 (b4_shared_declarations): ... this.
3591 Add new b4_before_definitions before b4_token_enums.
3592 Add new b4_after_definitions at the end.
3593 * data/glr.cc (b4_pre_prologue): Replace with...
3594 (b4_before_definitions): ... this in the header file.
3595 (b4_after_definitions): New near the end of the header file.
3596 * data/lalr1.cc (b4_pre_prologue): Move from the header file to the
3597 code file right before including the header file.
3598 (b4_before_definitions): New in the previous position of
3599 b4_pre_prologue in the header file.
3600 (b4_after_definitions): New near the end of the header file.
3601 * data/yacc.c: Clean up some m4 quoting especially in the header file.
3602 (b4_token_enums_defines): In the code file, move to right before
3603 YYSTYPE for consistency with the header file.
3604 (b4_before_definitions): New right before b4_token_enums_defines in
3605 both the header and code file.
3606 (b4_after_definitions): New right after YYLTYPE and yylloc in both the
3607 header and code file.
3608 * doc/bison.texinfo (Prologue): Show use of %before-definitions instead
3609 of prologues for %union dependencies.
91661ebb
JD
3610 (Decl Summary): In %defines description, mention the effect of
3611 %before-definitions and %after-definitions on the header file.
9bc0dd67
JD
3612 (Calc++ Parser): Forward declare driver in a %before-definitions rather
3613 than in the pre-prologue so that make check succeeds.
148d66d8 3614 (Table of Symbols): Add entries for %before-definitions and
9bc0dd67
JD
3615 %after-definitions.
3616 * src/parse-gram.y (PERCENT_BEFORE_DEFINITIONS): New token for
3617 %before-definitions.
3618 (PERCENT_AFTER_DEFINITIONS): New token for %after-definitions.
3619 (declaration): Parse those declarations and append to
3620 b4_before_definitions and b4_after_definitions, respectively.
3621 * src/reader.c (before_definitions, after_definitions): New bools to
3622 track whether those declarations have been seen.
3623 (prologue_augment): Add to the post-prologue if %union,
3624 %before-definitions, or %after-definitions has been seen.
3625 * src/reader.h (before_definitions, after_definitions): New extern's.
3626 * src/scan-gram.l: Scan the new declarations.
3627 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Place the second
3628 prologue block in a %before-definitions or a %after-definitions based
3629 on whether the %union is declared.
3630 * tests/regression.at (Early token definitions with --yacc, Early token
3631 definitions without --yacc): Move tests for token definitions into the
3632 post-prologue since token names are no longer defined in the
3633 pre-prologue.
3634
203b9274
AD
36352006-06-20 Akim Demaille <akim@epita.fr>
3636
3637 * src/symtab.h, src/symtab.c (symbol_from_uniqstr): New.
3638 (symbol_get): Use it.
3639 * src/parse-gram.y: Use it.
3640
a7ee59cf
JD
36412006-06-19 Joel E. Denny <jdenny@ces.clemson.edu>
3642
3643 * src/scan-gram.l: Remove unused declaration of last_string_1 so the
3644 build succeeds when configured with --enable-gcc-warnings.
3645
5a2baae7
PE
36462006-06-19 Paul Eggert <eggert@cs.ucla.edu>
3647
33ad1a9c
PE
3648 * src/parse-gram.y (char_name): New function.
3649 (CHAR, STRING, string_content): For %printer, properly escape.
3650 (ID): Prefer fputs to fprintf.
3651 (id): Reindent to be consistent with other rules.
3652 Properly quote char.
3653
5a2baae7
PE
3654 The Translation Project changed its way of publishing translations
3655 to maintainers. I haven't received any responses to my request
3656 for supporting the old way, or for documenting the new way. I
3657 have modified 'bootstrap' to use screen scraping
3658 (in this case, HTML scraping). This is unreliable and inelegant,
3659 but I don't see any better way. Yuck.
3660 * bootstrap (TP_URL, WGET_COMMAND): New vars.
3661 (get_translations): New function, which uses HTML scraping to
3662 deduce locations of latest translations.
3663 Use this function to grab both bison and bison-runtime .po files.
3664 Don't bother priming the pump for the runtime-po domain any more,
3665 as it's now translated better than bison is.
3666
58d7a1a1
AD
36672006-06-19 Akim Demaille <akim@epita.fr>
3668
3669 * src/scan-gram.l: No longer "parse" things after `%union' until
3670 `{'. Rather, return a single "%union" token.
3671 No longer make symbols: return strings, and leave the conversion
3672 to symbols to the parser.
3673 (SC_PRE_CODE, token_type): Remove.
3674 * src/parse-gram.y (%union): New field `character'.
3675 Sort tokens.
3676 (CHAR): New token.
3677 (ID, ID_COLON): Now that the scanner no longer makes them
3678 identifiers, adjust all uses to invoke symbol_get.
3679 (id_colon): New, wraps the conversion from string to symbol.
3680 (%union): Accept a possible union_name.
3681 (symbol): Now can be a char.
3682 * data/c.m4 (b4_union_name): Leave a default value.
3683 * data/glr.c, data/yacc.c: Use it.
3684
b931235e
JD
36852006-06-11 Joel E. Denny <jdenny@ces.clemson.edu>
3686
3687 For associating token numbers with token names for "yacc.c", don't use
3688 #define statements unless `--yacc' is specified; always use enum
3689 yytokentype. Most important discussions start at:
3690 <http://lists.gnu.org/archive/html/bison-patches/2005-09/msg00053.html>,
3691 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00052.html>,
3692 and
3693 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00043.html>.
3694 * NEWS (2.3+): Mention.
3695 * data/c.m4 (b4_yacc_if): New.
3696 (b4_token_enums_defines): Use b4_yacc_if to decide whether to add the
3697 token #define's.
3698 * doc/bison.texinfo (Bison Options): Describe the effect of `--yacc'
3699 on token name definitions.
3700 * src/getargs.c (usage): Capitalize `Yacc' in English.
3701 * src/output.c (prepare): Define b4_yacc_flag.
3702 * tests/regression.at (Early token definitions): Test that tokens names
3703 are defined before the pre-prologue not just before the post-prologue.
3704 Remove this test case and copy to...
3705 (Early token definitions with --yacc): ... this to test #define's.
3706 (Early token definitions without --yacc): ... and this to test enums.
3707
9e6e7ed2
PE
37082006-06-11 Paul Eggert <eggert@cs.ucla.edu>
3709
3710 * NEWS: Reword the post-2.3 change to not be so optimistic about
3711 removing the old "look-ahead" spelling.
3712 Update previous look-ahead/lookahead change reports.
3713 * REFERENCES: look-ahead -> lookahead (since that's
3714 what he actually wrote).
3715 * doc/refcard.tex: look ahead -> lookahead,
3716 look-ahead -> lookahead
3717
742e4900
JD
37182006-06-09 Joel E. Denny <jdenny@ces.clemson.edu>
3719
3720 For consistency, use `lookahead' instead of `look-ahead' or
3721 `look_ahead'. Discussed starting at
3722 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00049.html>
3723 and then at
3724 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00017.html>.
3725 * NEWS: For the next release, note the change to `--report'.
3726 * TODO, doc/bison.1: Update English.
3727 * doc/bison.texinfo: Update English.
3728 (Understanding Your Parser, Bison Options): Document as
3729 `--report=lookahead' rather than `--report=look-ahead'.
3730 * src/conflicts.c: Update English in comments.
3731 (lookahead_set): Rename from look_ahead_set.
3732 (flush_reduce): Rename argument look_ahead_tokens to lookahead_tokens.
3733 (resolve_sr_conflict): Rename local look_ahead_tokens to
3734 lookahead_tokens, and update other uses.
3735 (flush_shift, set_conflicts, conflicts_solve, count_sr_conflicts,
3736 count_rr_conflicts, conflicts_free): Update uses.
3737 * src/getargs.c (report_args): Move "lookahead" before alternate
3738 spellings.
3739 (report_types): Update uses.
3740 (usage): For `--report' usage description, state `lookahead' spelling
3741 rather than `look-ahead'.
3742 * src/getargs.h (report.report_lookahead_tokens): Rename from
3743 report_look_ahead_tokens.
3744 * src/lalr.c: Update English in comments.
3745 (compute_lookahead_tokens): Rename from compute_look_ahead_tokens.
3746 (state_lookahead_tokens_count): Rename from
3747 state_look_ahead_tokens_count.
3748 Rename local n_look_ahead_tokens to n_lookahead_tokens.
3749 (lookahead_tokens_print): Rename from look_ahead_tokens_print.
3750 Rename local n_look_ahead_tokens to n_lookahead_tokens.
3751 Update other uses.
3752 Update English in output.
3753 (add_lookback_edge, initialize_LA, lalr, lalr_free): Update uses.
3754 * src/print.c: Update English in comments.
3755 (lookahead_set): Rename from look_ahead_set.
3756 (print_reduction): Rename argument lookahead_token from
3757 look_ahead_token.
3758 (print_core, state_default_rule, print_reductions, print_results):
3759 Update uses.
3760 * src/print_graph.c: Update English in comments.
3761 (print_core): Update uses.
3762 * src/state.c: Update English in comments.
3763 (reductions_new): Update uses.
3764 (state_rule_lookahead_tokens_print): Rename from
3765 state_rule_look_ahead_tokens_print, and update other uses.
3766 * src/state.h: Update English in comments.
3767 (reductions.lookahead_tokens): Rename from look_ahead_tokens.
3768 (state_rule_lookahead_tokens_print): Rename from
3769 state_rule_look_ahead_tokens_print.
3770 * src/tables.c: Update English in comments.
3771 (conflict_row, action_row): Update uses.
3772 * tests/glr-regression.at
3773 (Incorrect lookahead during deterministic GLR,
3774 Incorrect lookahead during nondeterministic GLR): Rename
3775 print_look_ahead to print_lookahead.
3776 * tests/torture.at: Update English in comments.
3777 (AT_DATA_LOOKAHEAD_TOKENS_GRAMMAR): Rename from
3778 AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR.
3779 (Many lookahead tokens): Update uses.
3780 * data/glr.c: Update English in comments.
3781 * lalr1.cc: Likewise.
3782 * yacc.c: Likewise.
3783 * src/conflicts.h: Likewise.
3784 * src/lalr.h: Likewise.
3785 * src/main.c: Likewise.
3786 * src/output.c: Likewise.
3787 * src/parse-gram.c: Likewise.
3788 * src/tables.h: Likewise.
3789 * tests/calc.at: Likewise.
3790
3c40d0b5
JD
37912006-06-08 Joel E. Denny <jdenny@ces.clemson.edu>
3792
3793 * src/flex-scanner.h (yytext): Remove stray `*/' in #define.
3794
5d278082
PE
37952006-06-07 Paul Eggert <eggert@cs.ucla.edu>
3796
3797 * TODO: Add request from Nelson H. F. Beebe to be able to install
3798 Bison without installing the yacc script.
3799
9e668899
JD
38002006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
3801
3802 * src/flex-scanner.h: For the sake of Flex 2.5.4, don't #define yyleng
3803 and yytext if they're already #define'd.
3804 * src/flex-scanner.h, src/location.h: Move #include "system.h" to...
3805 * src/scan-code-c.c: ... here.
3806 * src/scan-code.l, src/scan-gram.l: ... and here. Also #include
3807 <config.h>.
3808
0c8e079f
JD
38092006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
3810
3811 Get Bison to build again when configured with --enable-gcc-warnings.
3812 * src/location.c, src/location.h, src/main.c, src/scan-code.l: Add some
3813 missing #include's.
3814 * src/scan-code.l (handle_action_dollar, handle_action_at): Rename
3815 loc argument as it shadows a global.
3816 * src/scan-gram.l: Remove stray comma that prevents boundary_set
3817 invocation.
3818
3819 * src/.cvsignore: Add scan-code.c.
3820
2346344a
AD
38212006-06-07 Akim Demaille <akim@epita.fr>
3822
3823 * src/scan-gram.l: Move the "add a trailing ; to actions" code
3824 to...
3825 * src/scan-code.l: here.
3826 * tests/input.at (Torturing the Scanner): Fix another location
3827 error.
3828
4862bdfd
AD
38292006-06-07 Akim Demaille <akim@epita.fr>
3830
3831 * src/Makefile.am (BUILT_SOURCES): Fix the trailing backslash.
3832
e9071366
AD
38332006-06-06 Akim Demaille <akim@epita.fr>
3834
3835 Extract the parsing of user actions from the grammar scanner.
3836 As a consequence, the relation between the grammar scanner and
3837 parser is much simpler. We can also split "composite tokens" back
3838 into simple tokens.
3839 * src/gram.h (ITEM_NUMBER_MAX, RULE_NUMBER_MAX): New.
3840 * src/scan-gram.l (add_column_width, adjust_location): Move to and
3841 rename as...
3842 * src/location.h, src/location.c (add_column_width)
3843 (location_compute): these.
3844 Fix the column count: the initial column is 0.
3845 (location_print): Be robust to ending column being 0.
3846 * src/location.h (boundary_set): New.
3847 * src/main.c: Adjust to scanner_free being renamed as
3848 gram_scanner_free.
3849 * src/output.c: Include scan-code.h.
3850 * src/parse-gram.y: Include scan-gram.h and scan-code.h.
3851 Use boundary_set.
3852 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_INITIAL_ACTION)
3853 (PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Remove the {...} part,
3854 which is now, again, a separate token.
3855 Adjust all dependencies.
3856 Whereever actions with $ and @ are used, use translate_code.
3857 (action): Remove this nonterminal which is now useless.
3858 * src/reader.c: Include assert.h, scan-gram.h and scan-code.h.
3859 (grammar_current_rule_action_append): Use translate_code.
3860 (packgram): Bound check ruleno, itemno, and rule_length.
3861 * src/reader.h (gram_in, gram__flex_debug, scanner_cursor)
3862 (last_string, last_braced_code_loc, max_left_semantic_context)
3863 (scanner_initialize, scanner_free, scanner_last_string_free)
3864 (gram_out, gram_lineno, YY_DECL_): Move to...
3865 * src/scan-gram.h: this new file.
3866 (YY_DECL): Rename as...
3867 (GRAM_DECL): this.
3868 * src/scan-code.h, src/scan-code.l, src/scan-code-c.c: New.
3869 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
3870 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
3871 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
3872 Move these declarations, and...
3873 (obstack_for_string, STRING_GROW, STRING_FINISH, STRING_FREE):
3874 these to...
3875 * src/flex-scanner.h: this new file.
3876 * src/scan-gram.l (rule_length, rule_length_overflow)
3877 (increment_rule_length): Remove.
3878 (last_braced_code_loc): Rename as...
3879 (gram_last_braced_code_loc): this.
3880 Adjust to the changes of the parser.
3881 Move all the handling of $ and @ into...
3882 * src/scan-code.l: here.
3883 * src/scan-gram.l (handle_dollar, handle_at): Remove.
3884 (handle_action_dollar, handle_action_at): Move to...
3885 * src/scan-code.l: here.
3886 * src/Makefile.am (bison_SOURCES): Add flex-scanner.h,
3887 scan-code.h, scan-code-c.c, scan-gram.h.
3888 (EXTRA_bison_SOURCES): Add scan-code.l.
3889 (BUILT_SOURCES): Add scan-code.c.
3890 (yacc): Be robust to white spaces.
3891
3892 * tests/conflicts.at, tests/input.at, tests/reduce.at,
3893 * tests/regression.at: Adjust the column numbers.
3894 * tests/regression.at: Adjust the error message.
7891a7c4 3895
184e42f0
JD
38962006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
3897
3898 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
3899 Use Akim's wording from
3900 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00056.html>.
3901
7891a7c4
JD
39022006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
3903
3904 Between Bison releases, manually append `+' to the previous Bison
3905 release number, and use that as a signal to automatically print the
3906 ChangeLog's CVS Id keyword from --version. Discussed starting at
3907 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00028.html>.
3908 * ChangeLog: Add Id header.
3909 * configure.ac (AC_INIT): Append `+' to `2.3'.
3910 * src/.cvsignore: Add revision.c.
3911 * src/Makefile.am (bison_SOURCES): Add revision.c and revision.h.
3912 (BUILT_SOURCES): Add revision.c.
3913 (revision.c): New target rule. This file defines a new global variable
3914 named revision. It initializes it with either the Id from ChangeLog
3915 or, if VERSION doesn't contain `+', with the empty string.
3916 * src/getargs.c (version): Print the value of revision.
3917 * src/revision.h: Extern revision.
3918
4ad3ed84
PE
39192006-06-05 Paul Eggert <eggert@cs.ucla.edu>
3920
3921 * NEWS: Version 2.3.
3922 * configure.ac (AC_INIT): Likewise.
3923
02103984
PE
39242006-05-30 Paul Eggert <eggert@cs.ucla.edu>
3925
3926 * data/glr.c (YYRECOVERING): Define to be a function-like macro
3927 with no arguments, not as an object-like macro. This is for
3928 compatibility with data/yacc.c. Problem reported by John P. Hartmann in
3929 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00059.html>.
3930 * doc/bison.texinfo (Action Features, Error Recovery, Table of Symbols):
3931 Document this.
3932
2c08afa5
JD
39332006-05-30 Joel E. Denny <jdenny@ces.clemson.edu>
3934
3935 * src/getargs.c (usage): Back out yesterday's modification of the
3936 --help output so that we don't have to wait for translation before
3937 releasing 2.3.
3938
6077da58
PE
39392006-05-29 Paul Eggert <eggert@cs.ucla.edu>
3940
3941 * doc/bison.texinfo (Introduction): Don't say "GLR grammar".
3942 Problem reported by Akim Demaille.
3943
2a26b6c2
JD
39442006-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
3945
3946 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
3947
aefef0d6
PE
39482006-05-26 Paul Eggert <eggert@cs.ucla.edu>
3949
3950 * data/yacc.c (yy_reduce_print): Omit trailing white space in
3951 generated source code. Problem reported by Frans Englich in
3952 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00049.html>.
3953
fcd8e201
PE
39542006-05-22 Paul Eggert <eggert@cs.ucla.edu>
3955
3956 * Makefile.maint (gzip_rsyncable, GZIP_ENV): Compute within the
3957 shell, not within 'make', so that 'make' by an ordinary builder
3958 (using GNU make) does not worry about configuring gzip. This also
3959 works around a bug reported independently by Keith Thompson and by
3960 Georg Schwarz, whereby gzip 1.2.4 --help would output usage on
3961 stderr rather than stdout, messing up the build logs.
3962
7b5cdcbd
JD
39632006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
3964
3965 * data/yacc.c (yyparse): Wrap the final return from yyparse inside YYID
3966 to make sure that YYID will never be unused. This fixes a 'make
3967 maintainer-check' failure caused by the recent changes to the 'Trivial
3968 grammars' test case, which caused g++ 4.1.0 to complain that YYID was
3969 not used.
3970 * data/glr.c (yyparse): Wrap yyparse's return inside YYID just in case.
3971
5ad0a449
JD
39722006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
3973
3974 * data/glr.c (yyresolveLocations): Remove bogus YYASSERT that the
3975 state before an empty RHS is always resolved here. Only the location
3976 of that state is guaranteed to be resolved, and that's enough. This
3977 fixes the remaining bug reported by Derek M. Jones in
3978 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
3979 * tests/glr-regression.at (Uninitialized location when reporting
3980 ambiguity): Test the above case.
3981 Also, the embedded comments in this test case claim it checks the case
3982 of an empty RHS that has inherited the initial location. However, the
3983 corresponding LHS was already resolved, so yyresolveLocations didn't
3984 actually have reason to modify it. Fix this by forcing
3985 nondeterministic operation at the beginning of the parse.
3986
50cce58e
PE
39872006-05-20 Paul Eggert <eggert@cs.ucla.edu>
3988
3989 * data/c.m4 (b4_yy_symbol_print_generate):
3990 (b4_yy_symbol_print_generate): Use 'YYSTYPE const' rather than
3991 'const YYSTYPE', and similarly for YYLTYPE. This fixes one
3992 of the bugs reported today by Derek M Jones in
3993 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
3994 * doc/bison.texinfo (Value Type): Document that YYSTYPE must be
3995 defined to be a type name without parens or brackets.
3996 (Location Type): Similarly for YYLTYPE.
3997 * tests/regression.at (Trivial grammars): Put in a test for this
3998 bug that will be caught by 'make maintainer-check' (though not,
3999 alas, by 'make check' unless your compiler is picky).
4000
ab8d9dc5
PE
40012006-05-19 Paul Eggert <eggert@cs.ucla.edu>
4002
0d2c8934 4003 * NEWS: Version 2.2.
ab8d9dc5
PE
4004 * configure.ac (AC_INIT): Likewise.
4005
9138c575
JD
40062006-05-17 Joel E. Denny <jdenny@ces.clemson.edu>
4007
4008 * data/glr.c (yyreportTree): Make room in yystates for the state
4009 preceding the RHS. This fixes the segmentation fault reported by Derek
4010 M. Jones in
4011 <http://lists.gnu.org/archive/html/help-bison/2006-05/msg00035.html>.
4012 (yyreportTree, yypdumpstack): Subtract 1 from yyrule before printing
4013 to the user. Reported for yyreportTree by Derek M. Jones later in the
4014 same thread.
4015 * THANKS: Add Derek M. Jones.
4016 Update my email address.
4017 Fix typo in Steve Murphy's name.
4018
276f48df
PE
40192006-05-14 Paul Eggert <eggert@cs.ucla.edu>
4020
d6645148
PE
4021 * data/glr.c (yyreportSyntaxError): Fix off-by-one error in
4022 checking against YYLAST that caused the parser to miss a potential
4023 alternative in its diagnostic.
4024 Problem reported by Maria Jose Moron Fernandez in
4025 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00024.html>.
4026 * data/lalr1.cc (yysyntax_error_): Likewise.
4027 * data/yacc.c (yysyntax_error): Likewise.
4028 * tests/regression.at (_AT_DATA_DANCER_Y): Use static array for
4029 tokens, in case we run into an older C compiler.
4030 (_AT_DATA_EXPECT2_Y, AT_CHECK_EXPECT2): New macros.
4031 Use them to check for the off-by-one error fixed above.
4032
276f48df
PE
4033 * data/yacc.c (yytnamerr): Fix typo: local var should be of type
4034 YYSIZE_T, not size_t.
4035 * tests/regression.at (Trivial grammars): New test, to catch
4036 the error fixed by the above patch.
4037
cd8b5791
AD
40382006-05-14 Akim Demaille <akim@lrde.epita.fr>
4039
4040 * doc/bison.texinfo (C++ Bison Interface): Clarify the naming
4041 scheme.
4042 Reported by Steve Murphy.
4043
34376418
AD
40442006-05-14 Akim Demaille <akim@lrde.epita.fr>
4045
4046 * data/glr.cc, data/lalr1.cc: Using %defines is mandatory.
4047 * data/glr.cc: b4_location_flag is now b4_locations_flag.
4048
327afc7c
AD
40492006-05-14 Akim Demaille <akim@lrde.epita.fr>
4050
4051 Implement --trace=m4.
4052 * src/getargs.c (trace_types, trace_args): Accept trace_m4.
4053 * src/output.c (output_skeleton): When set, pass -dV to m4.
4054
4055 Factor the handling of flags in m4.
4056 * src/output.c (prepare): Rename the muscle names debug, defines,
4057 error_verbose to debug_flag, defines_flag, error_verbose_flag.
4058 * data/c.m4: Adjust.
4059 (_b4_define_flag_if, b4_define_flag_if, b4_defines_if): New.
4060 Use b4_define_flag_if to define other b4_FLAG_if macros.
4061 (b4_location_if): As a consequence, rename as...
4062 (b4_locations_if): this, for consistency.
4063 Adjust all the skeletons.
4064
ba9ecd19
AD
40652006-05-14 Akim Demaille <akim@lrde.epita.fr>
4066
4067 * etc/bench.pm: Shorten bench names.
4068
4e83ea15
AD
40692006-05-14 Akim Demaille <akim@lrde.epita.fr>
4070
4071 * src/output.h, src/output.c (error_verbose): Move to...
4072 * src/getargs.h, src/getargs.c: here.
4073 Sort the flags.
4074 Adjust dependencies.
4075
6e93d810
PE
40762006-05-13 Paul Eggert <eggert@cs.ucla.edu>
4077
4078 * data/c.m4 (b4_copyright): Put the special exception for Bison
4079 skeletons here, so we don't have to put it in each skeleton. All
b15296ff
PE
4080 uses changed. Suggested by Akim Demaille. Also, wrap the
4081 copyright notice, in case it is longer than 80 columns. Replace
4082 comma by newline after title.
6e93d810 4083
eaea13f5
PE
40842006-05-11 Paul Eggert <eggert@cs.ucla.edu>
4085
4086 * doc/bison.texinfo (Calc++ Scanner): The flex behavior is an
4087 incompatibility, not a bug. Mention that it wasn't fixed as of
4088 flex 2.5.33.
4089
3cf084ec
AD
40902006-05-11 Akim Demaille <akim@lrde.epita.fr>
4091
4092 * examples/extexi: Enforce the precedence of concatenation over
4093 >>.
0a9f1c7d 4094 Reported by Tommy Nordgren.
3cf084ec 4095
32c96bd7
AD
40962006-05-11 Akim Demaille <akim@lrde.epita.fr>
4097
4098 * data/lalr1.cc (yytranslate_): Rename token as t to avoid clashes
4099 with the member "token".
f94705b2 4100 Reported by Martin Nylin.
32c96bd7 4101
eaea13f5
PE
41022006-05-08 Paul Eggert <eggert@cs.ucla.edu>
4103
4104 * data/glr.c: Switch to Bison 2.2 special-exception language in
4105 the copyright notice. Use more-regular format for titles and
4106 copyright notices.
4107 * data/glr.cc: Likewise.
4108 * data/location.cc: Likewise.
4109 * data/yacc.cc: Likewise.
4110 * doc/bison.texinfo (Conditions): Document this.
4111 * NEWS: likewise. Upgrade version to 2.2.
4112
6e2d1146
AD
41132006-04-27 Akim Demaille <akim@lrde.epita.fr>
4114
4115 * data/glr.cc: Remove dead code.
4116
47671055
PE
41172006-04-25 Paul Eggert <eggert@cs.ucla.edu>
4118
4119 * bootstrap: Comment out the AM_CPPFLAGS line, since we don't use
4120 that variable and the line breaks the bootstrap. Problem reported
4121 by Juan M. Guerrero.
4122
ed2e6384
AD
41232006-04-24 Akim Demaille <akim@lrde.epita.fr>
4124
4125 * doc/bison.texinfo (Multiple start-symbols): New.
4126
3cedc2dc
AD
41272006-04-24 Akim Demaille <akim@lrde.epita.fr>
4128
4129 * etc/README, etc/bench.pl: New.
4130
b2ddc3f3
AD
41312006-04-03 Akim Demaille <akim@lrde.epita.fr>
4132
4133 * src/scan-gram.l: Be robust to BRACED_CODE appearing before any
4134 rule.
4135 Reported by Mickael Labau.
4136 * tests/input.at (Torturing the Scanner): Test it.
4137
91e3ac9a
PE
41382006-03-16 Paul Eggert <eggert@cs.ucla.edu>
4139
4140 * doc/bison.texinfo (Decl Summary): Don't mention yylloc twice.
4141 Problem reported by Bob Rossi.
4142
41432006-03-13 Paul Eggert <eggert@cs.ucla.edu>
4144
4145 * doc/bison.texinfo: Remove @shorttitlepage stuff; it wasn't used
4146 and didn't really work.
4147 For the index, use @ifnotinfo, not @iftex.
4148 Minor cleanups of spacing and terminology.
4149
5cf61e93
AD
41502006-03-12 Akim Demaille <akim@lrde.epita.fr>
4151
4152 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Fix the definition
4153 of AT_NAME_PREFIX when %name-prefix is not used.
4154
aa08666d
AD
41552006-03-12 Akim Demaille <akim@lrde.epita.fr>
4156
4157 Apply --prefix to C++ skeletons too: they change the namespace.
4158 The test suite already exercize these cases.
4159 * data/c++.m4 (b4_namespace): New.
4160 * data/lalr1.cc, data/glr.cc, data/location.cc: Use it instead of `yy'.
4161 * data/lalr1.cc (yytnameerr_): Move its definition into the namespace.
4162 * data/yacc.c, data/glr.c: Remove a useless `[]'.
4163 * doc/bison.texinfo: Document it.
4164 (Option Cross Key): Use @multitable in all formats. It looks
4165 nicer, even in TeX outputs.
4166 (Rules): Use the same code whatever the output type is.
4167 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS)
4168 (_AT_BISON_OPTION_POPDEFS): Support AT_NAME_PREFIX.
4169 * tests/calc.at: Use it, instead of hard coding `yy'.
91e3ac9a 4170
45567173
AD
41712006-03-10 Akim Demaille <akim@lrde.epita.fr>
4172
4173 * TODO: Remove dead items.
4174
e9d8f881 41752006-03-10 Akim Demaille <akim@lrde.epita.fr>
55ba27be
AD
4176
4177 * doc/FAQ: Remove, merged into...
4178 * doc/bison.texinfo (FAQ): this.
4179 * doc/Makefile.am (EXTRA_DIST): Adjust.
4180
c095d689
AD
41812006-03-10 Akim Demaille <akim@lrde.epita.fr>
4182
4183 * data/c.m4 (b4_token_enum): Always define the enum of tokens,
4184 even if empty.
4185 * data/lalrl1.cc, data/glr.cc (parser::token_type): New.
4186 * doc/bison.texinfo (Calc++ Scanner): Use it.
4187
6e0f8287
PE
41882006-03-09 Paul Eggert <eggert@cs.ucla.edu>
4189
4190 Fix two nits reported by twlevo, plus one more that I discovered.
4191
4192 * src/assoc.h (assoc_to_string): Give a name to the arg, as
4193 this is the usual Bison style.
4194 * src/location.h (location_print): Likewise.
4195
4196 * src/reader.h (token_name): Likewise.
4197
d6b771c3
PE
41982006-03-08 Paul Eggert <eggert@cs.ucla.edu>
4199
4200 Fix some nits reported by twlevo.
4201 * doc/FAQ: Remove ancient Y2K FAQ, replacing it with "secure"
4202 and "POSIX". Use more-modern syntax for URLs. Mention C++
4203 and ask for Java. Don't hardwire OS version numbers. Add
4204 copyright notice.
4205 * m4/.cvsignore: Add unistd_h.m4, for latest gnulib.
4206 * src/conflicts.c (solved_conflicts_obstack): Now static.
4207
1e137b71
JD
42082006-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
4209
4210 * doc/bison.texinfo (Introduction): Mention GLR and C++ as on the web
4211 page. Say "you can use it" not "you may use it" as on the web page;
4212 we're describing capabilities not granting permission.
4213
73f2e47e
PE
42142006-03-06 Paul Eggert <eggert@cs.ucla.edu>
4215
6d05403d
PE
4216 * data/glr.c (yyresolveLocations): Rename local variables to avoid
4217 shadowing warnings. Use usual patter for iterating through RHS.
4218 * tests/glr-regression.at
4219 (Uninitialized location when reporting ambiguity):
4220 Modify yylex so that it uses its argument, rather than trying
4221 to rely on ARGSUSED (which doesn't work for gcc with warnings).
4222 const char -> char const.
4223
73f2e47e
PE
4224 * tests/Makefile.am ($(srcdir)/package.m4, maintainer-check-valgrind):
4225 Don't use tabs inside commands; it messes up 'ps'.
4226 Problem reported by twlevo.
4227
8710fc41
JD
42282006-03-06 Joel E. Denny <jdenny@ces.clemson.edu>
4229
4230 * tests/glr-regression.at (Uninitialized location when reporting
4231 ambiguity): New test case.
4232 * data/glr.c (yyresolveLocations): New function, which uses
4233 YYLLOC_DEFAULT.
4234 (yyresolveValue): Invoke yyresolveLocations before reporting an
4235 ambiguity.
4236 * doc/bison.texinfo (Default Action for Locations): Note
4237 YYLLOC_DEFAULT's usage for ambiguity locations.
4238 (GLR Semantic Actions): Cross-reference those notes.
4239
ae952af2
JD
42402006-03-04 Joel E. Denny <jdenny@ces.clemson.edu>
4241
4242 * tests/glr-regression.at (Leaked semantic values when reporting
4243 ambiguity): Remove unnecessary union and type declarations.
4244 (Leaked lookahead after nondeterministic parse syntax error): New test
4245 case.
4246 * data/glr.c (yyparse): Check for zero stacks remaining before
4247 attempting to shift the lookahead so that you don't lose it.
4248
35ee866a
JD
42492006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
4250
4251 Avoid memory leaks by not invoking longjmp in yyreportAmbiguity.
4252 * tests/glr-regression.at (Leaked semantic values when reporting
4253 ambiguity): New test case.
4254 * data/glr.c (yyreportAmbiguity): Invoke yyyerror directly and return
4255 yyabort rather than invoking yyFail, which invokes longjmp. Remove the
4256 now unnecessary yystackp parameter.
4257 (yyresolveValue): Return yyreportAmbiguity's result. Now the necessary
4258 destructors can be called.
4259
4260 * tests/glr-regression.at: Don't invoke bison with `-t' unnecessarily
4261 in existing testcases.
4262
520181ab
JD
42632006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
4264
4265 Don't leak semantic values for parent RHS when a user action cuts the
4266 parser, and clean up related code a bit.
4267 * tests/glr-regression.at (Leaked merged semantic value if user action
35ee866a
JD
4268 cuts parse): Rename to...
4269 (Leaked semantic values if user action cuts parse): ... this. Add check
520181ab
JD
4270 for leaked parent RHS values.
4271 * data/glr.c (yydestroyGLRState): In debugging output, distinguish
4272 between an unresolved state (non-empty chain of semantic options) and
4273 an incomplete one (signaled by an empty chain).
ae952af2 4274 (yyresolveStates): Document the interface. Move all manipulation of a
520181ab
JD
4275 successfully or unsuccessfully resolved yyGLRState to...
4276 (yyresolveValue): ... here so that yyresolveValue always leaves a
4277 yyGLRState with consistent data and thus is easier to understand.
4278 Remove the yyvalp and yylocp parameters since they are always just
4279 taken from the yys parameter. When reporting a discarded merged value
4280 in debugging output, note that it is incompletely merged. Document the
4281 interface.
4282 (yyresolveAction): If resolving any of the RHS states fails, destroy
4283 them all rather than leaking them. Thus, as long as user actions are
4284 written to clean up the RHS correctly, yyresolveAction always cleans up
4285 the RHS of a semantic option. Document the interface.
4286
18d9185c
PE
42872006-02-27 Paul Eggert <eggert@cs.ucla.edu>
4288
4289 * data/glr.c (yyexpandGLRStack): Catch an off-by-one error that
4290 led to a segmentation fault in GNU Pascal. Problem reported
4291 by Waldek Hebisch.
4292
841a7737
JD
42932006-02-21 Joel E. Denny <jdenny@ces.clemson.edu>
4294
4295 * doc/bison.texinfo (Mid-Rule Actions): Explain how to bury a
4296 mid-rule action inside a nonterminal symbol in order to declare a
4297 destructor for its semantic value.
4298
fc3f467f
PE
42992006-02-16 Paul Eggert <eggert@cs.ucla.edu>
4300
4301 * data/yacc.c [(! defined yyoverflow || YYERROR_VERBOSE) && !
4302 YYSTACK_USE_ALLOCA && ! defined YYSTACK_ALLOC && defined
4303 __cplusplus && ! defined _STDLIB_H && !
4304 ((defined YYMALLOC || defined malloc) && (defined YYFREE ||
4305 defined free))]: Include <stdlib.h> rather than rolling our own
4306 declarations of malloc and free, to avoid problems with
4307 incompatible declarations (using 'throw') C++'s stdlib.h. This
4308 should fix Debian bug 340012
4309 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=340012>,
4310 reported by Guillaume Melquiond.
4311
a3af26dd
PE
43122006-02-13 Paul Eggert <eggert@cs.ucla.edu>
4313
4d7bc38c
PE
4314 * NEWS: Clarify symbols versus types in unused-value warnings.
4315
a3af26dd
PE
4316 * configure.ac (AC_INIT): Bump version number.
4317
4e26c69e
PE
43182006-02-13 Paul Eggert <eggert@cs.ucla.edu>
4319
4320 * NEWS: Version 2.1a.
4321 * tests/headers.at (AT_TEST_CPP_GUARD_H): Declare yyerror and yylex,
4322 since C99 requires this.
4323
498e897c
PE
43242006-02-11 Paul Eggert <eggert@cs.ucla.edu>
4325
4326 * m4/c-working.m4: New file.
4327 * configure.ac (BISON_TEST_FOR_WORKING_C_COMPILER): Use it.
4328
57bb17ca
PE
43292006-02-10 Paul Eggert <eggert@cs.ucla.edu>
4330
4331 * Makefile.maint: Merge from coreutils.
4332
0be105dc
PE
43332006-02-09 Paul Eggert <eggert@cs.ucla.edu>
4334
4335 More portability fixes for problems summarized by Nelson H. F. Beebe.
4336
4337 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Catch a
4338 configuration screwup "./configure CC=/opt/SUNWspro/bin/c89
4339 CFLAGS="-xarch=generic64" CXX=/opt/SUNWspro/bin/CC
4340 LDFLAGS="-xarch=generic64" with Sun C 5.7 on Solaris 10; this
4341 messes up because C++ code is compiled in 32-bit mode but linked
4342 in 64-bit mode.
4343
6fc0c024
PE
43442006-02-08 Paul Eggert <eggert@cs.ucla.edu>
4345
4346 More portability fixes for problems summarized by Nelson H. F. Beebe.
4347
7870f699
PE
4348 * doc/bison.texinfo (Calc++ Scanner): Work around a bug in flex
4349 2.5.31. This resembles the 2005-10-10 patch to src/scan-skel.l.
4350
6fc0c024
PE
4351 * examples/calc++/Makefile.am (check_PROGRAMS): Renamed from
4352 nodist_PROGRAMS, since we don't need to actually compile the
4353 example if we're just doing a plain 'make'. This avoids bothering
4354 the installer unnecessarily about problems due to weird C++
4355 compilers.
4356
fe6c2fde
PE
43572006-02-06 Paul Eggert <eggert@cs.ucla.edu>
4358
4359 More portability fixes for problems summarized by Nelson H. F. Beebe.
4360
4361 * tests/headers.at (AT_TEST_CPP_GUARD_H): Use #include <...> rather
4362 than #include "...", and compile with -I'.'. The old method was
4363 not portable, according to Posix and the C standard, and it does
4364 not work with Sun C 5.7, where previous #line directives affect
4365 the working directory used in later #include "..." directives.
4366
927b425b
JMG
43672006-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
4368
4369 Various DJGGP specific issues in /djgpp
4370
d9735e9e
PE
43712006-02-02 Paul Eggert <eggert@cs.ucla.edu>
4372
4373 More portability fixes for problems summarized by Nelson H. F. Beebe.
4374
4375 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check that
4376 '#include <map>' works and that you can apply ++ to iterators.
4377
5a6755af
PE
43782006-02-01 Paul Eggert <eggert@cs.ucla.edu>
4379
67a0dc4f
PE
4380 Work around portability problems summarized by Nelson H. F. Beebe in
4381 <http://lists.gnu.org/archive/html/bug-bison/2005-09/msg00021.html>.
4382
8c86f0ef
PE
4383 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
4384 that '#include <string>' works.
4385
de35dd59
PE
4386 * data/lalr1.cc (yytranslate_): No longer inline, to work around a
4387 porting problem to g++ 3.4.3 on Darwin 7.9.0, where g++ complained
4388 "warning: sorry: semantics of inline function static data `const
4389 unsigned char translate_table[262]' are wrong (you'll wind up with
4390 multiple copies)".
4391
67a0dc4f
PE
4392 * lib/bbitset.h (struct bitset_vtable): Rename members not, and,
4393 or, xor to not_, and_, or_, and xor_, respectively. This works
4394 around a bug in GCC 3.4.3 on Irix 6.5, which apparently has a
4395 random system header somewhere that includes the equivalent of
4396 <iso646.h>.
4397
5a6755af
PE
4398 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that "$CC
4399 -E" works; it apparently doesn't work with PathScale EKO Compiler
67a0dc4f 4400 Suite Version 2.0.
5a6755af 4401
3f001415
JD
44022006-01-30 Joel E. Denny <jdenny@ces.clemson.edu>
4403
4404 During deterministic GLR operation, user actions should be able to
4405 influence the parse by changing yychar. To make this easier to fix and
4406 to make glr.c easier to evolve in general, don't maintain yytoken in
4407 parallel with yychar; just compute yytoken when needed.
4408 * tests/glr-regression.at (Incorrect lookahead during deterministic
4409 GLR): Check that setting yychar in a user action has the intended
4410 effect.
4411 * data/glr.c (yyGLRStack): Remove yytokenp member.
4412 (yyclearin): Don't set *yytokenp.
4413 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Examine
4414 yychar rather than *yytokenp to determine the current lookahead.
4415 Compute yytoken locally when needed.
4416 (yyparse): Likewise. Remove the local yytoken that yytokenp used to
4417 point to.
4418
4419 * doc/bison.texinfo (Bison Options): Remove stray sentence fragment
4420 after `--report' documentation.
4421
e2a8c0f5
PE
44222006-01-30 Paul Eggert <eggert@cs.ucla.edu>
4423
4424 * src/parse-gram.y (grammar_declaration): Location of printer
4425 symbol is @1, not list->location. Bug reported by twlevo.
4426 * tests/input.at (Incompatible Aliases): Adjust to above change.
4427
6b702268
PE
44282006-01-29 Paul Eggert <eggert@cs.ucla.edu>
4429
27622431
PE
4430 * tests/input.at (AT_CHECK_UNUSED_VALUES): Remove. Instead, do
4431 all the test at once. This makes the output easier to read in the
4432 normal case.
4433
6b702268
PE
4434 Fix a longstanding bug uncovered by bro-0.9a9/src/parse.y, which I
4435 got from <http://bro-ids.org/download.html>. The bug is that
4436 when two actions appeared in succession, the second one was
4437 scanned before the first one was added to the grammar rule
4438 as a midrule action. Bison then output the incorrect warning
4439 "parse.y:905.17-906.36: warning: unused value: $3".
4440 * src/parse-gram.y (BRACED_CODE, action): These are no longer
4441 associated with a value.
4442 (rhs): Don't invoke grammar_current_rule_action_append.
4443 (action): Invoke it here instead.
4444 * src/reader.c (grammar_midrule_action): Now extern.
4445 (grammar_current_rule_action_append): Don't invoke
4446 grammar_midrule_action; that is now the scanner's job.
4447 * src/reader.h (last_string, last_braced_code_loc):
4448 (grammar_midrule_action): New decls.
4449 * src/scan-gram.l (last_string): Now extern, sigh.
4450 (last_braced_code_loc): New extern variable.
4451 (<INITIAL>"{"): Invoke grammar_midrule_action if the current
4452 rule already has an action.
4453 (<SC_BRACED_CODE>"}"): Set last_braced_code_loc before returning.
4454 * tests/input.at (AT_CHECK_UNUSED_VALUES):
4455 Add some tests to check that the above changes fixed the bug.
4456
d40ba6c2
PE
44572006-01-27 Paul Eggert <eggert@cs.ucla.edu>
4458
4459 * src/reader.c (symbol_should_be_used): Renamed from symbol_typed_p.
4460 All used changed. Check whether the symbol has a destructor,
4461 not whether it is typed.
4462 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add a destructor, so
4463 that the values are still reported as unused. All line numbers
4464 adjusted.
4465
401aace6
PE
44662006-01-23 Paul Eggert <eggert@cs.ucla.edu>
4467
4468 Work around a bug in bro 0.8, which underparenthesizes its
4469 definition of YYLLOC_DEFAULT.
4470 * data/glr.c: Change all uses of YYLLOC_DEFAULT to parenthesize
4471 their arguments.
4472 * data/lalr1.cc: Likewise.
4473 * data/yacc.cc: Likewise.
4474
06f01bc4
PE
44752006-01-22 Paul Eggert <eggert@cs.ucla.edu>
4476
401aace6
PE
4477 Work around a bug in Pike 7.0, and give the Pike folks a
4478 better way to override the usual int widths.
4479 * data/yacc.c (b4_int_type): Use yytype_uint8, etc., so that the
4480 user can override the types.
4481 (short): #undef, to work around a bug in Pike 7.0.
4482 (yytype_uint8, yytype_int8, yytype_uint16, yytype_int16): New types.
4483 (union yyalloc.yyss): Use yytype_int16 rather than short.
4484 All uses changed.
4485 (yysigned_char): Remove.
4486 * src/parse-gram.y (YYTYPE_UINT8, YYTYPE_INT8, YYTYPE_UINT16):
4487 (YYTYPE_INT16): New macros, to test the new facility in yacc.c.
4488 * tests/regression.at (Web2c Actions): Adjust to above changes.
4489
4490 * src/reader.c (check_and_convert_grammar): New function.
4491 (reader): Close the input file even if something went wrong during
4492 parsing. Minor file descriptor leak reported by twlevo.
4493
06f01bc4
PE
4494 * src/assoc.c (assoc_to_string): Use a default: abort (); case
4495 to pacify gcc -Wswitch-default.
4496 * src/scan-gram.l (adjust_location): Use a default: break; case
4497 to pacify gcc -Wswitch-default.
4498 * src/scan-skel.h (skel_get_lineno, skel_get_in, skel_get_out):
4499 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
4500 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
4501 Move these decls to scan-skel.l, since they don't need to be
4502 visible elsewhere.
4503 * src/scan-skel.l: Accept the above decls.
4504 (skel_lex): New decl, to pacify GCC when unpatched flex 2.5.31
4505 is used.
4506
02650b7f
PE
45072006-01-21 Paul Eggert <eggert@cs.ucla.edu>
4508
4509 * Makefile.cfg (local-checks-to-skip): Add changelog-check,
4510 since we don't want to insist on a version number at the start
4511 of the changelog every time.
4512 * Makefile.maint: Sync from coreutils a bit better.
4513 (sc_trailing_blank): Renamed from sc_trailing_space.
4514 All uses changed.
4515 (sc_no_if_have_config_h, sc_require_config_h):
4516 (sc_prohibit_assert_without_use): New rules.
4517 (sc_obsolete_symbols): Don't catch Makefile.maint itself.
4518 (sc_dd_max_sym_length): Fix leading spaces in rule.
4519 (sc_system_h_headers): Prefix with @.
4520 (sc_useless_cpp_parens, m4-check): Output line numbers.
4521 (changelog-check): Allow version only in head.
4522 * data/c.m4: Use "defined FOO" instead of "defined (FOO)", to
4523 satisfy new Makefile.maint rule.
4524 * data/glr.c: Likewise.
4525 * data/glr.cc: Likewise.
4526 * data/lalr1.cc: Likewise.
4527 * data/yacc.c: Likewise.
4528 * lib/ebitsetv.c: Likewise.
4529 * lib/lbitset.c: Likewise.
4530 * lib/subpipe.c: Likewise.
4531 * lib/timevar.c: Likewise.
4532 * src/system.h: Likewise.
4533 * data/yacc.c (YYSTYPE): Don't generate trailing spaces in output.
4534 * djgpp/Makefile.maint: Add copyright notice.
4535 * djgpp/README.in: Likewise.
4536 * djgpp/config.bat: Likewise.
4537 * djgpp/config.site: Likewise.
4538 * djgpp/config_h.sed: Likewise.
4539 * djgpp/djunpack.bat: Likewise.
4540 * djgpp/config.sed: Fix copyright notice to match standard format.
4541 * djgpp/subpipe.h: Likewise.
4542 * lib/bitsetv-print.c: Likewise.
4543 * lib/bitsetv.c: Likewise.
4544 * lib/subpipe.h: Likewise.
4545 * lib/timevar.c: Likewise.
4546 * lib/timevar.h: Likewise.
4547 * djgpp/subpipe.c: Use standard recipe for config.h.
4548 * lib/abitset.c: Likewise.
4549 * lib/bitset.c: Likewise.
4550 * lib/bitset_stats.c: Likewise.
4551 * lib/bitsetv-print.c: Likewise.
4552 * lib/bitsetv.c: Likewise.
4553 * lib/ebitsetv.c: Likewise.
4554 * lib/get-errno.c: Likewise.
4555 * lib/lbitset.c: Likewise.
4556 * lib/subpipe.c: Likewise.
4557 * lib/timevar.c: Likewise.
4558 * lib/vbitset.c: Likewise.
4559 * tests/local.at: Likewise.
4560 * src/scan-gram.l: Don't include verify.h, since system.h does
4561 that for us.
4562 * .x-sc_require_config_h: New file.
4563 * .x-sc_unmarked_diagnostics: New file.
4564
287c78f6
PE
45652006-01-20 Paul Eggert <eggert@cs.ucla.edu>
4566
287c78f6
PE
4567 Be a bit more systematic about using 'abort'.
4568 * lib/abitset.c (abitset_test): Remove ATTRIBUTE_UNUSED; not needed.
4569 * lib/bitset.c (bitset_bytes, bitset_init, bitset_op4_cmp):
4570 Put 'default: abort ();' before some other case, to satisfy older
4571 pedantic compilers.
4572 * lib/bitset_stats.c (bitset_stats_init): Likewise.
4573 * lib/ebitset.c (ebitset_elt_find, ebitset_op3_cmp): Likewise.
4574 * lib/lbitset.c (lbitset_elt_find, lbitset_op3_cmp): Likewise.
4575 * src/conflicts.c (resolve_sr_conflict): Likewise.
68cae94e
PE
4576 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str):
4577 (get_decision_str, get_orientation_str, get_node_alignment_str):
4578 (get_arrow_mode_str, get_crossing_type_str, get_view_str):
4579 (get_linestyle_str, get_arrowstyle_str): Likewise.
4580 * src/conflicts.c (resolve_sr_conflict):
4581 Use a default case rather than one for the one remaining enum
4582 value, to catch invalid enum values as well.
4583 * src/lalr.c (set_goto_map, map_goto):
4584 Prefer "assert (FOO);" to "if (!FOO) abort ();".
4585 * src/nullable.c (nullable_compute, token_definitions_output):
4586 Likewise.
4587 * src/reader.c (packgram, reader): Likewise.
4588 * src/state.c (transitions_to, state_new, state_reduction_find):
4589 Likewise.
4590 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias):
4591 (symbol_pack): Likewise.
4592 * src/tables.c (conflict_row, pack_vector): Likewise.
287c78f6
PE
4593 * src/scan-skel.l (QPUTS): Remove unnecessary parens.
4594 (BASE_QPUTS, "@output ".*\n): Remove unnecessary asserts.
68cae94e
PE
4595 * src/system.h: Don't include <assert.h>.
4596 (assert): New macro.
4597
4598 * doc/bison.texinfo (Prologue, Rules, Actions, Union Decl, Action Decl):
4599 (Destructor Decl, Parser Function, Pure Calling):
4600 Describe rules for braces inside C code more carefully.
287c78f6 4601
c66dfadd
PE
46022006-01-19 Paul Eggert <eggert@cs.ucla.edu>
4603
c21493b8
PE
4604 Fix some porting glitches found by Nelson H. F. Beebe.
4605 * lib/abitset.c (abitset_resize): Rewrite to avoid warnings from
4606 compilers that don't understand that abort () does not return.
4607 * src/state.c (transitions_to): Likewise.
4608 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
4609 that '#include <cstdlib>' works.
4610 * src/system.h (INT8_MIN, INT16_MIN, INT32_MIN, INT8_MAX):
4611 (INT16_MAX, UINT8_MAX, INT32_MAX, UINT16_MAX, UINT32_MAX):
4612 #undef if ! defined __STDC_VERSION__ || __STDC_VERSION__ < 199901,
4613 for the benefit of some pre-C99 compilers.
4614
b6e3facf
PE
4615 * bootstrap: Undo changes to gnulib files that autoreconf made.
4616
c66dfadd
PE
4617 Minor fixups to get 'make maintainer-check' to work.
4618 * configure.ac: Don't use -Wnested-externs, as it's incompatible
4619 with the new verify.h implementation.
4620 * data/c.m4 (b4_yy_symbol_print_generate): YYUSE (yyoutput).
4621 * data/glr.c (YYUSE): Depend on __GNUC__ as well.
4622 * data/yacc.c (YYUSE): Likewise.
4623 * data/lalr1.cc (yysyntax_error_): YYUSE (yystate).
4624 * lib/subpipe.c (end_of_output_subpipe): The args are unused.
4625 * src/parse-gram.y (declaration): Don't pass a string constant
4626 to a function that expects char *, since GCC might complain
4627 about the constant value.
4628 * src/reader.c (symbol_typed_p): Add parens to pacify GCC.
4629 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): #undef yylloc and yylval
4630 before #defining them.
4631 * tests/glr-regression.at
4632 (Incorrectly initialized location for empty right-hand side in GLR):
4633 In yyerror, use the msg arg.
4634 (Corrupted semantic options if user action cuts parse):
4635 (Incorrect lookahead during deterministic GLR):
4636 (Incorrect lookahead during nondeterministic GLR):
4637 Don't name a local var 'index'; it shadows string.h's 'index'.
4638
ed94ef2a
AD
46392006-01-19 Akim Demaille <akim@epita.fr>
4640
4641 * tests/calc.at (_AT_DATA_CALC_Y): Initialize the whole initial
4642 location, not just parts of it.
4643
e9ad4aec
PE
46442006-01-18 Paul Eggert <eggert@cs.ucla.edu>
4645
d6ca7905
PE
4646 * NEWS: Document the fact that multiple %unions are now allowed.
4647 * doc/bison.texinfo (Union Decl): Likewise.
51cbef6f
PE
4648 * TODO: This feature is now implemented, so remove it from
4649 the wishlist.
d6ca7905 4650
ef1b70e0
PE
4651 * Makefile.maint: Merge with coreutils Makefile.maint.
4652 (CVS_LIST): Use build-aux version if available.
4653 (VERSION_REGEXP): New macro.
4654 (syntax-check-rules): Add sc_no_if_have_config_h,
4655 sc_prohibit_assert_without_use, sc_require_config_h,
4656 sc_useless_cpp_parens.
4657 (sc_obsolete_symbols): Check for O_NDELAY.
4658 (sc_dd_max_sym_length): Track coreutils.
4659 (sc_unmarked_diagnostics): Look in all files, not just *.c.
4660 (sc_useless_cpp_parens): New rule.
4661 (news-date-check): Look for version or today's date.
4662 (changelog-check): Don't require version number near head.
4663 (copyright-check): Use current year instead of hardwiring 2005.
4664 (my-distcheck): Depend on $(release_archive_dir)/$(prev-tgz).
4665 (announcement): Add --gpg-key-ID.
4666
4667 * djgpp/config.sed: Add copyright notice, and replace "filesystem"
4668 with "file system".
4669
2073ce56 4670 Avoid undefined behavior that addressed just before the start of an
e9ad4aec
PE
4671 array. Problem reported by twlevo.
4672 * src/reader.c (packgram): Prepend a new sentinel before ritem.
4673 * src/lalr.c (build_relations): Rely on new sentinel.
4674 * src/gram.c (gram_free): Adjust to new sentinel.
4675
b7691f15
JD
46762006-01-12 Joel E. Denny <jdenny@ces.clemson.edu>
4677
4678 * data/glr.c (yyGLRStateSet): Rename yylookaheadStatuses to
4679 yylookaheadNeeds. All uses updated.
4680 (yysplitStack): Rename local yynewLookaheadStatuses to
4681 yynewLookaheadNeeds.
4682 * data/glr-regression.at (Incorrect lookahead during nondeterministic
4683 GLR): In comments, change `lookahead status' to `lookahead need'.
4684
ddee1b06
PH
46852006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
4686
4687 * data/glr.c (yysplitStack): A little stylistic rewrite.
4688
12f4614d
PH
46892006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
4690
4691 * data/glr.c (yyaddDeferredAction): Flesh out the comment.
4692
32c29292
JD
46932006-01-11 Joel E. Denny <jdenny@ces.clemson.edu>
4694
4695 * doc/bison.texinfo: Fix some typos.
4696 (GLR Semantic Actions): New subsection discussing special
4697 considerations because GLR semantic actions might be deferred.
4698 (Actions): Mention look-ahead usage of yylval.
4699 (Actions and Locations): Mention look-ahead usage of yylloc.
4700 (Special Features for Use in Actions): Add YYEOF entry and mention it
4701 in the yychar entry.
4702 In the yychar entry, remove mention of the local yychar case (pure
4703 parser) since this is irrelevant information when writing semantic
148d66d8 4704 actions and since it's already discussed in `Table of Symbols' where
32c29292
JD
4705 yychar is otherwise described as an external variable.
4706 In the yychar entry, don't call it the `current' look-ahead since it
4707 isn't when semantic actions are deferred.
4708 In the yychar and yyclearin entries, add note about deferred semantic
4709 actions.
4710 Add yylloc and yylval entries discussing look-ahead usage.
4711 (Look-Ahead Tokens): When discussing yychar, don't call it the
4712 `current' look-ahead, and do mention yylval and yylloc.
4713 (Error Recovery): Cross-reference `Action Features' when mentioning
4714 yyclearin.
148d66d8 4715 (Table of Symbols): In the yychar entry, don't call it the `current'
32c29292
JD
4716 look-ahead.
4717 In the yylloc and yylval entries, mention look-ahead usage.
4718
de366a2f 47192006-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
2781dbd1
JD
4720
4721 * tests/glr-regression.at: Update copyright year to 2006.
4722
bf70fa87
JD
47232006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
4724
4725 * data/glr.c (yyGLRStateSet): Add yybool* yylookaheadStatuses member to
4726 use during nondeterministic operation to track which stacks have
4727 actually needed the current lookahead.
4728 (yyinitStateSet, yyfreeStateSet, yyremoveDeletes, yysplitStack):
4729 Allocate, deallocate, resize, and otherwise shuffle space for
4730 yylookaheadStatuses in parallel with yystates member of yyGLRStateSet.
4731 (yysplitStack, yyprocessOneStack, yyparse): Set lookahead status
4732 appropriately during nondeterministic operation.
4733 (yySemanticOption): Add int yyrawchar, YYSTYPE yyval, and YYLTYPE yyloc
4734 members to store the current lookahead to be used by the deferred
4735 user action.
4736 (yyaddDeferredAction): Add size_t yyk parameter specifying the stack
4737 from which the RHS is taken. Set the lookahead members of the new
4738 yySemanticOption according to the lookahead status for stack yyk.
4739 (yyglrShiftDefer, yyglrReduce): Pass yyk parameter on to
4740 yyaddDeferredAction.
4741 (yyresolveAction): Set yychar, yylval, and yylloc to the lookahead
4742 members of yySemanticOption before invoking yyuserAction, and then set
4743 them back to their current values afterward.
4744 (yyparse): Set yychar = YYEMPTY where yytoken = YYEMPTY.
4745 (yyreportAmbiguity): Add /*ARGSUSED*/ to pacify lint.
4746 * tests/glr-regression.at: Remove `.' from the ends of recent test case
4747 titles for consistency.
4748 (Leaked merged semantic value if user action cuts parse): In order to
4749 suppress lint warnings, use arguments in merge function, and assign
4750 char value < 128 in main.
4751 (Incorrect lookahead during deterministic GLR): New test case.
4752 (Incorrect lookahead during nondeterministic GLR): New test case.
4753
05449a2c
JD
47542006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
4755
de366a2f 4756 * data/c.m4 (b4_yy_symbol_print_generate): In yy_symbol_print, accept
05449a2c
JD
4757 !yyvaluep as signal that no semantic value is available to print.
4758 * data/glr.c (yydestroyGLRState): If state is not resolved, don't try
4759 to print a semantic value.
4760
4158e0a1 47612006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
fd2493f7 4762
4158e0a1
JD
4763 * tests/glr-regression.at: For consistency with my newer test cases,
4764 don't thank myself.
4765
d659304d
JD
47662006-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
4767
4768 * data/glr.c (yyresolveValue): When merging semantic options, if at
4769 least one user action succeeds but a later one cuts the parse, then
4770 destroy the semantic value before returning rather than leaking it.
4771 (yyresolveStates): If a user action cuts the parse and thus
4772 yyresolveValue fails, ignore the (unset) semantic value rather than
4773 corrupting the yyGLRState, and empty the semantic options list since
4774 the user actions should have called all necessary destructors.
4775 Simplify code with YYCHK.
4776 * tests/glr-regression.at (Corrupted semantic options if user action
4777 cuts parse): New test case.
4778 (Undesirable destructors if user action cuts parse): New test case.
4779 Before applying any of this patch, this test case never actually failed
4780 for me... but only because the corrupted semantic options usually
4781 masked this bug.
4782 (Leaked merged semantic value if user action cuts parse): New test
4783 case.
4784
6ec2c0f2
AD
47852006-01-05 Akim Demaille <akim@epita.fr>
4786
4787 * src/reader.c, src/symlist.h, src/symlist.c: s/mid_rule/midrule/.
4788
1b9c21fb
PE
47892006-01-04 Paul Eggert <eggert@cs.ucla.edu>
4790
4791 * data/c.m4 (b4_c_modern): New macro, with a new provision for
4792 _MSC_VER. Problem reported by Cenzato Marco.
4793 (b4_c_function_def): Use it.
4794 * data/yacc.c (YYMODERN_C): Remove. All uses replaced by
4795 b4_c_modern.
4796 (yystrlen, yystpcpy, yyparse): Use b4_c_function... macros rather
4797 than rolling our own.
4798
84866159
AD
47992006-01-04 Akim Demaille <akim@epita.fr>
4800
4801 Also warn about non-used mid-rule values.
4802 * src/symlist.h, src/symlist.c (symbol_list): Add a mid_rule
4803 member.
4804 (symbol_list_new): Adjust.
4805 * src/reader.c (symbol_typed_p): New.
4806 (grammar_rule_check): Use it.
4807 (grammar_midrule_action): Bind a mid-rule LHS to its rule.
4808 Check its rule.
4809 * tests/input.at (AT_CHECK_UNUSED_VALUES): New.
4810 Use it.
4811 * tests/actions.at (Exotic Dollars): Adjust.
4812
378f4bd8
AD
48132006-01-04 Akim Demaille <akim@epita.fr>
4814
4815 * src/reader.c (grammar_midrule_action): If $$ is set in a
4816 mid-rule, move the `used' bit to its lhs.
4817 * tests/input.at (Unused values): New.
4818 * tests/actions.at (Exotic Dollars): Adjust: exp is not typed.
4819
e2a21b6f
PE
48202006-01-03 Paul Eggert <eggert@cs.ucla.edu>
4821
54662697
PE
4822 * doc/bison.texinfo (Bison Options): Say more accurately what
4823 --yacc does.
4824 * src/parse-gram.y (rules_or_grammar_declaration): Don't complain
4825 about declarations in the grammar when in Yacc mode, as POSIX does
4826 not require a diagnostic when the grammar uses extensions.
4827
4828 * src/reduce.c (reduce_grammar): Remove unnecessary cast to bool.
4829
073f9288
PE
4830 Warn about dubious constructions like "%token T T".
4831 Reported by twlevo.
4832 * src/symtab.h (struct symbol.declared): New member.
4833 * src/symtab.c (symbol_new): Initialize it to false.
4834 (symbol_class_set): New arg DECLARING, specifying whether
4835 this is a declaration that we want to warn about, if there
4836 is more than one of them. All uses changed.
4837
1221b78a
PE
4838 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c:
4839 Allow multiple %union directives, whose contents concatenate.
4840 * src/parse-gram.y (grammar_declaration): Likewise.
4841 Use muscle_code_grow, so that we don't need stype_line any more.
4842 All uses changed.
4843
4844 * src/muscle_tab.c (muscle_grow): Fix comment.
4845
e2a21b6f
PE
4846 * ChangeLog, data/c.m4, data/glr.c, data/glr.cc, data/location.cc:
4847 * data/yacc.c, src/getargs.c, src/output.c, tests/cxx-type.at:
4848 Update copyright year to 2006.
4849
8f7e3cf9
AD
48502006-01-03 Akim Demaille <akim@epita.fr>
4851
4852 Have glr.cc pass (some of) the calc.at tests.
4853 * data/glr.cc (b4_parse_param_orig): New.
4854 (b4_parse_param): Improve its definition, and bound it more
4855 clearly in the skeleton.
4856 (b4_epilogue): Append, instead of prepending, in order to keep
4857 #line consistency.
4858 Simplify the generation of auxiliary functions: locations and
4859 purity are mandated.
4860 (b4_global_tokens_and_yystype): Honor it.
4861 * data/location.cc (c++.m4): Don't include it.
4862 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Define AT_GLR_CC_IF
4863 and AT_SKEL_CC_IF.
4864 * tests/calc.at (AT_CHECK_CALC): Rely on AT_SKEL_CC_IF instead of
4865 AT_LALR1_CC_IF.
4866 Be sure to initialize the first position's filename.
4867 (AT_CHECK_CALC_LALR1_CC): Add %location and %defines, they are
4868 mandated anyway.
4869 (AT_CHECK_CALC_GLR_CC): New.
4870 Use it to exercise glr.cc as a lalr1.cc drop-in replacement.
4871
3953ed88
AD
48722006-01-02 Akim Demaille <akim@epita.fr>
4873
4874 * src/output.c (output_skeleton): Don't hard wire the inclusion of
4875 c.m4.
0a96ba81 4876 * data/c++.m4, data/glr.c, data/yacc.c: Include c.m4.
3953ed88
AD
4877 * data/glr.cc: Do not include stack.hh.
4878
9ecafbbf
AD
48792006-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
4880
4881 * data/glr.c: Reformat whitespace with tabs.
4882 (b4_lpure_formals): Remove this unused m4 macro.
4883 * tests/cxx-type.at: Reformat whitespace with tabs.
4884 (_AT_TEST_GLR_CXXTYPES): In union Node, rename node_info to nodeInfo
4885 since it's a member. Rename type to isNterm for clarity.
4886
c4d497a0
AD
48872005-12-29 Akim <akim@sulaco.local>
4888
4889 Let glr.cc catch up with symbol_value_print.
4890 * data/glr.cc (b4_yysymprint_generate): Replace by...
4891 (b4_yy_symbol_print_generate): this.
4892 (yy_symbol_print, yy_symbol_value_print): Declare them.
4893
4517da37
PE
48942005-12-28 Paul Eggert <eggert@cs.ucla.edu>
4895
4896 * src/location.h (boundary): Note that a line or column equal
4897 to INT_MAX indicates an overflow.
4898 * src/scan-gram.l: Include verify.h. Don't include get-errno.h.
4899 (rule_length_overflow, increment_rule_length, add_column_width):
4900 New functions.
4901 (<INITIAL>{id}, <SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'"):
4902 (<SC_BRACED_CODE>"}"):
4903 Use increment_rule_length rather than incrementing it by hand.
4904 (adjust_location, handle_syncline): Diagnose overflow.
4905 (handle_action_dollar, handle_action_at):
4906 Fix bug with monstrosities like $-2147483648.
4907 Remove now-unnecessary checks.
4908 (scan_integer): Verify assumptions and remove now-unnecessary checks.
4909 (convert_ucn_to_byte): Verify assumptions.
4910 (handle_syncline): New arg LOC. All callers changed.
4911 Don't store through a value derived from char const * pointer.
4912
4913 * src/reader.c (grammar_rule_check): Rewrite slightly to avoid
4914 GCC warnings.
4915
e3233bf6
PE
49162005-12-27 Paul Eggert <eggert@cs.ucla.edu>
4917
4918 * src/reader.c (grammar_midrule_action, grammar_symbol_append):
4919 Remove unnecessary forward static decls.
4920
8f3596a6
AD
49212005-12-27 Akim Demaille <akim@epita.fr>
4922
4923 * src/reader.c (grammar_current_rule_check): Also check that $$
4924 is used.
4925 Take the rule to check as argument, hence rename as...
4926 (grammar_rule_check): this.
4927 * src/reader.h, src/reader.c (grammar_rule_begin, grammar_rule_end):
4928 Rename as...
4929 (grammar_rule_begin, grammar_rule_end): these, for consistency.
4930 (grammar_midrule_action, grammar_symbol_append): Now static.
4931 * tests/torture.at (input): Don't rely on the default action
4932 being always performed.
4933 * tests/calc.at: "Set" $$ even when the action is "cut" with
4934 YYERROR or other.
4935 * tests/actions.at (Exotic Dollars): Instead of using unused
4936 values, check that the warning is issued.
4937
721be13c
PE
49382005-12-22 Paul Eggert <eggert@cs.ucla.edu>
4939
4940 * NEWS: Improve wording for unused-value warnings.
4941
a0af42fc
AD
49422005-12-22 Akim Demaille <akim@epita.fr>
4943
4944 * data/lalr1.cc, data/yacc.c, data/glr.c, data/c.m4
4945 (b4_yysymprint_generate): Rename as...
4946 (b4_yy_symbol_print_generate): this.
4947 Generate yy_symbol_print instead of yysymprint.
4948 Generate also yy_symbol_value_print, and use it.
4949
affac613
AD
49502005-12-22 Akim Demaille <akim@epita.fr>
4951
721be13c 4952 * NEWS: Warn about unused values.
affac613
AD
4953 * src/symlist.h, src/symlist.c (symbol_list, symbol_list_new): Add
4954 a `used' member.
4955 (symbol_list_n_get, symbol_list_n_used_set): New.
4956 (symbol_list_n_type_name_get): Use symbol_list_n_get.
4957 * src/scan-gram.l (handle_action_dollar): Flag used symbols.
4958 * src/reader.c (grammar_current_rule_check): Check that values are
4959 used.
4960 * src/symtab.c (symbol_print): Accept 0.
4961 * tests/existing.at: Remove the type information.
4962 Empty the actions.
4963 Remove useless actions (beware of mid-rule actions: perl -000
4964 -pi -e 's/\s*\{\}(?=[\n\s]*[|;])//g').
4965 * tests/actions.at (Exotic Dollars): Use unused values.
4966 * tests/calc.at: Likewise.
4967 * tests/glr-regression.at (No users destructors if stack 0 deleted):
4968 Likewise.
4969
4970 * src/gram.c (rule_useful_p, rule_never_reduced_p): Use
4971 rule_useful_p.
4972
9d9b8b70
PE
49732005-12-21 Paul Eggert <eggert@cs.ucla.edu>
4974
8bb4c753
PE
4975 Undo 2005-12-01 tentative license wording change. The wording is
4976 still being reviewed by the lawyers, and we don't want to wait for
4977 them before publishing a test release. For now, revert to the
4978 previous wording.
4979 * NEWS: Undo 2005-12-01 change.
4980 * data/glr.c: Revert to previous license wording.
4981 * data/glr.cc: Likewise.
4982 * data/lalr1.cc: Likewise.
4983 * data/location.cc: Likewise.
4984 * data/yacc.c: Likewise.
4985
9d9b8b70
PE
4986 * NEWS: Reword %destructor vs YYABORT etc.
4987 * data/glr.c: Use American spacing, for consistency.
4988 * data/glr.cc: Likewise.
4989 * data/lalr1.cc: Likewise.
4990 * data/yacc.c: Likewise.
4991 * data/yacc.c: Reformat comments slightly.
4992 * doc/bison.texinfo: Replace "non-" with "non" when that makes sense,
4993 for consistency. Fix some spelling errors and reword recently-included
4994 text slightly.
4995 * tests/cxx-type.at: Cast results of malloc, for C++.
4996
2c3b392a
AD
49972005-12-21 Joel E. Denny <address@hidden>
4998
4999 * tests/cxx-type.at: Construct a tree, count the parents of shared
5000 nodes, and free each node once and only once. Previously, the memory
5001 for semantic values was leaked instead.
5002
d6cff4dc
AD
50032005-12-21 Joel E. Denny <address@hidden>
5004
5005 * data/glr.c (struct yyGLRStack): If pure, add yyval and yyloc members.
5006 (yylval, yylloc): If pure, #define to yystackp->yyval and
5007 yystackp->yyloc similar to yychar and yynerrs.
5008 (yyparse): If pure, remove local yylval and yylloc. Add local
5009 yystackp to accommodate pure definitions of yylval and yylloc.
5010 (b4_lex_param, b4_lyyerror_args, b4_lpure_args): If pure, change
5011 yylvalp and yyllocp to &yylval and &yylloc.
5012 (nerrs, char, lval, lloc): If pure, add #define's for b4_prefix[]
5013 namespace. Previously, nerrs and char were missing, but lval and lloc
5014 weren't necessary.
5015 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Remove
5016 yylvalp and yyllocp parameters since, if pure, these are now always
5017 accessible through yystackp. If not pure, they are still accessible
5018 globally.
5019 * data/glr.c, data/yacc.c (YYLLOC_DEFAULT): Change `if (N)' to
5020 `if (YYID (N))' to pacify lint.
5021
a85284cf
AD
50222005-12-21 Akim Demaille <akim@epita.fr>
5023
5024 YYACCEPT, YYERROR, and YYABORT, as user actions, should not
5025 destroy the RHS symbols of a rule.
5026 * data/yacc.c (yylen): Initialize to 0.
5027 Keep its value to the number of items to possibly shift.
5028 In particular, a regular successful parse that ends on YYFINAL by
5029 a (internal) YYACCEPT must not have yylen != 0.
5030 (yyerrorlab, yyreturn): Pop the RHS.
5031 Reorder a bit to emphasize the `shifting' bits of code.
5032 (YYPOPSTACK): Now accept a number of items to pop.
5033 * data/lalr1.cc: Likewise.
5034 * data/glr.c: Formatting changes.
5035 Use goto instead of fall through.
5036 * doc/bison.texinfo (Destructor Decl): Complete.
5037
d508c281
JMG
50382005-12-20 Juan Manuel Guerrero <juan.guerrero@gmx.de>
5039
5040 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
5041 * djgpp/Makefile.maint: Fix PACKAGE variable computation.
5042 * djgpp/config.bat: Replace every occurence of the file name
5043 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
5044 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
5045 * djgpp/config.sed: Replace every occurence of the file name
5046 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
5047 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
5048 * djgpp/djunpack.bat: DJGPP specific file.
5049 * djgpp/fnchange.lst: DJGPP specific file.
5050 * djgpp/README.in: Add new information about how to unpack the bison
5051 source on MSDOS and other systems which have 8.3 file name restrictions
5052 using djunpack.bat and fnchange.lst.
5053
3e7a2cd9
PE
50542005-12-12 Paul Eggert <eggert@cs.ucla.edu>
5055
5056 * bootstrap (build_cvs_prefix): Remove; unused.
5057 (CVS_PREFIX): Adjust to yesterday's Savannah reorganization
5058 when getting gnulib.
5059
50602005-12-12 "Joel E. Denny" <jdenny@ces.clemson.edu>
5061
5062 * data/glr.c: Reorder typedef declarations for structs to match order
5063 of struct declarations.
5064 Rename yystack everywhere to yystackp except in yyparse where it's not
5065 a pointer.
5066 (yyglrShift): Change parameter YYSTYPE yysval to YYSTYPE* yyvalp for
5067 consistency.
5068 (yyis_table_ninf): Change 0 to YYID (0) to pacify lint.
5069 (yyreportSyntaxError): Add /*ARGSUSED*/ to pacify lint.
5070 (yyparse): Change while (yytrue) to while ( YYID (yytrue)) to pacify
5071 lint.
5072
877519f8
PE
50732005-12-09 Paul Eggert <eggert@cs.ucla.edu>
5074
0eca5a39
PE
5075 * tests/sets.at (Accept): Fix typos in regular expression used to
5076 sed out the final state number.
5077
2cec9080
PE
5078 Work around portability problem on Solaris 10: flex-generated
5079 files include <stdio.h> before <config.h>, which messes up
5080 because the latter defines __EXTENSIONS__. Address the problem
5081 by creating two new little files that include <config.h> first,
5082 then include the flex-generated files. Rewrite everyone else
5083 to include <config.h> first, as well.
5084 * lib/timevar.c: Always include "config.h".
5085 * src/Makefile.am (bison_SOURCES): Replace scan-gram.l with
5086 scan-gram-c.c, and scan-skel.l with scan-skel-c.c.
5087 (EXTRA_bison_SOURCES): New macro.
5088 * src/scan-gram-c.c, src/scan-skel-c.c: New files.
5089 * src/system.h: Don't include config.h.
5090 * src/LR0.c: Include <config.h> first.
5091 * src/assoc.c: Likewise.
5092 * src/closure.c: Likewise.
5093 * src/complain.c: Likewise.
5094 * src/conflicts.c: Likewise.
5095 * src/derives.c: Likewise.
5096 * src/files.c: Likewise.
5097 * src/getargs.c: Likewise.
5098 * src/gram.c: Likewise.
5099 * src/lalr.c: Likewise.
5100 * src/location.c: Likewise.
5101 * src/main.c: Likewise.
5102 * src/muscle_tab.c: Likewise.
5103 * src/nullable.c: Likewise.
5104 * src/output.c: Likewise.
5105 * src/parse-gram.y: Likewise.
5106 * src/print.c: Likewise.
5107 * src/print_graph.c: Likewise.
5108 * src/reader.c: Likewise.
5109 * src/reduce.c: Likewise.
5110 * src/relation.c: Likewise.
5111 * src/state.c: Likewise.
5112 * src/symlist.c: Likewise.
5113 * src/symtab.c: Likewise.
5114 * src/tables.c: Likewise.
5115 * src/uniqstr.c: Likewise.
5116 * src/vcg.c: Likewise.
5117
877519f8
PE
5118 * src/parse-gram.y: Fix minor problems uncovered by lint.
5119 (current_lhs, current_lhs_location): Now static.
5120 (current_assoc): Remove unused variable.
5121
5122 Cleanups so that Bison-generated parsers have less lint.
5123 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate):
5124 Prepend /*ARGSUSED*/, for lint's sake.
5125 * data/glr.c (YYUSE): Properly parenthesize, and use an alternate
5126 definition if 'lint' is defined.
5127 (YYID): New macro (or function, if lint).
5128 All uses of /*CONSTCOND*/0 replaced by YYID(0).
5129 * data/yacc.c: Likewise.
5130 * data/glr.c (yyuserAction, yyuserMerge, yy_reduce_print):
5131 (yyrecoverSyntaxError): Prepend /*ARGSUSED*/.
5132 * data/glr.cc (YYLLOC_DEFAULT): Omit /*CONSTCOND*/ since this code
5133 is C++ only.
5134 * data/lalr1.cc (YYUSE): Just use a cast, since this code is C++ only.
5135 * data/yacc.c (YYSTACK_FREE) [defined YYSTACK_ALLOC]:
5136 Use YYID(0) rather than 0, for lint.
5137 (yystrlen): Rewrite to avoid lint warning about ptrdiff_t overflow.
5138 (yysyntax_error): Rewrite to avoid lint warnings about parenthesization.
5139
f5228370
PE
51402005-12-07 Paul Eggert <eggert@cs.ucla.edu>
5141
5142 * tests/glr-regression.at
5143 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
5144 Close memory leak reported by twlevo.
5145
69ce078b
PE
51462005-12-06 "Joel E. Denny" <jdenny@ces.clemson.edu>
5147
6ff99711
PE
5148 * data/glr.c (yyprocessOneStack, yyparse): Synchronize the shift for
5149 all stacks.
5150 (yyparse): Iterate another stack in order to call user destructors.
69ce078b
PE
5151 * tests/glr-regression.at (No users destructors if stack 0 deleted):
5152 New test case.
5153 (Duplicated user destructor for lookahead): This test now is expected
5154 to succeed.
5155
af3412cd
PE
51562005-12-01 Paul Eggert <eggert@cs.ucla.edu>
5157
32b5b719 5158 * NEWS: Document the following change.
af3412cd
PE
5159 * data/yacc.c: Say "parser skeleton" rather than "file", since
5160 it's no longer just a file.
5161 * data/glr.c: Grant a special exception for C GLR parsers, that
5162 reads like the already-existing exception for C LALR(1) parsers.
5163 * data/glr.cc: Likewise.
5164 * data/lalr1.cc: Likewise.
5165 * data/location.cc: Likewise.
5166 * data/yacc.c: Reword the "written by" statement to clarify that
5167 it was the parser skeleton, not the entire output file.
5168 * data/glr.c: Written by Paul Hilfinger.
5169 * data/glr.cc: Written by Akim Demaille.
5170 * data/lalr1.cc: Likewise.
5171
035aa4a0
PE
51722005-11-18 Paul Eggert <eggert@cs.ucla.edu>
5173
d9963c85
PE
5174 * data/yacc.c (yy_reduce_print, YY_REDUCE_PRINT):
5175 Fix typos in previous change that broke 'make check'.
5176 YY_REDUCE_PRINT cannot be a pseudo-varargs macro; that isn't
5177 supported in C.
5178 * tests/calc.at (_AT_CHECK_CALC,_AT_CHECK_CALC_ERROR):
5179 Don't check NUM-STDERR-LINES, since the output format is fluctuating.
5180 We can revert this once things settle down.
5181
035aa4a0
PE
5182 * src/conflicts.c (conflicts_print): Don't print file name twice
5183 when %expect fails because there were no conflicts.
5184 * doc/bison.texinfo (Expect Decl): Tighten up wording in previous
5185 change.
5186 * tests/conflicts.at (%expect not enough, %expect too much):
5187 (%expect with reduce conflicts): Adjust to new behavior.
5188
51892005-11-18 Akim Demaille <akim@epita.fr>
5190
5191 * src/conflicts.c (conflicts_print): Unsatisfied %expectation are
5192 errors.
5193 * NEWS: Document this.
5194 * doc/bison.texinfo (Expect Decl): Likewise.
5195
d1ff7a7c
AD
51962005-11-16 Akim Demaille <akim@epita.fr>
5197
5198 Generalize the display of semantic values and locations in traces.
5199 * data/glr.c (yy_reduce_print): Fix indices (again).
5200 * data/c++.m4 (b4_rhs_value, b4_rhs_location): Don't expect
5201 literal integers.
5202 * data/lalr1.cc (yyreduce_print): Rename as...
5203 (yy_reduce_print): this.
5204 Display values and locations.
5205 * data/yacc.c (yy_reduce_print): Likewise.
5206 (YY_REDUCE_PRINT): Adjust to pass the required arguments.
5207 (yysymprint): Move higher to be visible from yy_reduce_print).
5208 (yyparse): Adjust.
5209 * tests/calc.at: Adjust the expected length of the traces.
5210
6de5398d
AD
52112005-11-14 Akim Demaille <akim@epita.fr>
5212
5213 * data/glr.c (yy_reduce_print): The loop was quite wrong: type are
5214 from 1 to N, while values and location start at 0.
5215 (b4_rhs_location, b4_rhs_value): Add parens around $1 and $2.
5216
a1373f55
AD
52172005-11-14 Akim Demaille <akim@epita.fr>
5218
5219 * data/glr.c (yy_reduce_print): Fix the $ number.
5220
613d8952
AD
52212005-11-14 Akim Demaille <akim@epita.fr>
5222
5223 "Use" parse parameters.
5224 * data/c.m4 (b4_parse_param_for, b4_parse_param_use): New.
5225 * data/glr.c, data/glr.cc: Use them.
5226 * data/glr.c (YYUSE): Have a C++ definition that supports
5227 non-pointer types.
5228
b2741627
AD
52292005-11-14 Akim Demaille <akim@epita.fr>
5230
5231 * data/glr.c (yyexpandGLRStack): Declare only if defined.
5232
5059b5c8
AD
52332005-11-14 Akim Demaille <akim@epita.fr>
5234
42249483
AD
5235 * data/glr.cc: New.
5236 * data/m4sugar/m4sugar.m4 (m4_prepend): New.
5059b5c8 5237
4626a15d
AD
52382005-11-12 Akim Demaille <akim@epita.fr>
5239
5240 Let position and location be PODs.
5241 * data/location.cc (position::initialize, location::initialize): New.
5242 (position::position, location::location): Define only if
5243 b4_location_constructors is defined.
5244 * data/lalr1.cc (b4_location_constructors): Define it for backward
5245 compatibility.
5246 * doc/bison.texinfo (Initial Action Decl): Use initialize.
5247
52482005-11-12 Akim Demaille <akim@epita.fr>
98ae9643
AD
5249
5250 * data/lalr1.cc: Move the body of the ctor and dtor into the
5251 parser file (instead of the header).
5252 Wrap the implementations in a "namespace yy".
5253
52542005-11-12 Akim Demaille <akim@epita.fr>
5255
5256 Have glr.c include its header file when created.
5257 * data/glr.c (b4_shared_declarations): New.
5258 Output them verbatim in the parser if !%defines, otherwise
5259 output then in the header file, and include it instead.
5260
1989d947
AD
52612005-11-11 Akim Demaille <akim@epita.fr>
5262
5263 * data/glr.c: Comment changes.
5264
52652005-11-11 Akim Demaille <akim@epita.fr>
62b08cfc
AD
5266
5267 When yydebug, report semantic and location values for reductions.
5268 * data/glr.c (yy_reduce_print): Report the semantic values and the
5269 locations.
5270 (YY_REDUCE_PRINT): Adjust.
5271 (yyglrReduce): Use them.
5272 (b4_rhs_value, b4_rhs_location): Remove m4_eval invocations.
5273 * data/c.m4 (b4_yysymprint_generate): Specify the const arguments.
5274 * tests/calc.at (_AT_CHECK_CALC_ERROR): Remove the reduction
5275 traces.
5276
02998094
AD
52772005-11-10 Akim Demaille <akim@epita.fr>
5278
5279 * data/glr.c (yynewGLRStackItem, YY_RESERVE_GLRSTACK): New.
5280 (yyaddDeferredAction, yyglrShift, yyglrShiftDefer): Use them.
5281 (yyexpandGLRStack, YYRELOC): Define only when YYSTACKEXPANDABLE.
5282
5210672f
PE
52832005-11-09 Albert Chin-A-Young <china@thewrittenword.com>
5284
5285 * m4/cxx.m4, examples/Makefile.am: Don't build
5286 examples/calc++ if no C++ compiler is available. (trivial change)
5287
a8991a1d
AD
52882005-11-09 Akim Demaille <akim@epita.fr>
5289
5290 * src/scan-skel.l: Use a couple of asserts.
5291
36b5e963
AD
52922005-11-03 Akim Demaille <akim@epita.fr>
5293
5294 In some (weird) cases, the final state number is incorrect.
5295 Reported by Alexandre Duret-Lutz.
5296 * src/LR0.c (state_list_append): Remove the computation of
5297 final_state.
5298 (save_reductions): Do it here.
5299 (get_state): Alpha conversion.
5300 (generate_states): Use a for loop.
5301 * src/gram.h (item_number_is_rule_number)
5302 (item_number_is_symbol_number): New.
5303 * src/state.c: Use assert.
5304 * src/system.h: Include assert.h.
5305 * tests/sets.at (Accept): New.
5306
44e7ead1
PH
53072005-10-30 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
5308
5309 * data/glr.c (yyfill): Adjust comment.
36b5e963 5310 (yyresolveAction): Initialize default location properly
44e7ead1
PH
5311 for empty right-hand sides.
5312 (yydoAction): Ditto.
5313 Add comment explaining apparently dead code.
36b5e963
AD
5314 * tests/glr-regression.at
5315 (Incorrectly initialized location for empty right-hand side in GLR):
44e7ead1 5316 New test.
36b5e963 5317
e10a80ee
PE
53182005-10-30 Paul Eggert <eggert@cs.ucla.edu>
5319
5320 * bootstrap (cleanup_gnulib): New function. Use it to clean up
5321 gnulib when interrupted. This fixes some race conditions and
5322 works around some portability problems (one noted by Paul
5323 Hilfinger).
5324
067b32ee
AD
53252005-10-22 Akim <akim@epita.fr>
5326
5327 * Makefile.cfg: Adjust to config -> build-aux.
5328 Reported by twledo.
5329
4b367315
AD
53302005-10-21 Akim Demaille <akim@epita.fr>
5331
5332 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Pass
5333 the %parse-params.
5334 * data/glr.c (YY_SYMBOL_PRINT, yydestroyGLRState): Adjust.
5335 * data/yacc.c (b4_Pure_if): Rename as...
5336 (b4_yacc_pure_if): this.
5337 (YY_SYMBOL_PRINT, yyparse): Adjust.
5338 * doc/bison.texinfo: Formatting changes.
5339
24cc23d9
AD
53402005-10-21 Akim Demaille <akim@epita.fr>
5341
5342 Finish the transition config -> build-aux.
5343 * configure.ac, Makefile.am: Use build-aux.
5344 * config/prev-version, config/announce-gen, config/Makefile.am:
5345 Move to...
5346 * build-aux/prev-version, build-aux/announce-gen,
5347 * build-aux/Makefile.am: here.
5348
d4476375
AD
53492005-10-14 Akim Demaille <akim@epita.fr>
5350
5351 * examples/calc++/test: Use set -x only when VERBOSE.
5352
302c0aee
PE
53532005-10-13 Paul Eggert <eggert@cs.ucla.edu>
5354
5355 * NEWS: Bison now warns if it finds a stray `$' or `@' in an action.
5356 * src/scan-gram.l (<SC_BRACED_CODE>[$@]): Implement this.
5357
7625ec2c
AD
53582005-10-13 Akim Demaille <akim@epita.fr>
5359
5360 * src/scan-skel.l: Output the base name parts of the parser and
5361 header file names.
302c0aee 5362 * tests/output.at (AT_CHECK_OUTPUT): Support subdirectories, and
7625ec2c
AD
5363 additional checks.
5364 Use this to exercise C++ outputs in subdirs.
5365 Reported by Oleg Smolsky.
5366
ba0fe3c7
PE
53672005-10-12 Paul Eggert <eggert@cs.ucla.edu>
5368
5369 * data/c.m4 (b4_c_function_def): Look at __C99_FUNC__, not at
5370 __STDC_VERSION__, as IBM cc 7.0 doesn't define the latter either.
5371 Problem reported by John P. Hartmann.
5372 * data/yacc.c (YYMODERN_C): Likewise. Don't define if the user has
5373 already defined it.
5374
9b8a5ce0
AD
53752005-10-12 Akim Demaille <akim@epita.fr>
5376
5377 * src/parse-gram.y (version_check): Exit 63 to please missing
5378 (stands for "version mismatch).
5379 * tests/input.at, doc/bison.texinfo: Adjust.
5380
4f6e011e
PE
53812005-10-10 Paul Eggert <eggert@cs.ucla.edu>
5382
5383 Work around portability problems with Visual Age C compiler
5384 (xlc and xlC_r) reported by John P. Hartmann.
5385 * data/location.cc (initial_column, initial_line): Remove.
5386 All uses replaced by 0 and 1.
5387 * src/scan-gram.l (gram_wrap): Redefine to avoid bug in flex 2.5.31
5388 that xlc complains about.
5389 * src/scan-skel.l (skel_wrap): Likewise.
4d7aa45e 5390 * data/c.m4 (b4_c_function_def): Look at __STDC_VERSION__ as well
ba0fe3c7 5391 as __STDC__.
4d7aa45e
PE
5392 * data/yacc.c (YYMODERN_C): New macro, which also looks at
5393 __STDC_VERSION__. Use it everywhere instead of looking at
5394 __STDC__ and __cplusplus.
4f6e011e 5395
a1b3bf8c
AD
53962005-10-10 Akim Demaille <akim@epita.fr>
5397
5398 * examples/calc++/test: Be quiet unless VERBOSE.
5399
412e44aa
PE
54002005-10-05 Paul Eggert <eggert@cs.ucla.edu>
5401
2a4647a3
PE
5402 * data/c.m4 (yydestruct, yysymprint):
5403 Use YYUSE instead of casting to void.
5404 * data/glr.c (YYUSE): New macro.
5405 (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
5406 Use it instead of rolling our own.
5407 (YYLLOC_DEFAULT, YYCHK, YYDPRINTF, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
5408 (YYCHK1):
5409 Use /*CONSTCOND*/ to suppress lint warnings.
5410 * data/lalr1.cc (YYLLOC_DEFAULT, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
5411 (YY_STACK_PRINT): Use 'false' not '0'.
5412 (YYUSE): New macro.
5413 (yysymprint_, yydestruct_): Use it instead of rolling our own.
5414 * data/yacc.c (YYUSE): New macro.
5415 (YYCOPY, YYSTACK_RELOCATE, YYBACKUP, YYLLOC_DEFAULT):
5416 (YYDPRINTF, YY_SYMBOL_PRINT, YY_STACK_PRINT, YY_REDUCE_PRINT):
5417 (yyerrorlab): Use /*CONSTCOND*/ to suppress lint warnings.
5418
5419
412e44aa
PE
5420 * data/m4sugar/m4sugar.m4 (_m4_map): New macro.
5421 (m4_map, m4_map_sep): Use it. Handle the empty list correctly.
5422
88c6637f
PE
54232005-10-04 Paul Eggert <eggert@cs.ucla.edu>
5424
2f4f028d
PE
5425 Undo the parts of the unlocked-I/O change that substituted
5426 putc or puts for printf. This might hurt performance a bit,
5427 but some people prefer the printf style.
5428 * data/c.m4 (yysymprint): Prefer printf to puts and putc.
5429 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): Remove.
5430 All uses replaced by YYFPRINTF and YYDPRINTF.
5431 * data/yacc.c: Likewise.
5432 * lib/bitset.c (bitset_print): Likewise.
5433 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer printf to
5434 putc and puts.
5435 * lib/lbitset.c (debug_lbitset): Likewise.
5436 * src/closure.c (print_firsts, print_fderives): Likewise.
5437 * src/gram.c (grammar_dump): Likewise.
5438 * src/lalr.c (look_ahead_tokens_print): Likewise.
5439 * src/output.c (escaped_output): Likewise.
5440 (user_actions_output): Break apart two printfs.
5441 * src/parse-gram.y (%printer): Prefer printf to putc and puts.
5442 * src/reduce.c (reduce_print): Likewise.
5443 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
5444 * src/system.h: Include unlocked-io.h rathe than stdio.h.
5445
88c6637f
PE
5446 * data/glr.c (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
5447 Use assignments rather than casts-to-void to suppress
5448 unused-variable warnings. This pacifies 'lint'.
5449 * data/lalr1.cc (yysymprint_, yydestruct_): Use a call to suppress
5450 unused-variable warnings.
5451
fb32e373
JMG
54522005-10-03 Juan Manuel Guerrero <juan.guerrero@gmx.de>
5453
5454 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
5455
edb8f44f
PE
54562005-10-02 Paul Eggert <eggert@cs.ucla.edu>
5457
fb9c0b33
PE
5458 Use unlocked I/O for a minor performance improvement on hosts like
5459 GNU/Linux and Solaris that support unlocked I/O. The basic idea
5460 is to use the gnlib unlocked-io module, and to prefer putc and
5461 puts to printf when either will work (since the latter doesn't
5462 come in an unlocked flavor).
5463 * bootstrap (gnulib_modules): Add unlocked-io.
5464 * data/c.m4 (yysymprint): Prefer puts and putc to printf.
5465 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): New macros.
5466 Prefer them to YYFPRINTF and YYDPRINTF if either will do,
5467 and similarly for puts and putc and printf.
5468 * data/yacc.c: Likewise.
5469 * lib/bitset.c (bitset_print): Likewise.
5470 * lib/bitset.h [USE_UNLOCKED_IO]: Include unlocked-io.h.
5471 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer putc and puts
5472 to printf.
5473 * lib/lbitset.c (debug_lbitset): Likewise.
5474 * src/closure.c (print_firsts, print_fderives): Likewise.
5475 * src/gram.c (grammar_dump): Likewise.
5476 * src/lalr.c (look_ahead_tokens_print): Likewise.
5477 * src/output.c (escaped_output): Likewise.
5478 (user_actions_output): Coalesce two printfs.
2f4f028d 5479 * src/parse-gram.y (%printer): Prefer putc and puts to printf.
fb9c0b33
PE
5480 * src/reduce.c (reduce_print): Likewise.
5481 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
2f4f028d 5482 * src/system.h: Include unlocked-io.h rather than stdio.h.
fb9c0b33 5483
edb8f44f
PE
5484 * data/lalr1.cc: Don't put an unmatched ' in a dnl comment, as
5485 this confuses xgettext.
5486
b50d2359
AD
54872005-10-02 Akim Demaille <akim@epita.fr>
5488
5489 * bootstrap (gnulib_modules): Add strverscmp.
5490 * lib/.cvsignore: Add strverscmp.c, strverscmp.h.
5491 * m4/.cvsignore: Add strverscmp.m4.
5492 * src/parse-gram.y (%require): New token, new rule.
5493 (version_check): New.
5494 * src/scan-gram.l (%require): Adjust.
5495 * tests/input.at (AT_REQUIRE): New.
5496 Use it.
5497 * doc/bison.texinfo (Require Decl): New.
5498 (Calc++ Parser): Use %require.
5499
21667f64
AD
55002005-10-02 Akim Demaille <akim@epita.fr>
5501
5502 * data/location.cc: New.
5503
2b81e969
AD
55042005-10-02 Paul Eggert <eggert@cs.ucla.edu>,
5505 Akim Demaille <akim@epita.fr>
5506
5507 Make sure -odir/foo.cc creates dir/location.hh etc.
5508 * src/files.h (spec_outfile, parser_file_name, spec_name_prefix)
5509 (spec_file_prefix, spec_verbose_file, spec_graph_file)
5510 (spec_defines_file): Now const.
5511 (dir_prefix): New.
5512 (short_base_name): Remove.
5513 * src/files.c: Adjust.
5514 (dirname.h): Include.
5515 (base_name): Don't prototype it.
5516 (finput): Remove, duplicates gram_in.
5517 (full_base_name, short_base_name): Replace by...
5518 (all_but_ext, all_but_tab_ext): these.
5519 (compute_base_names): Rename as...
5520 (compute_file_name_parts): this.
5521 Update to compute the new variables, including dir_prefix.
5522 Adjust dependencies.
5523 * src/output.c (prepare): Output them.
5524 * src/reader.c: Adjust to use gram_in, not finput.
5525 * src/scan-skel.l (@dir_prefix@): New.
5526
ad6a9b97
JMG
55272005-10-02 Juan Manuel Guerrero <juan.guerrero@gmx.de>
5528
5529 * lib/subpipe.c: New function end_of_output_subpipe() added
5530 to allow support for non-posix systems. This is a no-op function
5531 for posix systems.
5532
5533 * lib/subpipe.h: New function end_of_output_subpipe() added
5534 to allow support for non-posix systems. This is a no-op function
5535 for posix systems.
5536
5537 * src/output.c (output_skeleton): Use end_of_output_subpipe() to
5538 handle the lack of pipe/fork functionality on non-posix systems.
5539
5540 * djgpp/Makefile.maint: DJGPP specific file.
5541
5542 * djgpp/README.in: DJGPP specific file.
5543
5544 * djgpp/config.bat: DJGPP specific configuration file.
5545
5546 * djgpp/config.sed: DJGPP specific configuration file.
5547
5548 * djgpp/config.site: DJGPP specific configuration file.
5549
5550 * djgpp/config_h.sed: DJGPP specific configuration file.
5551
5552 * djgpp/subpipe.c: DJGPP specific replacement file for lib/subpipe.c.
5553
5554 * djgpp/subpipe.h: DJGPP specific replacement file for lib/subpipe.h.
5555
fc695704
AD
55562005-10-02 Akim Demaille <akim@epita.fr>
5557
5558 * data/location.cc: New, extract from...
5559 * data/lalr1.cc: here.
5560 (location.hh): Include it after the user prologue, in case the
5561 filename type is defined by the user.
5562 Forward declation location and position before the pre-prologue.
5563 (yyresult_): Rename as...
5564 (yyresult): this, it's a local variable, not an attribute.
5565 * data/Makefile.am (dist_pkgdata_DATA): Adjust.
5566
55672005-10-01 Akim Demaille <akim@epita.fr>
5215c87f
AD
5568
5569 * examples/extexi: Restore the #line generation.
5570
fb9712a9
AD
55712005-09-30 Akim Demaille <akim@epita.fr>,
5572 Alexandre Duret-Lutz <adl@gnu.org>
5573
5574 Move the token type and YYSTYPE in the parser class.
5575 * data/lalr1.cc (stack.hh, location.hh): Include earlier.
5576 (parser::token): New, from the moved free definition of tokens.
5577 (parser::semantic_value): Now a full definition instead of an
5578 indirection to YYSTYPE.
5579 (b4_post_prologue): No longer included in the header file, but
5580 in the implementation file.
5581 * doc/bison.texi (C+ Language Interface): Update.
5582 * src/parse-gram.y: Support unary %define.
5583 * tests/actions.at: Define global_tokens_and_yystype for backward
5584 compatibility until we update the tests.
5585 * tests/calc.at: Idem.
5586 (first_line, first_column, last_line, last_column): Define for lalr1.cc
5587 to simplify the code.
5588
55f0c7b1
PE
55892005-09-29 Paul Eggert <eggert@cs.ucla.edu>
5590
5591 Port to SunOS 4.1.4, which lacks strtoul and strerror.
5592 Ah, the good old days! Problem reported by Peter Klein.
5593 * bootstrap (gnulib_modules): Add strerror, strtoul.
5594 * lib/.cvsignore: Add strerror.c, strtol.c, strtoul.c
5595 * m4/.cvsignore: Add strerror.m4, strtol.m4, strtoul.m4.
5596
fb9712a9 55972005-09-29 Akim Demaille <akim@epita.fr>
d4fb5e3c
AD
5598
5599 * data/c.m4 (b4_error_verbose_if): New.
5600 * data/lalr1.cc: Use it.
5601 (YYERROR_VERBOSE_IF): Remove.
5602 (yyn_, yylen_, yystate_, yynerrs_, yyerrstatus_): Remove as
5603 parser members, replaced by...
5604 (yyn, yylen, yystate, yynerss, yyerrstatus): these parser::parse
5605 local variables.
5606 (yysyntax_error_): Takes the state number as argument.
5607 (yyreduce_print_): Use the argument yyrule, not the former
5608 attribute yyn_.
5609
8a6f72f3
PE
56102005-09-26 Paul Eggert <eggert@cs.ucla.edu>
5611
5612 * bootstrap (gnulib_modules): Add verify.
5613 * lib/.cvsignore: Add verify.h.
5614 * src/getargs.c: Use ARGMATCH_VERIFY rather than verify.
5615 * src/system.h (verify): Remove.
5616 Include verify.h instead.
5617 * src/tables.c (tables_generate): Use new API for 'verify'.
5618
0d50976f
PE
56192005-09-21 Paul Eggert <eggert@cs.ucla.edu>
5620
ebc3737e
PE
5621 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Do not use
5622 local variables whose names begin with 'yy'.
5623 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
5624 Trivial changes from Joel E. Denny.
5625
0d50976f
PE
5626 * bootstrap (gnulib_modules): Remove alloca. Bison doesn't need
5627 it itself.
5628 * src/main.c (main) [C_ALLOCA]: Don't flush alloca'ed memory; we
5629 don't use alloca any more.
5630
5631 * data/yacc.c [YYSTACK_USE_ALLOCA && !defined __GNUC__ && ! defined
5632 __BUILTIN_VA_ARG_INCR && ! defined _AIX && ! defined _MSC_VER &&
62c4328e 5633 defined _ALLOCA_H]: Don't include <stdlib.h>; not needed in this case.
0d50976f
PE
5634 * tests/torture.at (Exploding the Stack Size with Alloca): Adjust
5635 to match yacc.c, to test more hosts.
5636
a05b79df
PE
56372005-09-20 Paul Eggert <eggert@cs.ucla.edu>
5638
55289366
PE
5639 * data/yacc.c (YYSIZE_T): Reindent to make it clearer. This
5640 doesn't affect behavior.
5641 (YYSTACK_ALLOC) [YYSTACK_USE_ALLOCA]: Improve support for
5642 Solaris, AIX, MSC.
5643 (_STDLIB_H): Renamed from YYINCLUDED_STDLIB_H. All uses changed.
5644 This works a bit better with glibc, if user code has already included
5645 stdlib.h.
5646 * doc/bison.texinfo (Bison Parser): Document that users can't
5647 arbitrarily use malloc and free for other purposes. Document
5648 that <alloca.h> and <malloc.h> might be included.
5649 (Table of Symbols): Under YYSTACK_USE_ALLOCA, Don't claim that the
5650 user must declare alloca.
5651
a05b79df
PE
5652 * HACKING (release): Forwarn the Translation Project about
5653 stable releses.
5654
3ab2ca22
AD
56552005-09-20 Akim Demaille <akim@epita.fr>
5656
5657 * data/glr.c: Use b4_token_enums, not b4_token_enums_defines.
5658
a9739e7c
PE
56592005-09-19 Paul Eggert <eggert@cs.ucla.edu>
5660
a702593e
PE
5661 * data/yacc.c (YYSIZE_MAXIMUM): New macro.
5662 (YYSTACK_ALLOC_MAXIMUM): Use it.
5663 (yysyntax_error): New function.
5664 (yyparse) [YYERROR_VERBOSE]: Don't leak memory indefinitely if
5665 multiple syntax errors are reported, and alloca is being used.
5666 Instead, reallocate buffers twice as big each time, so that
5667 we waste at most half the allocated memory. Start with a small
5668 (128-byte) buffer that will suffice in most cases anyway.
5669 Use yysyntax_error to do most of the work.
5670
5671 * doc/bison.texinfo (Error Reporting, Table of Symbols):
5672 yynerrs is the number of errors reported, not the number of
5673 errors encountered.
5674
a9739e7c
PE
5675 * tests/glr-regression.at (Duplicated user destructor for lookahead):
5676 Mark it as expected to fail.
5677 Cast result of malloc; problem reported by twlevo@xs4all.nl.
5678 * tests/actions.at, tests/calc.at, tests/glr-regression.at:
5679 Don't start user-code symbols with "yy", to avoid name space problems.
5680
f479c6c6
AD
56812005-09-19 Akim Demaille <akim@epita.fr>
5682
5683 Remove the traits, failed experiment.
5684 It never proved useful, and anyway because of the current
5685 definition, it was not possible to have several specialization of
5686 this traits, making it useless.
5687 * data/lalr1.cc (yy:traits): Remove.
5688 Inline its definitions in the parser class.
5689
e2586f82
AD
56902005-09-19 Akim Demaille <akim@epita.fr>
5691
5692 * tests/atlocal.in (LIBS): Pass INTLLIBS to address failures on at
5693 least Mac OSX with a /usr/local install of gettext.
5694
2e8cf949
AD
56952005-09-19 Akim Demaille <akim@epita.fr>
5696
5697 * data/lalr1.cc (yyparse): Rename yylooka and yyilooka as yychar
5698 and yytoken for similarity with the other skeletons.
5699
c7fb0b90
AD
57002005-09-19 Akim Demaille <akim@epita.fr>
5701
4e26c69e 5702 * NEWS, configure.ac: update version number to 2.1a.
c7fb0b90 5703
1bd0deda
PE
57042005-09-16 Paul Eggert <eggert@cs.ucla.edu>
5705
5706 * NEWS: Version 2.1.
5707
5708 * NEWS: Remove notice of yytname change, since it was never in an
5709 official release.
5710 * data/glr.c (yydestroyGLRState): Rename local var to avoid shadowing
5711 diagnostic.
5712 * src/output.c (prepare): Likewise.
5713 * data/lalr1.cc (YYERROR_VERBOSE_IF): New macro.
5714 (yysyntax_error_): Use it to avoid GCC warning when YYERROR_VERBOSE
5715 is not defined. This is an awful hack, but it's enough for now.
5716 All callers changed.
5717 * tests/glr-regression-at (make_value): Args are const pointers now,
5718 to avoid GCC warning.
5719 (Duplicated user destructor for lookahead): New test. Currently
5720 skipped. It fails on my host but I'm not sure it'll always fail.
5721
57222005-09-16 Akim Demaille <akim@epita.fr>
c1432f65
AD
5723
5724 * src/symtab.h (struct symbol): Declare the printer and destructor
5725 as const, to avoid accidental calls to free.
5726 (symbol_destructor_set, symbol_printer_set): Adjust.
5727 * src/symtab.c: Adjust.
5728
1bd0deda 57292005-09-16 Akim Demaille <akim@epita.fr>
cf147260
AD
5730
5731 * data/c.m4 (b4_token_enums): New.
5732 (b4_token_defines): Rename as...
5733 (b4_token_enums_defines): this.
5734 (b4_token_defines): New, output only the #defines.
5735 * data/yacc.c, data/glr.c: Adjust.
5736 * data/lalr1.cc: Use b4_token_enums instead of b4_token_enums_defines.
5737 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Define
5738 as default values.
5739
dbcdae2d
AD
57402005-09-16 Akim Demaille <akim@epita.fr>
5741
5742 * data/lalr1.cc (yylex_): Remove, inline its code.
5743 (yyreport_syntax_error_): Remove, replaced by...
5744 (yysyntax_error_): this which returns a string and leaves to the
5745 caller the call to the users' error function.
5746 (yylooka_, yyilooka_, yylval, yylloc, yyerror_range_, yyval, yyloc):
5747 Move from members of the parser object...
5748 (yylooka, yyilooka, yylval, yylloc, yyerror_range, yyval, yyloc):
5749 to local variables of the parse function.
5750
70d8f291
AD
57512005-09-16 Akim Demaille <akim@epita.fr>
5752
5753 * doc/bison.texinfo (Calc++ Parser): Don't promote defining YYEOF
5754 since it's in Bison's name space.
5755
b47dbebe
PE
57562005-09-15 Paul Eggert <eggert@cs.ucla.edu>
5757
ae199bf1
PE
5758 * data/glr.c (yyresolveValue): Add default case to pacify
5759 gcc -Wswitch-default. Problem reported by twlevo@xs4all.nl.
5760
b47dbebe
PE
5761 * NEWS: Document when yyparse started to return 2.
5762 * doc/bison.texinfo (Parser Function): Document when yyparse
5763 returns 2.
5764
5765 * data/lalr1.cc: Revert part of previous change, as it's incompatible.
5766 (b4_filename_type): Renamed back from b4_file_name_type. All uses
5767 changed.
5768 (class position): file_name -> filename (reverting). All uses changed.
5769
57702005-09-14 Paul Eggert <eggert@cs.ucla.edu>
5771
5772 * examples/calc++/Makefile.am ($(calc_sources_generated)): Don't
5773 do anything if $@ exists. This reverts part of the 2005-07-07
5774 patch.
5775
00292f66
PE
57762005-09-11 Paul Eggert <eggert@cs.ucla.edu>
5777
5778 * Makefile.am (EXTRA_DIST): Do not distribute REFERENCES; it
5779 contains obsolete information and isn't worth distributing as a
5780 separate file anyway.
5781 * data/glr.c [defined YYSETJMP]: Don't include <setjmp.h>.
5782 (YYJMP_BUF, YYSETJMP, YYLONGJMP) [!defined YYSETJMP]: New macros.
5783 All uses of jmp_buf, setjmp, longjmp changed to use these instead.
5784 (yyparse): Abort if user code uses longjmp to throw an unexpected
5785 value.
5786
a420f962
PE
57872005-09-09 Paul Eggert <eggert@cs.ucla.edu>
5788
00292f66
PE
5789 * data/c.m4 (b4_identification): Define YYBISON_VERSION.
5790 Suggested by twlevo@xs4all.nl.
5791
127287e9
PE
5792 * data/glr.c (YYCHK1): Do not assume YYE is in range.
5793 This avoids a diagnostic from gcc -Wswitch-enum.
5794 Problem reported by twlevo@xs4all.nl.
5795
a420f962
PE
5796 * doc/bison.texinfo: Don't use "filename", as per GNU coding
5797 standards. Use "file name" or "file" or "name", depending on
5798 the context.
5799 (Invocation): The output of "bison hack/foo.y" goes to foo.tab.c,
5800 not to hack/foo.tab.c.
5801 (Calc++ Top Level): 2nd arg of main is not const.
48b16bbc
PE
5802 * data/glr.c: b4_filename -> b4_file_name.
5803 * data/lalr1.cc: Likewise. Also, b4_filename_type -> b4_file_name_type.
5804 All uses changed.
5805 (class position): filename -> file_name. All uses changed.
5806 * data/yacc.c: b4_filename -> b4_file_name.
5807 * lib/bitset.h: filename -> file_name in local vars.
5808 * lib/bitset_stats.c: Likewise.
5809 * src/files.c: Likewise.
5810 * src/scan-skel.l ("@output ".*\n): Likewise.
5811 * src/files.c (file_name_split): Renamed from filename_split.
5812 * src/muscle_tab.c (muscle_init): Output b4_file_name, not b4_filename.
a420f962
PE
5813
58142005-09-08 Paul Eggert <eggert@cs.ucla.edu>
5815
5816 * lib/.cvsignore: Add pipe-safer.c, stdio--.h, unistd--.h,
5817 to accommodate latest gnulib.
5818
5819 * tests/glr-regression.at (Duplicate representation of merged trees):
5820 Add casts to pacify g++. Problem reported by twlevo@xs4all.nl.
5821
5822 * bootstrap: Add comment as to why the AM_LANGINFO_CODESET hack is
5823 needed.
5824
42a6501d
PE
58252005-08-26 Paul Eggert <eggert@cs.ucla.edu>
5826
5827 * data/glr.c (yydestroyGLRState): Renamed from yydestroyStackItem.
5828 All uses changed. Invoke user destructor after an error during a
5829 split parse (trivial change from Joel E. Denny).
5830
5831 * tests/glr-regression.at
5832 (User destructor after an error during a split parse): New test case.
5833 Problem reported by Joel E. Denny in:
5834 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00029.html
5835
ef9a1faf
PE
58362005-08-25 Paul Eggert <eggert@cs.ucla.edu>
5837
5b4aaf78
PE
5838 * README-cvs: Give URLs for recommended tools.
5839 Mention Gzip version problem, and bootstrapping issues.
5840 Remove troubleshooting section, as it's somewhat obsolete.
5841
b5240ba5
PE
5842 * bootstrap (no_cache): New var, to accommodate different wget
5843 variants. Use it instead of '-C off'. Problem reported by
5844 twlevo@xs4all.nl.
5845
ef9a1faf
PE
5846 * data/glr.c (yydestroyStackItem): New function.
5847 (yyrecoverSyntaxError, yyreturn): Use it to improve quality of
5848 debugging information. Problem reported by Joel E. Denny.
5849
e6efa9da
AD
58502005-08-25 Akim Demaille <akim@epita.fr>
5851
5852 * tests/local.at (AT_COMPILE_CXX): Pass $LINKS too.
5853
adc90f13
PE
58542005-08-24 Paul Eggert <eggert@cs.ucla.edu>
5855
5856 * data/glr.c (yyrecoverSyntaxError, yyreturn):
5857 Don't invoke destructor on unresolved entries.
5858 * tests/glr-regression.at
5859 (User destructor for unresolved GLR semantic value): New test case.
5860 Problem reported by Joel E. Denny in:
5861 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00016.html
5862
f9315de5
PE
58632005-08-21 Paul Eggert <eggert@cs.ucla.edu>
5864
15d29c1f
PE
5865 * lib/.cvsignore: Remove realloc.c, strncasecmp.c, xstrdup.c.
5866 Add strnlen.c.
5867 * m4/.cvsignore: Remove codeset.m4, gettext.m4, lib-ld.m4,
5868 lib-prefix.m4, po.m4.
5869
dd5f2af2
PE
5870 * data/glr.c (yyreturn): Use "Cleanup:" rather than "Error:"
5871 in yydestruct diagnostic, since it might not be an error.
5872 Problem reported by Joel Denny near end of
5873 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
6250acbd 5874 * data/lalr1.cc (yyerturn): Likewise.
dd5f2af2
PE
5875 * data/yacc.c (yyreturn): Likewise.
5876 * tests/calc.at (_AT_CHECK_CALC_ERROR): Adjust to the above change.
5877
5878 * src/files.c: Remove obsolete FIXME comment.
5879
5880 * data/glr.c (YY_SYMBOL_PRINT): Append a newline, for consistency
5881 with the other templates, and to fix bogus run-on messages such
5882 as the one reported at the end of
5883 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
5884 All callers changed to avoid the newline.
5885 (yyprocessOneStack): Output two lines rather than one, to accommodate
5886 the above change. This changes the debug output format slightly.
5887
f9315de5
PE
5888 * data/glr.c (yyresolveValue): Fix redundant parse tree problem
5889 reported by Joel E. Denny in
5890 <http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00004.html>
5891 (trivial change).
5892 * tests/glr-regression.at (Duplicate representation of merged trees):
5893 New test, from Joel E. Denny in:
5894 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00013.html>.
5895 * THANKS: Add Joel E. Denny.
5896
5897 * configure.ac (AC_INIT): Bump to 2.0c.
5898
04098407
PE
58992005-07-24 Paul Eggert <eggert@cs.ucla.edu>
5900
5901 * NEWS: Version 2.0b.
5902
ca5d2013
PE
5903 * Makefile.am (SUBDIRS): Put examples before tests, so that
5904 "make check" doesn't finish with "All 1 tests passed".
5905
3d54b576
PE
5906 * tests/regression.at (Token definitions): Don't rely on
5907 AT_PARSER_CHECK for data that contains backslashes. It currently
5908 uses 'echo', and 'echo' isn't portable if its argument contains
5909 backslashes. Problem found on OpenBSD 3.4. Also, do not assume
5910 that the byte '\0xff' is not printable in the C locale; it is,
5911 under OpenBSD 3.4 (!). Luckily, '\0x80' through '\0x9e' are
5912 not printable, so use '\0x81' to test.
5913
d53ae497
PE
5914 * data/glr.c (YYOPTIONAL_LOC): Define even if it's not a recent
5915 version of GCC, since the macro is used with non-GCC compilers.
5916
fc01665e
PE
5917 Fix core dump reported by Pablo De Napoli in
5918 <http://lists.gnu.org/archive/html/bug-bison/2005-07/msg00053.html>.
5919 * tests/regression.at (Invalid inputs with {}): New test.
5920 * src/parse-gram.y (token_name): Translate type before using
5921 it as an index.
5922
04098407
PE
5923 * data/glr.c (ATTRIBUTE_UNUSED): Remove, since it infringes on
5924 the user's name space. All uses changed to __attribute__
5925 ((__unused__)).
5926 (yyFail, yyMemoryExhausted, yyreportAmbiguity):
5927 Add __attribute__ ((__noreturn__)).
5928
5929 * etc/clcommit: Remove. We weren't using it, and it failed
5930 "make maintainer-distcheck".
5931 * Makefile.maint: Merge from coreutils.
5932 (CVS_LIST, CVS_LIST_EXCEPT): New macros.
5933 (syntax-check-rules): Change list of rules as described below.
5934 (sc_cast_of_alloca_return_value, sc_dd_max_sym_length):
5935 (sc_file_system, sc_obsolete_symbols, sc_prohibit_atoi_atof):
5936 (sc_prohibit_jm_in_m4, sc_root_tests, sc_tight_scope):
5937 (sc_trailing_space): New rules.
5938 (sc_xalloc_h_in_src): Remove.
5939 (sc_cast_of_argument_to_free, sc_cast_of_x_alloc_return_value):
5940 (sc_space_tab, sc_error_exit_success, sc_changelog):
5941 (sc_system_h_headers, sc_sun_os_names, sc_unmarked_diagnostics):
5942 (makefile-check, po-check, author_mark_check):
5943 (makefile_path_separator_check, copyright-check):
5944 Use grep -n, to make it easier to find violations.
5945 Use CVS_LIST and CVS_LIST_EXCEPT.
5946 (header_regexp, h_re): Remove.
5947 (dd_c): New macro.
5948 (sc_dd_max_sym_length, .re-list, news-date-check): New rules.
5949 (my-distcheck): Use more-modern GCC flags.
5950 (signatures, %.asc): Remove.
5951 (rel-files, announcement): Remove signatures.
5952 Restore old updating code, even though we don't use it, so
5953 that we're the same as coreutils.
5954 (alpha, beta, major): Depend on news-date-check.
5955 Make the upload commands.
5956
5957 * data/c.m4, data/lalr1.cc, data/yacc.c: Normalize white space.
5958 * lib/abitset.h, lib/bbitset.h, lib/bitset.h: Likewise.
5959 * lib/bitset_stats.c, lib/ebitset.h, lib/lbitset.c: Likewise.
5960 * lib/libitset.h, lib/timevar.c, lib/vbitset.h: Likewise.
5961 * src/Makefile.am, src/gram.c, src/muscle_tab.h: Likewise.
5962 * src/parse-gram.y, src/system.h, src/tables.c, src/vcg.c: Likewise.
5963 * src/vcg_defaults.h, tests/cxx-type.at, tests/existing.at: Likewise.
5964 * tests/sets.at: Likewise.
5965
5966 * data/m4sugar/m4sugar.m4: Sync from Autoconf, except that
5967 we comment out the Autoconf version number.
5968 * doc/bison.texinfo (Calc++ Scanner): Don't use atoi, as
5969 it's error-prone and "make maintainer-distcheck" rejects it.
5970
5971 * lib/subpipe.c: Include <fcntl.h> without checking for HAVE_FCNTL_H.
5972 Indent calls to "error" to pacify "make maintainer-distcheck",
5973 when the calls are not intended to be translated.
5974 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't check for fcntl.h.
5975
5976 * src/Makefile.am (DEFS): Use +=, to pacify
5977 "make maintainer-distcheck".
5978 (bison_SOURCES): Add scan-skel.h.
5979 (sc_tight_scope): New rule, from coreutils.
5980
5981 * src/files.c (src_extension, header_extension):
5982 Now static, not extern.
5983 * src/getargs.c (short_options): Likewise.
5984 * src/muscle_tab.c (muscle_table): Likewise.
5985 * src/parse-gram.y (current_class, current_type, current_prec):
5986 Likewise.
5987 * src/reader.c (grammar_end, previous_rule_end): Likewise.
5988 * src/getargs.h: Redo comments to pacify "make maintainer-distcheck".
5989 * src/main.c (main): Cast bindtextdomain and textdomain calls to
5990 void, to avoid warning when NLS is disabled.
5991 * src/output.c: Include scan-skel.h.
5992 (scan_skel): Remove decl, since scan-skel.h does this.
5993 (output_skeleton):
5994 Indent calls to "error" to pacify "make maintainer-distcheck".
5995 * src/print_graph.c: Don't include <obstack.h>, as system.h does this.
5996 * src/reader.h (gram_end, gram_lineno): New decls to pacify
5997 "make maintainer-distcheck".
5998 * src/scan-skel.l (skel_lex, skel_get_lineno, skel_get_in):
5999 (skel_get_out, skel_get_leng, skel_get_text, skel_set_lineno):
6000 (skel_set_in, skel_set_out, skel_get_debug, skel_set_debug):
6001 (skel_lex_destroy, scan_skel): Move these decls to...
6002 * src/scan-skel.h: New file.
6003 * src/uniqstr.c (uniqstr_assert):
6004 Indent calls to "error" to pacify "make maintainer-distcheck".
6005
6006 * tests/Makefile.am ($(srcdir)/package.m4): Use $(VAR),
6007 not @VAR@.
6008
6009 * tests/torture.at: Revamp to avoid misuse of atoi that
6010 "make maintainer-distcheck" complained about.
6011
6012 * examples/extexi (message): Don't print a message more than once,
6013 and omit line-number decoration that makes Emacs compile think
6014 that informative messages are worth worrying about.
6015
60162005-07-22 Paul Eggert <eggert@cs.ucla.edu>
6017
6018 * configure.ac: Update version number.
6019
6020 * Makefile.am (SUBDIRS): Add examples; somehow this got removed
6021 accidentally.
6022 * examples/calc++/calc++-parser.yy: Remove from CVS, as it's
6023 autogenerated by the maintainer.
6024 * examples/calc++/.cvsignore: Add *.yy.
6025
6026 * lib/bitset.c (bitset_alloc): Don't cast xcalloc result.
6027 * lib/bitset_stats.c (bitset_stats_init): Likewise.
6028 * lib/bitsetv.c (bitsetv_alloc): Likewise.
6029
6030 * po/POTFILES.in: Add lib/xalloc-die.c; remove lib/xmalloc.c.
6031
6032 * src/relation.c (relation_transpose): Rewrite to avoid bogus complaint
6033 from maintainer-distcheck about casting the argument of 'free'.
6034
6035 * NEWS: Mention recent yytname changes.
6036 * THANKS: Add Anthony Heading, twlevo@xs4all.nl.
6037
6038 * bootstrap: For translations that have not yet been upgraded to
6039 the new runtime-po domain, prime the pump by extracting the
6040 relevant strings from the obsolete translations. This code can be
6041 removed once the bison-runtime domain has been translated by each
6042 team.
6043
6044 * src/scan-gram.l (<SC_PRE_CODE>.): Don't double-quote token names,
6045 now that token names are already quoted.
6046
6047 Fix problem reported by Anthony Heading.
6048 * data/glr.c (YYTOKEN_TABLE): New macro.
6049 (yytname): Define if YYTOKEN_TABLE.
6050 * data/yacc.c (YYTOKEN_TABLE, yytname): Likewise.
6051 * data/lalr1.cc (YYTOKEN_TABLE, yytname_): Likewise.
6052 (YYERROR_VERBOSE): Define the same way the other skeletons do.
6053 * src/output.c (prepare_symbols): Output token_table_flag.
6054
0ffda363
PE
60552005-07-21 Paul Eggert <eggert@cs.ucla.edu>
6056
6057 * data/glr.c (yyinitGLRStack, yyreturn): Don't call malloc
6058 again if the first call fails.
6059
6060 * data/glr.c (yytnamerr): New function.
6061 (yyreportSyntaxError): Use it to dequote most string literals.
6062 * data/lalr1.c (yytname_): Renamed from yyname_, for compatibility
6063 with other skeletons. All uses changed.
6064 (yytnameerr_): New function.
6065 (yyreport_syntax_error): Use it to dequote most string literals.
6066 * data/yacc.c (yytnamerr): New function.
6067 (yyerrlab): Use it to decode most string literals.
6068 * doc/bison.texinfo (Decl Summary, Calling Convention):
6069 Clarify quoting convention of yytname.
6070 * src/output.c (prepare_symbols): Quote all names. This undoes
6071 the 2005-04-17 change, which is now accomplished (mostly) via
6072 changes in the parsers as described above.
6073 * tests/regression.at (Token definitions, Web2c Actions):
6074 Undo most 2005-04-17 change here, too.
6075
60762005-07-20 Paul Eggert <eggert@cs.ucla.edu>
6077
6078 Fix more problems reported by twlevo@xs4all.nl.
6079 * tests/cxx-type.at: Don't pipe output of ./types through sed to
6080 remove trailing spaces. This loses the exit status of ./types,
6081 and isn't needed since ./types shouldn't be emitting trailing
6082 spaces.
6083 * data/glr.c (yyreturn): Don't pop stack if yyinitStateSet failed,
6084 as the stack isn't valid in that case.
6085
6086 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
6087 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
6088 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
6089 Add declarations to pacify "gcc -Wmissing-prototypes" when flex 2.5.31
6090 is used.
6091 * src/scan-skel.l (skel_get_lineno, skel_get_in, skel_get_out):
6092 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
6093 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
6094 Likewise.
6095
6096 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Work even with
6097 overly-picky compilers that reject 'char *foo = "bar";'.
6098
6099 * src/symtab.c (SYMBOL_ATTR_PRINT, symbol_print): Direct output
6100 to FILE * parameter, not to stderr. This fixes a typo introduced
6101 in the 2005-07-12 change.
6102
6103 * lib/subpipe.c (create_subpipe): Rewrite slightly to avoid
6104 warnings from GCC 4.
6105
6106 * data/glr.c (yyexpandGLRStack, yyaddDeferredAction, yyexpandGLRStack):
6107 (yyglrShiftDefer, yysplitStack):
6108 Remove unused parameters b4_pure_formals. All uses changed.
6109 (yyglrShift): Remove unused parameters b4_user_formals.
6110 All uses changed.
6111 (yyglrReduce): Removed unused parameter yylocp. All uses changed.
6112
6100a9aa
PE
61132005-07-18 Paul Eggert <eggert@cs.ucla.edu>
6114
258b75ca
PE
6115 Destructor cleanups and regularization among the three skeletons.
6116 * NEWS: Document the behavior changes.
6117 * data/glr.c (yyrecoverSyntaxError): Don't bother to pop the
6118 stack before failing, as the cleanup code will do it for us now.
6119 * data/lalr1.cc (yyerrlab): Likewise.
6120 * data/glr.c (yyparse): Pop everything off the stack before
6121 freeing it, so that destructors get called properly.
6122 * data/lalr1.cc (yyreturn): Likewise.
6123 * data/yacc.c (yyreturn): Pop and destroy the start symbol, too.
6124 This is more consistent.
6125 * doc/bison.texinfo (Destructor Decl): Mention more reasons
6126 why destructors might be called. 1.875 -> 2.1.
6127 (Destructor Decl, Decl Summary, Table of Symbols):
6128 Some English-language cleanups for %destructor.
6129 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
6130 Add output line for destructor of start symbol.
6131 * tests/calc.at (AT_CHECK_CALC): Add one to line counts,
6132 because of that same extra output line.
6133
1a059451
PE
6134 * NEWS: Document minor wording changes in diagnostics of
6135 Bison-generated parsers.
6136 * data/glr.c (yyMemoryExhausted): Renamed from yyStackOverflow.
6137 Remove unused formals. All uses changed.
6138 (yyreportAmbiguity): "ambiguity detected" -> "syntax is ambiguous".
6139 (yyparse): Rename yyoverflowlab to yyexhaustedlab.
6140 * data/yacc.c (yyparse): "parser stack overflow" -> "memory exhausted".
6141 Rename yyoverflowab to yyexhaustedlab.
6142 When memory exhaustion occurs during syntax-error reporting,
6143 report it separately rather than in a single diagnostic; this
6144 eases translation.
6145 * doc/bison.texinfo (Memory Management): Renamed from Stack Overflow.
6146 (Memory Exhausted): Renamed from Parser Stack Overflow.
6147 Revamp wording slightly to prefer "memory exhaustion".
6148 * tests/actions.at: "parser stack overflow" -> "memory exhausted".
6149
97460c78
PE
6150 * data/c.m4 (b4_yysymprint_generate): Use YYFPRINTF, not fprintf.
6151
30757c8c
PE
6152 Add i18n support to the GLR skeleton. Partially fix the C++
6153 skeleton; a C++ expert needs to finish this. Remove debugging
6154 msgids; there's little point to having them translated, since they
6155 can be understood only by someone who can read the
6156 (English-language) source code.
6157
6158 Generate runtime-po/bison-runtime.pot automatically, so that we
6159 don't have to worry about garbage getting in that file. We'll
6160 make sure after the next official release that old msgids don't
6161 get lost. See
6162 <http://lists.gnu.org/archive/html/bison-patches/2005-07/msg00119.html>.
6163
6164 * runtime-po/Makefile.in.in, runtime-po/bison-runtime.pot: Remove.
6165 Now auto-generated.
6166 * PACKAGING: Don't claim that Gawk, GCC, Perl use this method yet.
6167 Fix typos in explanations of the runtime file.
6168 * bootstrap: Change gettext keyword from YYI18N to YY_.
6169 Use standard Makefile.in.in in runtime-po, since we'll arrange
6170 for backward-compatible bison-runtime.po files in a different way.
6171 * data/glr.c (YY_): New macro, from yacc.c.
6172 (yyuserAction, yyreportAmbiguity, yyreportSyntaxError, yyparse):
6173 Translate messages intended for users.
6174 (yyreportSyntaxError): Change "virtual memory" to "memory" to match
6175 the wording in the other skeletons. We don't know that the memory
6176 is virtual.
6177 * data/lalr1.cc (YY_): Renamed from _. All uses changed.
6178 Use same method that yacc.c uses.
6179 Don't translate debugging messages.
6180 (yy::yyreport_syntax_error): Put in a FIXME for the i18n stuff;
6181 it doesn't work (yet), and requires C++ expertise to fix.
6182 * data/yacc.c (YY_): Renamed from YY18N. All uses changed.
6183 Move defn to a more logical place, to be consistent with other
6184 skeletons.
6185 Don't translate debugging messages.
6186 Don't assume line numbers fit in unsigned int; use unsigned long fmts.
6187 * doc/bison.texinfo: Mention <libintl.h>. Change glibc cross reference
6188 to gettext cross reference. Add indexing terms. Mention YYENABLE_NLS.
6189 * runtime-po/POTFILES.in: Add data/glr.c, data/lalr1.cc.
6190
ac8c5689
PE
6191 Fix yyerror / yylex test glitches noted by twlevo@xs4all.nl.
6192 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Have yyerror return
6193 void, not int.
6194 * tests/glr-regression.at (Badly Collapsed GLR States):
6195 Likewise.
6196 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
6197 yylex should return 0 at EOF rather than aborting.
6198
6100a9aa
PE
6199 Improve tests for stack overflow in GLR parser.
6200 Problem reported by twlevo@xs4all.nl.
6201 * data/glr.c (struct yyGLRStack): Remove yyerrflag member.
6202 All uses removed.
6203 (yyStackOverflow): Just longjmp, but with value 2 so that caller
6204 can handle the problem.
6205 (YYCHK1): Use goto (a la yacc.c) rather than setting a flag.
6206 (yyparse): New local variable yyresult to record the result.
6207 Use result of setjmp to set it, rather than storing itinto
6208 struct.
6209 (yyDone): Remove label.
6210 (yyacceptlab, yyabortlab, yyoverflowlab, yyreturn): New labels,
6211 to mimic yacc.c. Do not discard lookahead if it's EOF (possible
6212 if YYABORT is used).
6213 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Exit with
6214 yyparse status; put status > 1 into diagnostic.
6215 Check that status==2 works.
6216 * tests/calc.at, tests/cxx-type.at, tests/glr-regression.at:
6217 Use exit status 3 for failure to open (which shouldn't happen).
6218
15f40952
PE
62192005-07-17 Paul Eggert <eggert@cs.ucla.edu>
6220
67fd79c4
PE
6221 * tests/conflicts.at (%nonassoc and eof): Don't exit with status
6222 1 on syntax error; just let yyparse do its thing.
6223 * tests/glr-regression.at (Badly Collapsed GLR States): Likewise.
6224 * tests/torture.at (AT_DATA_STACK_TORTURE): Likewise.
6225 (Exploding the Stack Size with Alloca):
6226 (Exploding the Stack Size with Malloc):
6227 Expect exit status 2, not 1, since the parser is supposed to blow
6228 its stack. Problem reported by twlevo@xs4all.nl.
6229
15f40952
PE
6230 * data/glr.c (yyparse): Don't assume that the initial calls
6231 to YYMALLOC succeed; in that case, yyparse incorrectly returned 0.
6232 Print a stack-overflow message and fail instead.
6233 Initialize the line-number information before creating the stack,
6234 so that the stack-overflow message can report line zero safely.
6235
f32c66b5
PE
62362005-07-14 Paul Eggert <eggert@cs.ucla.edu>
6237
a22ff96f 6238 Fix problems reported by twlevo@xs4all.nl.
e2688cd9
PE
6239 * data/glr.c (YYSTACKEXPANDABLE): Don't define if already defined.
6240 (yyuserMerge): Provide a default case if b4_mergers is empty.
6241 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Define YYSTACKEXPANDABLE.
6242 * tests/glr-regression.at
6243 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
c70fdfcd 6244 Add casts to pacify C++ compilers.
1beb0b24
PE
6245 * tests/glr-regression.at (Improper merging of GLR delayed action
6246 sets): Declare yylex before using it.
f32c66b5 6247 * tests/Makefile.am (maintainer-check-g++): Fix a stray
a22ff96f
PE
6248 $(GXX) that escaped the renaming of GXX to CXX. Remove bogus
6249 test for valgrind; valgrind is independent of g++.
6250 (maintainer-check-posix): Add _POSIX2_VERSION=200112, to check
6251 for compatibility with POSIX 1003.1-2001 (if running coreutils).
6252 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Port to stricter C++.
6253 Use a destructor, so that we can expand the stack. Change
6254 YYSTYPE to char * so that we can free it. Cast result of malloc.
f32c66b5 6255
d741bd1b
PE
62562005-07-13 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
6257
6258 * data/glr.c (yyuserAction): Fix uninitialized variable that caused
6259 a valgrind failure. Problem reported by twlevo@xs4all.nl.
6260
0410a6e0
PE
62612005-07-13 Paul Eggert <eggert@cs.ucla.edu>
6262
6263 * PACKAGING: New file, suggested by Bruno Haible and taken from
6264 similar wording in gettext's PACKAGING file.
6265 * NEWS: Mention PACKAGING.
6266 * Makefile.am (EXTRA_DIST): Add PACKAGING.
6267
f7ab6a50
PE
62682005-07-12 Paul Eggert <eggert@cs.ucla.edu>
6269
baf785db 6270 * NEWS: Document recent i18n improvements.
f7ab6a50
PE
6271 * bootstrap: Get runtime translations into runtime-po.
6272 Create runtime-po files automatically, if possible.
6273 * configure.ac: Invoke BISON_I18N, so that we eat our own dog food.
6274 * data/yacc.c: Rewrite inclusion of <libintl.h> so that ENABLE_NLS
6275 does not infringe on the user's name space.
6276 (YYENABLE_NLS): Renamed from ENABLE_BISON_NLS.
6277 * doc/bison.texinfo (Internationalization): Revamp the English
6278 and Texinfo syntax a bit, to try to make it clearer.
6279 (Bison Options, Option Cross Key): Mention --print-localedir.
6280 * m4/bison-i18n.m4 (BISON_I18N): Rename ENABLE_BISON_NLS to
6281 YYENABLE_NLS. Quote a bit more.
6282 * runtime-po/.cvsignore: New file.
6283 * runtime-po/Makefile.in.in (mostlyclean): Remove *.old.pot.
6284 * runtime-po/Rules-quot: Remove; now created by bootstrap.
6285 * runtime-po/quot.sed: Likewise.
6286 * runtime-po/boldquot.sed: Likewise.
6287 * runtime-po/en@quot.header: Likewise.
6288 * runtime-po/en@boldquot.header: Likewise.
6289 * runtime-po/insert-header.sin: Likewise.
6290 * runtime-po/remove-potcdate.sin: Likewise.
6291 * runtime-po/Makevars: Likewise.
6292 * runtime-po/LINGUAS: Likewise.
6293 * runtime-po/de.po: Likewise; we will rely on the translation project
6294 to maintain this, so "bootstrap" should get it.
0410a6e0 6295 * src/getarg.c (PRINT_LOCALEDIR_OPTION): Let the C compiler determine
f7ab6a50
PE
6296 its value.
6297 * src/main.c (main): Bind the bison-runtime domain, too.
6298
62992005-07-12 Bruno Haible <bruno@clisp.org>
6300
6301 * data/yacc.c: Include <libintl.h> when NLS is enabled.
6302 (YYI18N): Renamed from _. Use dgettext when NLS is enabled.
6303 * po/POTFILES.in: Remove autogenerated file src/parse-gram.c.
6304 * runtime-po: New directory.
6305 * runtime-po/Makefile.in.in: New file, copied from po/, with modified
6306 $(DOMAIN).pot-update rule, so that old messages are never dropped.
6307 * runtime-po/Rules-quot: New file, copied from po/.
6308 * runtime-po/quot.sed: Likewise.
6309 * runtime-po/boldquot.sed: Likewise.
6310 * runtime-po/en@quot.header: Likewise.
6311 * runtime-po/en@boldquot.header: Likewise.
6312 * runtime-po/insert-header.sin: Likewise.
6313 * runtime-po/remove-potcdate.sin: Likewise.
6314 * runtime-po/Makevars: New file.
6315 * runtime-po/POTFILES.in: New file.
6316 * runtime-po/LINGUAS: New file.
6317 * runtime-po/bison-runtime.pot: New file.
6318 * runtime-po/de.po: New file.
6319 * m4/bison.m4: New file.
6320 * Makefile.am (SUBDIRS): Add runtime-po.
6321 (aclocaldir, aclocal_DATA): New variables.
6322 * configure.ac: Add AC_CONFIG_FILES of runtime-po/Makefile.in.
6323 Define aclocaldir.
6324 * src/getargs.c (usage): Document --print-localedir option.
6325 (PRINT_LOCALEDIR_OPTION): New enum item.
6326 (long_options): Add --print-localedir option.
6327 (getargs): Handle --print-localedir option.
6328 * doc/bison.texinfo (Bison Parser): Remove paragraph about _().
6329 (Internationalization): New section.
6330
22dda0f0
AD
63312005-07-12 Akim Demaille <akim@epita.fr>
6332
6333 * src/symtab.h, src/symtab.c (symbol_print): Swap the arguments,
6334 for consistency with the rest of the code.
6335 * src/symlist.h, src/symlist.c (symbol_list_print): Ditto.
6336 Add separators.
6337
82b248ad
AD
63382005-07-12 Akim Demaille <akim@epita.fr>
6339
6340 * src/parse-gram.y: Use %printer instead of YYPRINT.
6341
fa0e9314
AD
63422005-07-12 Akim Demaille <akim@epita.fr>
6343
867a3e00
AD
6344 * src/symtab.h, src/symtab.c (symbol_print): New.
6345 * src/symlist.h, src/symlist.c (symbol_list_print): New.
6346 * src/symlist.c (symbol_list_n_type_name_get): Report the culprit.
6347
63482005-07-12 Akim Demaille <akim@epita.fr>
6349
6350 * data/glr.c (b4_syncline): Fix (swap) the definitions of
fa0e9314
AD
6351 b4_at_dollar and b4_dollar_dollar.
6352
e054b190
PE
63532005-07-11 Paul Eggert <eggert@cs.ucla.edu>
6354
6355 * doc/bison.texinfo (Mystery Conflicts): Add reference to DeRemer
6356 and Pennello's paper.
6357
34160ec4
PE
63582005-07-09 Paul Eggert <eggert@cs.ucla.edu>
6359
407d4a75
PE
6360 * data/yacc.c (yyparse): Undo previous patch. Instead,
6361 set yylsp[0] and yyvsp[0] only if the initial action
6362 sets yylloc and yylval, respectively.
6363
34160ec4
PE
6364 * data/yacc.c (yyparse): In the initial action, set
6365 yylsp[0] and yyvsp[0] rather than yylloc and yylval.
6366 This avoids the use of undefined variables if the initial
6367 action does not set yylloc and/or yylval.
6368
c3d5a4a7
PE
63692005-07-07 Paul Eggert <eggert@cs.ucla.edu>
6370
b34d96c1
PE
6371 * examples/calc++/calc++-driver.cc, examples/calc++/calc++-driver.hh:
6372 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc:
6373 Remove from CVS. These files are automatically generated.
6374 * examples/extexi: Clarify that this file is now part of Bison,
6375 not GNU M4, and that it works with any POSIX-compatible Awk.
6376 * examples/calc++/Makefile.am (run_extexi): Remove; not used.
6377 ($(calc_extracted)): Renamed from $(calc_sources_extracted),
6378 so that we also get calc++-parser.yy. Geneate it.
6379 Use $(AWK), not gawk, since any conforming Awk will do.
6380 Put comment before action, since older 'make' can't handle comment
6381 in action.
6382 $(BUILT_SOURCES): List all built sources, not just some of them.
6383 $(MAINTAINERCLEANFILES): Remove *.stamp, and all built sources.
6384 $($(srcdir)/calc++-parser.stamp): Work even if POSIXLY_CORRECT.
6385 $($(calc_sources_generated)): Remove unnecessary test for existence
6386 of target. (This had a shell syntax error anyway; a stray "x".)
6387 (calc_extracted): List $(srcdir)/calc++-parser.yy, not
6388 calc++-parser.yy.
6389 * examples/.cvsignore, examples/calc++/.cvsignore: New files.
6390
c3d5a4a7
PE
6391 * bootstrap (gnulib_modules): Add gettext, now that it's no longer
6392 implied by the other modules.
6393
828c373b
AD
63942005-07-06 Akim Demaille <akim@epita.fr>
6395
6396 Bind examples/calc++ to the package.
6397 * examples/calc++/Makefile: Remove, replaced by...
6398 * examples/calc++/Makefile.am: ... this new file.
6399 * examples/calc++/test: Remove input.
6400 * examples/calc++/compile: Remove.
6401 * examples/Makefile.am: New.
6402 * configure.ac, Makefile.am: Adjust.
6403 * doc/Makefile.am (clean-local): New, for more recent texi2dvis.
6404
63cb01d6
PE
64052005-07-05 Paul Eggert <eggert@cs.ucla.edu>
6406
fd2df2ed
PE
6407 * data/glr.c (yyFail): Drastically simplify; since the format argument
6408 never had any % directives, we can simply pass it to yyerror.
6409 (yyparse): Use "t a; a=b;" rather than "t a = b;" when a will
6410 be modified later, as that is the usual style in glr.c.
6411 Problems reported by Paul Hilfinger.
6412
63cb01d6
PE
6413 Rewrite GLR parser to catch more buffer overrun, storage exhaustion,
6414 and size overflow errors.
6415 * data/glr.c: Include <stdio.h> etc. after user prolog, not before,
6416 in case the user prolog sets feature-test macros like _GNU_SOURCE.
6417 (YYSIZEMAX): New macro.
6418 (yystpcpy): New function, taken from yacc.c.
6419 (struct yyGLRStack.yyspaceLeft): Now size_t, not int.
6420 (yyinitGLRStack, yyfreeGLRstack): Remove unnecessary forward decls,
6421 so that we don't have to maintain their signatures.
6422 (yyFail): Check for buffer overflow, by using vsnprintf rather
6423 than vsprintf. Allocate a bigger buffer if possible.
6424 Report an error if buffer allocation fails.
6425 (yyStackOverflow): New function.
6426 (yyinitStateSet, yyinitGLRStack): Return a boolean indicating whether
6427 the initialization was successful. It might fail if storage was
6428 exhausted.
6429 (yyexpandGLRStack): Add more checks for storage allocation failure.
6430 Use yyStackOverflow to report failures.
6431 (yymarkStackDeleted, yyglrShift, yyglrShiftDefer, yydoAction):
6432 (yysplitStack, yyprocessOneStack, yyparse, yypstack):
6433 Don't assume stack number fits in int.
6434 (yysplitStack): Check for storage allocation failure.
6435 (yysplitStack, yyprocessOneStack): Add pure_formals, so that we
6436 can print diagnostics on storage allocation failure. All callers
6437 changed.
6438 (yyresolveValue): Use yybool for boolean.
6439 (yyreportSyntaxError): Check for size-calculation overflow.
6440 This code is taken from yacc.c.
6441 (yyparse): Check for storage allocation errors when allocating
6442 the initial stack.
6443
1c59e0a1
AD
64442005-07-05 Akim Demaille <akim@epita.fr>
6445
6446 Extract calc++ from the documentation.
6447 * doc/bison.texinfo (Calc++): Add the extraction marks.
6448 * examples/extexi: New, from the aborted GNU Programming 2E.
6449 Separate the different paragraph of a file with empty lines.
6450 * examples/Makefile: Use it to extract the whole calc++ example.
6451
8a0adb01
AD
64522005-06-24 Akim Demaille <akim@epita.fr>
6453
6454 * doc/bison.texinfo (C++ Parser Interface): Use defcv to define
6455 class typedefs.
6456
12545799
AD
64572005-06-22 Akim Demaille <akim@epita.fr>
6458
6459 * doc/bison.texinfo (C++ Language Interface): First stab.
6460 (C++ Parsers): Remove.
6461
99be0235
AD
64622005-06-22 Akim Demaille <akim@epita.fr>
6463
6464 * data/lalr1.cc (yylex_): Honor %lex-param.
6465
0ffd4fd1
AD
64662005-06-22 Akim Demaille <akim@epita.fr>
6467
6468 Start a set of simple examples.
6469 * examples/calc++/Makefile, examples/calc++/calc++-driver.cc,
6470 * examples/calc++/calc++-driver.hh,
6471 * examples/calc++/calc++-parser.yy,
6472 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc,
6473 * examples/calc++/compile, examples/calc++/test: New.
6474
0925ebb4
PE
64752005-06-09 Paul Eggert <eggert@cs.ucla.edu>
6476
6477 * data/yacc.c (malloc, free) [defined __cplusplus]: Wrap inside
6478 extern "C" {}. This fixes a problem reported by Paul Hilfinger,
6479 which stems from the 2005-05-27 patch.
6480
43d3b664
PH
64812005-06-06 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
6482
6483 * data/glr.c: Modify treatment of unused parameters to permit use
6484 of g++ (which doesn't allow __attribute__ ((unused)) for parameters).
6485
3062864d
PE
64862005-05-30 Paul Eggert <eggert@cs.ucla.edu>
6487
6488 Fix infringement on user name space reported by Janos Zoltan Szabo.
6489 * data/yacc.c (yyparse): strlen -> yystrlen.
6490
989b5b8e
AD
64912005-05-30 Akim Demaille <akim@epita.fr>
6492
6493 * data/lalr1.cc (_): New.
6494 Translate the various messages.
6495
bedf57f5
PE
64962005-05-27 Paul Eggert <eggert@cs.ucla.edu>
6497
6498 Fix infringement on user name space reported by Bruno Haible.
6499 * data/yacc.c (YYSIZE_T): Define first, so that later decls can use it.
6500 Prefer GCC's __SIZE_TYPE__ if available, so that we don't infringe on
6501 the user's name space.
6502 (alloca): Include <stdlib.h> to get it, if it's not built in.
6503 (YYMALLOC, YYFREE): Define only if needed.
6504 (malloc, free): Declare, but only if needed, as this infringes on
6505 the user name space.
6506
4d1801f1
PE
65072005-05-25 Paul Eggert <eggert@cs.ucla.edu>
6508
6509 Fix BeOS, FreeBSD, MacOS porting problems reported by Bruno Haible.
6510 * lib/bitset.c (bitset_print): Don't assume size_t can be printed
6511 with %d format.
6512 * lib/ebitset.c (min, max): Undef before defining.
6513 * lib/vbitset.c (min, max): Likewise.
6514 * lib/subpipe.c (create_subpipe): Save local variables in case
6515 vfork clobbers them.
6516
65172005-05-24 Bruno Haible <bruno@clisp.org>
6518
6519 * tests/synclines.at (AT_SYNCLINES_COMPILE): Add support for the
6520 error message syntax used by gcc-4.0.
6521
b94a9e1e
PE
65222005-05-23 Paul Eggert <eggert@cs.ucla.edu>
6523
85ac3861
PE
6524 * README: Mention m4 1.4.3. Remove obsolete advice about
6525 Sun Forte Developer 6 update 2, VMS, and MS-DOS.
6526
b94a9e1e
PE
6527 * bootstrap: Remove workaround for problem I encountered with
6528 gettext 0.14.1; it seems to be fixed now.
6529
51c30d21
PE
65302005-05-22 Paul Eggert <eggert@cs.ucla.edu>
6531
009ce67d
PE
6532 * NEWS: Version 2.0a.
6533
f2a97c62
PE
6534 * src/files.c: Include "stdio-safer.h"; this fixes a typo in
6535 the previous change.
6536
c8775f93
PE
6537 Various maintainer cleanups.
6538 * .cvsignore: Add a.exe, a.out, b.out,, conf[0-9]*, confdefs*,
6539 conftest*, for benefit of CVS commands run at the same time as
6540 "configure". Add build-aux, since "bootstrap" now creates it and
6541 its subfiles.
6542 * Makefile.cfg (move_if_change): Remove.
6543 * Makefile.maint: Remove the update stuff; we now use "bootstrap".
6544 (ftp-gnu, www-gnu, move_if_change, local_updates, update):
6545 (po_repo, do-po-update, po-update, wget_files, get-targets):
6546 (config.guess-url_prefix, config.sub-url_prefix):
6547 (ansi2knr.c-url_prefix, texinfo.tex-url_prefix):
6548 (standards.texi-url_prefix, make-stds.texi-url_prefix, taget, url):
6549 ($(get-targets), cvs-files, automake_repo, wget-update, cvs-update):
6550 Remove.
6551 * configure.ac (AC_CONFIG_AUX_DIR): Change from config to build-aux;
6552 this is now the recommended name.
6553 * config/.cvsignore: Remove config.guess, config.rpath, config.sub,
6554 depcomp, install-sh, mdate-sh, missing, mkinstalldirs, texinfo.tex,
6555 ylwrap. These files now go into build-aux.
6556 * config/move-if-change: Remove.
6557 * config/prev-version.txt: Bump from 1.75 to 2.0.
6558
3ea5f0ec
PE
6559 * bootstrap: Add stdio-safer, unistd-safer modules.
6560 Remove m4/glibc2.m4 (introduced by latest gnulib, but
6561 we don't need it).
6562 * lib/.cvsignore: Add dup-safer.c, fd-safer.c,
6563 fopen-safer.c, stdio-safer.h, unistd-safer.h.
6564 * lib/subpipe.c: Include "unistd-safer.h".
6565 (create_subpipe): Make sure all the newly-created
6566 file descriptors are > 2, so that diagnostics don't
6567 get sent down them (which might cause Bison to hang, in theory).
6568 * m4/.cvsignore: Add stdio-safer.m4, unistd-safer.m4.
6569 * src/files.c (xfopen): Use fopen_safer, not fopen.
6570
51c30d21
PE
6571 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Port
6572 yesterday's yacc.c fix.
6573
cea1469d
PE
65742005-05-21 Paul Eggert <eggert@cs.ucla.edu>
6575
3ea5f0ec
PE
6576 * data/glr.c, data/lalr1.cc: Update copyright date.
6577
cea1469d
PE
6578 Fix a destructor bug reported by Wolfgang Spraul in
6579 <http://lists.gnu.org/archive/html/bug-bison/2005-05/msg00042.html>.
6580 * data/yacc.c (yyabortlab): Don't call destructor, and
6581 don't set yychar to EMPTY.
6582 (yyoverflowlab): Don't call destructor.
6583 (yyreturn): Call destructor, if yychar is neither YYEOF nor YYEMPTY.
6584 * tests/calc.at (AT_CHECK_CALC): Expect one fewer output lines,
6585 since we no longer output the message "discarding lookahead token
6586 end of input ()".
6587
5e6f62f2
PH
65882005-05-20 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
6589
6590 * data/glr.c (YY_SYMBOL_PRINT): Don't print newline at end to
6591 fix a small glitch in debugging output.
6592 (yyprocessOneStack, yyrecoverSyntaxError, yyparse): Print newline
6593 after YY_SYMBOL_PRINT where needed.
6594
6595 (struct yyGLRState): Add some comments.
6596 (struct yySemanticOption): Add some comments.
6597 (union yyGLRStackItem): Add comment.
6598
6599 (yymergeOptionSets): Correct this to properly perform the union,
6600 avoiding infinite reported by Michael Rosien.
6601 Update comment.
6602
6603 * tests/glr-regression.at: Add test for GLR merging error reported
6604 by M. Rosien.
cea1469d 6605
0fb669f9
PE
66062005-05-13 Paul Eggert <eggert@cs.ucla.edu>
6607
6608 * COPYING, ChangeLog, GNUmakefile, HACKING, Makefile.am,
6609 Makefile.cfg, Makefile.maint, NEWS, README, README-alpha,
6610 README-cvs, TODO, bootstrap, configure.ac, data/Makefile.am,
6611 data/README, data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c,
6612 data/m4sugar/m4sugar.m4, doc/Makefile.am, doc/bison.texinfo,
6613 doc/fdl.texi, doc/gpl.texi, doc/refcard.tex, lib/Makefile.am,
6614 lib/abitset.c, lib/abitset.h, lib/bbitset.h, lib/bitset.c,
6615 lib/bitset.h, lib/bitset_stats.c, lib/bitset_stats.h,
6616 lib/bitsetv-print.c, lib/bitsetv-print.h, lib/bitsetv.c,
6617 lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/get-errno.c,
6618 lib/get-errno.h, lib/lbitset.c, lib/lbitset.h, lib/libiberty.h,
6619 lib/main.c, lib/subpipe.c, lib/subpipe.h, lib/timevar.c,
6620 lib/timevar.def, lib/timevar.h, lib/vbitset.c, lib/vbitset.h,
6621 lib/yyerror.c, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4, m4/timevar.m4,
6622 m4/warning.m4, src/LR0.c, src/LR0.h, src/Makefile.am, src/assoc.c,
6623 src/assoc.h, src/closure.c, src/closure.h, src/complain.c,
6624 src/complain.h, src/conflicts.c, src/conflicts.h, src/derives.c,
6625 src/derives.h, src/files.c, src/files.h, src/getargs.c,
6626 src/getargs.h, src/gram.c, src/gram.h, src/lalr.c, src/lalr.h,
6627 src/location.c, src/location.h, src/main.c, src/muscle_tab.c,
6628 src/muscle_tab.h, src/nullable.c, src/nullable.h, src/output.c,
6629 src/output.h, src/parse-gram.c, src/parse-gram.h,
6630 src/parse-gram.y, src/print.c, src/print.h, src/print_graph.c,
6631 src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c,
6632 src/reduce.h, src/relation.c, src/relation.h, src/scan-gram.l,
6633 src/scan-skel.l, src/state.c, src/state.h, src/symlist.c,
6634 src/symlist.h, src/symtab.c, src/symtab.h, src/system.h,
6635 src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h,
6636 src/vcg.c, src/vcg.h, src/vcg_defaults.h, tests/Makefile.am,
6637 tests/actions.at, tests/c++.at, tests/calc.at, tests/conflicts.at,
6638 tests/cxx-type.at, tests/existing.at, tests/glr-regression.at,
6639 tests/headers.at, tests/input.at, tests/local.at, tests/output.at,
6640 tests/reduce.at, tests/regression.at, tests/sets.at,
6641 tests/synclines.at, tests/testsuite.at, tests/torture.at:
6642 Update FSF postal mail address.
6643
51f4735e
PE
66442005-05-11 Paul Eggert <eggert@cs.ucla.edu>
6645
6646 * tests/local.at (AT_COMPILE_CXX): Treat LDFLAGS like AT_COMPILE does.
6647 Problem reported by Ralf Menzel.
6648
80ce3401
PE
66492005-05-01 Paul Eggert <eggert@cs.ucla.edu>
6650
6651 * tests/actions.at: Test that stack overflow invokes destructors.
6652 From Marcus Holland-Moritz.
6653 * data/yacc.c (yyerrlab): Move the code that destroys the stack
6654 from here....
6655 (yyreturn): to here. That way, destructors are called properly
6656 even if the stack overflows, or the user calls YYACCEPT or
6657 YYABORT. Stack-overflow problem reported by Marcus Holland-Moritz.
6658 (yyoverflowlab): Destroy the lookahead.
6659
66602005-04-24 Paul Eggert <eggert@cs.ucla.edu>
6661
6662 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): Add more-descriptive comment.
6663
72f000b0
PE
66642005-04-17 Paul Eggert <eggert@cs.ucla.edu>
6665
6666 * NEWS: Bison-generated C parsers no longer quote literal strings
6667 associated with tokens.
6668 * src/output.c (prepare_symbols): Don't escape strings,
6669 since users don't want to see C escapes.
6670 * tests/calc.at (AT_CHECK_CALC): Adjust to lack of quotes
6671 in diagnostics.
c19683bb 6672 * tests/input.at (Torturing the Scanner): Likewise.
72f000b0
PE
6673 * tests/regression.at (Token definitions, Web2c Actions): Likewise.
6674
1094323f
PE
66752005-04-16 Paul Eggert <eggert@cs.ucla.edu>
6676
6677 * tests/torture.at (AT_INCREASE_DATA_SIZE): Skip the test if
6678 the data size is known to be too small and we can't increase it.
6679 This works around an HP-UX 11.00 glitch reported by Andrew Benham.
6680
ca407bdf
PE
66812005-04-15 Paul Eggert <eggert@cs.ucla.edu>
6682
6683 * src/parse-gram.y: Include quotearg.h.
6684 (string_as_id): Quote $1 before using it as a key, since the
6685 lexer no longer quotes it for us.
6686 (string_content): Don't strip quotes, since lexer no longer
6687 quotes it for us.
6688 * src/scan-gram.l: Include quotearg.h.
6689 ("\""): Omit quote.
6690 ("'"<SC_ESCAPED_CHARACTER>): Quote symbol before using it as
6691 a key, since the rest of the lexer doesn't quote it.
6692 * src/symtab.c (symbol_get): Don't quote symbol; caller does it now.
6693 * tests/regression.at (Token definitions): Check for backslashes
6694 in token strings.
6695
6696 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): New macro.
6697 (YYSIZE_T): Define to unsigned long int when using an older compiler.
6698 (yyparse): Revamp code to generate long syntax error message, to
6699 make it easier to translate, and to avoid problems with arithmetic
6700 overflow. Change "virtual memory" to "memory" in diagnostic, since
6701 we don't know whether the memory is virtual.
6702
1ce59070
PE
67032005-04-13 Paul Eggert <eggert@cs.ucla.edu>
6704
6705 * NEWS: Bison-generated C parsers now use the _ macro to
6706 translate strings.
6707 * data/yacc.c (_) [!defined _]: New macro.
6708 All English strings wrapped inside this macro.
6709 * doc/bison.texinfo (Bison Parser): Document _.
6710 * po/POTFILES.in: Include src/parse-gram.c, since it now
6711 includes translateable strings that parse-gram.y doesn't.
6712
a749a695
PE
67132005-04-12 Paul Eggert <eggert@cs.ucla.edu>
6714
6715 * src/symtab.c (symbol_make_alias): Call symbol_type_set,
6716 reverting the 2004-10-11 change to this function.
6717 (symbol_check_alias_consistency): Don't call symbol_type_set
6718 if the type name is already correct.
6719 * tests/input.at (Typed symbol aliases): New test, from Tim Van Holder.
6720
8fb1053b
PE
67212005-03-25 Paul Eggert <eggert@cs.ucla.edu>
6722
6723 * tests/regression.at (Token definitions): Don't use a token named
6724 c, as that generates a "#define c ..." that runs afoul of buggy
6725 stdlib.h that uses the identifier c as a member of struct
6726 drand48_data. Problem reported by Horst Wente.
6727
ff498c4a
PE
67282005-03-21 Paul Eggert <eggert@cs.ucla.edu>
6729
6730 * bootstrap: Change translation URL from
6731 http://www2.iro.umontreal.ca/~gnutra/po/maint/bison/ to
6732 http://www.iro.umontreal.ca/translation/maint/bison/ to avoid
6733 redirection glitches. Problem reported by twlevo@xs4all.nl.
6734
65211d70
PE
67352005-03-20 Paul Eggert <eggert@cs.ucla.edu>
6736
6737 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Don't put options
6738 after operands; POSIX says this isn't portable for the c99 command.
6739
9577fb1f
PE
67402005-03-18 Paul Eggert <eggert@cs.ucla.edu>
6741
6742 * tests/glr-regression.at (glr-regr2a.y): Try to dump core
6743 immediately if a data overrun has occurred; this may help us track
6744 down what may be a spurious failure on MacOS.
6745
78b178f7
PE
67462005-03-17 Paul Eggert <eggert@cs.ucla.edu>
6747
a2599d0f
PE
6748 Respond to problems reported by twlevo@xs4all.nl.
6749
6750 * bootstrap: Use "trap - 0" rather than the unportable "trap 0".
6751
78b178f7
PE
6752 * src/vcg.h: Comment fix.
6753 * src/vcg_defaults.h: Parenthesize macro bodies to make them safe.
6754 (G_CMAX): Change to -1 instead of INT_MAX.
6755
6756 * data/yacc.c (yyparse): Omit spaces before #line.
78b178f7 6757
7296e729
PE
67582005-03-15 Paul Eggert <eggert@cs.ucla.edu>
6759
6760 * src/tables.c (state_number_to_vector_number): Put it inside an
6761 "#if 0", since it's not currently used. Problem reported by
6762 Roland McGrath.
6763
05ac60f3
PE
67642005-03-06 Paul Eggert <eggert@cs.ucla.edu>
6765
6766 * src/output.c (escaped_output): Renamed from
6767 escaped_file_name_output, since we now use it for symbol tags as
6768 well. All uses changed.
6769 (symbol_destructors_output, symbol_printers_output):
6770 Escape symbol tags too.
6771 Problem reported by Matyas Forstner in
6772 <http://lists.gnu.org/archive/html/bug-bison/2005-03/msg00009.html>.
6773
6774 * src/muscle_tab.c (muscle_code_grow): Don't quote numbers; it's
6775 not needed.
6776 * src/output.c (user_actions_output, token_definitions_output,
6777 symbol_destructors_output, symbol_printers_output): Likewise.
6778 * src/reader.c (prologue_augment): Likewise.
6779 * src/scan-gram.l (handle_action_dollar, handle_action_at): Likewise.
6780
6781 * src/vcg.c (output_edge): Don't quote linestyle arg.
6782 Problem reported by twlevo@xs4all.nl.
6783
7eb453ac
PE
67842005-02-28 Paul Eggert <eggert@cs.ucla.edu>
6785
6786 * doc/bison.texinfo (Semantic Tokens): Fix scoping problem in
6787 example, reported by Derek M Jones. Also, make the example even
6788 more outrageous, to better illustrate how bad the problem is.
6789
4c04c52a
PE
67902005-02-24 Paul Eggert <eggert@cs.ucla.edu>
6791
6792 * doc/bison.texinfo (Mfcalc Symtab): Correct the prototype for
6793 putsym. Typo reported by Sebastian Piping.
6794
a61e1620
PE
67952005-02-23 Paul Eggert <eggert@cs.ucla.edu>
6796
6797 * doc/bison.texinfo (Language and Grammar): some -> same
6798 (Epilogue): int he -> in the
6799 Typos reported by Sebastian Piping via Justin Pence.
6800
9ec93868
PE
68012005-02-07 Paul Eggert <eggert@cs.ucla.edu>
6802
6803 * tests/glr-regression.at (Improper handling of embedded actions
6804 and dollar(-N) in GLR parsers): Renamed from "Improper handling of
6805 embedded actions and $-N in GLR parsers", work around an Autoconf bug
6806 with dollar signs in test names.
6807 * tests/input.at (Invalid dollar-n): Renamed from "Invalid \$n",
6808 for a similar reason.
6809
73ce7e7e
PE
68102005-01-28 Paul Eggert <eggert@cs.ucla.edu>
6811
6812 * src/vcg.c (output_graph): G_VIEW -> normal_view in case someone
6813 wants to redefine G_VIEW.
6814
2e72b98e
PE
68152005-01-27 Paul Eggert <eggert@cs.ucla.edu>
6816
6817 * src/vcg.c (get_view_str): Remove case for normal_view.
6818 Problem reported by twlevo@xs4all.nl.
6819
e0d634e5
PE
68202005-01-24 Paul Eggert <eggert@cs.ucla.edu>
6821
ccf830a4
PE
6822 * configure.ac (O0CFLAGS, O0CXXFLAGS): Fix quoting bug.
6823 Problem reported by twlevo@xs4all.nl.
6824
e0d634e5
PE
6825 * doc/bison.texinfo: Change @dircategory from "GNU programming
6826 tools" to "Software development". Requested by Richard Stallman
6827 via Karl Berry.
6828
7bbc8cb0
PE
68292005-01-23 Paul Eggert <eggert@cs.ucla.edu>
6830
6831 * tests/c++.at (AT_CHECK_DOXYGEN): Don't use options after operands.
6832 Problem reported by twlevo@xs4all.nl.
6833
08b770bc
PE
68342005-01-21 Paul Eggert <eggert@cs.ucla.edu>
6835
6836 * data/yacc.c (YYCOPY, yystpcpy, yyparse): Remove "register"
6837 keyword; it's not needed with modern compilers, and it doesn't
6838 affect correctness with older compilers. Suggested by
6839 twlevo@xs4all.nl.
6840
95f22ad2
PE
68412005-01-17 Paul Eggert <eggert@cs.ucla.edu>
6842
6843 * data/glr.c (yyuserAction): Add "default: break;" case to pacify
6844 gcc -Wswitch-default.
6845 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
6846 * data/yacc.c (yyparse): Likewise.
6847
d229d15c
PE
68482005-01-12 Paul Eggert <eggert@cs.ucla.edu>
6849
6850 * src/system.h (OUTPUT_EXT, TAB_EXT): Define only if not defined
6851 already. Let config.h define any nonstandard values.
6852
ecadd90f
PE
68532005-01-10 Paul Eggert <eggert@cs.ucla.edu>
6854
6855 * tests/calc.at (_AT_DATA_CALC_Y): Use alarm (100), not alarm (10),
6856 for the benefit of slower hosts. Problem reported by
6857 Nelson H. F. Beebe.
6858
213744b5
PE
68592005-01-07 Paul Eggert <eggert@cs.ucla.edu>
6860
6861 * data/yacc.c (yyparse): Pacify non-GCC compilers about yyerrorlab
6862 being defined and not used.
6863 * data/lalr1.cc (yyparse): Likewise.
6864 Use "if (false)" rather than "if (0)".
6865
249d3236
PE
68662005-01-05 Paul Eggert <eggert@cs.ucla.edu>
6867
6868 * TODO: Mention that we should allow NUL bytes in tokens.
6869
987cc1fb
PE
68702005-01-02 Paul Eggert <eggert@cs.ucla.edu>
6871
6872 * src/scan-skel.l (<<EOF>>): Don't close standard output.
6873 Problem reported by Hans Aberg.
6874
08fe02d9
PE
68752005-01-01 Paul Eggert <eggert@cs.ucla.edu>
6876
6877 * src/getargs.c (version): Happy new year; update overall
6878 program copyright date from 2004 to 2005.
6879
6880 * src/scan-skel.l ("@output ".*\n): Don't close standard output.
6881 Problem reported by Hans Aberg.
6882 * tests/output.at (AT_CHECK_OUTPUT): New arg SHELLIO.
6883 (Output file names.): Add a test for the case when standard output
6884 is closed.
6885
010c0266
PE
68862004-12-26 Paul Eggert <eggert@cs.ucla.edu>
6887
6888 * doc/bison.texinfo (@copying): Update FDL version number to 1.2,
6889 to fix an oversight in the Bison 2.0 manual.
6890
da12206a
PE
68912004-12-25 Paul Eggert <eggert@cs.ucla.edu>
6892
6893 * NEWS: Version 2.0. Reformat the existing news items since
6894 1.875, so that related items are grouped together.
3a4734aa 6895 * configure.ac (AC_INIT): Bump version to 2.0.
da12206a
PE
6896 * src/parse-gram.c, src/parse-gram.h: Regenerate with 2.0.
6897
c935d934
PE
6898 * tests/torture.at (Exploding the Stack Size with Alloca): Set
6899 YYSTACK_USE_ALLOCA to 1 if __GNUC__ or alloca are defined;
6900 otherwise, we're not testing alloca. Unfortunately there's no
6901 simple way to consult HAVE_ALLOCA here.
6902
da12206a
PE
6903 * data/lalr1.cc (yydestruct_): Pacify unused variable warning
6904 for yymsg, too.
6905
6906 * src/LR0.c (new_itemsets): Use memset rather than zeroing by
6907 hand. This avoids a warning about comparing int to size_t when
6908 GCC warnings are enabled.
6909
0a2c5137
PE
69102004-12-22 Paul Eggert <eggert@cs.ucla.edu>
6911
d7e14fc0
PE
6912 * NEWS: Bison-generated parsers no longer default to using the
6913 alloca function (when available) to extend the parser stack, due
6914 to widespread problems in unchecked stack-overflow detection.
6915 * data/glr.c (YYMAXDEPTH): Remove undef when zero. It's the user's
6916 responsibility to set it to a positive value. This lets the user
6917 specify a value that is not a preprocessor constant.
6918 * data/yacc.c (YYMAXDEPTH): Likewise.
6919 (YYSTACK_ALLOC): Define only if YYSTACK_USE_ALLOCA is nonzero.
6920 * doc/bison.texinfo (Stack Overflow): YYMAXDEPTH no longer needs
6921 to be a compile-time constant. However, explain the constraints on it.
6922 Also, explain the constraints on YYINITDEPTH.
6923 (Table of Symbols): Explain that alloca is no longer the default.
6924 Explain the user's responsibility if they define YYSTACK_USE_ALLOCA
6925 to 1.
6926
0a2c5137
PE
6927 * doc/bison.texinfo (Location Default Action): Mention that n must
6928 be zero when k is zero. Suggested by Frank Heckenbach.
6929
e019c247
AD
69302004-12-22 Akim Demaille <akim@epita.fr>
6931
6932 * data/lalr1.cc (parser::token_number_type, parser::rhs_number_type)
6933 (parser::state_type, parser::semantic_type, parser::location_type):
6934 Private, not public.
6935 (parser::parse): Return ints, not bool.
6936 Returning a bool introduces a problem: 0 corresponds to false, and
6937 it seems weird to return false on success. Returning true changes
6938 the conventions for yyparse.
6939 Alternatively we could return void and send an exception.
6940 There is no clear consensus (yet?).
6941 (state_stack, semantic_stack, location_stack): Rename as...
6942 (state_stack_type, semantic_stack_type, location_stack_type): these.
6943 Private, not public.
6944 * tests/c++.at: New.
6945 * tests/testsuite.at, tests/Makefile.am: Adjust.
6946
72731bb7
AD
69472004-12-21 Akim Demaille <akim@epita.fr>
6948
6949 * data/lalr1.cc (parser::parse): Return a bool instead of an int.
6950
9a0d8bec
AD
69512004-12-21 Akim Demaille <akim@epita.fr>
6952
6953 Don't impose std::string for filenames.
6954
6955 * data/lalr1.cc (b4_filename_type): New.
6956 (position::filename): Use it.
6957 (parser.hh): Move the inclusion of stack.hh and location.hh below
6958 the user code, so that needed headers for the filename type can be
6959 included first.
72731bb7
AD
6960 Forward declare them before the user code.
6961 * tests/Makefile.am (check-local, installcheck-local): Pass
6962 TESTSUITEFLAGS to the TESTSUITE.
9a0d8bec 6963
99880de5
AD
69642004-12-20 Akim Demaille <akim@epita.fr>
6965
6966 Use more STL like names: my_class instead of MyClass.
6967
6968 * data/lalr1.cc (LocationStack, LocationType, RhsNumberType)
6969 (SemanticStack, SemanticType, StateStack, StateType)
6970 (TokenNumberType, Stack, Slice, Traits, Parser::location)
6971 (Parser::value): Rename as...
6972 (location_stack, location_type, rhs_number_type, semantic_stack)
6973 (semantic_type, state_stack, state_type, token_number_type, stack)
6974 (slice, traits, parser::yylloc, parser::yylval): these.
6975
6976 * tests/calc.at, tests/regression.at, tests/actions.at: Adjust.
6977
9bec482e
PE
69782004-12-19 Paul Eggert <eggert@cs.ucla.edu>
6979
6980 * data/glr.c (YYLLOC_DEFAULT): Use GNU spacing conventions.
6981 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
6982
f6fbd3da
PE
69832004-12-17 Paul Eggert <eggert@cs.ucla.edu>
6984
6985 Remove uses of 'short int' and 'unsigned short int'. This raises
6986 some arbitrary limits. It uses more memory but nowadays that's
6987 not much of an issue.
6988
6989 This change does not affect the generated parsers; that's a different
6990 task, as some users will want to conserve memory there.
6991
6992 Ideally we should use size_t to represent all object counts, and
6993 something like ptrdiff_t to represent signed differences of object
6994 counts; but that will require more code-cleanup than I have the
6995 time to do right now.
6996
6997 * src/LR0.c (allocate_itemsets, new_itemsets, save_reductions):
6998 Use size_t, not int or short int, to count objects.
6999 * src/closure.c (nritemset, closure): Likewise.
7000 * src/closure.h (nritemset, closure): Likewise.
7001 * src/nullable.c (nullable_compute): Likewise.
7002 * src/print.c (print_core): Likewise.
7003 * src/print_graph.c (print_core): Likewise.
7004 * src/state.c (state_compare, state_hash): Likewise.
7005 * src/state.h (struct state): Likewise.
7006 * src/tables.c (default_goto, goto_actions): Likewise.
7007
7008 * src/gram.h (rule_number, rule): Use int, not short int.
7009 * src/output.c (prepare_rules): Likewise.
7010 * src/state.h (state_number, STATE_NUMBER_MAXIMUM, transitions,
7011 errs, reductions): Likewise.
7012 * src/symtab.h (symbol_number, SYMBOL_NUMBER_MAXIMUM, struct symbol):
7013 Likewise.
7014 * src/tables.c (vector_number, tally, action_number,
7015 ACTION_NUMBER_MINIMUM): Likewise.
7016 * src/output.c (muscle_insert_short_int_table): Remove.
7017
efeed023
AD
70182004-12-17 Akim Demaille <akim@epita.fr>
7019
7020 * data/lalr1.cc: Extensive Doxygenation.
7021 (error_): Rename as...
7022 (error): this, since it is visible to the user.
7023 Adjust callers.
7024 (Parser::message): Now an automatic variable from...
7025 (Parser::yyreport_syntax_error_): here.
7026 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust to
7027 Parser::error.
7028 * tests/input.at: Escape $.
7029
bc82c5a5
PE
70302004-12-16 Paul Eggert <eggert@cs.ucla.edu>
7031
7032 * data/glr.c (b4_lhs_value, b4_rhs_value, b4_rhs-location):
7033 Parenthesize rhs to avoid obscure problems with mistakes like
7034 "foo$$bar = foo$1bar;". Problem reported by twlevo at xs4all.
7035 * data/lalr1.cc (b4_lhs_value, b4_rhs_value, b4_lhs_location,
7036 b4_rhs_location): Likewise.
7037 * data/yacc.c (b4_lhs_value, b4_rhs_value, b4_lhs_location,
7038 b4_rhs_location): Likewise.
7039
fd19f271
AD
70402004-12-16 Akim Demaille <akim@epita.fr>
7041
7042 * data/lalr1.cc (yyreport_syntax_error_): Catch up with glr.c and
7043 yacc.c: be sure to stay within yycheck_.
7044 * tests/actions.at: Re-enable C++ tests.
7045
10454ea4
AD
70462004-12-16 Akim Demaille <akim@epita.fr>
7047
7048 * src/print_graph.c (print_graph): Remove layoutalgorithm uses for
7049 real.
7050
c5b95ccf
AD
70512004-12-16 Akim Demaille <akim@epita.fr>
7052
7053 Use #define to handle the %name-prefix.
7054
7055 * data/glr.c, data/yacc.c: Comment changes.
7056 * data/lalr1.cc (yylex): Use #define to select the name of yylex,
7057 so that one can refer to yylex in the parser file, and have it
7058 renamed, as is the case with other skeletons.
7059
617a8f12
AD
70602004-12-16 Akim Demaille <akim@epita.fr>
7061
7062 Move lalr1.cc internals into yy*.
7063
7064 * data/lalr1.cc (semantic_stack_, location_stack_, state_stack_)
7065 (semantic_stack_, location_stack_, pact_, pact_ninf_, defact_)
7066 (pgoto_, defgoto_, table_, table_ninf_, check_, stos_, r1_, r2_)
7067 (name_, rhs_, prhs_, rline_, token_number_, eof_, last_, nnts_)
7068 (empty_, final_, terror_, errcode_, ntokens_)
7069 (user_token_number_max_, undef_token_, n_, len_, state_, nerrs_)
7070 (looka_, ilooka_, error_range_, nerrs_):
7071 Rename as...
7072 (yysemantic_stack_, yylocation_stack_, yystate_stack_)
7073 (yysemantic_stack_, yylocation_stack_, yypact_, yypact_ninf_)
7074 (yydefact_, yypgoto_, yydefgoto_, yytable_, yytable_ninf_)
7075 (yycheck_, yystos_, yyr1_, yyr2_, yyname_, yyrhs_, yyprhs_)
7076 (yyrline_, yytoken_number_, yyeof_, yylast_, yynnts_, yyempty_)
7077 (yyfinal_, yyterror_, yyerrcode_, yyntokens_)
7078 (yyuser_token_number_max_, yyundef_token_, yyn_, yylen_, yystate_)
7079 (yynerrs_, yylooka_, yyilooka_, yyerror_range_, yynerrs_):
7080 these.
7081
1e547e6e
PE
70822004-12-15 Paul Eggert <eggert@cs.ucla.edu>
7083
7084 Fix some problems reported by twlevo at xs4all.
7085 * src/symtab.c (symbol_new): Report an error if the input grammar
7086 contains too many symbols. This is better than calling abort() later.
7087 * src/vcg.h (enum layoutalgorithm): Remove. All uses removed.
7088 (struct node, struct graph):
7089 Rename member expand to stretch. All uses changed.
7090 (struct graph): Remove member layoutalgorithm. All uses removed.
7091 * src/vcg.c (get_layoutalgorithm_str): Remove. All uses removed.
7092 * src/vcg_defaults.h (G_STRETCH): Renamed from G_EXPAND.
7093 All uses changed.
7094 (N_STRETCH): Rename from N_EXPAND. All uses changed.
7095
735d6bd4
AD
70962004-12-15 Akim Demaille <akim@epita.fr>
7097
7098 * data/lalr1.cc: Normalize /** \brief ... */ to ///.
7099 Add more Doxygen comments.
7100 (symprint_, stack_print_, reduce_print_, destruct_, pop)
7101 (report_syntax_error_, translate_): Rename as...
7102 (yysymprint_, yystack_print_, yyreduce_print_, yydestruct_)
7103 (yypop_, yyreport_syntax_error_, yytranslate_): this.
7104
2e1f5829
AD
71052004-12-15 Akim Demaille <akim@epita.fr>
7106
7107 * data/lalr1.cc (lex_): Rename as...
7108 (yylex_): this.
7109 Move the trace here.
7110 Take the %name-prefix into account.
7111 Reported by Alexandre Duret-Lutz.
7112
a3cb6248
AD
71132004-12-15 Akim Demaille <akim@epita.fr>
7114
7115 Simplify the C++ parser constructor.
7116
7117 * data/lalr1.cc (debug_): Rename as...
7118 (yydebug_): so that the parser's internals are always in the yy*
7119 pseudo namespace.
7120 Adjust uses.
7121 (b4_parse_param_decl): Remove the leading comma as it is now only
7122 called as unique argument list.
7123 (Parser::Parser): Remove the constructor accepting a location and
7124 an initial debugging level.
7125 Remove from the other ctor the argument for the debugging level.
7126 (debug_level_type, debug_level, set_debug_level): New.
7127
7128 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust
7129 constructor calls.
7130
07fed891
AD
71312004-12-15 Akim Demaille <akim@epita.fr>
7132
7133 Remove b4_root related material: failure experiment
a3cb6248 7134 (which goal was to allow to derive from a class).
07fed891
AD
7135
7136 * data/lalr1.cc (b4_root, b4_param, b4_constructor): Remove
7137 definitions and uses.
7138
e603eaa5
PE
71392004-12-14 Paul Eggert <eggert@cs.ucla.edu>
7140
7141 * data/glr.c (struct yyGLRStack): yyerror_range now has 3 items,
7142 not 2, since it's not portable to subtract 1 from the start of an
7143 array. The new item 0 is never set or used. All uses changed.
7144
7145 (yyrecoverSyntaxError): Use YYLLOC_DEFAULT instead of assuming
7146 the default definition of YYLLOC_DEFAULT. Problem reported
7147 by Frank Heckenbach.
7148
fafb007d
PE
71492004-12-12 Paul Eggert <eggert@cs.ucla.edu>
7150
7151 * data/glr.c (YYRHSLOC): Don't have two definitions, one for
7152 the normal case and one for the error case. Just use the
7153 first one uniformly. Problem reported by Frank Heckenbach.
7154 (YYLLOC_DEFAULT): Use the conventions of yacc.c, so we can
7155 use exactly the same macro in both places.
7156 (yyerror_range): Now of type yyGLRStackItem, not YYLTYPE,
7157 so that the normal-case YYRHSLOC works for the error case too.
7158 All uses changed.
7159 * data/yacc.c (YYRHSLOC): New macro, taken from glr.c.
7160 (YYLLOC_DEFAULT): Use the same macro as glr.c.
7161 * doc/bison.texinfo (Location Default Action): Don't claim that
7162 we have an array of locations. Use the same macro for both glr
7163 and lalr parsers. Mention YYRHSLOC. Mention what happens when
7164 the index is 0.
7165
48814dcd
PE
71662004-12-10 Paul Eggert <eggert@cs.ucla.edu>
7167
a4e1a53b
PE
7168 * HACKING: Update email addresses to send announcements to.
7169
48814dcd
PE
7170 * configure.ac (AC_INIT): Bump version to 1.875f.
7171
337116ba
PE
71722004-12-10 Paul Eggert <eggert@cs.ucla.edu>
7173
7174 * NEWS: Version 1.875e.
7175 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875e.
7176
7177 * src/scan-skel.l: Include "complain.h", for "fatal".
7178
7179 * src/relation.h (relation_print, relation_digraph):
7180 Relation sizes are of type relation_node, not size_t (this is
7181 merely a doc fix, since the two types are equivalent).
7182 (relation_transpose): Relation sizes are of type relation_node,
7183 not int.
7184 * src/relation.c: Likewise.
7185 (top, infinity): Now of type relation_node, not int.
7186 (traverse, relation_transpose): Use relation_node, not int.
7187
7188 * data/glr.c (yyuserAction, yyrecoverSyntaxError): Mark args
7189 with ATTRIBUTE_UNUSED if they're not used, to avoid GCC warning.
7190 (yyparse): Remove unused local introduced in 2004-10-25 patch.
7191
7192 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): New arg
68b082af 7193 specifying whether the test should be skipped. Use it tp
337116ba 7194 specify that the [%defines %skeleton "lalr1.cc"] tests currently
68b082af 7195 fail on some hosts, and should be skipped.
337116ba 7196
da2a7671
PE
71972004-12-08 Paul Eggert <eggert@cs.ucla.edu>
7198
7199 * src/system.h (CALLOC, MALLOC, REALLOC): Remove. All callers
7200 changed to use xcalloc, xnmalloc, xnrealloc, respectively,
7201 unless otherwise specified below.
7202
7203 * src/LR0.c (allocate_itemsets): Use xnmalloc, not xcalloc,
7204 to allocate kernel_base, kernel_items, kernel_size, since
7205 they needn't be initialized to 0.
7206 (allocate_storgae): Likewise, for shiftset, redset, shift_symbol.
7207 * src/closure.c (new_closure): Likewise, for itemset.
7208 * src/derives.c (derives_compute): Likewise, for delts, derives, q.
7209 * src/lalr.c (set_goto_map): Likewise, for temp_map.
7210 (initialize_F): Likewise, for reads, edge, reads[i], includes[i].
7211 (build_relations): Likewise for edge, states1, includes.
7212 * src/nullable.c (nullable_compute): Likewise, for squeue, relts.
7213 * src/reader.c (packgram): Likewise, for ritem, rules.
7214 * src/reduce.c (nonterminals_reduce): Likewise for nontermmap.
7215 * src/relation.c (relation_digraph): Likewise for VERTICES.
7216 (relation_transpose): Likewise for new_R, end_R.
7217 * src/symtab.c (symbols_token_translations_init): Likewise for
7218 token_translations.
7219 * src/tables.c (save_row): Likewise for froms, tos, conflict_tos.
7220 (token_actions): Likewise for yydefact, actrow, conflrow,
7221 conflict_list.
7222 (save_column): Likewise for froms[symno], tos[symno].
7223 (goto_actions): Likewise for state_count.
7224 (pack_table): Likewise for base, pos, check.
7225 (tables_generate): Likewise for width.
7226
7227 * src/LR0.c (set_states): Don't reuse kernel_size and kernel_base
7228 for initial core. Just have a separate core, so we needn't worry
7229 about whether kernel_size and kernel_base are initialized.
7230
7231 * src/LR0.c (shift_symbol, redset, shiftset, kernel_base,
7232 kernel_size, kernel_items): Remove unnecessary initialization.
7233 * src/conflicts.c (conflicts): Likewise.
7234 * src/derives.c (derives): Likewise.
7235 * src/muscle_tablc (muscle_insert): Likewise.
7236 * src/relation.c (relation_digraph): Likewise.
7237 * src/tables.c (froms, tos, conflict_tos, tally, width, actrow, order,
7238 conflrow, conflict_table, conflict_list, table, check):
7239 Likewise.
7240
7241 * src/closure.c (new_closure): Arg is of type unsigned int, not int.
7242 This is because all callers pass unsigned int.
7243 * src/closure.h (new_closure): Likewise.
7244
7245 * src/lalr.c (initialize_F): Initialize reads[i] in all cases.
7246 (build_relations): Initialize includes[i] in all cases.
7247 * src/reader.c (packgram): Always initialize rules[ruleno].prec
7248 and rules[ruleno].precsym. Initialize members in order.
7249 * src/relation.c (relation_transpose): Always initialize new_R[i]
7250 and end_R[i].
7251 * src/table.c (conflict_row): Initialize 0 at end of conflict_list.
7252
7253 * src/output.c (prepare_actions): Pass 0 instead of conflict_list[0];
7254 conflict_list[0] was always 0, but now it isn't initialized.
7255
7256 * src/table.c (table_grow): When conflict_table grew, the grown
7257 area wasn't cleared. Fix this.
7258
7259 * lib/.cvsignore: Add strdup.c, strdup.h.
7260 * m4/.cvsignore: Add strdup.m4.
7261
00baeeac
PE
72622004-12-07 Paul Eggert <eggert@cs.ucla.edu>
7263
7264 * src/lalr.h (GOTO_NUMBER_MAXIMUM): New macro.
7265 * src/lalr.c (set_goto_map): Don't allow ngotos to equal
7266 GOTO_NUMBER_MAXIMUM, since we occasionally compute
7267 ngotos + 1 without checking for overflow.
7268 (build_relations): Use END_NODE, not -1, to denote end of edges.
7269 * src/lalr.c (set_goto_map, map_goto, initialize_F, add_loopback_edge,
7270 build_relations): Use goto_number, not int, for goto numbers.
7271 * src/tables.c (save_column, default_goto): Likewise.
7272
be3d9d42
AD
72732004-11-23 Akim Demaille <akim@epita.fr>
7274
7275 * data/lalr1.cc (YYSTYPE): Define it as is done for C, instead
7276 of #defining from yystype.
7277 Don't typedef yystype, C++ does not need it.
7278 This lets it possible to forward declare it as union.
7279
78e526d5
PE
72802004-11-23 Paul Eggert <eggert@cs.ucla.edu>
7281
7282 * bootstrap (gnulib_modules): Add extensions.
7283 Problem reported by Jim Meyering.
7284
afbb696d
PE
72852004-11-22 Paul Eggert <eggert@cs.ucla.edu>
7286
7287 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c,
7288 src/lalr.c, src/nullable.c, src/relation.c, src/scan-skel.l,
7289 src/system.h, src/tables.c: XFREE -> free, to accommodate
7290 recent change to gnulib xalloc.h.
78e526d5 7291 Problem reported by Jim Meyering.
afbb696d 7292
c1f8f16a
AD
72932004-11-17 Akim Demaille <akim@epita.fr>
7294
7295 * data/lalr1.cc (symprint_): Use cdebug_ to avoid warnings.
7296
db7e5eb5 72972004-11-17 Akim Demaille <akim@epita.fr>,
9a1e9989
AD
7298 Alexandre Duret-Lutz <adl@gnu.org>
7299
7300 * data/lalr1.cc (Parser::yycdebug_): New, a pointer, to allow
7301 changes.
7302 (YYCDEBUG): Adjust.
7303 Use it instead of cdebug_.
7304 (Parser::debug_stream, Parser::set_debug_stream): New.
7305 (Parser::symprint_): Define cdebug_ for temporary backward
7306 compatibility.
7307 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use
7308 debug_stream ().
7309
68e11668
AD
73102004-11-17 Akim Demaille <akim@epita.fr>
7311
7312 * data/lalr1.cc (Parser:print_): Remove, use %printer instead.
7313 * tests/regression.at (_AT_DATA_DANCER_Y): Adjust.
7314 * tests/calc.at (_AT_DATA_CALC_Y): Ditto.
7315 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
7316
97cbc73e
PE
73172004-10-27 Paul Eggert <eggert@cs.ucla.edu>
7318
7319 * data/glr.c (yyloc_default): Remove; not used.
7320 Problem reported by Frank Heckenbach.
7321
e342c3be
AD
73222004-10-25 Akim Demaille <akim@epita.fr>
7323
7324 * data/glr.c (YYRHSLOC): Move its definition next to its uses.
7325 Introduce another definition to address simple location arrays.
7326 (yyGLRStack): New member: yyerror_range.
7327 (yyrecoverSyntaxError, yyparse): Update it.
7328 (yyrecoverSyntaxError): Use it when shifting the error token to
7329 have an accurate range, equivalent to the one computed by both
7330 yacc.c and lalr1.cc.
7331 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Change its yylex so
7332 that column numbers start at column 0, as per GNU Coding
7333 Standards, the others tests, and the doc.
7334 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT_WITH_LOC):
7335 Adjust to the above change (first column is 0).
7336 And adjust the location of the "<error>", now covering the whole
7337 line.
7338
93602feb 73392004-10-22 Akim Demaille <akim@epita.fr>
04098407 7340 and Paul Eggert <eggert@cs.ucla.edu>
93602feb
PE
7341
7342 Remove some arbitrary limits on goto numbers and relations.
7343 * src/lalr.c (goto_map, ngotos, from_state, to_state): Omit
7344 initial values, since they're never used.
7345 (set_goto_map): ngotos is now unsigned, so test for overflow
7346 by seeing whether it wraps around to zero.
7347 * src/lalr.h (goto_number): Now size_t, not short int.
7348 (GOTO_NUMBER_MAXIMUM): Remove.
7349 * src/relation.c (relation_print, traverse, relation_transpose):
7350 Check for END_NODE rather than looking at sign.
7351 * src/relation.h (END_NODE): New macro.
7352 (relation_node): Now size_t, not short int.
7353
dba08b04
PE
73542004-10-22 Paul Eggert <eggert@cs.ucla.edu>
7355
7356 * doc/bison.texinfo (Language and Grammar): In example, "int" is a
7357 keyword, not an identifier. Problem reported by Baron Schwartz in
7358 <http://lists.gnu.org/archive/html/bug-bison/2004-10/msg00017.html>.
7359
df09ef2e
AD
73602004-10-11 Akim Demaille <akim@epita.fr>
7361
7362 * src/symtab.c (symbol_check_alias_consistency): Also check
7363 type names, destructors, and printers.
7364 Reported by Alexandre Duret-Lutz.
7365 Recode the handling of associativity and precedence in terms
7366 of symbol_precedence_set.
7367 Accept no redeclaration at all, not even equal to the previous
7368 value.
7369 (redeclaration): New.
7370 Use it to factor redeclaration complaints.
7371 (symbol_make_alias): Don't set the type of the alias, let
7372 symbol_check_alias_consistency do it as for other features.
7373 * src/symtab.h (symbol): Add new member prec_location, and
7374 type_location.
7375 * src/symtab.c (symbol_precedence_set, symbol_type_set): Set them.
7376 * tests/input.at (Incompatible Aliases): New.
7377
146bc99d
PE
73782004-10-09 Paul Eggert <eggert@cs.ucla.edu>
7379
7380 .cvsignore fixes to accommodate gnulib changes,
7381 and the practice of naming build directories "_build".
7382 * .cvsignore: Add "_*". Sort.
7383 * lib/.cvsignore: Add getopt_.h, xalloc-die.c.
7384 * m4/.cvsignore: Add "*_gl.m4".
7385
e503aa60
AD
73862004-10-06 Akim Demaille <akim@epita.fr>
7387
7388 * src/parse-gram.y (add_param): Fix the truncation of trailing
7389 spaces.
7390
b4a20338
AD
73912004-10-05 Akim Demaille <akim@epita.fr>
7392
7393 In Bison 1.875's yacc.c, YYLLOC_DEFAULT was called regardless
7394 whether the reducion was empty or not. This leaves room to
7395 improve the use of YYLLOC_DEFAULT in such a case.
7396 lalr1.cc is still experimental, so changing this is acceptable.
7397 And finally, there are probably not many users who changed the
7398 handling of locations in GLR, so changing is admissible too.
7399
7400 * data/glr.c, data/lalr1.cc, data/yacc.c (YYLLOC_DEFAULT): On an
7401 empty reduction, set @$ to an empty location ending the previously
7402 stacked symbol.
7403 Adjust uses to make sure the code is triggered on empty
7404 reductions.
7405 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust the
7406 expected output: empty reductions have empty locations.
7407
f85a5e6f
AD
74082004-09-29 Akim Demaille <akim@epita.fr>
7409
7410 * data/lalr1.cc: Move towards a more standard C++ coding style
7411 for templates: Class < T > -> Class<T>.
7412
b203fc2c
AD
74132004-09-29 Akim Demaille <akim@epita.fr>
7414
7415 * data/lalr1.cc: Reinstall the former ctor, for sake of
7416 compatibility, but warn it will be removed.
7417 Move towards a more standard C++ coding style (i.e., type *var ->
7418 type* var).
7419
5b7e1e73
PE
74202004-09-27 Paul Eggert <eggert@cs.ucla.edu>
7421
3fee967f
PE
7422 * src/parse-gram.y (add_param): Rewrite to avoid strchr,
7423 since it's less likely to work if NULs are involved in the future.
5b7e1e73 7424
0dcca5c2
AD
74252004-09-27 Akim Demaille <akim@epita.fr>
7426
7427 * data/yacc.c (YY_LOCATION_PRINT): Fix its default declaration.
7428
6dde1c82
AD
74292004-09-27 Akim Demaille <akim@epita.fr>
7430
7431 * data/lalr1.cc (b4_parse_param_decl_1): New.
b203fc2c 7432 (b4_parse_param_decl): Use it to have different names between attribute
6dde1c82
AD
7433 and argument names.
7434 (b4_cc_constructor_call): Likewise.
7435
b233d555
AD
74362004-09-24 Akim Demaille <akim@epita.fr>
7437
7438 * src/parse-gram.y (add_param): Strip the leading and trailing
7439 blanks from a formal argument declaration.
7440 (YY_LOCATION_PRINT): New.
7441
619404e3
AD
74422004-09-24 Akim Demaille <akim@epita.fr>
7443
7444 * data/c.m4 (b4_yysymprint_generate): Move the YYINPUT invocation
7445 after the location.
7446
dd8d9022
AD
74472004-09-24 Akim Demaille <akim@epita.fr>
7448
7449 * doc/bison.texinfo (Table of Symbols): Sort.
7450
0092f063
AD
74512004-09-21 Akim Demaille <akim@epita.fr>
7452
7453 * data/yacc.c, data/glr.c (b4_at_dollar, b4_dollar_dollar): Remove
7454 the useless parentheses.
7455 Suggested by Paul Eggert.
7456
451364ed
AD
74572004-09-20 Akim Demaille <akim@epita.fr>
7458
7459 Let the initial-action act on the look-ahead, and use it for the
7460 "initial push" (corresponding to an hypothetical beginning-of-file).
7461 And let lalr1.cc honor %initial-action.
7462
7463 * doc/bison.texinfo (Initial Action Decl): Clarify, and add an
7464 example.
7465 * data/lalr1.cc (Parser::initlocation_): Remove, bad experiment.
7466 (Parser::Parser): Remove the ctor that used to initialize it.
7467 (Parser::parse): Like in the other skeletons, issue the "starting
7468 parse" message before any action.
7469 Honor %initial-action.
7470 Initialize the stacks with the lookahead.
7471 * data/yacc.c: Let $$ and @$ in %initial-action designate the
7472 look-ahead.
7473 Push them in the stacks.
7474 * tests/actions.at, tests/calc.at: Adjust the C++ ctor invocations.
7475
18d192f0
AD
74762004-09-20 Akim Demaille <akim@epita.fr>
7477
7478 * doc/bison.texinfo (Initial Action Decl): New.
7479
b8458aa5
AD
74802004-09-20 Akim Demaille <akim@epita.fr>
7481
7482 * data/yacc.c (YY_LOCATION_PRINT): Use YYLTYPE_IS_TRIVIAL as a
7483 clearer criterion to define it.
7484 (parse): Initialize the initial location when YYLTYPE_IS_TRIVIAL.
7485 When reducing on an empty RHS, use the latest stacked location as
7486 location.
7487 yylloc is not always available.
7488 * data/glr.c: Likewise.
7489 Also, honor initial-actions.
7490
3fc16193
AD
74912004-09-20 Akim Demaille <akim@epita.fr>
7492
7493 * data/yacc.c (YY_LOCATION_PRINT): New.
7494 Define when we know YYLTYPE's structure, i.e., when the default
7495 YYLLOC_DEFAULT is used.
7496 * data/c.m4 (b4_yysymprint_generate): Use it.
7497 * data/lalr1.cc (YYLLOC_DEFAULT): Stop relying on the initial
7498 value of the result.
7499 (error_start_): Replace with...
7500 (error_range_): this location array.
7501 This allows to replace code relying on the implementation of
7502 locations by portable code.
7503 * data/yacc.c (yylerrsp): Replace with...
7504 (yyerror_range): this.
7505 Every time a token is popped, update yyerror_range[0], to have an
7506 accurate location for the error token.
7507 * data/glr.c (YY_LOCATION_PRINT): New.
7508 (yyprocessOneStack): Fix an invocation of YY_SYMBOL_PRINT:
7509 deference a pointer.
7510 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): No longer
7511 report the location in %printers.
7512
7513 * src/scan-skel.l: Instead of abort, report error messages to ease
7514 understanding skeleton scanning failures.
7515
ecfe33e7
AD
75162004-09-16 Akim Demaille <akim@epita.fr>
7517
7518 * data/lalr1.cc (Stack::Iterator, Stack::ConstIterator): Rename as...
7519 (iterator, const_iterator): these, to be more in the C++ spirit.
7520 Also, return reverse iterators so that when displaying the stack
7521 we display its bottom first.
7522 (Parser::stack_print_, Parser::reduce_print_): Match the messages
7523 from yacc.c.
7524 We should probably use vector here though.
7525
1576d44d
AD
75262004-09-16 Akim Demaille <akim@epita.fr>
7527
7528 Have more complete shift traces.
7529
7530 * data/yacc.c, data/lalr1.c, data/glr.c: Use YY_SYMBOL_PRINT
7531 to report Shifts instead of ad hoc YYDPRINTF invocations,
7532 including for the error token.
7533 * data/lalr1.cc (symprint_): Output the location.
7534 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): In C++, don't
7535 output the location within the %printer.
7536 Activate GLR tests, at least to make sure they compile properly.
7537 They still don't pass though.
7538 * tests/calc.at: Adjust expect verbose output, since now "Entering
7539 state..." is on a different line than the "Shifting" message.
7540
9c66f418
AD
75412004-09-08 Akim Demaille <akim@epita.fr>
7542
7543 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Move the
7544 Bison directive from the Bison file to the invocation of this
7545 macro, so that these directives are passed to
7546 AT_BISON_OPTION_PUSHDEFS to get correct help macros.
7547 Use these helping macros (e.g., AT_LOC, AT_VAL and so forth).
7548 Move the AT_SETUP/AT_CLEANUP outside, to report as test title
7549 the extra Bison directives instead of the whole series.
7550 Change the grammar so that there are recoverable errors, and
7551 unrecoverable errors. Now we can have the parser give up before
7552 consuming the whole input. As a result we now can observe that
7553 the lookahead is freed when needed.
7554 Change the parser source to parse argv[1] instead of a hard coded
7555 string.
7556 Simplify yylex, and give a value and location to EOF.
7557 Simplify some invocations of AT_CHECK_PRINTER_AND_DESTRUCTOR that
7558 passed directives already coded in the file.
7559 Add some tests to check the location of "error".
7560 For some tests, the C++ parser is correct, and not yacc.c.
7561 For other tests, they provide different, but unsatisfying, values,
7562 so keep the C++ value so that at least one parser is "correct"
7563 according to the test suite.
7564 (Actions after errors): Remove, this is subsumed by the
7565 AT_CHECK_PRINTER_AND_DESTRUCTOR series.
7566
52d5733f
AD
75672004-09-06 Akim Demaille <akim@epita.fr>
7568
7569 * data/lalr1.cc: Adjust the indentation of the labels.
04098407 7570 (Parser::pop): New.
52d5733f
AD
7571 Use it.
7572
a0e68930
AD
75732004-09-06 Akim Demaille <akim@epita.fr>
7574
7575 * data/yacc.cc, data/glr.cc (yydestruct): Accept an additional
7576 argument, an informative message.
7577 Call YY_SYMBOL_PRINT.
7578 Adjust all callers: integrate the associated YY_SYMBOL_PRINT.
7579 * data/lalr1.cc (destruct_): Likewise.
7580 In addition, no longer depend on b4_yysymprint_generate and
7581 b4_yydestruct_generate to generate these functions, do it "by
7582 hand".
7583
e757bb10
AD
75842004-09-03 Akim Demaille <akim@epita.fr>
7585
7586 * data/glr.c, data/lalr1.cc, data/yacc.c: When YYABORT was
7587 invoked, yydestruct the lookahead.
7588 * tests/calc.at (Calculator $1): Update the expected lengths of
7589 traces: there is an added line for the discarded lookahead.
7590 * doc/bison.texinfo (Destructor Decl): Some rewording.
7591 Define "discarded" symbols.
7592
0fe1f06d
AD
75932004-09-02 Akim Demaille <akim@epita.fr>
7594
7595 * data/lalr1.cc (translate_, destruct_): No reason to be static.
7596
284acc8b
AD
75972004-09-02 Akim Demaille <akim@epita.fr>
7598
7599 * data/glr.c, yacc.c (YYDSYMPRINT): Remove, not used.
7600 (YYDSYMPRINTF): Rename as...
7601 (YY_SYMBOL_PRINT): this.
7602 * data/lalr1.cc (YY_SYMBOL_PRINT): New, modeled after the previous
7603 two.
7604 Use it instead of direct symprint_ calls.
7605 (yybackup): Tweak the "Now at end of input" case to match yacc.c's
7606 one.
7607
a5eb1ed2
AD
76082004-09-02 Akim Demaille <akim@epita.fr>
7609
b7c72fe1
AD
7610 * data/lalr1.cc (b4_yysymprint_generate): New.
7611 (symprint_): New member function, defined when YYDEBUG.
7612 Use it consistently instead of token/nterm debugging output by
7613 hand.
a5eb1ed2
AD
7614 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust
7615 %printer calls to use cdebug_ when using lalr1.cc.
7616
417141dd
AD
76172004-08-30 Florian Krohm <florian@edamail.fishkill.ibm.com>
7618
7619 * data/glr.c: Guard the declarations of yypstack and yypdumpstack
7620 with #ifdef YYDEBUG.
7621
2fa09258
AD
76222004-08-26 Akim Demaille <akim@epita.fr>
7623
7624 * doc/bison.texinfo (Implementing Loops): Rename as...
7625 (Implementing Gotos/Loops): this.
7626
9378b508
PE
76272004-08-13 Paul Eggert <eggert@cs.ucla.edu>
7628
7629 Adjust to latest gnulib.
7630 * bootstrap (gnulib_modules): Add xalloc-die.
7631 Set LC_ALL=C so that file names sort consistently.
7632 Prefer the gnulib copies of gettext.m4, glibc21.m4,
7633 inttypes_h.m4, lib-ld.m4, lib-prefix.m4, po.m4, stdint_h.m4,
7634 uintmax_t.m4, ulonglong.m4.
7635 (intl_files_to_remove): Add gettext.m4, lib-ld.m4, lib-prefix.m4,
7636 po.m4 since we are now using _gl.m4 instead.
7637
87a8ad5c
PE
76382004-08-10 Florian Krohm <florian@edamail.fishkill.ibm.com>
7639
7640 * src/scan-action.l: Remove. Scanning of semantic actions is
7641 handled in scan-gram.l.
7642
dca81a78
PE
76432004-08-07 Florian Krohm <florian@edamail.fishkill.ibm.com>
7644
7645 * src/scan-gram.l (handle_syncline): Use uniqstr_new not xstrdup.
7646
7647 * src/location.h (struct): The file member is a uniqstr.
7648 (equal_boundaries): Use UNIQSTR_EQ for comparison.
7649
c9cbf7c5
PE
76502004-07-22 Paul Eggert <eggert@cs.ucla.edu>
7651
7652 Fix bug with non-%union parsers that have printers or destructors,
7653 which led to a Bison core dump. Reported by Peter Fales in
7654 <http://lists.gnu.org/archive/html/bug-bison/2004-07/msg00014.html>.
2fa09258 7655
c9cbf7c5
PE
7656 * data/c.m4 (b4_symbol_actions): Don't assume %union was used.
7657 * data/lalr1.cc (yystype) [defined YYSTYPE]: Define to YYSTYPE,
7658 not to our own type.
7659 * src/output.c (symbol_destructors_output, symbol_printers_output):
7660 Don't assume %union.
7661 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR,
7662 AT_CHECK_PRINTER_AND_DESTRUCTOR): New argument
7663 UNION-FLAG. All callers changed.
7664 (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't assume %union.
7665 Use type char, not unsigned int, when declaring an array of char;
7666 this lets us remove a cast.
7667 (Printers and Destructors): Add non-%union test cases.
7668
fa7e68c3
PE
76692004-06-21 Paul Eggert <eggert@cs.ucla.edu>
7670
7671 * doc/bison.texinfo: Minor editorial changes, mostly to the new
7672 GLR writeups. E.g., avoid frenchspacing and the future tense,
7673 change "lookahead" to "look-ahead", and change "wrt" to "with
7674 respect to".
2fa09258 7675
fa7e68c3
PE
76762004-06-21 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
7677
7678 * doc/bison.texinfo (Merging GLR Parses, Compiler Requirements):
7679 New sections, split off from the GLR Parsers section. Put the new
7680 Simple GLR Parser near the start of the GLR section, for clarity.
7681 Rewrite connective text.
7682
99a9344e
PE
76832004-06-21 Frank Heckenbach <frank@g-n-u.de>
7684
7685 * doc/bison.texinfo (Simple GLR Parsers): New section.
7686
8dd162d3
PE
76872004-06-21 Paul Eggert <eggert@cs.ucla.edu>
7688
7689 * NEWS, TODO, doc/bison.texinfo:
7690 Use "look-ahead" instead of "lookahead", to be consistent.
7691 * REFERENCES: Fix incorrect reference to DeRemer and Pennello,
7692 while we're fixing "look-ahead".
7693 * src/conflicts.c (shift_set): Renamed from shiftset.
7694 (look_ahead_set): Renamed from lookaheadset.
7695 * src/print.c: Likewise.
7696 * src/getargs.c (report_args): Add "look-ahead" as the new canonical
7697 name for "lookahead".
7698 (report_types, usage): Likewise.
7699 * src/getargs.h (report_look_ahead_tokens): Renamed from
7700 report_lookaheads.
7701 * src/lalr.c (compute_look_ahead_tokens): Renamed from
7702 compute_lookaheads.
7703 (state_look_ahead_tokens_count): Renamed from state_lookaheads_count.
7704 (look_ahead_tokens_print): Renamed from lookaheads_print.
7705 * src/state.c (state_rule_look_ahead_tokens_print): Renamed from
7706 state_rule_lookaheads_print.
7707 * src/state.h: Likewise.
7708 (reductions.look_ahead_tokens): Renamed from lookaheads.
7709 * tests/torture.at (AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR): Renamed from
7710 AT_DATA_LOOKAHEADS_GRAMMAR.
7711
57a90331
PE
77122004-06-03 Paul Eggert <eggert@cs.ucla.edu>
7713
7714 * README: Update location of patched M4 distribution.
7715
8ed3234a
PE
77162004-05-30 Albert Chin-A-Young <china@thewrittenword.com>
7717
7718 Don't assume the C++ compiler takes the same arguments as the C compiler
7719 (trivial change).
7720 * configure.ac (O0CXXFLAGS): New var.
7721 * tests/atlocal.in (CXXFLAGS): Use it.
7722
07971983
PE
77232004-05-29 Paul Eggert <eggert@cs.ucla.edu>
7724
7725 Fix some "make check" problems with C++ reported by
7726 Albert Chin-A-Young for Tru64 C++ in this thread:
7727 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00049.html
7728
7729 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check for std::cerr.
7730 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
7731 Output to a .cc file for C++, not to a .c file.
7732 * tests/calc.at (AT_CHECK_CALC): Likewise.
7733 * tests/regression.at (AT_CHECK_DANCER): Likewise.
7734 * tests/local.at (AT_COMPILE_CXX): Default to OUTPUT.cc, not OUTPUT.c.
7735
29058652
PE
77362004-05-28 Albert Chin-A-Young <china@thewrittenword.com>
7737
7738 * tests/calc.at, tests/actions.at: Workaround for SGI
7739 C++ compiler. (trivial change)
7740
62cb8a99
PE
77412004-05-27 Paul Eggert <eggert@cs.ucla.edu>
7742
fd418816
PE
7743 Spent a few hours checking out which prerequisite versions the
7744 current sources actually require. I went all the way back to
7745 Gettext 0.10.40, Automake 1.4, and Autoconf 2.57 and investigated
7746 a seemingly endless set of combinations of versions more recent
7747 than that. The bottom line is that the current sources require
7748 fairly recent versions of the build tools, and it'll be some work
7749 to change this.
7750 * configure.ac (AC_PREREQ): Increase from 2.58 to 2.59.
7751 (AM_INIT_AUTOMAKE): Increase from 1.7 to 1.8.
7752 (AM_GNU_GETTEXT_VERSION): Increase from 0.11.5 to 0.12.
7753 Add comments explaining why those particular versions are
7754 currently needed.
2fa09258 7755
62cb8a99
PE
7756 * src/parse-gram.y (lloc_default): Rewrite to avoid compiler bug
7757 in SGI MIPSpro 7.4.1m. Problem reported by Albert Chin-A-Young in
161a71f3 7758 <http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00037.html>.
62cb8a99
PE
7759
7760 * configure.ac (AC_PREREQ): Bump to 2.58, since 2.57 doesn't work
7761 (it fails with a Autoconf-without-aclocal-m4 diagnostic).
7762
caa52c10
PE
77632004-05-26 Paul Eggert <eggert@cs.ucla.edu>
7764
7765 * configure.ac (AM_GNU_GETTEXT_VERSION): Lower it from 0.14.1 to
7766 0.11.5. Suggested by Bruno Haible.
7767 * bootstrap: Remove gettext version checking.
7768
7769 * doc/bison.texinfo (Decl Summary): Also mention that %union
7770 can depend on prerequisite types. Problem reported by Tim
7771 Van Holder.
7772
4bfd5e4e
PE
77732004-05-25 Paul Eggert <eggert@cs.ucla.edu>
7774
2cef3017
PE
7775 * README: Mention GNU m4 1.4 bugs and Akim's patched version.
7776 * README-alpha: Don't tell people not to package this.
7777
b9c85d5c
PE
7778 * bootstrap: Don't assume $(...) works; use `...` instead.
7779 Problem reported by Paul Hilfinger. Also, diagnose non-GNU
7780 gettext better.
7781
4bfd5e4e
PE
7782 * doc/bison.texinfo (Decl Summary, Bison Options): Clarify what's
7783 put into the -d output file, and mention what to do if YYSTYPE is
7784 defined as a macro.
7785
6a36ff94
PE
77862004-05-24 Paul Eggert <eggert@cs.ucla.edu>
7787
6712933e
PE
7788 Undo change made earlier today: it caused autopoint to not bring
7789 in ABOUT-NLS. Ouch. Instead, substitute our own diagnostic for
7790 autopoint's.
7791
7792 * bootstrap: Check that gettext version matches what's in
7793 configure.ac. Warn users to ignore robots.txt ERROR 404.
7794 * bootstrap: Undo today's earlier change (logged below).
7795 * configure.ac (AM_GNU_GETTEXT_VERSION): Likewise.
b9c85d5c 7796
6a36ff94
PE
7797 The gettext version checking is causing more trouble than it's
7798 curing; remove it. Problem reported by Paul Hilfinger.
7799
7800 * bootstrap: Issue a warning that one can expect a message
7801 'AM_GNU_GETTEXT is used, but not AM_GNU_GETTEXT_VERSION'.
7802 * configure.ac (AM_GNU_GETTEXT_VERSION): Remove.
7803
209ea708
PE
78042004-05-23 Paul Eggert <eggert@cs.ucla.edu>
7805
7806 Ensure that the C++ compiler used for testing actually works on a
7807 simple test program; if not, skip the C++-related tests. Problem
7808 reported by Vin Shelton in:
161a71f3 7809 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00026.html
209ea708
PE
7810
7811 * m4/cxx.m4: New file.
7812 * configure.ac (BISON_TEST_FOR_WORKING_CXX_COMPILER): Add.
7813 * tests/atlocal.in (BISON_CXX_WORKS): Add.
7814 * tests/local.at (AT_COMPILE_CXX): Use it.
7815
41ca2549
PE
78162004-05-21 Paul Eggert <eggert@cs.ucla.edu>
7817
383e69dc
PE
7818 * data/glr.c (yylloc): Output this macro even if locations are not
7819 being generated, as the GLR parser needs it even in that case.
7820 Problem reported by Troy A. Johnson
7821 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=195946>.
7822
41ca2549
PE
7823 * configure.ac (AC_INIT): Update to 1.875e.
7824
e476c87d
PE
78252004-05-21 Paul Eggert <eggert@cs.ucla.edu>
7826
7827 * NEWS: Version 1.875d.
7828 * configure.ac (AC_INIT): Likewise.
7829 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875d.
7830
7831 * configure.ac (--enable-gcc-warnings): Do not enable -Wshadow,
7832 -Wmissing-prototypes, or -Wstrict-prototypes for C++. The current
7833 lalr1.cc runs afoul of the first, and the last two are no longer
7834 supported by GCC 3.4.0.
7835 * README: Mention GNU m4 1.4 or later; mention m4 patches.
7836 * HACKING: Use ./bootstrap, not "make update" to import foreign files.
7837
233a88ad
PE
78382004-05-06 Paul Eggert <eggert@cs.ucla.edu>
7839
7840 * src/muscle_tab.c (hash_muscle): Accept and return size_t, not
7841 unsigned int, for compatibility with latest gnulib hash module.
7842 * src/state.c (state_hash, state_hasher): Likewise.
7843 * src/symtab.c (hash_symbol, hash_symbol_hasher): Likewise.
7844 * src/uniqstr.c (hash_uniqstr): Likewise.
e476c87d 7845
12ffdd28
PE
78462004-05-03 Paul Eggert <eggert@cs.ucla.edu>
7847
7848 * NEWS: Unescaped newlines are no longer allowed in char & strings.
7849
7850 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER,
7851 SC_CHARACTER,SC_STRING>): Reject unescaped newlines in
7852 character and string literals.
7853 (unexpected_end): New function.
7854 (unexpected_eof): Use it.
7855 (unexpected_newline): New function.
7856 (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>): Coalesce duplicate
7857 actions.
e476c87d 7858
12ffdd28
PE
7859 * NEWS: Document %expect-rr.
7860
7861 * bootstrap (--gnulib-srcdir=*, --cvs-user=*):
7862 Fix typo by replacing $1 with $option.
7863 Remove more 'intl'-related files.
9668e2be 7864 Don't DEFUN AM_INTL_SUBDIR twice.
12ffdd28
PE
7865
7866 * lib/.cvsignore: Add strndup.h. Remove memchr.c, memcmp.c,
7867 memrchr.c, strcasecmp.c, strchr.c, strrchr.c, strspn.c, strtol.c,
7868 strtoul.c.
7869 * m4/.cvsignore: Add exitfail.m4, extensions.m4, gnulib.m4,
7870 hard-locale.m4, mbstate_t.m4, strerror_r.m4, strndup.m4,
7871 xstrndup.m4. Remove glibc21.m4, intdiv0.m4, inttypes-pri.m4,
7872 inttypes.m4, inttypes_h.m4, isc-posix.m4, lcmessage.m4,
7873 stdint_h.m4, uintmax_t.m4, ulonglong.m4.
7874 * src/.cvsignore: Add *.output.
7875
7876 * src/parse-gram.y: Put copyright notice inside %{ %} so it
7877 gets copied to the output file.
e476c87d 7878
1f65350a
PE
78792004-04-28 Paul Eggert <eggert@twinsun.com>
7880
7881 Get files from the gnulib and po repositories, instead of relying
7882 on them being in our CVS. Upgrade to latest versions of gnulib
7883 and Automake.
7884
7885 * Makefile.am (SUBDIRS): Remove m4; Automake now does m4.
7886 * bootstrap: Bootstrap from gnulib and po repositories.
7887 Much of this code was stolen from GNU diff and GNU tar's bootstrap.
7888 * README-cvs: Document these changes. Remove version numbers from
7889 mentions of build tools, since they change so often. Mention Flex.
7890
7891 * configure.ac (AC_CONFIG_MACRO_DIR): Add, with m4 as arg.
7892 (gl_USE_SYSTEM_EXTENSIONS): Add.
12ffdd28
PE
7893 (AC_GNU_SOURCE, AC_AIX, AC_MINIX):
7894 Remove; no longer needed, as gl_USE_SYSTEM_EXTENSIONS
1f65350a 7895 does this for us.
12ffdd28
PE
7896 (AC_ISC_POSIX): Remove; we no longer support this
7897 ancient OS, as it gets in the way of latest Autoconf & gnulib.
1f65350a
PE
7898 (AC_HEADER_STDC): Remove: we now assume C89 or better.
7899 (AC_CHECK_HEADERS_ONCE): Use instead of AC_CHECK_HEADERS.
7900 Do not check for C89 headers, except for locale.h which is used
7901 by the Yacc library and must port to K&R hosts.
7902 (AC_CHECK_FUNCS_ONCE): Use instead of AC_CHECK_FUNCS.
7903 Do not check for C89 functions, except for setlocale which is
7904 used by the Yacc library.
7905 (AC_CHECK_DECLS, AC_REPLACE_FUNCS): Remove; no longer needed.
7906 (gl_DIRNAME, gl_ERROR, gl_FUNC_ALLOCA, gl_FUNC_MEMCHR,
7907 gl_FUNC_MEMRCHR, gl_FUNC_STPCPY, gl_FUNC_STRNLEN, gl_FUNC_STRTOL,
7908 gl_GETOPT, gl_HASH, gl_MBSWIDTH, gl_OBSTACK, gl_QUOTE,
7909 gl_QUOTEARG, gl_XALLOC, jm_FUNC_GLIBC_UNLOCKED_IO, jm_FUNC_MALLOC,
7910 AM_GNU_GETTEXT): Remove; now done by:
7911 (GNULIB_AUTOCONF_SNIPPET): Add. "bootstrap" builds this for us.
7912 (AC_CONFIG_FILES): Remove m4/Makefile, as Automake now does this
7913 for us.
7914
7915 * lib/Makefile.am: Include gnulib.mk, built for us by "bootstrap".
7916 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES):
7917 Define to empty, as gnulib.mk will do the rest for us.
7918 ($(libbison_a_OBJECTS), stdbool.h): Remove, as gnulib.mk does this
7919 for us.
7920 (libbison_a_SOURCES): Define to $(lib_SOURCES) now.
7921 (lib_SOURCES): New symbol, containing only the non-gnulib libs.
7922
7923 * src/files.c: Include gnulib's xstrndup.h.
7924
7925 * src/system.h (MALLOC): Use xnmalloc, for better overflow checking.
7926 (REALLOC): Use xnrealloc, for likewise.
7927 (xstrndup, stpcpy): Remove decls, as gnulib does this for us now.
7928 (strnlen, memrchr): Remove decls; functions no longer used.
7929 Include <stpcpy.h>.
7930
7931 * config/depcomp, config/install-sh, lib/alloca.c, lib/argmatch.c,
7932 lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
7933 lib/error.c, lib/error.h, lib/getopt.c, lib/getopt.h,
7934 lib/getopt1.c, lib/gettext.h, lib/hash.c, lib/hash.h,
7935 lib/malloc.c, lib/mbswidth.c, lib/mbswidth.h, lib/memchr.c,
7936 lib/memcmp.c, lib/memrchr.c, lib/obstack.c, lib/obstack.h,
7937 lib/quote.c, lib/quote.h, lib/quotearg.c, lib/quotearg.h,
7938 lib/realloc.c, lib/stdbool_.h, lib/stpcpy.c, lib/strcasecmp.c,
7939 lib/strchr.c, lib/strncasecmp.c, lib/strnlen.c, lib/strrchr.c,
7940 lib/strspn.c, lib/strtol.c, lib/strtoul.c, lib/unlocked-io.h,
7941 lib/xalloc.h, lib/xmalloc.c, lib/xstrdup.c, lib/xstrndup.c,
7942 m4/Makefile.am, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
7943 m4/error.m4, m4/getopt.m4, m4/hash.m4, m4/malloc.m4,
7944 m4/mbrtowc.m4, m4/mbswidth.m4, m4/memchr.m4, m4/memcmp.m4,
7945 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/prereq.m4,
7946 m4/quote.m4, m4/quotearg.m4, m4/realloc.m4, m4/stdbool.m4,
7947 m4/stpcpy.m4, m4/strnlen.m4, m4/strtol.m4, m4/strtoul.m4,
7948 m4/unlocked-io.m4, m4/xalloc.m4, po/LINGUAS, po/Makefile.in.in,
7949 po/Makevars, po/da.po, po/de.po, po/es.po, po/et.po, po/fr.po,
7950 po/hr.po, po/id.po, po/it.po, po/ja.po, po/ms.po, po/nl.po,
7951 po/pt_BR.po, po/ro.po, po/ru.po, po/sv.po, po/tr.po:
7952 Remove, as these files are now generated automatically
7953 by bootstrap or automake.
7954
7955 * po/ChangeLog: Remove: all but one entry was a duplicate
7956 of this file, and I moved that 2000-11-02 entry here.
7957
7958 * config/.cvsignore: Add Makefile, depcomp, install-sh.
7959 * lib/.cvsignore: Add alloca.c, alloca.h, alloca_.h, argmatch.c,
7960 argmatch.h, basename.c, dirname.c, dirname.h, error.c, error.h,
7961 exit.h, exitfail.c, exitfail.h, getopt.c, getopt.h, getopt1.c,
7962 getopt_int.h, gettext.h, gnulib.mk, hard-locale.c, hard-locale.h,
7963 hash.c, hash.h, malloc.c, mbswidth.c, mbswidth.h, memchr.c,
7964 memcmp.c, memrchr.c, obstack.c, obstack.h, quote.c, quote.h,
7965 quotearg.c, quotearg.h, realloc.c, stdbool_.h, stpcpy.c, stpcpy.h,
7966 strcasecmp.c, strchr.c, stripslash.c, strncasecmp.c, strndup.c,
7967 strnlen.c, strrchr.c, strspn.c, strtol.c, strtoul.c,
7968 unlocked-io.h, xalloc.h, xmalloc.c, xstrdup.c, xstrndup.c,
7969 xstrndup.h.
7970 * m4/.cvsignore: Remove Makefile, Makefile.in. Add alloca.m4,
7971 dirname.m4, dos.m4, error.m4, getopt.m4, hash.m4, mbrtowc.m4,
7972 mbswidth.m4, obstack.m4, onceonly.m4, quote.m4, quotearg.m4,
7973 stdbool.m4, stpcpy.m4, strnlen.m4, unlocked-io.m4, xalloc.m4.
7974 * po/.cvsignore: Add *.po, LINGUAS, Makefile.in.in, Makevars.
7975 * src/.cvsignore: Remove *_.c.
7976
7977
7978 * Makefile.maint (GZIP_ENV): Don't use --rsyncable if gzip doesn't
7979 support it. (The latest stable gzip doesn't.)
7980
79812004-04-27 Paul Eggert <eggert@twinsun.com>
7982
7983 * data/lalr1.cc (Parser::stos_) [! YYDEBUG]: Define even in this
7984 case, as stos_ is now used by destructors due to the 2004-02-09
7985 change.
7986
7987 Remove more K&R C support.
7988 * lib/libiberty.y (PARAMS): Remove. All uses removed.
7989 * lib/subpipe.c (errno): Remove decl.
7990 Include <stdlib.h> unconditionally.
7991 (EXIT_FAILURE): Remove macro.
7992 * src/complain.c (vfprintf, strerror): Remove.
7993 * src/system.h: Include limits.h, stdlib.h, string.h, locale.h
7994 unconditionally.
7995 (EXIT_FAILURE, EXIT_SUCCESS, setlocale): Remove defns.
7996 Use latest Autoconf recommendations for including inttypes.h, stdint.h.
7997 (strchr, strspn, memchr): Remove decls.
7998 * tests/calc.at (_AT_DATA_CALC_Y): Include stdlib.h, string.h
7999 unconditionally. Do not declare perror.
8000 * tests/conflicts.at (%nonassoc and eof): Include stdlib.h
8001 unconditionally.
8002
8003 * src/complain.c (_): Remove useless defn, as system.h defines this.
8004
8005 * lib/bitset.h (__INT_TO_PTR): Remove; workaround no longer needed
8006 with latest obstack.h.
8007 * lib/ebitset.c (ebitset_elt_alloc): Don't bother to cast args
8008 to procedure types, as obstack.h now does that for us.
8009 * lib/lbitset.c (lbitset_elt_alloc): Likewise.
8010
8011 * lib/subpipe.h [HAVE_SYS_TYPES_H]: Include <sys/types.h>,
8012 so that this include file can stand alone.
8013 * lib/subpipe.c: Do not include <sys/types.h>, as subpipe.h
8014 does this now. Include subpipe.h first after config.h, to
8015 test whether it can stand alone.
8016
8017 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't
8018 declare yyerror when using lalr.cc, as GCC 3.4.0 warns about the
8019 unused declaration.
8020
8021 * tests/synclines.at (%union synch line): Put a dummy member in
8022 the union, because empty unions aren't allowed in C. Caught
8023 by GCC 3.4.0.
8024
4f16766c
PE
80252004-04-13 Jim Meyering <jim@meyering.net>
8026
8027 * src/conflicts.c (conflicts_print): Correct format string typo:
8028 use `%%' to produce literal `%'. (trivial change)
8029
779e7ceb
PE
80302004-03-30 Paul Eggert <eggert@twinsun.com>
8031
8032 * src/getargs.c (version): Update copyright year to 2004.
8033
8034 * data/c.m4 (b4_int_type): Use 'short int' rather than
8035 'short', and similarly for 'long', 'unsigned', etc.
8036 * data/glr.c (YYTRANSLATE, yyconfl, yySymbol, yyItemNum,
8037 yygetLRActions, yyprocessOneStack, yyrecoverSyntaxError,
8038 yy_yypstack, yydumpstack): Likewise.
8039 * data/lalr1.cc (user_token_number_max_, user_token_number_max_,
8040 translate_, seq_, [], pop, Slice, range_, operator+, operator+=):
8041 Likewise.
8042 * data/yacc.c (b4_int_type, yyss, YYSTACK_BYTES, yysigned_char,
8043 yy_stack_print, yyparse): Likewise.
8044 * doc/bison.texinfo (Prologue, Multiple Types): Likewise.
8045 * lib/bbitset.h (bitset_word, BITSET_WORD_BITS): Likewise.
8046 * lib/bitset.c (bitset_print): Likewise.
8047 * lib/bitset_stats.c (bitste_log_histogram_print): Likewise.
8048 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
8049 * lib/bitsetv.c (bitsetv_dump): Likewise.
8050 * lib/ebitset.c (EBITSET_ELT_BITS, ebitset_elt_alloc): Likewise.
8051 * lib/lbitset.c (LBITSET_ELT_BITS, lbitset_elt_alloc, debug_lbitset):
8052 Likewise.
8053 * src/LR0.c (allocate_itemsets): Likewise.
8054 * src/gram.h (rule_number, rule): Likewise.
8055 * src/lalr.h (goto_number): Likewise.
8056 * src/nullable.c (nullable_compute): Likewise.
8057 * src/output.c (prepare_rules): Likewise.
8058 * src/relation.c (relation_print, relation_digraph): Likewise.
8059 * src/relation.h (relation_node): Likewise.
8060 * src/state.h (state_number, transitions, errs, reductions,
8061 struct state): Likewise.
8062 * src/symtab.h (symbol_number, struct symbol): Likewise.
8063 * src/tables.c (vector_number, tally, action_number,
8064 default_goto, goto_actions): Likewise.
8065 * tests/existing.at (GNU Cim Grammar): Likewise.
8066 * tests/regression.at (Web2c Actions): Likewise.
8067
8068 * src/output.c (muscle_insert_short_int_table): Renamed from
8069 muscle_insert_short_table. All uses changed.
8070
d6328241
PH
80712004-03-25 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
8072
8073 * src/parse-gram.y: Define PERCENT_EXPECT_RR.
8074 (declaration): Replace expected_conflicts with expected_sr_conflicts.
8075 Add %expect-rr rule.
4f16766c 8076
d6328241
PH
8077 * src/scan-gram.l: Recognize %expect-rr.
8078
4f16766c 8079 * src/conflicts.h (expected_sr_conflicts): Rename from
d6328241 8080 expected_conflicts.
4f16766c 8081 (expected_rr_conflicts): Declare.
d6328241
PH
8082
8083 * src/conflicts.c (expected_sr_conflicts): Rename from
8084 expected_conflicts.
8085 (expected_rr_conflicts): Define.
8086 (conflicts_print): Check r/r conflicts against expected_rr_conflicts
8087 for GLR parsers.
8088 Use expected_sr_conflicts in place of expected_conflicts.
8089 Warn if expected_rr_conflicts used in non-GLR parser.
4f16766c 8090
d6328241 8091 * doc/bison.texinfo: Add documentation for %expect-rr.
4f16766c 8092
1452af69
PE
80932004-03-08 Paul Eggert <eggert@gnu.org>
8094
8095 Add support for hex token numbers. Suggested by Odd Arild Olsen in
161a71f3 8096 <http://lists.gnu.org/archive/html/bison-patches/2004-03/msg00000.html>.
1452af69
PE
8097
8098 * NEWS: Document hexadecimal tokens, no NUL bytes, %destructor
8099 in lalr1.cc.
8100 * doc/bison.texinfo (Token Decl): Add hexadecimal token numbers.
8101 * src/scan-gram.l (scan_integer): New function.
8102 ({int}): Use it.
8103 (0[xX][0-9abcdefABCDEF]+): New pattern, to support hex numbers.
8104 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>, \\x[0-9abcdefABCDEF]+,
8105 handle_action_dollar, handle_action_at, convert_ucn_to_byte):
8106 Say "long int", not "long", for uniformity with GNU style.
8107
006d217d
PE
81082004-02-25 Paul Eggert <eggert@twinsun.com>
8109
8110 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Ignore stdout from
8111 compilers. This fixes a problem with Intel's C++ compiler being
8112 chatty, reported by Guido Trentalancia in
161a71f3 8113 <http://lists.gnu.org/archive/html/bug-bison/2004-02/msg00030.html>.
006d217d 8114
c2729758
ADL
81152004-02-09 Alexandre Duret-Lutz <adl@gnu.org>
8116
8117 Support %destructor and merge error locations in lalr1.cc.
8118
8119 * data/lalr1.cc (b4_cxx_destruct_def): New macro.
8120 (Parser::stos_): Define unconditionally.
8121 (Parser::destruct_): New method. Generate its body with
8122 b4_yydestruct_generate.
8123 (Parser::error_start_): New attribute.
8124 (Parser::parse) <yyerrlab, yyerrlab1>: Call destruct_ on erroneous
8125 token which are discarded.
8126 (Parser::parse) <yyerrlab, yyerrorlab, yyerrlab1>: Update
8127 error_start_ when erroneous token are discarded.
8128 (Parser::parse) <yyerrlab1>: Compute the location of the error
8129 token so that it covers all the discarded tokens.
8130 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust so
8131 it can be called with `%skeleton "lalr1.cc"', and do that.
8132
dd0e0635
PE
81332004-02-02 Paul Eggert <eggert@twinsun.com>
8134
8135 * src/Makefile.am (AM_CPPFLAGS): New macro. It mentions
8136 $(top_srcdir)/lib and ../lib. This fixes a bug reported
8137 by Paul Hilfinger; the old INCLUDES value didn't mention ../lib.
8138 There's no need to mention top_builddir since Automake does that
8139 for us.
8140 (INCLUDES): Remove, as Automake says it's obsolescent.
8141 Contents migrated into AM_CPPFLAGS as described above.
8142 * lib/Makefile.am (INCLUDES): Remove; obsolescent.
8143
81442004-01-14 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
8145
8146 * data/glr.c (yytokenName): Bullet-proof against YYEMPTY token.
8147 (yyreportSyntaxError): Handle case where lookahead token is
8148 YYEMPTY.
8149
be16239b
PH
81502004-01-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
8151
8152 * data/glr.c: Put casts on uses of YYREALLOC and YYMALLOC so that
8153 resulting parsers are compilable with C++.
8154
5fa90832
PE
81552003-12-23 Paul Eggert <eggert@twinsun.com>
8156
8157 * config/depcomp, config/install-sh: Sync with Automake 1.8.
8158 * src/output.c (output_skeleton): Rename local var.
8159 * tests/input.at (Torturing the Scanner): Don't use \x0 or \0 in
8160 Bison tokens, as this runs afoul of the 2003-10-07 change that
8161 disallowed NUL bytes in character constants or string literals.
8162
8163 * tests/local.at: Require Autoconf 2.59's Autotest.
8164 * tests/testsuite.at: Don't include local.at, since we now assume
8165 Autoconf 2.59 or later. Autoconf 2.59 had some problems with
8166 including it.
8167 * tests/Makefile.am ($(TESTSUITE)): Remove warning about ignoring
8168 multiple inclusion warnings.
dd0e0635 8169
b165c324
AD
81702003-12-02 Akim Demaille <akim@epita.fr>
8171
8172 * doc/bison.texinfo (How Can I Reset the Parser): More about start
8173 conditions.
8174 From Bruno Haible.
8175
26e06a21
ADL
81762003-11-18 Alexandre Duret-Lutz <adl@gnu.org>
8177
8178 * doc/bison.texinfo (Bison Options): Escape `@' in `$@'.
8179
92ac3705
PE
81802003-10-07 Paul Eggert <eggert@twinsun.com>
8181
6a5ecb38
PE
8182 * tests/Makefile.am (clean-local): Don't run 'testsuite --clean'
8183 if testsuite doesn't exist.
8184
92ac3705
PE
8185 * doc/bison.texinfo (Symbols): NUL bytes are not allowed in string
8186 literals, unfortunately.
8187 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
8188 Complain about NUL bytes in character constants or string literals.
8189
91d2c560
PE
81902003-10-05 Paul Eggert <eggert@twinsun.com>
8191
8192 * NEWS: Don't document %no-default-prec, as it's still
8193 too experimental.
8194 * doc/bison.texinfo: Document %no-default-prec only if
8195 the defaultprec flag is set. Normally it's not.
8196
0cc3da3a
PE
81972003-10-04 Paul Eggert <eggert@twinsun.com>
8198
8199 * data/glr.c (b4_rhs_value, b4_rhs_location): Yield a
8200 non-modifiable lvalue, instead of a modifiable one.
8201 * doc/bison.texinfo (Actions): Document that $$ can
8202 be assigned to. Do not claim that $$ and $N are
8203 array element references: user code should not rely on this.
8204
22fccf95
PE
82052003-10-01 Paul Eggert <eggert@twinsun.com>
8206
8207 * src/parse-gram.h (PERCENT_NO_DEFAULT_PREC): New token.
8208 (grammar_declaration): Use it.
8209 * src/scan-gram.l: New token %no-default-prec.
8210 * tests/conflicts.at: Revamp tests to use %no-default-prec.
8211 * NEWS, doc/bison.texinfo: Document the above.
8212
fc8f2965
AD
82132003-10-01 Akim Demaille <akim@epita.fr>
8214
8215 VCG no longer supports long_straight_phase.
8216
8217 * src/vcg.c, src/vcg.h: Remove the handling of long_straight_phase.
8218 * src/print_graph.c (print_graph): Adjust.
8219
39a06c25
PE
82202003-09-30 Frank Heckenbach <frank@g-n-u.de>
8221 and Paul Eggert <eggert@twinsun.com>
8222
8223 * doc/bison.texinfo (Decl Summary, Contextual Precedence,
8224 Table of Symbols): Document %default-prec.
8225 * src/parse-gram.y (PERCENT_DEFAULT_PREC): New token.
8226 (grammar_declaration): Set default_prec on %default-prec.
8227 * src/scan-gram.l (%default-prec): New token.
8228 * src/reader.h (default_prec): New flag.
8229 * src/reader.c: Likewise.
8230 (packgram): Handle it.
8231 * tests/conflicts.at (%default-prec without %prec,
8232 %default-prec with %prec, %default-prec 1): New tests.
fc8f2965 8233
39a06c25
PE
82342003-09-30 Paul Eggert <eggert@twinsun.com>
8235
8236 * tests/testsuite.at: Include local.at, not input.at, fixing
8237 a typo in the 2003-08-25 patch.
8238
62b6aef9
AD
82392003-08-27 Akim Demaille <akim@epita.fr>
8240
8241 * data/lalr1.cc (yyparse) [__GNUC__]: "Use" yyerrorlab to pacify
8242 GCC warnings.
8243
89e1cc61
AD
82442003-08-26 Akim Demaille <akim@epita.fr>
8245
8246 * config/announce-gen (print_changelog_deltas): Neutralize "<#" as
8247 "<\#" to avoid magic from Gnus when posting parts of this script.
8248
a08460b0
AD
82492003-08-26 Akim Demaille <akim@epita.fr>
8250
8251 * data/lalr1.cc (Parser::report_syntax_error_): New, extracted from
8252 (Parser::parse): here.
8253 Adjust: nerrs and errstatus is now replaced by...
8254 (Parser::nerrs_, Parser::errstatus_): New.
8255
603f1cfd
AD
82562003-08-25 Akim Demaille <akim@epita.fr>
8257
8258 * config/announce-gen, Makefile.cfg: New.
8259 * Makefile.am: Adjust.
8260 * GNUmakefile, Makefile.maint: Update from CVS Autoconf, but
8261 keeping local WGET and WGETFLAGS modifications from Paul Eggert.
8262
cd3684cf
AD
82632003-08-25 Akim Demaille <akim@epita.fr>
8264
8265 When reducing initial empty rules, Bison parser read an initial
8266 location that is not defined. This results in garbage, and that
8267 affects Bison's own parser. Therefore we need (i) to extend Bison
8268 to support a means to initialize this location, and (ii) to use
8269 this CVS Bison to fix CVS Bison's parser.
8270
8271 * src/reader.h, reader.c (epilogue_augment): Remove, replace
8272 with...
8273 * src/muscle_tab.h, src/muscle_tab.c (muscle_code_grow): this.
8274 * src/parse-gram.y: Adjust.
8275 (%initial-action): New.
8276 (%error-verbose): Since we require CVS Bison, there is no reason
8277 not to use it.
8278 * src/scan-gram.l: Adjust.
8279 * src/Makefile.am (YACC): New, to make sure we use our own parser.
8280 * data/yacc.c (yyparse): Use b4_initial_action.
8281
4e03e201
AD
82822003-08-25 Akim Demaille <akim@epita.fr>
8283
8284 * doc/bison.texinfo: Don't promote stdout for error messages.
8285
8c182d05
AD
82862003-08-25 Akim Demaille <akim@epita.fr>
8287
8288 * data/lalr1.cc (Parser::reduce_print_): Remove unused yyi.
8289 From Alexandre Duret-Lutz.
8290
6a60c4cf
PE
82912003-08-25 Akim Demaille <akim@epita.fr>
8292
8293 Version 1.875c.
8294
25f66e1a
AD
82952003-08-25 Akim Demaille <akim@epita.fr>
8296
8297 * data/lalr1.cc (Parser::stack_print_, YY_STACK_PRINT): New.
8298 Use them.
8299
5348bfbe
AD
83002003-08-25 Akim Demaille <akim@epita.fr>
8301
8302 * data/lalr1.cc (Parser::reduce_print_): New.
8303 Use it.
8304
47301314
AD
83052003-08-25 Akim Demaille <akim@epita.fr>
8306
8307 Have lalr1.cc catch with Paul Eggert's patch to fix the infinite
8308 error recovery loops. This patch is based on
161a71f3 8309 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00000.html>.
47301314
AD
8310 Also, augment the similarity between lalr1.cc and yacc.c.
8311 Note: the locations of error recovery rules are not correct yet.
8312
8313 * data/lalr1.cc: Comment changes to augment the similarity between
8314 lalr1.cc and yacc.c.
8315 (YYERROR): Goto to yyerrorlab, not yyerrlab1.
8316 (yyerrlab1): Remove, but where it used to be (now the bottom part of
8317 yyerrlab), when hitting EOF, pop the whole stack here instead of
8318 merely falling thru the default error handling mechanism.
8319 (yyerrorlab): New label, with the old contents of YYERROR,
8320 plus the following change: pop the stack of rhs corresponding
8321 to the production that invoked YYERROR. That is how Yacc
8322 behaves (required by POSIX).
8323 * tests/calc.at (AT_CHECK_CALC_LALR1_CC): No longer expected to
8324 fail.
8325
1f7a61ff
AD
83262003-08-25 Akim Demaille <akim@epita.fr>
8327
8328 Tune local.at so that people can "autom4te -l autotest calc.at -o
8329 calc" for instance, to extract a sub test suite.
8330
8331 * tests/testsuite.at: Move the initialization, Autotest version
8332 requirement, and AT_TESTED invocation into...
8333 * tests/local.at: here.
8334 * tests/testsuite.at: Include it for compatibility with Autoconf
8335 2.57.
8336 * tests/Makefile.am ($(TESTSUITE)): Report that the warning should
8337 be ignore.
8338
327b5b56
PE
83392003-08-04 Paul Eggert <eggert@twinsun.com>
8340
8341 Rework code slightly to avoid gcc -Wtraditional warnings.
8342 * data/glr.c (yyuserMerge): Return void, not YYSTYPE.
8343 The returned value is now stored in *YY0. All callers changed.
8344 * src/output.c (merge_output): Adjust to the above change.
8345
0051e3ed
PE
83462003-07-26 Paul Eggert <eggert@twinsun.com>
8347
8348 * data/glr.c (YYASSERT): New macro.
8349 (yyfillin, yydoAction, yyglrReduce, yysplitStack,
8350 yyresolveStates, yyprocessOneStack):
8351 Use `YYASSERT (FOO);' rather than `if (! (FOO)) abort ();'.
8352 Derived from a suggestion by Frank Heckenbach.
1f7a61ff 8353
137437c6
PE
83542003-07-25 Paul Eggert <eggert@twinsun.com>
8355
5b620e06
PE
8356 * data/glr.c (yyglrReduce): Don't use C89 string concatenation,
8357 for portability to K&R C (after ansi2knr, presumably). See
161a71f3 8358 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>
5b620e06
PE
8359 by Frank Heckenbach, though I have omitted the structure-initialization
8360 part of his glr-knr.diff patch since I recall that the Portable
8361 C Compiler didn't require that change.
8362
137437c6
PE
8363 Let the user specify how to allocate and free memory.
8364 Derived from a suggestion by Frank Heckenbach in
161a71f3 8365 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>.
137437c6
PE
8366 * data/glr.c (YYFREE, YYMALLOC, YYREALLOC): New macros.
8367 All uses of free, malloc, realloc changed to use these macros,
8368 and unnecessary casts removed.
8369 * data/yacc.c (YYFREE, YYMALLOC): Likewise.
8370
ddb85ca5
PE
83712003-07-06 Matthias Mann <MatthiasMann@gmx.de>
8372
8373 * data/lalr1.cc (operator<<(std::ostream&, const Position&)):
8374 use s.empty() rather than s == "" to test for empty string; see
161a71f3 8375 <http://lists.gnu.org/archive/html/bison-patches/2003-07/msg00003.html>
ddb85ca5
PE
8376 (trivial change)
8377
39910e09
AD
83782003-06-25 Akim Demaille <akim@epita.fr>
8379
8380 * config/depcomp, config/install-sh: Update from masters.
8381
0ae99356
PE
83822003-06-20 Paul Eggert <eggert@twinsun.com>
8383
8384 * data/glr.c (YYLLOC_DEFAULT): Parenthesize arguments as needed,
8385 and return properly parenthesized result.
8386 * data/lalar1.cc (YYLLOC_DEFAULT): Likewise.
8387 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
8388 Remove unnecessary parentheses from uses.
8389 * doc/bison.texinfo (Location Default Action): Describe the
8390 conventions for parentheses.
8391
cd05d13c
PE
83922003-06-19 Paul Eggert <eggert@twinsun.com>
8393
81fd08ca
PE
8394 * data/glr.c (yyremoveDeletes, yy_reduce_print, yyglrReduce,
8395 yyreportTree): Do not assume that size_t is the same width as int,
8396 when printing sizes. Print sizes using an unsigned format.
8397 Problem reported by Frank Heckenbach in
161a71f3 8398 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00035.html>.
4dcf140b 8399
cd05d13c
PE
8400 Port to Forte Developer 7 C compiler.
8401 * data/glr.c (struct YYLTYPE): If locations are not being used,
8402 declare a single dummy member, as empty structs do not conform
8403 to the C standard.
8404 (YYERROR, YYBACKUP): Do not use "do { ...; return foo; } while (0)";
8405 the Forte Developer 7 C compiler complains that end-of-loop
8406 code is not reached.
8407
4dcf140b
PE
84082003-06-17 Paul Eggert <eggert@twinsun.com>
8409
8410 * lib/libiberty.h (PARAMS): Spell argument as Args, not as X, to
8411 avoid warnings from picky compilers about redefinition of PARAMS.
8412
8dd76bee
PE
84132003-06-17 Paul Eggert <eggert@twinsun.com>
8414
8415 Version 1.875b.
8416
8417 * NEWS: Document 1.875b.
8418
8419 * lib/bbitset.h: Do not include config.h; that's the includer's job.
8420 Do not include <sys/types.h>; shouldn't be needed on a C89 host.
8421 * lib/bitset.h (bitset_compatible_p): Indent as per GNU standard.
8422 Don't use 'index' in comments, as it's a builtin fn on some hosts.
8423 * lib/bitset_stats.c: Include gettext.h unconditionally, as
8424 per recent gettext manual's suggestion.
8425 * lib/ebitset.c (ebitset_resize, ebitset_unused_clear):
8426 Use prototypes, not old-style definitions.
8427 * lib/lbitset.c (lbitset_unused_clear): Likewise.
8428 * lib/vbitset.c (vbitset_resize, vbitset_ones, vbitset_zero,
8429 vbitset_empty_p, vbitset_copy1, vbitset_not, vbitset_equal_p,
8430 vbitset_subset_p, vbitset_disjoint_p, vbitset_and, vbitset_and_cmp,
8431 vbitset_andn, vbitset_andn_cmp, vbitset_or, vbitset_or_cmp,
8432 vbitset_xor, vbitset_xor_cmp, vbitset_and_or, vbitset_and_or_cmp,
8433 vbitset_andn_or, vbitset_andn_or_cmp, vbitset_or_and,
8434 vbitset_or_and_cmp, vbitset_copy): Likewise.
8435
8436 * lib/libiberty.h: Do not include config.h; that's the includer's job.
8437 Do not include <stdlib.h>.
8438 (PARAMS): Define unconditionally for C89.
8439 (ATTRIBUTE_NORETURN): Remove.
8440 (ATTRIBUTE_UNUSED): Define unconditionally.
8441
8442 Upgrade to 2003-06-08 libbitset, submitted by Michael Hayes in:
161a71f3 8443 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00005.html>
8dd76bee
PE
8444 * lib/Makefile.am (bitsets_sources): Add vbitset.c, vbitset.h.
8445 * lib/vbitset.c, lib/vbitset.h: New files.
8446 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
8447 lib/bitset_stats.c, lib/ebitset.c, lib/lbitset.c: Import
8448 from libbitset.
8449
8450 * doc/bison.texinfo (How Can I Reset the Parser): Renamed from
8451 `How Can I Reset @code{yyparse}', since texinfo does not allow
8452 arbitrary @ in node names.
8453
8454 * m4/Makefile.am (EXTRA_DIST): Add the following files, which
8455 shouldn't be needed according to the gettext 0.12.1 documentation
8456 but which seem to be needed anyway: codeset.m4 glibc21.m4
f8e8262e 8457 intdiv0.m4 inttypes-pri.m4 inttypes.m4 inttypes_h.m4 isc-posix.m4
8dd76bee 8458 lcmessage.m4 nls.m4 po.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4.
f8e8262e 8459 * po/Makefile.in.in: Upgrade to gettext 0.12.1 version.
cd05d13c 8460
8dd76bee
PE
8461 * lib/.cvsignore: Add stdbool.h.
8462 * m4/.cvsignore: Add nls.m4, po.m4.
8463
8464 Upgrade to CVS gnulib.
8465 * stdbool_.h: File renamed from stdbool.h.in.
8466 * configure.ac (AM_STDBOOL_H): Invoke this instead of
8467 AC_HEADER_STDBOOL.
8468 (AM_GNU_GETTEXT): Put brackets around args, as latest manual suggests.
8469 (AM_GNU_GETTEXT_VERSION): Update to 0.12.1.
8470 * lib/Makefile.am (EXTRA_DIST): Add stdbool_.h.
8471 (MOSTLYCLEANFILES): New var.
8472 ($(libbison_a_OBJECTS)): Depend on $(STDBOOL_H).
8473 (stdbool.h): New rule.
8474 * lib/dirname.c, lib/dirname.h, lib/hash.c, lib/hash.h,
8475 lib/malloc.c, lib/obstack.h, lib/quote.c, lib/realloc.c,
8476 lib/strcasecmp.c, lib/xalloc.h, m4/alloca.m4, m4/onceonly.m4,
8477 m4/quote.m4: Upgrade to today's gnulib.
8478
8479 * tests/calc.at (AT_CHECK_CALC): New option EXPECTED-TO-FAIL.
8480 (AT_CHECK_CALC_LALR1_CC): Use it, since the C++ LALR parser fails
8481 the tests right now.
8482 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Ensure yylex and
8483 yyerror are declared before use; C99 requires this.
8484
25005f6a
PH
84852003-06-09 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
8486
8487 * data/glr.c (YYERROR): Update definition to reset yyerrState to 0
8488 first.
8489 (yyrecoverSyntaxError): Correct the logic for setting and testing
8490 yyerrState.
8491 Correct comment on handling EOF.
8492 Allow states with only a default reduction, rather than failing
8dd76bee 8493 (I can't quite reconstruct why these were not allowed before).
25005f6a 8494
137437c6 8495 Fixes to avoid problem that $-N rules in GLR parsers can cause
25005f6a 8496 buffer overruns, corrupting state.
8dd76bee
PE
8497
8498 * src/output.c (prepare_rules): Output max_left_semantic_context
25005f6a
PH
8499 definition.
8500 * src/reader.h (max_left_semantic_context): New variable declaration.
8501 * src/scan-gram.l (max_left_semantic_context): Define.
8502 (handle_action_dollar): Update max_left_semantic_context.
8503 * data/glr.c (YYMAXLEFT): New definition.
8504 (yydoAction): Increase size of yyrhsVals by YYMAXLEFT.
8505 (yyresolveAction): Ditto.
8506
8507 Fixes to problems with location handling in GLR parsers reported by
8508 Frank Heckenbach (2003/06/05).
8509
8510 * data/glr.c (YYLTYPE): Make trivial if locations not used.
8511 (YYRHSLOC): Add parentheses, and define only if locations used.
8512 (YYLLOC_DEFAULT): Add parentheses, and give trivial definition if
8513 locations not used.
8514 (yyuserAction): Use YYLLOC_DEFAULT to set *yylocp.
8515 (yydoAction): Remove redundant initialization of *yyvalp and *yylocp.
8dd76bee 8516
25005f6a
PH
8517 * tests/cxx-type.at: Exercise location information; update tests
8518 to differentiate output with and without locations.
8dd76bee 8519 Remove forward declarations of yylex and yyerror---caused errors
25005f6a
PH
8520 because default YYLTYPE not yet defined.
8521 Change semantic actions to compute strings, rather than printing
8522 them directly (to test proper passing of semantics values). Change
8523 output to prefix notation and update test data and expected results.
8524 (yylex): Track locations.
8525 (stmtMerge): Return value rather than printing, and include arguments
8526 in value.
8dd76bee 8527
711f40b7
PE
85282003-06-03 Paul Eggert <eggert@twinsun.com>
8529
8530 Avoid warnings generated by GCC 2.95.4 when Bison is
8531 configured with --enable-gcc-warnings.
8532 * data/lalr1.cc (yy::]b4_parser_class_name[::parse,
8533 yy::]b4_parser_class_name[::translate_,
8534 yy::Stack::operator[] (unsigned),
8535 yy::Stack::operator[] (unsigned) const,
8536 yy::Slice::operator[] (unsigned),
8537 yy::Slice::operator[] (unsigned) const):
8538 Rename local vars to avoid warnings.
8539 * tests/glr-regression.at (Improper handling of embedded actions
8540 and $-N in GLR parsers): Remove unused local variable from yylex.
8541 * tests/regression.at (_AT_DATA_DANCER_Y): Declare yylex to take
8542 (void) as arg when not pure, since we now assume C89 when building
8543 Bison. Pacify GCC by using parameter.
8544
ac695f7d
PE
85452003-06-02 Paul Eggert <eggert@twinsun.com>
8546
8547 * data/lalr1.cc (yy::Position::lines, yy::Position::columns,
8548 yy::Location::lines, yy::Location::columns): Rename arguments
8549 to avoid shadowing; this removes a warning generated by GCC 3.3.
8550
26ec81e0
PE
85512003-06-01 Paul Eggert <eggert@twinsun.com>
8552
8553 Don't pass C-only warning optins (e.g., -Wmissing-declarations)
8554 to g++, as GCC 3.3 complains if you do it.
8555 * configure.ac (WARNING_CXXFLAGS): New subst. Set it to
8556 everything that WARNING_CFLAGS has, except omit warnings
8557 not suitable for C++.
8558 (AC_PROG_CXX): Use this instead of AC_CHECK_PROGS([CXX], [g++]).
8559 * tests/atlocal.in (CXXFLAGS): New var.
8560 * tests/local.at (AT_COMPILE_CXX): Use it instead of CFLAGS.
8561
8562 Fix a GLR parser bug I reported in February; see
161a71f3 8563 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00008.html>.
26ec81e0
PE
8564 The problem was that GLR parsers did not conform to the C standard,
8565 because actions like { $1 = $2 + $3; } expanded to expressions
8566 that invoked YYFILL in separate subexpressions, and YYFILL assigned
8567 to a local variable. The C standard says that expressions
8568 like (var = f ()) + (var = f ()) have undefined behavior.
8569 Another problem was that GCC sometimes issues warnings that
8570 yyfill and its parameters are unused.
8571
8572 * data/glr.c (yyfillin): Renamed from the old yyfill. Mark
8573 as possibly unused.
8574 (yyfill): New function.
8575 (YYFILL): Use it.
8576 (yyuserAction): Change type of yynormal to bool, so that it matches
8577 the new yyfill signature. Mark it as possibly unused.
8578
8579
8580 Follow up on a bug I reported in February, where a Bison-generated
8581 parser can loop. Provide a test case and a fix for yacc.c. I
8582 don't have a fix for lalr1.cc or for glr.c, unfortunately.
8583 The original bug report is in:
161a71f3 8584 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00044.html>
26ec81e0
PE
8585
8586 * data/yacc.c (YYERROR): Now just 'goto yyerrorlab', since the
8587 macro's size was becoming unwieldy.
8588 (yyerrlab): Do not discard an empty lookahead symbol, as this
8589 might destroy garbage.
8590 (yyerrorlab): New label, with the old contents of YYERROR,
8591 plus the following change: pop the stack of rhs corresponding
8592 to the production that invoked YYERROR. That is how Yacc
8593 behaves, and POSIX requires this behavior.
8594 (yyerrlab1): Use YYPOPSTACK instead of its definiens.
8595 * tests/calc.at (_AT_DATA_CALC_Y): Include unistd.h if available.
8596 Define 'alarm' to do nothing if unistd.h is not available.
8597 Add a new rule "exp: '-' error;" to test the above change to
8598 data/yacc.c. Use 'alarm' to abort any test taking longer than
8599 10 seconds, as it's probably looping.
8600 (AT_CHECK_CALC): Test recovery from error in new grammar rule.
8601 Also, the new yacc.c generates two fewer diagnostics for an
8602 existing test.
8603
d0829076
PE
86042003-05-24 Paul Eggert <eggert@twinsun.com>
8605
c6ae27df
PE
8606 * data/glr.c (YYSTACKEXPANDABLE): Do not evaluate
8607 YYSTYPE_IS_TRIVIAL or YYSTYPE_IS_TRIVIAL unless they are defined.
8608 This fixes a problem reported by John Bowman when the Compaq/HP
8609 Alpha cxx compiler happy (e.g. using cxx -D__USE_STD_IOSTREAM
8610 -ansi -Wall -gall).
8611 * data/yacc.c (union yyalloc): Likewise.
8612 (YYCOPY): Do not evaluate __GNUC__ unless it is defined.
26ec81e0 8613
d0829076
PE
8614 Switch from 'int' to 'bool' where that makes sense.
8615
8616 * lib/abitset.c (abitset_test, abitset_empty_p, abitset_equal_p,
8617 abitset_subset_p, abitset_disjoint_p, abitset_and_cmp,
8618 abitset_andn_cmp, abitset_or_cmp, abitset_xor_cmp, abitset_and_or,
8619 abitset_and_or_cmp, abitset_andn_or_cmp, abitset_or_and_cmp):
8620 Return or accept bool, not int. All callers changed.
8621 * lib/bbitset.h: (bitset_toggle_, bitset_copy_, bitset_and_or_cmp_,
8622 bitset_andn_or_cmp_, bitset_or_and_cmp_): Likewise.
8623 * lib/bitset.c (bitset_only_set_p, bitset_print, bitset_toggle_,
8624 bitset_copy_, bitset_op4_cmp, bitset_and_or_cmp_, bitset_andn_or_cmp_,
8625 bitset_or_and_cmp_): Likewise.
8626 * lib/bitset.h (bitset_test, bitset_only_set_p): Likewise.
8627 * lib/bitset_stats.c (bitset_stats_print, bitset_stats_toggle,
8628 bitset_stats_test, bitset_stats_empty_p, bitset_stats_disjoint_p,
8629 bitset_stats_equal_p, bitset_stats_subset_p, bitset_stats_and_cmp,
8630 bitset_stats_andn_cmp, bitset_stats_or_cmp, bitset_stats_xor_cmp,
8631 bitset_stats_and_or_cmp, bitset_stats_andn_or_cmp,
8632 bitset_stats_or_and_cmp): Likewise.
8633 * lib/ebitset.c (ebitset_elt_zero_p, ebitset_equal_p, ebitset_copy_cmp,
8634 ebitset_test, ebitset_empty_p, ebitset_subset_p, ebitset_disjoint_p,
8635 ebitset_op3_cmp, ebitset_and_cmp, ebitset_andn_cmp, ebitset_or_cmp,
8636 ebitset_xor_cmp): Likewise.
8637 * lib/lbitset.c (lbitset_elt_zero_p, lbitset_equal_p, lbitset_copy_cmp,
8638 lbitset_test, lbitset_empty_p, lbitset_subset_p, lbitset_disjoint_p,
8639 lbitset_op3_cmp, lbitset_and_cmp, lbitset_andn_cmp, lbitset_or_cmp,
8640 lbitset_xor_cmp): Likewise.
8641 * lib/bbitset.h: Include <stdbool.h>.
8642 (struct bitset_vtable): The following members now return bool, not
8643 int: toggle, test, empty_p, disjoint_p, equal_p, subset_p,
8644 and_cmp, andn_cmp, or_cmp, xor_cmp, and_or_cmp, andn_or_cmp,
8645 or_and_cmp).
8646 * src/conflicts.c (count_rr_conflicts): Likewise.
8647 * lib/bitset_stats.h (bitset_stats_enabled): Now bool, not int.
8648 All uses changed.
8649 * lib/ebitset.c (ebitset_obstack_init): Likewise.
8650 * lib/lbitset.c (lbitset_obstack_init): Likewise.
8651 * src/getargs.c (debug_flag, defines_flag, locations_flag,
8652 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
8653 graph_flag): Likewise.
8654 * src/getargs.h (debug_flag, defines_flag, locations_flag,
8655 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
8656 graph_flag): Likewise.
8657 * src/output.c (error_verbose): Likewise.
8658 * src/output.h (error_verbose): Likewise.
8659 * src/reader.c (start_flag, typed): Likewise.
8660 * src/reader.h (typed): Likewise.
8661 * src/getargs.c (LOCATIONS_OPTION): New constant.
8662 (long_options, getargs): Use it.
8663 * src/lalr.c (build_relations): Use bool, not int.
8664 * src/nullable.c (nullable_compute): Likewise.
8665 * src/print.c (print_reductions): Likewise.
8666 * src/tables.c (action_row, pack_vector): Likewise.
8667 * src/muscle_tab.h (MUSCLE_INSERT_BOOL): New macro.
8668 * src/output.c (prepare): Use it.
8669 * src/output.c (token_definitions_output,
8670 symbol_destructors_output, symbol_destructors_output): Use string,
8671 not boolean integer, to keep track of whether to output separator.
8672 * src/print_graph.c (print_core): Likewise.
8673 * src/state.c (state_rule_lookaheads_print): Likewise.
8674
8675 * config/install-sh: Sync from automake 1.7.5.
8676
6b2584b7
PE
86772003-05-14 Paul Eggert <eggert@twinsun.com>
8678
8679 * src/parse-gram.y (rules_or_grammar_declaration): Require a
8680 semicolon after a grammar declaration, in the interest of possible
8681 future changes to the Bison input language.
8682 Do not allow a stray semicolon at the start of the grammar.
8683 (rhses.1): Allow one or more semicolons after any rule, including
8684 just before "|" as required by POSIX.
8685 * tests/input.at (Torturing the Scanner): Add tests for ";|" in a
8686 grammar.
8687
caf37a36
ADL
86882003-05-14 Alexandre Duret-Lutz <adl@gnu.org>
8689
8690 %parse-param support for lalr1.cc.
8691
8692 * data/lalr1.cc (b4_parse_param_decl, b4_parse_param_cons,
8693 b4_cc_constructor_calls, b4_cc_constructor_call,
8694 b4_parse_param_vars, b4_cc_var_decls, b4_cc_var_decl): New m4
8695 definitions.
8696 (yy::b4_parser_class_name::b4_parser_class_name): Take extra
8697 parse-param arguments.
8698 (yy::b4_parser_class_name): Declare instance variables to
8699 hold parse-param arguments.
8700 * tests/calc.at: s/value/semantic_value/ because value clashes
8701 with a member of yy::b4_parser_class_name. Adjust C++ code
8702 to handle %parse-param. Enable %parse-param test in C++.
8703
3ab37077
PE
87042003-05-12 Paul Eggert <eggert@twinsun.com>
8705
8706 * doc/bison.texinfo (How Can I Reset @code{yyparse}): Reword the
8707 English a bit. Fix fclose typo. Change "const char" to "char
8708 const", and use ANSI C rather than K&R for "main". Suggest
8709 YY_FLUSH_BUFFER over yyrestart (as that is what Flex recommends)
8710 and suggest yy_switch_to_buffer.
8711
87122003-05-05 Paul Eggert <eggert@twinsun.com>
163ab321
PE
8713
8714 * lib/bitset.h (__INT_TO_PTR): Define to a value that presumes
8715 C89. This avoids a diagnostic on compilers that define __STDC__
8716 to 0, fixing a problem with Tru64 cc reported by Martin Mokrejs in
161a71f3 8717 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
163ab321 8718
e743727f
PE
87192003-05-03 Paul Eggert <eggert@twinsun.com>
8720
8721 * lib/bitset.h (BITSET_FOR_EACH, BITSET_FOR_EACH_REVERSE):
8722 Do not overrun array bounds.
8723 This should fix a bug reported today by Olatunji Oluwabukunmi in
161a71f3 8724 <http://lists.gnu.org/archive/html/bug-bison/2003-05/msg00004.html>.
e743727f 8725
916708d5
AD
87262003-04-29 Akim Demaille <akim@epita.fr>
8727
8728 * src/gram.h, src/gram.c (pure_parser, glr_parser): Move to...
8729 * src/getargs.c, src/getargs.h: here, as bool, not int.
8730 (nondeterministic_parser): New.
8731 * src/parse-gram.y, src/scan-gram.l: Support
8732 %nondeterministic-parser.
8733 * src/output.c (prepare): Use nondeterministic_parser instead
8734 of glr_parser where appropriate.
8735 * src/tables.c (conflict_row, action_row, save_row)
8736 (token_actions, token_actions, pack_vector): Ditto.
8737
a06ea4aa
AD
87382003-04-29 Akim Demaille <akim@epita.fr>
8739
8740 * doc/bison.texinfo (C++ Parsers, Implementing Loops): New.
8741
211074ca
AD
87422003-04-29 Akim Demaille <akim@epita.fr>
8743
8744 * tests/calc.at: Also test yacc.c and glr.c (but not lalr1.cc yet)
8745 with %pure-parser and %locations to exercise the patch from Yakov
8746 Markovitch below.
8747
6175ffe3
PE
87482003-04-28 Tim Van Holder <tim.van.holder@pandora.be>
8749
8750 * data/yacc.c: (b4_lex_param): Corrected for the case where
8751 %lex-param is provided and %pure-parser isn't.
8752
b1e95857
PE
87532003-04-27 Paul Eggert <eggert@twinsun.com>
8754
8755 Avoid gcc -Wundef warnings reported by Gerald Pfeifer in
161a71f3 8756 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00044.html>.
b1e95857
PE
8757 * data/yacc.c (YYSTACK_ALLOC): Don't evaluate YYSTACK_USE_ALLOCA
8758 if it is not defined.
8759 (YYMAXDEPTH): Don't evaluate YYMAXDEPTH if it is not defined.
8760
acda9df6
PE
87612003-04-26 Paul Eggert <eggert@twinsun.com>
8762
3470c57b
PE
8763 * data/lalr1.cc (yy::Parser::pact_ninf_, yy::Parser::table_ninf_):
8764 Declare to be of type suitable for the ninf value itself, not of
8765 type suitable for the corresponding table, since the latter might
8766 be unsigned but the ninf value might be negative. This fixes a
8767 bug reported by Alexandre Duret-Lutz in
161a71f3 8768 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00017.html>.
3470c57b 8769
acda9df6
PE
8770 * configure.ac (AC_FUNC_ERROR_AT_LINE): Remove, since gl_ERROR
8771 invokes it. We shouldn't invoke it twice because it will attempt
8772 to put error.o in the archive twice. This fixes a glitch reported
8773 by Martin Mokrejs in
161a71f3 8774 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
acda9df6 8775
b5250f26
PE
87762003-04-21 Paul Eggert <eggert@twinsun.com>
8777
8778 * m4/error.m4: Update from Bruno Haible's 2003-04-14 patch
8779 to gnulib.
8780
089ac0f1
PE
87812003-04-21 Yakov Markovitch <Markovitch@iso.ru>
8782
8783 * data/glr.c (yyexpandGLRStack) [!YYSTACKEXPANDABLE]:
8784 Fix obvious typo that results in uncompilable GLR parsers
8785 when both %pure-parser and %locations are used. (trivial change)
8786
5ededac6
PE
87872003-04-17 Paul Eggert <eggert@twinsun.com>
8788
1b8f2fff
PE
8789 * src/scan-gram.l: Add %option nounput, since we no longer use unput.
8790 (unexpected_eof): Renamed from unexpected_end_of_file, for brevity.
8791 Do not insert the expected token via unput, as this runs afoul
8792 of a POSIX-compatibility bug in flex 2.5.31.
8793 All uses changed to BEGIN the parent state,
8794 since we no longer insert the expected token via unput.
8795 * tests/regression.at (Invalid inputs): Remove cascaded diagnostic
8796 that is no longer emitted after the above change.
8797
5ededac6
PE
8798 * src/conflicts.c (set_conflicts): Resolve all conflicts, not just
8799 the first one. This change is from Paul Hilfinger, and it fixes
8800 regression reported by Werner Lemberg in
161a71f3 8801 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
5ededac6
PE
8802
8803 (resolve_sr_conflict): Don't invoke state_errs_set
8804 unless one or more tokens have been explicitly made errors.
8805 Otherwise, the above change causes Bison to abort.
8806
8807 * tests/existing.at (GNU pic Grammar): New test case, taken from
8808 Lemberg's email.
8809
b8be9132
AD
88102003-03-31 Akim Demaille <akim@epita.fr>
8811
8812 * doc/Makefile.am (AM_MAKEINFOFLAGS): Don't split the info file.
8813
d423d460
AD
88142003-03-31 Akim Demaille <akim@epita.fr>
8815
8816 * src/output.c (prepare_symbols): Avoid trailing spaces in the
8817 output.
8818
c7e441b4
AD
88192003-03-31 Akim Demaille <akim@epita.fr>
8820
8821 * doc/bison.texinfo (Strings are Destroyed): s/losses/loses/.
8822 From Paul Hilfinger.
8823
231897ad
AD
88242003-03-29 Akim Demaille <akim@epita.fr>
8825
8826 * m4/error.m4: Do not put under dynamic conditions some code which
8827 expansion is under static control.
8828
5b066063
AD
88292003-03-29 Akim Demaille <akim@epita.fr>
8830
8831 * doc/bison.texinfo (How Can I Reset @code{yyparse}): New.
8832
22a74fec
AD
88332003-03-29 Akim Demaille <akim@epita.fr>
8834
8835 * doc/bison.texinfo (Strings are Destroyed): New.
8836
0eee27e7
PE
88372003-03-13 Paul Eggert <eggert@twinsun.com>
8838
8839 * .cvsignore: Add configure.lineno.
8840 * src/.cvsignore: Add yacc.
8841 * tests/.cvsignore: Add testsuite.log.
8842 * doc/fdl.texi: Sync with latest FSF version.
8843
f61aad93
PE
88442003-03-12 Paul Eggert <eggert@twinsun.com>
8845
537636c7
PE
8846 * scan-gram.l (YY_USER_INIT): Initialize code_start, too.
8847 (<INITIAL><<EOF>>, <SC_PRE_CODE><<EOF>>): Set *loc to the scanner
8848 cursor, instead of leaving it undefined. This fixes a bug
8849 reported by Tim Van Holder in
161a71f3 8850 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00023.html>.
537636c7
PE
8851 * tests/input.at (Torturing the Scanner): Test the scanner on
8852 an empty input file, which was Tim Van Holder's test case.
8853
8854 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): When checking whether
8855 <sys/resource.h> can be included, include sys/time.h and
8856 sys/times.h first, if available. This works around the SunOS
8857 4.1.4 porting bug reported by Bruce Becker in
161a71f3 8858 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00018.html>.
537636c7
PE
8859
8860 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't
8861 AC_CHECK_HEADERS([sys/wait.h]), as this interferes with
8862 AC_HEADER_SYS_WAIT.
8863
f61aad93
PE
8864 Merge changes from gnulib. This was prompted because the CVS
8865 snapshot didn't build on Solaris 7 due to strnlen problems.
8866
8867 These changes need to be merged back into gnulib:
8868 * lib/hash.c: Include <stdbool.h> unconditionally.
8869 * m4/onceonly.m4 (m4_quote): New macro.
8870 (AC_CHECK_HEADERS_ONCE, AC_CHECK_FUNCS_ONCE, AC_CHECK_DECLS_ONCE):
8871 Quote AC_FOREACH variable-expansions properly.
8872 The 2003-01-03 obstack.h change also needs merging.
8873 {end of changes requiring merging}
5b066063 8874
f61aad93
PE
8875 * lib/stdbool.h.in, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
8876 m4/getopt.m4, m4/hash.m4, m4/malloc.m4, m4/memchr.m4,
8877 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/quote.m4,
8878 m4/quotearg.m4, m4/realloc.m4, m4/stpcpy.m4, m4/strnlen.m4,
8879 m4/strtol.m4, m4/strtoul.m4, m4/unlocked-io.m4, m4/xalloc.m4:
8880 New files, imported from gnulib.
8881 * m4/Makefile.am (EXTRA_DIST): Add the new m4/*.m4 files mentioned
8882 above.
8883
8884 * lib/mbswidth.c, m4/error.m4, m4/mbrtowc.m4, m4/mbswidth.m4,
8885 m4/memcmp.m4, m4/prereq.m4, m4/stdbool.m4: Update to current
8886 gnulib sources.
8887
8888 * configure.ac (gl_DIRNAME, gl_GETOPT, gl_HASH, gl_QUOTE, gl_XALLOC):
8889 Add.
8890 (gl_ERROR): New, replacing jm_PREREQ_ERROR.
8891 (gl_FUNC_ALLOCA): New, replacing AC_FUNC_ALLOCA.
8892 (gl_FUNC_STPCPY): New, replacing AC_REPLACE_FUNCS(stpcpy).
8893 (gl_FUNC_STRNLEN): New, replacing AC_FUNC_STRNLEN.
8894 (gl_MBSWIDTH): New, replacing jm_PREREQ_MBSWIDTH.
8895 (gl_OBSTACK): New, replacing AC_FUNC_OBSTACK.
8896 (gl_QUOTEARG): New, replacing jm_PREREQ_QUOTEARG.
8897 (jm_FUNC_GLIBC_UNLOCKED_IO, gl_FUNC_STPCPY, gl_FUNC_STRTOL): New.
8898 (jm_FUNC_MALLOC): New, replacing AC_FUNC_MALLOC.
8899 (jm_FUNC_REALLOC): New, replacing AC_FUNC_REALLOC.
8900 (jm_PREREQ_ARGMATCH): Remove.
8901 (AC_REPLACE_FUNCS): Remove memchr, memrchr, stpcpy, strtol, strtoul.
8902 * lib/Makefile.am (libbison_a_SOURCES): Add argmatch.c, argmatch.h.
8903
8904 * src/system.h: Include <stdbool.h> unconditionally.
8905
8906 * lib/bbitset.h: Include <limits.h> unconditionally. We have been
8907 assuming at least C89 in the bitset code for some time now.
8908
d2ffe116
AD
89092003-03-03 Akim Demaille <akim@epita.fr>
8910
8911 * ro.po: New.
8912
052826fd
AD
89132003-03-02 Akim Demaille <akim@epita.fr>
8914
8915 * doc/bison.texinfo (Table of Symbols): Reactivate the
8916 documentation for %lex-param, and %parse-param.
8917
c4749565
AD
89182003-03-02 Akim Demaille <akim@epita.fr>
8919
8920 * data/yacc.c, data/glr.c, data/lal1.cc: Use similar code to
8921 generate verbose error messages.
8922 Use the number of tokens as an upper bound in yytname, as it
8923 cannot be a non terminal.
8924
d5286af1
AD
89252003-03-02 Akim Demaille <akim@epita.fr>
8926
8927 * tests/regression.at (_AT_DATA_DANCER_Y): Fix the expected error
8928 message.
8929
22e304a6
AD
89302003-03-02 Akim Demaille <akim@epita.fr>
8931
22e304a6
AD
8932 * tests/regression.at (_AT_DATA_DANCER_Y, AT_CHECK_DANCER): New.
8933 Use them to exercise yycheck overrun.
8934 Based on Andrew Suffield's grammar.
8935
67a25fed
AD
89362003-03-02 Akim Demaille <akim@epita.fr>
8937
8938 Create tests/local.at for Bison generic testing macros.
8939
8940 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Move to...
8941 * tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS):
8942 This new file.
8943 * tests/calc.at (AT_CHECK_CALC): Adjust.
8944 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR)
8945 (AT_COMPILE, AT_COMPILE_CXX, AT_PARSER_CHECK): Move to...
8946 * tests/local.at: here.
8947 (AT_COMPILE_CXX): Tags the tests using it as c++.
8948 Ignore the test if CXX is not functional.
8949
9c2b381f
PE
89502003-03-01 Paul Eggert <eggert@twinsun.com>
8951
8952 * src/scan-gram.l (code_start): Initialize it to scanner_cursor,
8953 not loc->end, since loc->end might contain garbage and this leads
8954 to undefined behavior on some platforms.
8955 (id_loc, token_start): Use (IF_LINTed) initial values that do not
8956 depend on *loc, so that the reader doesn't give the the false
8957 impression that *loc is initialized.
8958 (<INITIAL>"%%"): Do not bother setting code_start, since its value
8959 does not survive the return.
8960
0433ba88
AD
89612003-03-01 Akim Demaille <akim@epita.fr>
8962
8963 * src/scan-gram.l (code_start): Always initialize it when entering
8964 into yylex, as SC_EPILOGUE is activated *before* the corresponding
8965 yylex invocation. An alternative would be making it static, but
8966 then it starts with the second %%'s beginning, instead of its end.
8967
b305ea69
PE
89682003-02-28 Paul Eggert <eggert@twinsun.com>
8969
8970 * lib/mbswidth.c: Include <wchar.h> before "mbswidth.h", to work
8971 around a UnixWare 7.1.1 porting bug reported by John Hughes in
161a71f3 8972 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00030.html>.
b305ea69 8973
c3d25e01
PE
89742003-02-26 Paul Eggert <eggert@twinsun.com>
8975
8976 * README: Mention compiler bug in Sun Forte Developer 6 update 2.
8977 Remove Sequent/Pyramid discussion (nobody uses them any more).
8978 Merge VMS and MS-DOS discussion; these ports may well be dead
8979 but let's keep mentioning them for now. Put <> around email
8980 addresses. Add copyright notice.
8981
c267ffbc
PE
89822003-02-24 Paul Eggert <eggert@twinsun.com>
8983
8984 * data/glr.c (yy_reduce_print): yylineno -> yylno,
8985 to avoid collision with flex use of yylineno.
8986 Problem reported by Bruce Lilly in
161a71f3 8987 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00016.html>.
c267ffbc
PE
8988 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
8989 * data/yacc.c (yy_reduce_print): Likewise.
8990
8991 * config/depcomp: Sync with Automake 1.7.3.
8992
f939fc12
AD
89932003-02-21 Akim Demaille <akim@epita.fr>
8994
8995 * data/lalr1.cc: Use temporary variables instead of casts to
8996 change integer types.
8997 Suggested by Paul Eggert.
8998
95923bd6
AD
89992003-02-21 Akim Demaille <akim@epita.fr>
9000
9001 * doc/bison.texinfo: Use "location" consistently to refer to @n,
9002 to avoid confusions with lalr1.cc's notion of Position.
9003 Suggested by Paul Eggert.
9004
2cdc240e
AD
90052003-02-20 Akim Demaille <akim@epita.fr>
9006
9007 * data/lalr1.cc (position.hh): Make sure "columns" never pushes
9008 before initial_columns.
9009 (location.hh): Use consistent variable names when defining the
9010 operator<<.
9011 Use "last" so that we subtract from Positions, not from unsigned.
9012
5d003116
AD
90132003-02-20 Akim Demaille <akim@epita.fr>
9014
9015 * data/lalr1.cc (position.hh): New subfile, including the extended
9016 and Doxygen'ed documentation of class Position.
9017 (location.hh): Use it.
9018 Document a` la Doxygen.
ba1ecc07 9019 With the help of Benoit Perrot.
5d003116 9020
d02b25f9
AD
90212003-02-20 Akim Demaille <akim@epita.fr>
9022
9023 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Define
9024 AT_YACC_IF.
9025 Redefine AT_YYERROR_SEES_LOC_IF using it.
9026 (_AT_DATA_CALC_Y): Don't declare yyerror when lalr1.cc, as it is
9027 not defined.
9028 Don't use the location in yy::Parser::error_ and
9029 yy::Parser::print_ when not %locations.
9030 Activate more lalr1.cc tests.
9031
0d1c3a04
AD
90322003-02-19 Akim Demaille <akim@epita.fr>
9033
9034 * data/lalr1.cc: When displaying a line number, be sure to make it
9035 an int.
9036
60a777aa
AD
90372003-02-19 Akim Demaille <akim@epita.fr>
9038
9039 * data/lalr1.cc (b4_stack_depth_init, yy::Parser::initdepth_):
9040 Remove, useless.
9041 (YYABORT, YYACCEPT, YYERROR): New.
9042 * tests/calc.at: Renable the lalr1.cc test.
9043
0b86fc41
AD
90442003-02-19 Akim Demaille <akim@epita.fr>
9045
9046 * tests/calc.at (AT_CHECK_CALC): Check different scenarios of
9047 error recovery, mixing with/without pops and discarding of the
9048 lookahead.
9049 Exercise YYERROR.
9050 Disable the lalr1.cc tests as currently it doesn't support YYERROR.
9051
da99a5dc
PE
90522003-02-17 Paul Eggert <eggert@twinsun.com>
9053
9054 * tests/atlocal.in (LDFLAGS, LIBS): New vars.
9055 * tests/testsuite.at (AT_COMPILE): Use them.
9056 This fixes the testsuite problem reported by Robert Lentz in
161a71f3 9057 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00011.html>.
da99a5dc 9058
93b8c255
PE
90592003-02-12 Paul Eggert <eggert@twinsun.com>
9060
9061 * data/yacc.c (yyerrlab) [YYERROR_VERBOSE]:
9062 Avoid subscript error in yycheck. Bug reported by Andrew Suffield in
161a71f3 9063 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00003.html>.
93b8c255
PE
9064 * data/glr.c (yyreportSyntaxError) [YYERROR_VERBOSE]: Likewise.
9065 Check for malloc failure, for consistency with yacc.c.
9066 (yytname_size): Remove, for consistency with yacc.c.
9067
9068 The bug still remains in data/lalr1.cc, as I didn't have time
9069 to fix it there.
9070
7548fed2
AD
90712003-02-06 Akim Demaille <akim@epita.fr>
9072
9073 * configure.ac (GXX): Rename as...
9074 (CXX): this, to keep the original Autoconf semantics.
9075 Require 2.57.
9076 * data/lalr1.cc: Fix b4_copyright invocations.
9077 If YYDEBUG is not defined, don't depend upon name_ being defined.
9078 (location.hh): Include string and iostream.
9079 (Position::filename): New member.
9080 (Position::Position ()): New.
9081 (operator<< (Position)): New.
9082 (operator- (Position, int)): New.
9083 (Location::first, Location::last): Rename as...
9084 (Location::begin, Location::end): these, to mock the conventional
9085 iterator names.
9086 (operator<< (Location)): New.
9087 * tests/atlocal.in (CXX): New.
9088 * tests/testsuite.at (AT_COMPILE_CXX): New.
9089 * tests/calc.at (_AT_DATA_CALC_Y): Adjust yyerror to report the
9090 locations in a more synthetic way.
9091 (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF is positive if
9092 lalr1.cc is used.
9093 Adjust the C locations to match those from Emacs: first column is
9094 column 0.
9095 Change all the expected results.
9096 Conform to the GCS: simplify the locations when applicable.
9097 (LOC, VAL, YYLLOC_FORMAL, YYLLOC_ARG, USE_YYLLOC, LEX_FORMALS)
9098 (LEX_ARGS, USE_LEX_ARGS, LEX_PRE_FORMALS, LEX_PRE_ARGS): Replace
9099 these CPP macros with the m4 macros new defined by...
9100 (AT_CHECK_PUSHDEFS): this, i.e.:
9101 (AT_LALR1_CC_IF, AT_PURE_LEX_IF, AT_LOC, AT_VAL, AT_LEX_FORMALS)
d02b25f9 9102 (AT_LEX_ARGS, AT_USE_LEX_ARGS, AT_LEX_PRE_FORMALS, AT_LEX_PRE_ARGS)
7548fed2
AD
9103 New macros.
9104 (AT_CHECK_POPDEFS): Undefine them.
9105 (AT_CHECK_CALC_LALR1_CC): New.
9106 Use it for the first lalr1.cc test.
9107
43a176ef
AD
91082003-02-04 Akim Demaille <akim@epita.fr>
9109
9110 * data/lalr1.cc (YYLLOC_DEFAULT): Fix its definition: be based on
9111 Location as is defined.
9112
fc049e9c
AD
91132003-02-04 Akim Demaille <akim@epita.fr>
9114
9115 * data/lalr1.cc: If YYDEBUG is not defined, don't depend upon
9116 name_ being defined.
9117
a737b216
PE
91182003-02-03 Paul Eggert <eggert@twinsun.com>
9119
9120 * src/gram.h (start_symbol): Remove unused decl.
9121
9122 Use more-consistent naming conventions for local vars.
9123
9124 * src/derives.c (derives_compute): Change type of local var from
9125 int to rule_number.
9126 * src/gram.c (grammar_rules_partial_print): Likewise.
9127 * src/print.c (print_core): Likewise.
9128 * src/reduce.c (reduce_grammar_tables): Likewise.
9129
9130 * src/gram.c (grammar_dump): Change name of item_number *
9131 local var from r to rp.
9132 * src/nullable.c (nullable_compute): Likewise.
9133
9134 * src/gram.h (ISTOKEN, ISVAR): Use i, not s, for int var.
9135
9136 * src/gram.h (symbol_number_as_item_number): Use sym, not s,
9137 for symbol or symbol_number var.
9138 * src/reader.c (grammar_start_symbol_set): Likewise.
9139 * src/reader.h (grammar_start_symbol_set, grammar_symbol_append):
9140 Likewise.
9141 * src/state.c (transitions_to): Likewise.
9142 * src/state.h: Likewise.
9143 * src/tables.c (symbol_number_to_vector_number): Likewise.
9144
9145 * src/muscle_tab.h (MUSCLE_OBSTACK_SGROW): Use p, not s, for
9146 char * var.
9147
9148 * src/parse-gram.y (lloc_default): Use loc, not r, for YYLTYPE
9149 var.
9150
9151 * src/scan-gram.l (no_cr_read): Use bytes_read, not s, for size
9152 var.
9153
9154 * src/system.h (xstrndup, strchr, strspn, strnlen, memchr, memrchr):
9155 Use str, not s, for char * var. Use ch, not c, for character var.
9156 Use size for size var.
9157
9158 * src/uniqstr.c (uniqstr_new, uniqstr_assert): Use str, not s, for
9159 char * var.
9160 (uniqstr_print, uniqst_print_processor): Use ustr, not s, for
9161 uniqstr var.
9162 * src/uniqstr.h: Likewise.
9163
9164 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
9165 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
9166 get_node_alignment_str, get_arrow_mode_str, get_crossing_type_str,
9167 get_view_str, get_linestyle_str, get_arrowstyle_str): Rename
9168 param to have same name as that of enum, so that we don't use
9169 "s" to stand for a non-state.
9170
68e93ad5
AD
91712003-02-02 Akim Demaille <akim@epita.fr>
9172
9173 * src/scan-skel.l: Scan more than one inert character per yylex
9174 invocation.
9175
92898986
PE
91762003-02-01 Paul Eggert <eggert@twinsun.com>
9177
9178 Version 1.875a.
9179
1d9d5d71
PE
9180 * po/LINGUAS: Add ms.
9181
0435d061
AD
91822003-01-30 Akim Demaille <akim@epita.fr>
9183
9184 * doc/Makefile.am (CLEANFILES): Add bison.fns for distcheck.
9185
6029a57f
PH
91862003-01-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
9187
9188 * tests/cxx-type.at: Correct apparent typo in Bison input: $$ instead
9189 of $1.
0435d061
AD
9190
9191 Changes in response to error report by S. Eken: GLR mode does not
6029a57f 9192 handle negative $ indices or $ indices in embedded rules correctly.
161a71f3 9193 See <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00076.html>.
0435d061 9194
6029a57f
PH
9195 * data/glr.c (b4_rhs_value): Change to use YYFILL macro.
9196 (b4_rhs_location): Ditto.
0435d061 9197 (yyfill): New function to copy from stack tree into array
6029a57f 9198 incrementally.
0435d061
AD
9199 (yyuserAction): Modify to allow incremental move of semantic values
9200 to rhs array when in GLR mode.
9201 Define YYFILL to use in user-defined actions to fill semantic array
6029a57f
PH
9202 as needed.
9203 Remove dummy use of yystack, as there is now a guaranteed use.
9204 (yydoAction): Modify to allow incremental move of semantic values
9205 to rhs array when in GLR mode.
9206 (yyresolveAction): Ditto.
9207 (yyglrShiftDefer): Update comment.
0435d061 9208 (yyresolveStates): Use X == NULL for pointers, not !X.
6029a57f
PH
9209 (yyglrReduce): Ditto.
9210 (yydoAction): Ditto
0435d061 9211
6029a57f
PH
9212 * tests/glr-regr1.at: Rename to ...
9213 * tests/glr-regression.at: Add new regression test for the problems
9214 described above (adapted from S. Eken).
9215 Update copyright notice.
9216 * tests/testsuite.at: Rename glr-regr1.at to glr-regression.at.
9217 * tests/Makefile.am: Ditto.
9218
6cee6297
PE
92192003-01-28 Paul Eggert <eggert@twinsun.com>
9220
9221 * data/lalr1.cc: Do not use @output_header_name@ unless
9222 b4_defines_flag is set. This fixes two bugs reported by
9223 Tim Van Holder in
161a71f3
PE
9224 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00071.html>
9225 and <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00073.html>.
6cee6297 9226
b2a836b5
PE
92272003-01-21 Paul Eggert <eggert@twinsun.com>
9228
9229 * data/yacc.c (YYERROR): Move code from yyerrlab1 to here, so that
9230 we don't need to worry about yyerrlab1 being reported as an
9231 "unused label" by non-GCC C compilers. The downside is that if
9232 locations are used then a couple of statements are duplicated each
9233 time YYERROR is invoked, but the upside is that the warnings
9234 should vanish.
9235 (yyerrlab1): Move code to YERROR.
9236 (yyerrlab2): Remove. Change uses back to yyerrlab1.
9237 This reverts some of the 2002-12-27 change.
9238
4196b931
PE
92392003-01-17 Paul Eggert <eggert@twinsun.com>
9240
9241 * src/output.c (symbol_printers_output): Fix typo that led
9242 to core dump. Problem reported by Antonio Rus in
161a71f3 9243 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00058.html>.
4196b931 9244
3ae831b4
AD
92452003-01-13 Akim Demaille <akim@epita.fr>,
9246 Quoc Peyrot <chojin@lrde.epita.fr>,
9247 Robert Anisko <anisko_r@lrde.epita.fr>
9248
9249 * data/lalr1.cc (parse::yyerrlab1): When popping the stack, stop
9250 when the stacks contain one element, as the loop would otherwise
9251 free the last state, and then use the top state (the one we just
9252 popped). This means that the initial elements will not be freed
9253 explicitly, as is the case in yacc.c; it is not a problem, as
9254 these elements have fake values.
9255
e3aa65c5
PE
92562003-01-11 Paul Eggert <eggert@twinsun.com>
9257
9258 * NEWS: %expect-violations are now just warnings, reverting
9259 to Bison 1.30 and 1.75 behavior. This fixes the GCC 3.2
9260 bootstrapping problem reported by Matthias Klose; see
161a71f3 9261 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00053.html>.
e3aa65c5
PE
9262 * src/conflicts.c (conflicts_print): Likewise.
9263 * tests/conflicts.at (%expect not enough, %expect too much,
9264 %expect with reduce conflicts): Likewise.
9265 * doc/bison.texinfo (Expect Decl): Document this. Also mention
9266 that the warning is enabled if the number of conflicts changes
9267 (not necessarily increases).
9268
9269 * src/getargs.c (version): Update copyright year.
9270
f0057011
AD
92712003-01-09 Akim Demaille <akim@epita.fr>
9272
9273 * src/Makefile.am, lib/Makefile.am: Use $(VAR) instead of @VAR@.
9274
1ee6d2a0
PE
92752003-01-08 Paul Eggert <eggert@twinsun.com>
9276
9277 * Makefile.maint (WGETFLAGS):
9278 New macro, containing "-C off" to disable proxy caches.
9279 All uses of $(WGET) changed to $(WGET) $(WGETFLAGS).
9280 (rel-check): Use $(WGET) instead of wget.
9281
d4fd77c4
PE
92822003-01-06 Paul Eggert <eggert@twinsun.com>
9283
9284 * doc/bison.texinfo (Generalized LR Parsing): Add a reference to
9285 the GLR paper of Scott, Johnstone and Hussain.
9286
464c6927
PE
92872003-01-04 Paul Eggert <eggert@twinsun.com>
9288
d600ee67
PE
9289 * configure.ac (AC_ARG_ENABLE): Add --disable-yacc.
9290 (YACC_SCRIPT, YACC_LIBRARY): New vars to AC_SUBST.
9291 * lib/Makefile.am (lib_LIBRARIES): liby.a -> @YACC_LIBRARY@.
9292 (EXTRA_LIBRARIES): New var, for liby.a.
9293 * src/Makefile.am (bin_SCRIPTS): yacc -> @YACC_SCRIPT@.
9294 (EXTRA_SCRIPTS): New var, for yacc.
9295
464c6927
PE
9296 * data/yacc.c (yyerrlab1): Omit attribute if __cplusplus is defined,
9297 since GNU C++ (as of 3.2.1) does not allow attributes on labels.
9298 Problem reported by Nelson H. F. Beebe.
9299
93002003-01-03 Paul Eggert <eggert@twinsun.com>
9301
9302 * lib/obstack.h (__INT_TO_PTR) [__STDC__]: Cast result to
9303 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
9304 when compiling Bison 1.875's `bitset bset = obstack_alloc
9305 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
9306
9307 * src/scan-skel.l (QPUTS): Omit redundant `;' from macro definition.
9308 ([^@\n]): Renamed from [^@\n]+ so that the token buffer does not
9309 grow to a huge size with typical invocation.
d600ee67 9310
464c6927
PE
9311 * lib/hash.c (_Bool, bool, false, true, __bool_true_false_are_defined):
9312 Use the pattern recommended by Autoconf 2.57, except also protect
9313 against double-definition.
9314 * src/system.h: Likewise.
9315 Portability issues reported by Nelson H. F. Beebe.
d600ee67 9316
464c6927
PE
9317 * data/glr.c (yybool): Renamed from bool, to avoid collisions in C.
9318 All uses changed. Provide a definition in both C and C++.
9319 (yytrue, yyfalse): Define even if defined (__cplusplus).
9320
9321 * lib/bitset_stats.c (bitset_stats_list): Remove unused var.
9322 Reported by Nelson H. F. Beebe.
d600ee67 9323
464c6927
PE
9324 * src/scan-skel.l ("@oline@"): Output lineno+1, not lineno.
9325
0f42c7d5
PE
93262003-01-02 Paul Eggert <eggert@twinsun.com>
9327
9328 * data/yacc.c (yyerrlab1): Append `;' after attribute, to
9329 pacify the buggy "smart preprocessor" in MacOS 10.2.3.
9330 Bug reported by Nelson H. F. Beebe.
9331
dc546b0f
PE
93322003-01-01 Paul Eggert <eggert@twinsun.com>
9333
9334 * Version 1.875.
9335
2c09b6a7
PE
93362002-12-30 Paul Eggert <eggert@twinsun.com>
9337
9338 * src/scan-gram.l (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>","):
9339 Moved here from...
9340 (<INITIAL>","): Here. This causes stray "," to be treated
9341 more uniformly.
9342
dc546b0f 9343 * src/scan-gram.l (<SC_BRACED_CODE>"}"): Output ";" before the
2c09b6a7
PE
9344 last brace in braced code when not in Yacc mode, for compatibility
9345 with Bison 1.35. This resurrects the 2001-12-15 patch to
9346 src/reader.c.
9347
9348 * src/reader.h (YYDECL): Use YYSTYPE, not its deprecated alias
9349 yystype. This follows up the 2002-12-24 YYSTYPE bug fix.
9350
535c0f63
PE
93512002-12-28 Paul Eggert <eggert@twinsun.com>
9352
9353 * src/symtab.c (symbol_make_alias): Set type of SYMVAL to be
9354 that of SYM's type. This fixes Debian bug 168069, reported by
9355 Thomas Olsson.
d600ee67 9356
963fcc17
PE
93572002-12-28 Paul Eggert <eggert@twinsun.com>
9358
9359 Version 1.75f.
9360
9361 Switch back to the Yacc style of conflict reports, undoing some
9362 of the 2002-07-30 change.
9363 * doc/bison.texinfo (Understanding): Use Yacc style for
9364 conflict reports. Also, use new way of locating rules.
9365 * src/conflicts.c (conflict_report):
9366 Renamed from conflict_report_yacc, removing the old
9367 'conflict_report'. Translate the entire conflict report at once,
9368 so that we don't assume that "," has the same interpretation in
9369 all languages.
9370 (conflicts_output): Use Yacc-style conflict report for each state,
9371 instead of our more-complicated style.
9372 (conflicts_print): Use Yacc-style conflict report, except print
9373 the input file name when not emulating Yacc.
9374 * tests/conflicts.at (Unresolved SR Conflicts, Defaulted
9375 Conflicted Reduction, %expect not enough, %expect too much,
9376 %expect with reduce conflicts): Switch to Yacc-style conflict reports.
9377 * tests/existing.at (GNU Cim Grammar): Likewise.
9378 * tests/glr-regr1.at (Badly Collapsed GLR States): Likewise.
9379
9380 * src/complain.c (warn_at, warn, complain_at, complain, fatal_at,
9381 fatal): Don't invoke fflush; it's not needed and it might even be
9382 harmful for stdout, as stdout might not be open.
9383 * src/reduce.c (reduce_print): Likewise.
9384
b1efe548
PE
93852002-12-27 Paul Eggert <eggert@twinsun.com>
9386
9387 Fix a bug where error locations were not being recorded correctly.
9388 This problem was originally reported by Paul Hilfinger in
161a71f3 9389 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00086.html>.
b1efe548
PE
9390
9391 * data/yacc.c (yyparse): New local var yylerrsp, to record the
9392 top of the location stack's error locations.
9393 (yyerrlab): Set it. When discarding a token, push its location
9394 onto yylerrsp so that we don't lose track of the error's end.
9395 (yyerrlab1): Now is only the target of YYERROR, so that we can
9396 properly record the location of the action that failed. For GCC
9397 2.93 and later, insert an __attribute__ ((__unused__)) to avoid
9398 GCC warning about yyerrlab1 being unused if YYERROR is unused.
9399 (yyerrlab2): New label, which yyerrlab now falls through to.
9400 Compute the error's location by applying YYLLOC_DEFAULT to
9401 the locations of all the symbols that went into the error.
9402 * doc/bison.texinfo (Location Default Action): Mention that
9403 YYLLOC_DEFAULT is also invoked for syntax errors.
9404 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
9405 Error locations include the locations of all the tokens that were
9406 discarded, not just the last token.
d600ee67 9407
983c5c2c
PE
94082002-12-26 Paul Eggert <eggert@twinsun.com>
9409
b1efe548
PE
9410 * src/files.c: Include quote.h.
9411 (compute_output_file_names): Warn if we detect conflicting
9412 outputs to the same file. This should catch the misunderstanding
9413 exemplified by Debian Bug 165349, reported by Bruce Stephens..
9414
9415 * src/conflicts.c (conflicts_print): If the user specifies
9416 "%expect N", report an error if there are any reduce/reduce
9417 conflicts. This is what the manual says should happen.
9418 This fixes Debian bug 130890, reported by Anthony DeRobertis.
9419 * tests/conflicts.at (%expect with reduce conflicts): New test.
9420
983c5c2c
PE
9421 Don't use m4_include on relative file names, as it doesn't work as
9422 desired if there happens to be a file with that name under ".".
d600ee67 9423
983c5c2c
PE
9424 * m4sugar/version.m4: Remove; it was included but it wasn't used.
9425 * data/Makefile.am (dist_m4sugar_DATA): Remove m4sugar/version.m4.
9426 * data/m4sugar/m4sugar.m4: Don't include m4sugar/version.m4.
9427 * data/glr.c, data/lalr1.cc, data/yacc.c: Don't include c.m4.
9428 * src/output.c (output_skeleton): Use full path names when
9429 specifying a file to include; don't rely on include path, as
9430 it's unreliable when the working file contains a file with
9431 that name.
d600ee67 9432
983c5c2c
PE
94332002-12-25 Paul Eggert <eggert@twinsun.com>
9434
9435 Remove obsolete references to bison.simple and bison.hairy.
9436 Problem mentioned by Aubin Mahe in
161a71f3 9437 <http://lists.gnu.org/archive/html/help-bison/2002-12/msg00010.html>.
983c5c2c
PE
9438 * data/glr.c: Comment fix.
9439 * doc/bison.1: Remove references. Also, mention "yacc".
9440
9441 * src/getargs.c (getargs) [MSDOS]: Don't assume optarg != NULL
9442 with -g option.
9443
9444 * src/parse-gram.y (declaration): Use enum "report_states" rather
9445 than its numeric value 1.
9446
9447 * src/scan-skel.l ("@output ".*\n): Close any old yyout before
9448 opening a new one. This fixes Debian bug 165349, reported by
9449 Bruce Stephens.
9450
23f2d9dc
PE
94512002-12-24 Paul Eggert <eggert@twinsun.com>
9452
9453 Version 1.75e.
9454
9455 * Makefile.maint (cvs-update): Don't assume that the shell
9456 supports $(...), as Solaris sh doesn't.
9457
9458 * src/parse-gram.y (lloc_default): Remove test for empty
9459 nonterminals at the end, since it didn't change the result.
9460
94612002-12-24 Paul Eggert <eggert@twinsun.com>
33167b8b
PE
9462
9463 If the user does not define YYSTYPE as a macro, Bison now declares it
9464 using typedef instead of defining it as a macro. POSIX requires this.
9465 For consistency, YYLTYPE is also declared instead of defined.
9466
9467 %union directives can now have a tag before the `{', e.g., the
9468 directive `%union foo {...}' now generates the C code
9469 `typedef union foo { ... } YYSTYPE;'; this is for Yacc compatibility.
9470 The default union tag is `YYSTYPE', for compatibility with Solaris 9
9471 Yacc. For consistency, YYLTYPE's struct tag is now `YYLTYPE'
9472 instead of `yyltype'.
9473
9474 `yystype' and `yyltype' are now obsolescent macros instead of being
9475 typedefs or tags; they are no longer documented and will be
9476 withdrawn in a future release.
9477
9478 * data/glr.c (b4_location_type): Remove.
9479 (YYSTYPE): Renamed from yystype.
9480 (YYSTYPE_IS_DECLARED): New macro, used to prevent double-typedef.
9481 (struct YYLTYPE): Renamed from struct yyltype.
9482 (YYLTYPE): Renamed from yyltype.
9483 (yyltype, yystype): New (and obsolescent) macros,
9484 for backward compatibility.
9485 * data/yacc.c: Likewise.
9486
9487 * data/yacc.c (YYSTYPE): Declare as union YYSTYPE if the user
9488 does not specify a union tag. This is for compatibility with
9489 Solaris 9 yacc.
9490
9491 * src/parse-gram.y (add_param): 2nd arg is now char * not char
9492 const *, since it is now modified by stripping surrounding { }.
9493 (current_braced_code): Remove.
9494 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_UNION,
9495 PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Change names to include
9496 trailing " {...}". Now of type <chars>.
9497 (grammar_declaration): Adjust to bundled tokens.
9498 (code_content): Remove; stripping is now done by add_param.
9499 (print_token_value): Print contents of bundled tokens.
9500 (token_name): New function.
9501
9502 * src/reader.h (braced_code, current_braced_code): Remove.
9503 (token_name): New decl.
9504
9505 * src/scan-gram.l (handle_dollar, handle_at): Now takes int
9506 token_type, not braced_code code_kind. All uses changed.
9507 (SC_PRE_CODE): New state, for scanning after a keyword that
9508 has (or usually has) an immediately-following braced code.
9509 (token_type): New local var, to keep track of which token type
9510 to return when scanning braced code.
9511 (<INITIAL>"%destructor", <INITIAL>"%lex-param",
dc546b0f 9512 <INITIAL>"%parse-param", <INITIAL>"%printer",
33167b8b
PE
9513 <INITIAL>"%union"): Set token type and BEGIN SC_PRE_CODE
9514 instead of returning a token type immediately.
9515 (<INITIAL>"{"): Set token type.
9516 (<SC_BRACED_CODE>"}"): Use it.
9517 (handle_action_dollar, handle_action_at): Now returns bool
9518 indicating success. Fail if ! current_rule; this prevents a core dump.
9519 (handle_symbol_code_dollar, handle_symbol_code_at):
9520 Remove; merge body into caller.
9521 (handle_dollar, handle_at): Complain in invalid contexts.
9522
9523 * NEWS, doc/bison.texinfo: Document the above.
9524 * NEWS: Fix years and program names in copyright notice.
9525
879ca4f8
PE
95262002-12-17 Paul Eggert <eggert@twinsun.com>
9527
9528 * NEWS, doc/bison.texinfo (Parser Function, Pure Calling, Error
9529 Reporting, Table of Symbols): Omit mentions of %lex-param and
9530 %parse-param from the documentation for now.
9531
1c5fe69d
PE
95322002-12-15 Paul Eggert <eggert@twinsun.com>
9533
9534 Undo most of the 2002-11-12 yychar -> yytoken patch, as it broke
9535 GCC 3.2.1 (which depends on yychar == YYEMPTY when there is no
9536 lookahead symbol, and which sets yychar in parser actions) and it
7ea9026a
PE
9537 disagreed with the Bison documentation. Bug
9538 reported by Andrew Walrond.
d600ee67 9539
1c5fe69d
PE
9540 * data/yacc.c (YYTRANSLATE): Don't check for negative argument,
9541 as the caller now does that.
9542 (yyclearin, YYBACKUP, yyparse): Use yychar, not yytoken.
9543 (YYEMPTY): Parenthesize right hand side, since others use it.
9544 (yyparse): Don't assume that our generated code is the only code
9545 that sets yychar.
9546
d1de5372
PE
95472002-12-13 Paul Eggert <eggert@twinsun.com>
9548
9549 Version 1.75d.
9550
9551 POSIX requires a "yacc" command.
9552 * src/Makefile.am (bin_SCRIPTS): New macro, for yacc.
9553 (MOSTLYCLEANFILES): Add yacc.
9554 (yacc): New rule.
1c5fe69d 9555 * doc/bison.texinfo (Invocation, Bison Options): Mention yacc
d1de5372
PE
9556 as an alias for bison y.
9557
9558 * po/LINGUAS: Add da.
d600ee67 9559
d1de5372
PE
9560 * src/getargs.c (__GNU_LIBRARY__) [lint]: Define to work around
9561 problem with latest <getopt.h>.
9562 (HACK_FOR___GNU_LIBRARY___PROTOTYPE): New macro.
9563
9564 * doc/fdl.texi: Upgrade to 1.2.
9565 * lib/alloca.c, lib/error.c, lib/getopt.c, lib/getopt.h
9566 lib/getopt1.c, lib/gettext.h, lib/memrchr.c, lib/obstack.c,
9567 lib/obstack.h, lib/strnlen.c, lib/unlocked-io.h: Sync with
9568 gnulib.
9569 * config/install-sh: Sync with autotools.
9570
9571 Fix a bad interaction with flex 2.5.23 reported by Bruce Lilly in
161a71f3 9572 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
d1de5372
PE
9573 * data/yacc.c (YYLTYPE, struct yyltype): Do not define unless
9574 locations are requested.
9575 (union yyalloc): Do not depend on YYLTYPE_IS_TRIVIAL unless
9576 locations are requested.
9577
d0f3fe23
PE
95782002-12-12 Paul Eggert <eggert@twinsun.com>
9579
9580 Remove unportable casts and storage allocation tricks.
9581 While we're at it, remove almost all casts, since they
9582 usually aren't needed and are a sign of trouble.
9583
9584 * configure.ac (AC_CHECK_TYPES): Check for uintptr_t.
9585
9586 * src/derives.c (derives_compute): Do not subtract NTOKENS from
9587 the pointer DSET returned by malloc; this isn't portable.
9588 Instead, always use DSET[i - NTOKENS] rather than DSET[i].
9589 Similarly for DERIVES.
9590 * src/lalr.c (set_goto_map): Likewise, for GOTO_MAP and TEMP_MAP.
9591 * src/nullable.c (nullable_compute): Likewise, for RSETS and NULLABLE.
9592 * src/reduce.c (reduce_grammar_tables): Likewise, for nontermmap
9593
9594 * src/derives.c (derives_compute): Do not bother invoking
9595 int_of_rule_number, since rule numbers are integers.
9596
9597 * src/files.c (concat2, tr, compute_base_name): Use xmalloc (N)
9598 rather than XMALLOC (char, N).
9599
9600 * src/files.c (filename_split): Rewrite to avoid cast.
9601
9602 * src/gram.h (symbol_number_as_item_number,
9603 item_number_as_symbol_number, rule_number_as_item_number,
9604 item_number_as_rule_number):
9605 Now inline functions rather than macros, to avoid casts.
9606 * src/state.h (state_number_as_int): Likewise.
9607 * src/tables.c (state_number_to_vector_number,
9608 symbol_number_to_vector_number): Likewise.
9609
9610 * src/gram.h (int_of_rule_number): Remove; no longer used.
9611
9612 * src/lalr.c (add_lookback_edge): Use malloc rather than calloc,
9613 since the resulting storage is always stored into.
9614
9615 * src/main.c (alloca) [C_ALLOCA]: Add decl here, the only place
9616 where it's needed.
9617
9618 * src/muscle_tab.c (muscle_m4_output):
9619 Now inline. Return bool, not int.
9620 * src/state.c (state_compare): Likewise.
9621 * src/symtab.c (symbol_check_defined,
9622 symbol_check_alias_consistency, symbol_pack, symbol_translation,
9623 hash_compare_symbol, hash_symbol):
9624 Likewise.
9625 * src/uniqstr.c (uniqstr_print): Likewise.
9626 * src/muscle_tab.c (muscle_m4_output_processor):
9627 New function, to avoid casts.
9628 * src/state.c (state_comparator, stage_hasher): Likewise.
9629 * src/symtab.c (symbol_check_defined_processor,
9630 symbol_check_alias_consistency_processor, symbol_pack_processor,
9631 symbol_translation_processor, hash_symbol_comparator,
9632 hash_symbol_hasher): Likewise.
9633 * src/uniqstr.c (uniqstr_print_processor): Likewise.
9634 * src/muscle_tab.c (muscles_m4_output):
9635 Use new functions instead of casting old functions unportably.
9636 * src/state.c (state_hash_new): Likewise.
9637 * src/symtab.c (symbols_new, symbols_do, symbols_check_defined,
9638 symbols_token_translations_init):
9639 Likewise.
9640 * src/uniqstr.c (uniqstrs_new, hash_initialize, uniqstrs_do): Likewise.
9641
9642 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): Use long local
9643 var instead of casting to long, to avoid casts.
9644 (prepare_states): Use MALLOC rather than alloca, so that we don't
9645 have to worry about alloca.
9646 * src/state.c (state_hash_lookup): Likewise.
9647
9648 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>"'"): Use unsigned char
9649 local var instead of casting to unsigned char, to avoid casts.
9650
9651 * src/state.c (TRANSITIONS_ALLOC, ERRS_ALLOC, REDUCTIONS_ALLOC,
9652 STATE_ALLOC): Remove.
9653 (transitions_new, errs_new, reductions_new, state_new): Use malloc
9654 rather than calloc, and use offsetof to avoid allocating slightly
9655 too much storage.
9656 (state_new): Initialize all members.
9657
9658 * src/state.c (state_hash): Use unsigned accumulator, not signed.
9659
9660 * src/symtab.c (symbol_free): Remove; unused.
9661 (symbol_get): Remove cast in lhs of assignment.
9662 (symbols_do): Now static. Accept generic arguments, not
9663 hashing-related ones.
9664
9665 * src/symtab.h: (NUMBER_UNDEFINED): Remove unnecessary cast.
9666 (symbol_processor): Remove.
9667 (symbols_do): Remove decl; now static.
9668
9669 * src/system.h (alloca): Remove; decl no longer needed.
9670 (<stddef.h>): Include, for offsetof.
9671 (<inttypes.>, <stdint.h>): Include if available.
9672 (uintptr_t): New type, if system lacks it.
9673 (CALLOC, MALLOC, REALLOC): New macros.
9674 All uses of XCALLOC, XMALLOC, and XREALLOC changed to use these
9675 new macros.
9676
9677 * src/tables.c (table_size): Now int, to pacify GCC.
9678 (table_grow, table_ninf_remap): Use signed table size.
9679 (save_row): Don't bother initializing locals when not needed.
9680 (default_goto, goto_actions, pack_vector): Remove unnecessary casts.
9681 * src/uniqstr.c (hash_compare_uniqstr): Likewise.
9682
9683 * src/vcg.h: Correct misspellings.
9684
9685 * src/vcg_defaults.h (G_CMAX): Now INT_MAX.
9686
9687
9688 * src/getargs.c (getargs): Don't assume EOF == -1.
9689
26b4a969
PE
96902002-12-09 Paul Eggert <eggert@twinsun.com>
9691
9692 Change identifier spellings to avoid collisions with names
9693 that are reserved by POSIX.
9694
9695 Don't use names ending in _t, since POSIX reserves them.
9696 For consistency, remove _e and _s endings -- they're weren't
9697 needed to remove ambiguity. All uses changed.
9698 * src/uniqstr.h (uniqstr): Renamed from uniqstr_t, which in
9699 turn was just renamed from struniq_t.
9700 * src/uniqstr.c (uniqstr_processor): Renamed from struniq_processor,
9701 which in turn was just renamed from struniq_processor_t.
9702 (hash_compare_uniqstr): Renamed from hash_compare_struniq, which
9703 in turn was renamed from hash_compare_struniq_t.
9704 * src/LR0.c (struct state_list): Renamed from struct state_list_s.
9705 (state_list): Renamed from state_list_t.
9706 * src/assoc.h (assoc): Renamed from assoc_t.
9707 * src/conflicts.c (enum conflict_resolution): Renamed from
9708 enum conflict_resolution_e.
9709 * src/derives.c (struct rule_list): Renamed from struct rule_list_s.
9710 (rule_list): Renamed from rule_list_t.
9711 * src/getargs.h (enum trace): Renamed from enum trace_e.
9712 (enum report): Renamed from enum report_e.
9713 * src/gram.h (item_number): Renamed from item_number_t.
9714 (rule_number): Renamed from rule_number_t.
9715 (struct rule_s): Remove the "rule_s" part; not used.
9716 (rule): Renamed from rule_t.
9717 (rule_filter): Renamed from rule_filter_t.
9718 * src/lalr.c (struct goto_list): Renamed from struct goto_list_s.
9719 (goto_list): Renamed from goto_list_t.
9720 * src/lalr.h (goto_number): Renamed from goto_number_t.
9721 * src/location.h (location): Renamed from location_t.
9722 * src/muscle_tab.c (muscle_entry): Renamed from muscle_entry_t,
9723 and moved here from:
9724 * src/muscle_tab.h (muscle_entry_t): here.
9725 * src/nullable.c (struct rule_list): Renamed from struct rule_list_s.
9726 (rule_list): Renamed from rule_list_t.
9727 * src/print_graph.c (static_graph): Renamed from graph.
9728 * src/reader.h (braced_code): Renamed from braced_code_t.
9729 Remove brace_code_e tag.
9730 * src/relation.h (relation_node): Renamed from relation_node_t.
9731 (relation_nodes): Renamed from relation_nodes_t.
9732 (relation): Renamed from relation_t.
9733 * src/state.h (state_number): Renamed from state_number_t.
9734 (struct state): Renamed from struct state_s.
9735 (state): Renamed from state_t.
9736 (transitions): Renamed from transitions_t. Unused (and
9737 misspelled) transtion_s tag removed.
9738 (errs): Renamed from errs_t. Unused errs_s tag removed.
9739 (reductions): Renamed from reductions_t. Unused tag
9740 reductions_s removed.
9741 * src/symlist.h (symbol_list): Renamed from symbol_list_t.
9742 (struct symbol_list): Renamed from struct symbol_list_s.
9743 * src/symtab.h (symbol_number): Renamed from symbol_number_t.
9744 (struct symbol): Renamed from struct symbol_s.
9745 (symbol): Renamed from symbol_t.
9746 * src/tables.c (vector_number): Renamed from vector_number_t.
9747 (action_number): Renamed from action_t.
9748 * src/tables.h (base_number): Renamed from base_t.
9749 * src/vcg.h (enum color): Renamed from enum color_e.
9750 (enum textmode): Renamed from enum textmode_e.
9751 (enum shape): Renamed from enum shape_e.
9752 (struct colorentry): Renamed from struct colorentry_s.
9753 (struct classname): Renamed from struct classname_s.
9754 (struct infoname): Renamed from struct infoname_s.
9755 (enum layoutalgorithm): Renamed from enum layoutalgorithm_e.
9756 (enum decision): Renamed from enum decision_e.
9757 (enum orientation): Renamed from enum orientation_e.
9758 (enum alignment): Renamed from enum alignment_e.
9759 (enum arrow_mode): Renamed from enum arrow_mode_e.
9760 (enum crossing_type): Renamed from enum crossing_type_e.
9761 (enum view): Renamed from enum view_e.
9762 (struct node): Renamed from struct node_s.
9763 (node): Renamed from node_t.
9764 (enum linestyle): Renamed from enum linestyle_e.
9765 (enum arrowstyle): Renamed from enum arrowstyle_e.
9766 (struct edge): Renamed from struct edge.
9767 (edge): Renamed from edge_t.
9768 (struct graph): Renamed from struct graph_s.
9769 (graph): Renamed from graph_t.
9770 * tests/calc.at (_AT_DATA_CALC_Y, Simple LALR Calculator):
9771 Rename value_t -> value.
9772 * tests/input.at (Torturing the Scanner): Rename value_t -> value,
9773 value_t_as_yystype -> value_as_yystype.
9774
9775 Don't include <errno.h> in the mainstream code, since it
9776 reserves E[A-Z0-9]* and we want to use symbols like 'EQUALS'.
9777 * lib/get-errno.c, lib/get-errno.h: New files.
9778 * lib/Makefile.am (libbison_a_SOURCES): Add get-errno.h,
9779 get-errno.c.
9780 * src/files.c (xfopen, xfclose): Use get_errno instead of errno.
9781 * src/output.c (output_skeleton): Likewise.
9782 * src/scan-gram.l (<INITIAL>{int}): Use set_errno and get_errno
9783 instead of errno.
9784 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>\\x[0-9abcdefABCDEF]+):
9785 Likewise.
9786 (handle_action_dollar, handle_action_at): Likewise.
9787 * src/system.h: Do not include <errno.h>.
9788 (TAB_EXT): Renamed from EXT_TAB.
9789 (OUTPUT_EXT): Renamed from EXT_OUTPUT.
9790
9791 Avoid str[a-z]*, since <string.h> reserves that name space.
9792 Change all instances of "struniq" in names to "uniqstr", and
9793 likewise for "STRUNIQ" and "UNIQSTR".
9794 * src/uniqstr.c: Renamed from src/struniq.c.
9795 * src/uniqstr.h: Renamed from src/struniq.h.
9796 * src/Makefile.am (bison_SOURCES): Adjust to these renamings.
9797 * src/files.c (strsuffix): Remove; unused.
9798 (concat2): Renamed from stringappend. Now static.
9799 * src/files.h (strsuffix, stringappend): Remove; unused.
9800 * src/parse-gram.y (<chars>): Renamed from <string>.
9801 (<uniqstr>): Renamed from <struniq>.
9802 * src/scan-gram.l (obstack_for_string): Renamed from string_obstack.
9803 * src/vcg.h (struct node_s.expand): Renamed from struct node_s.stretch.
9804 (struct graph_s.expand): Renamed from struct graph_s.stretch.
9805 * src/vcg_defaults.h (G_EXPAND): Renamed from G_STRETCH.
9806 (G_LONG_STRAIGHT_PHASE): Renamed from G_STRAIGHT_PHASE.
9807 (N_EXPAND): Renamed from N_STRETCH.
9808
9809 Avoid *_MAX and *_MIN, since <limits.h> reserves that name space.
9810 * data/yacc.c (YYSTACK_GAP_MAXIMUM): Renamed from YYSTACK_GAP_MAX.
9811 * src/gram.h (ITEM_NUMBER_MAX, ITEM_NUMBER_MIN, RULE_NUMBER_MAX):
9812 Remove; unused.
9813 * src/lalr.h (GOTO_NUMBER_MAXIMUM): Renamed from GOTO_NUMBER_MAX.
9814 * src/state.h (STATE_NUMBER_MAXIMUM): Renamed from STATE_NUMBER_MAX.
9815 * src/symtab.h (SYMBOL_NUMBER_MAXIMUM): Renamed from SYMBOL_NUMBER_MAX.
9816 * src/tables.c (VECTOR_NUMBER_MAX, VECTOR_NUMBER_MIN): Remove; unused.
9817 (BASE_MAXIMUM): Renamed from BASE_MAX.
9818 (BASE_MINIMUM): Renamed from BASE_MIN.
9819 (ACTION_MAX): Remove; unused.
9820 (ACTION_NUMBER_MINIMUM): Renamed from ACTION_MIN.
9821 Unnecessary casts removed from above defines.
9822
9823
9824 Fix misspelling in names.
9825 * src/vcg.h (enum_alignment_e): Renamed from enum_alignement_e.
9826 * src/vcg_defaults.h (G_NODE_ALIGNMENT): Renamed from
9827 G_NODE_ALIGNEMENT.
9828
9829
9830 * lib/timevar.c (timevar_report): Renamed from time_report,
9831 for consistency with other names.
9832 * lib/timevar.h (timevar_report): New decl.
9833 * src/system.h (time_report): Remove; decl is now in lib/timevar.h.
9834
9835
9836 Sort include-file uses.
9837
9838 Reorder all include files under src to be in the order "system.h".
9839 then the ../lib include files in angle brackets (alphabetized),
9840 then the . include files in double-quotes (alphabetized). Fix
9841 dependency breakages encountered in this process, as follows:
9842 * src/closure.h, src/derives.h, src/state.h: Include "gram.h".
9843 * src/complain.c: Don't include stdlib.h, string.h _LIBC stuff.
9844 * src/state.h: Include "symtab.h".
9845
996b1c7e
PE
98462002-12-08 Paul Eggert <eggert@twinsun.com>
9847
9848 * data/glr.c, data/lalr1.cc, data/yacc.c: Do not use __file__,
9849 since this causes problems when __file__ contains character
9850 sequences like "@" that are treated specially by src/scan-skel.l.
9851 Instead, just use the file's basename. This fixes the bug
9852 reported by Martin Mokrejs in
161a71f3 9853 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00007.html>.
996b1c7e 9854
e19c4e5d
PE
98552002-12-06 Paul Eggert <eggert@twinsun.com>
9856
9857 Add support for rules that do not have trailing semicolons, as
9858 POSIX requires. Improve the quality of locations in Bison
9859 diagnostics.
26b4a969 9860
e19c4e5d
PE
9861 * src/location.c: Include <quotearg.h>.
9862 (empty_location): Now const.
9863 (location_print): New function. Follow the recommendation of the
9864 GNU Coding Standards for locations that span file boundaries.
9865 * src/location.h: Do not include <quotearg.h>; no longer needed.
9866 (boundary): New type.
9867 (location_t): Use it. This allows locations to span file boundaries.
9868 All member uses changed: file -> start.file or end.file (as needed),
9869 first_line -> start.line, first_column -> start.column,
9870 last_line -> end.line, last_column -> end.column.
9871 (equal_boundaries): New function.
9872 (LOCATION_RESET, LOCATION_STEP): Remove.
9873 (LOCATION_PRINT): Remove. All callers changed to use location_print.
9874 (empty_location): Now const.
9875 (location_print): New decl.
9876 * src/parse-gram.y (lloc_default): New function, which handles
9877 empty locations more accurately.
9878 (YYLLOC_DEFAULT): Use it.
9879 (%token COLON): Remove.
9880 (%token ID_COLON): New token.
26b4a969 9881 (rules): Use it.
e19c4e5d
PE
9882 (declarations, rules): Remove trailing semicolon.
9883 (declaration, rules_or_grammar_declaration):
9884 Allow empty (";") declaration.
9885 (symbol_def): Remove empty actions; no longer needed.
9886 (rules_or_grammar_declaration): Remove trailing semicolon.
9887 (semi_colon.opt): Remove.
9888 * src/reader.h: Include location.h.
9889 (scanner_cursor): New decl.
9890 * src/reduce.c (nonterminals_reduce): Use warn_at rather than
9891 rolling our own.
9892 * src/scan-gram.l (YY_USER_INIT): Initialize scanner_cursor instead
9893 of *loc.
9894 (STEP): Remove. No longer needed, now that adjust_location does
9895 the work. All uses removed.
9896 (scanner_cursor): New var.
9897 (adjust_location): Renamed from extend_location. It now sets
9898 *loc and adjusts the scanner cursor. All uses changed.
9899 Don't bother testing for CR.
9900 (handle_syncline): Remove location arg; now updates scanner cursor.
9901 All callers changed.
9902 (unexpected_end_of_file): Now accepts start boundary of token or
9903 comment, not location. All callers changed. Update scanner cursor,
9904 not the location.
9905 (SC_AFTER_IDENTIFIER): New state.
9906 (context_state): Renamed from c_context. All uses changed.
9907 (id_loc, code_start, token_start): New local vars.
9908 (<INITIAL,SC_AFTER_IDENTIFIER>): New initial context. Move all
9909 processing of Yacc white space and equivalents here.
9910 (<INITIAL>{id}): Save id_loc. Begin state SC_AFTER_IDENTIFIER
9911 instead of returning ID immediately, since we need to search for
9912 a subsequent colon.
9913 (<INITIAL>"'", "\""): Save token_start.
9914 (<INITIAL>"%{", "{", "%%"): Save code_start.
9915 (<SC_AFTER_IDENTIFIER>): New state, looking for a colon.
9916 (<SC_YACC_COMMENT>, <SC_COMMENT>, <SC_LINE_COMMENT>):
9917 BEGIN context_state at end, not INITIAL.
9918 (<SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'",
9919 <SC_BRACED_CODE>"}", <SC_PROLOGUE>"%}", <SC_EPILOGUE><<EOF>>):
9920 Return correct token start.
9921 (<SC_BRACED_CODE,SC_PROLOGUE,SC_EPILOGUE>): Save start boundary when
9922 the start of a character, string or multiline comment is found.
9923 * tests/conflicts.at (S/R in initial, Defaulted Conflicted
9924 Reduction): Adjust reported locations to match the more-precise
9925 results now expected.
9926 * tests/input.at (Invalid $n, Invalid @n, Type Clashes): Likewise.
9927 * tests/reduce.at (Useless Rules, Reduced Automaton,
9928 Underivable Rules): Likewise.
9929 * tests/regression.at (Invalid inputs): No longer `expecting ";"
9930 or "|"' now that so many other tokens are allowed by the new grammar.
9931
9932 * src/complain.h (current_file): Remove duplicate decl;
9933 current_file is now owned by files.h.
9934 * src/complain.c, src/scan-gram.l: Include files.h.
9935
99362002-12-06 Paul Eggert <eggert@twinsun.com>
26b4a969 9937
e19c4e5d
PE
9938 * data/glr.c (yy_reduce_print): Don't assume that yyrline[yyrule]
9939 promotes to int; it might be unsigned int.
9940 * data/yacc.c (yy_reduce_print): Likewise.
9941
9942 * doc/bison.texinfo (Table of Symbols): YYERROR_VERBOSE should
9943 be #defined in the prologue, not in the Bison declarations.
9944 This fixes Debian Bug 102878, reported by Shaul Karl.
26b4a969 9945
b64755e3
PE
99462002-12-02 Paul Eggert <eggert@twinsun.com>
9947
9948 * configure.ac (AC_REPLACE_FUNCS): Add strtoul.
9949 * lib/strtoul.c: New file, from gnulib.
9950 This fixes a porting bug reported by Peter Klein in
161a71f3 9951 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00000.html>.
b64755e3 9952
6e746484
PE
99532002-11-30 Paul Eggert <eggert@twinsun.com>
9954
b64755e3
PE
9955 * src/scan-gram.l (no_cr_read, extend_location): Move to epilogue,
9956 and put only a forward declaration in the prologue. This is for
9957 consistency with the other scanner helper functions.
9958
6ba55592
PE
9959 Type clashes now generate warnings, not errors, since it
9960 appears that POSIX may allow some grammars with type clashes.
9961 * src/reader.c (grammar_current_rule_check): Warn about
9962 type clashes instead of complaining.
9963 * tests/input.at (Type Clashes): Expect warnings, not complaints.
9964
6e746484
PE
9965 Add Yacc library, since POSIX requires it.
9966 * doc/bison.texinfo (Yacc Library): New node. Regenerate top menu.
9967 * lib/Makefile.am (lib_LIBRARIES, liby_a_SOURCES): New macros.
9968 * lib/main.c, lib/yyerror.c: New files.
9969
9970 gram_error can be static; it need not be extern.
9971 * src/reader.h (gram_error): Remove decl.
9972 * src/parse-gram.y (gram_error): Now static. Add static decl.
9973 (print_token_value): Omit parameter names from forward decl,
9974 for consistency.
9975
88510f9c
PE
99762002-11-29 Paul Eggert <eggert@twinsun.com>
9977
6e746484
PE
9978 * doc/bison.texinfo: Emphasize that yylex and yyerror must
9979 be declared before being used. E.g., one should typically
9980 declare them in the prologue. Use GNU coding style in examples.
9981 Put "const" consistently after the type it modifies. Mention
9982 that C99 supports "inline". Mention that yyerror traditionally
9983 returns "int".
9984
88510f9c
PE
9985 %parse-param and %lex-param now take just one argument, the
9986 declaration; the argument name is deduced from the declaration.
9987
9988 * doc/bison.texinfo (Parser Function, Pure Calling, Error
9989 Reporting, Table of Symbols): Document this.
9990 * src/parse-gram.y (add_param): New function.
9991 (COMMA): Remove.
9992 (declaration): Implement new rule for %parse-param and %lex-param.
9993 * src/scan-gram.l: "," now elicits a warning, rather than being
9994 a token; this is more compatible with byacc.
9995 * tests/calc.at (Simple LALR Calculator): Adopt new convention.
9996
bb92250c
PE
99972002-11-27 Paul Eggert <eggert@twinsun.com>
9998
9999 Rename identifiers to avoid real and potential collisions.
10000
10001 * data/c.m4 (b4_yysymprint_generate): yyout -> yyoutput,
10002 to avoid collision with lex macro described by Bruce Lilly in
161a71f3 10003 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
bb92250c
PE
10004 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
10005 * doc/bison.texinfo (Prologue, Tracing): yyprint -> print_token_value.
10006 * src/parse-gram.y (print_token_value): Renamed from yyprint.
10007 All uses changed.
10008 (YYPARSE_PARAM, YYLEX_PARAM, yycontrol): Remove. All uses changed.
10009 The name "yycontrol" violates the name space rules, and this stuff
10010 wasn't being used anyway.
10011 (input): Remove action; this stuff wasn't being used.
10012 (gram_error): Rename local variable yylloc -> loc.
10013 * src/reader.h (struct gram_control_s, gram_control_t): Remove.
10014 (YY_DECL): Don't use "yy" at start of local variables.
10015 All uses changed, e.g., yylloc -> loc.
10016 * src/scan-gram.l (STEP): Renamed from YY_STEP. All uses changed.
10017 (STRING_GROW): Renamed from YY_OBS_GROW. All uses changed.
10018 (STRING_FINISH): Renamed from YY_OBS_FINISH. All uses changed.
10019 (STRING_FREE): Renamed from YY_OBS_FREE. All uses changed.
10020
10021 * src/parse-gram.y (gram_error): loc is now const *.
10022 * src/reader.h (gram_error): Likewise.
10023
3af4feb2
PE
100242002-11-24 Paul Eggert <eggert@twinsun.com>
10025
10026 Version 1.75c.
10027
10028 * tests/actions.at (Actions after errors): Use an output format
10029 more similar to that of the Printers and Destructors test.
10030 Test the position of the ';' token too.
10031 (Printers and Destructors): Likewise.
10032 (Printers and Destructors: %glr-parser): Remove for now, to avoid
10033 unnecessarily alarming people when the test fails.
10034
10035 * data/yacc.c (yyerrlab1): Move this label down, so that the
10036 parser does not discard the lookahead token if the user code
10037 invokes YYERROR. This change is required for POSIX conformance.
10038
10039 * lib/error.c: Sync with gnulib.
10040
100412002-11-22 Paul Eggert <eggert@twinsun.com>
10042
10043 * lib/quotearg.c, lib/quotearg.h: Sync with gnulib.
10044 * lib/mbswidth.c, lib/mbswidth.h: Likewise.
10045 * lib/xmalloc.c: Likewise.
26b4a969 10046
58004308
PE
100472002-11-20 Paul Eggert <eggert@twinsun.com>
10048
10049 * lib/argmatch.c, lib/argmatch.h: Sync with gnulib.
10050
100512002-11-20 Paul Eggert <eggert@twinsun.com>
26b4a969 10052
58004308
PE
10053 Avoid use of <assert.h>, as the GNU Coding Standards hint that one
10054 should use `if (! x) abort ();' rather than `assert (x);', and
10055 anyway it's one less thing to worry about configuring.
10056
10057 * data/glr.c, lib/hash.c, src/system.h: Do not include <assert.h>.
10058 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise,
10059 and replace all instances of assert with abort.
10060 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
10061 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Likewise.
10062
10063 * data/glr.c (yydoAction, yyglrReduce, yysplitStack, yyresolveStates,
10064 yyresolveAction, yyprocessOneStack): Use abort rather than assert.
10065 * lib/hash.c (hash_lookup, hash_get_first, hash_get_next,
10066 hash_find_entry, hash_rehash, hash_insert): Likewise.
10067 * src/conflicts.c (resolve_sr_conflict): Likewise.
10068 * src/lalr.c (set_goto_map, map_goto): Likewise.
10069 * src/nullable.c (nullable_compute): Likewise.
10070 * src/output.c (prepare_rules, token_definitions_output): Likewise.
10071 * src/reader.c (packgram, reader): Likewise.
10072 * src/state.c (state_new, state_free, state_transitions_set,
10073 state_reduction_find): Likewise.
10074 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias,
10075 symbol_pack): Likewise.
10076 * src/tables.c (conflict_row, pack_vector): Likewise.
10077 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
10078 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
10079 get_node_alignement_str, get_arrow_mode_str, get_crossing_type_str,
10080 get_view_str, get_linestyle_str, get_arrowstyle_str): Likewise.
10081
10082 * lib/argmatch.h (ARRAY_CARDINALITY): Do not bother to #undef.
10083 (ARGMATCH_CONSTRAINT): New macro.
10084 (ARGMATCH_ASSERT): Use it.
10085
10086 * src/system.h (verify): New macro.
10087 * src/getargs.c (trace_argmatch, report_argmatch): Use verify
10088 rather than assert.
10089 * src/tables.c (tables_generate): Likewise.
10090
10091 * src/struniq.c (struniq_assert): Now returns void, and aborts
10092 if the assertion is false.
10093 (struniq_assert_p): Remove.
10094 * src/struniq.h: Likewise.
10095
76ae8198
PE
100962002-11-18 Paul Eggert <eggert@twinsun.com>
10097
10098 * data/glr.c (yygetLRActions): Replace `yyindex' with
10099 `yytable[yyindex]' to fix typo introduced in my 2002-11-09 patch.
10100 This fixes the regression with Sun ONE Studio 7 cc that I reported in
161a71f3 10101 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00077.html>.
76ae8198 10102
d3c4e709
AD
101032002-11-18 Akim Demaille <akim@epita.fr>
10104
10105 * doc/bison.texinfo (Tracing): `yyprint' shouldn't prepend a
10106 space.
10107 From Tim Van Holder.
10108
8d8a7238
PE
101092002-11-17 Paul Eggert <eggert@twinsun.com>
10110
10111 Pacify Sun ONE Studio 7 lint. Also, rename "ParseError"
10112 to "SyntaxError" for consistency with my 2002-11-15 change.
10113
10114 * data/glr.c (YYDPRINTF, YYDSYMPRINT, YYDSYMPRINTF) [!YYDEBUG]: Do
10115 not define to {}, since this breaks the common use of `YYDPRINTF
10116 ((...));' if a single statement is desired (e.g. before `else').
10117 Work around GCC warnings by surrounding corresponding calls with
10118 {} if needed.
10119 (yyhasResolvedValue): Remove unused function.
10120 (yymergeOptionSets, yyresolvStack): Use `continue;' for empty
10121 loop body.
10122 (yyreportSyntaxError): Renamed from yyreportParseError.
10123 (yyrecoverSyntaxError): Renamed from yyrecoverParseError.
10124 All uses changed.
10125 * tests/calc.at (_AT_DATA_CALC_Y): Make vars static instead of
10126 extern when possible. Remove unused initializations.
10127
b0937b22
AD
101282002-11-16 Akim Demaille <akim@epita.fr>
10129
10130 Augment the similarity between GLR and LALR traces.
10131
10132 * data/yacc.c (yy_stack_print, YY_STACK_PRINT, yy_reduce_print)
10133 (YY_REDUCE_PRINT): New.
10134 (yyparse): Use them.
10135 * data/glr.c (yy_reduce_print): Use YYFPRINTF, no need for
10136 YYDPRINT here.
10137 (yyglrReduce, yyrecoverParseError, yyparse): Don't report the
10138 state reached after the reduction/recovery, since...
10139 (yyparse, yyprocessOneStack): Report the state we are entering in.
10140
c5e3e510
AD
101412002-11-16 Akim Demaille <akim@epita.fr>
10142
10143 * src/getargs.h, src/getargs.c (trace_e, trace_args, trace_types):
10144 Add support for --trace=skeleton.
10145 * src/scan-skel.l: %option debug.
10146 Scan strings of non-@ or \n instead of character by character.
10147 (scan_skel): Handle trace_skeleton.
10148 (QPUTS): New.
10149 (@output_parser_name@, @output_header_name@): ``Restore'' their
10150 support (used to be M4 macros).
10151 * data/yacc.c: Quote larger chunks, a la glr.c.
10152 * data/lalr1.cc: Likewise.
10153 The header guards are no longer available, so use some other
10154 string than `YYLSP_NEEDED'.
10155
4c6cc1db
AD
101562002-11-16 Akim Demaille <akim@epita.fr>
10157
10158 Make the ``Printers and Destructors'' test more verbose, taking
10159 `yacc.c''s behavior as (possibly wrong) reference.
10160
10161 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use printf
10162 instead of fprint on stdout.
10163 Set and report the last_line of the symbols.
10164 Consistently display values and locations.
10165
6d9e8019
PE
101662002-11-16 Paul Eggert <eggert@twinsun.com>
10167
10168 * data/yacc.c: Avoid over-quoting of __line__ and __file__.
10169
6e649e65
PE
101702002-11-15 Paul Eggert <eggert@twinsun.com>
10171
b25d88f6
PE
10172 * tests/actions.at (Actions after errors): New test case.
10173
6e649e65
PE
10174 * data/glr.c, data/lalr1.cc, data/yacc.cc, doc/bison.texinfo,
10175 src/conflicts.c, src/parse-gram.y, src/tables.c, src/tables.h,
10176 tests/action.at, tests/calc.at, tests/conflicts.at,
10177 tests/cxx-type.at, tests/regression.at:
10178 "parse error" -> "syntax error" for POSIX compatibility.
10179 "parsing stack overflow..." -> "parser stack overflow" so
10180 that code matches Bison documentation.
10181
0f39aab9
AD
101822002-11-15 Akim Demaille <akim@epita.fr>
10183
10184 * src/parse-gram.y (declaration): Have %parse-param and %lex-param
10185 take two BRACED_CODE, not two string_content.
10186 Free the scanner's obstack when we are done.
10187 (code_content): New.
10188 * tests/calc.at: Adjust.
10189 * doc/bison.texinfo: Adjust.
10190 Also, make sure to include the `,' for these declarations.
10191
761c1926
AD
101922002-11-15 Tim Van Holder <tim.van.holder@pandora.be>
10193
10194 * m4/prereq.m4: Removed the commented jm_PREREQ_HASH
10195 definition; avoids potential autoreconf problems.
10196
b0f98b10
AD
101972002-11-15 Akim Demaille <akim@epita.fr>
10198
10199 Always check the value returned by yyparse.
10200
10201 * tests/calc.at (_AT_DATA_CALC_Y): Have `main' exit with the value
10202 returned by yyparse.
10203 (_AT_CHECK_CALC_ERROR): Take the expected exit value as argument.
10204 Adjust calls.
10205 * tests/glr-regr1.at (glr-regr1.y): Have `main' exit with the value
10206 returned by yyparse.
10207
970785f1
PH
102082002-11-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10209
10210 * data/glr.c (yyFail): Always set yyerrflag. Corrects regression
10211 on input.at test.
10212
8fcc7db1
PE
102132002-11-14 Paul Eggert <eggert@twinsun.com>
10214
7ec1b48e
PE
10215 * src/output.c (output_skeleton): Call xfopen instead of
10216 duplicating xfopen's body.
10217
cfff7583 10218 Fix bugs reported by Nelson H. F. Beebe in
161a71f3 10219 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00078.html>.
cfff7583 10220
8fcc7db1
PE
10221 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that
10222 "$CC -E foo.h" is allowed, as this doesn't work with the Portland
10223 Group compiler. Instead, use "$CC -E bar.c". Include the .h
10224 file twice in the grammar, as an extra check.
10225
10226 * tests/input.at (Torturing the Scanner): Surround the
10227 backslash-newline tests with "#if 0", to make it less likely that
10228 we'll run into compiler bugs. Bring back solitary \ inside
10229 comment, but add a closing comment to work around HP C bug. Don't
e3aa65c5 10230 test backslash-newline in C character constant.
8fcc7db1 10231
4e8d992c
AD
102322002-11-14 Akim Demaille <akim@epita.fr>
10233
10234 * tests/synclines.at (AT_SYNCLINES_COMPILE): Ignore the exit
10235 status of the compiler.
f32b346d 10236 Calling `exit 1' is no longer needed.
4e8d992c
AD
10237 Reported by Nelson H. F. Beebe.
10238
9501dc6e
AD
102392002-11-14 Akim Demaille <akim@epita.fr>
10240
10241 * tests/atlocal.in (CPPFLAGS): We have config.h.
10242 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR):
10243 New.
10244 * tests/actions.at, tests/calc.at, tests/conflicts.at,
10245 * tests/cxx-type.at, tests/glr-regr1.at, tests/headers.at,
10246 * tests/regression.at, tests/torture.at: Use them for all the
10247 grammars that are to be compiled.
10248 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Rename as...
10249 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): this.
10250 * doc/bison.texinfo (GLR Parsers): Document `inline'.
10251
18b519c0
AD
102522002-11-14 Akim Demaille <akim@epita.fr>
10253
10254 * doc/bison.texinfo: Various formatting changes (alignments in
10255 samples, additional @group/@end group, GCS in samples.
10256 Use @deffn instead of simple @table to define the directives,
10257 macros, variables etc.
10258
9a86cdb9
PE
102592002-11-13 Paul Eggert <eggert@twinsun.com>
10260
daa33def 10261 Fix some bugs reported by Albert Chin-A-Young in
161a71f3 10262 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00066.html>.
18b519c0 10263
daa33def 10264 * tests/input.at (Torturing the Scanner): Don't invoke "cc a.c b.c
8fcc7db1 10265 -o c"; the HP C compiler chatters during compilation.
daa33def
PE
10266 Instead, invoke "cc -c a.c -o a.o; cc -c b.c -o b.o; cc a.o b.o -o c".
10267 * tests/headers.at (export YYLTYPE): Likewise.
10268
10269 * tests/input.at (Torturing the Scanner): Remove lines containing
8fcc7db1 10270 solitary backslashes, as they tickle a bug in the HP C compiler.
daa33def 10271
9a86cdb9
PE
10272 * tests/glr-regr1.at (Badly Collapsed GLR States): Avoid //
10273 comments, since they're not portable. Use GNU coding style.
10274
9c1e26bd
AD
102752002-11-13 Akim Demaille <akim@epita.fr>
10276
10277 * data/yacc.c: Leave bigger chunks of quoted text.
10278 (YYDSYMPRINTF): New.
10279 Use it to report symbol activities.
10280 * data/glr.c (YYDSYMPRINTF): New.
10281 Use it.
10282
87f721cc
PE
102832002-11-12 Paul Eggert <eggert@twinsun.com>
10284
10285 Version 1.75b.
10286
10287 * data/glr.c (yydoAction): Return YYRESULTTAG, not int.
10288 (yyglrReduce): Return yyok, not 0.
10289 This should avoid the enumerated-type warnings reported
464c6927 10290 by Nelson H. F. Beebe in
161a71f3 10291 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00057.html>.
87f721cc
PE
10292
10293 * lib/bbitset.h (BITSET_INLINE): Remove.
10294 * lib/bitset.h [! BITSET_INLINE]: Remove.
10295 (bitset_set, bitset_reset, bitset_test): Rename local vars
10296 to avoid shadowing warnings by GCC.
10297
10298 * data/glr.c (inline): Remove #define. It's the user's
10299 responsibility to #define it away, just like 'const'.
464c6927 10300 This fixes one of the bugs reported by Nelson H. F. Beebe in
161a71f3 10301 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00058.html>.
18b519c0 10302
87f721cc
PE
10303 * Makefile.maint (po-check): Scan .l and .y files instead of the
10304 .c and the .h files that they generate. This fixes the bug
10305 reported by Tim Van Holder in:
161a71f3 10306 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00062.html>
87f721cc
PE
10307 Look for N_ as well as for _. Try to avoid matching #define for
10308 N_ and _.
10309 * po/POTFILES.in: Remove src/parse-gram.c, src/scan-gram.c,
10310 src/system.h. Add src/parse-gram.y, src/scan-gram.l.
10311 * src/scan-gram.l: Revamp regular expressions so that " and '
10312 do not confuse xgettext.
10313
10314 * src/struniq.h (struniq_new): Do not declare the return type
10315 to be 'const'; this violates the C standard.
10316 * src/struniq.c (struniq_new): Likewise.
10317
be14ade5
AD
103182002-11-12 Albert Chin-A-Young <china@thewrittenword.com>
10319
10320 * src/Makefile.am (LDADD): Link $(LIBINTL) last to avoid the
10321 duplicate definition of optind on Tru64 UNIX 4.0D with the Compaq
10322 linker.
10323
05291fbc
AD
103242002-11-12 Akim Demaille <akim@epita.fr>
10325
10326 * Makefile.maint: Sync with Autoconf:
10327 (local_updates): New.
10328
1f5fd52e
AD
103292002-11-12 Akim Demaille <akim@epita.fr>
10330
10331 * po/POTFILES.in (src/lalr.c, src/state.c): Remove
10332
283f1e64
AD
103332002-11-12 Akim Demaille <akim@epita.fr>
10334
10335 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Display the
10336 locations.
10337
886b69d1
AD
103382002-11-12 Akim Demaille <akim@epita.fr>
10339
10340 * data/c.m4 (b4_yysymprint_generate): Pass *yyvaluep to YYPRINT,
10341 not yyvalue.
10342
3df37415
AD
103432002-11-12 Akim Demaille <akim@epita.fr>
10344
10345 * tests/actions.at (AT_CHECK_PRINTER_AND_DESTRUCTOR): New.
10346 Use it to test the GLR parser.
10347
7bd6c77e
AD
103482002-11-12 Akim Demaille <akim@epita.fr>
10349
10350 * tests/regression.at (input.y): s/YYEOF/MYEOF/, as the skeleton
10351 defines it.
10352 * data/glr.c (yystos): New.
10353 (b4_yysymprint_generate, b4_yydestruct_generate): Invoke.
10354 (YYDSYMPRINT): New.
10355 (yyval): Don't define it, it is handled via M4.
10356 (yyrecoverParseError): Free verbosely the discarded symbols.
10357 * data/yacc.c (yysymprint): Remove, rather...
10358 (b4_yysymprint_generate): invoke.
10359 * data/c.m4 (b4_yysymprint_generate): New.
10360 Accept pointers as arguments, as opposed to the version from
10361 yacc.c.
10362 (b4_yydestruct_generate): Likewise.
10363 * tests/cations.at (Printers and Destructors): Use Bison directives
10364 instead of CPP macros.
10365 Don't rely on internal details.
10366
b0400cc6
AD
103672002-11-12 Akim Demaille <akim@epita.fr>
10368
10369 * data/c.m4 (b4_yydestruct_generate, b4_symbol_actions): New.
10370 * data/yacc.c: Rename yychar1 as yytoken, as in glr.c.
10371 Don't work on yychar (i.e., do set it to YYEMPTY, don't match
10372 it against YYEMPTY and so forth), work on yytoken (i.e., set
10373 it to YYEMPTY etc.).
10374 (yydestruct): Replace with a b4_yydestruct_generate invocation.
10375 (b4_symbol_actions): Remove.
10376 * data/glr.c (YYTRANSLATE): As for yacc.c, if negative, it stands
10377 for 0, end-of-input.
10378
72f889cc
AD
103792002-11-12 Akim Demaille <akim@epita.fr>
10380
10381 * doc/bison.texinfo (Destructor Decl): New.
10382
b1ae9233
AD
103832002-11-12 Akim Demaille <akim@epita.fr>
10384
10385 * src/tables.c (tables_generate): Use free for pointers that
10386 cannot be NULL, not XFREE.
10387 (pack_vector): Use assert, not fatal, for bound violations.
10388 * src/state.c (state_new): Likewise.
10389 * src/reader.c (reader): Likewise.
10390 * src/lalr.c (set_goto_map): Likewise.
72f889cc 10391 * src/location.h (LOCATION_PRINT): If first_line is 0, just issue
b1ae9233
AD
10392 the file name.
10393
7ec2d4cd
AD
103942002-11-12 Akim Demaille <akim@epita.fr>
10395
10396 * src/scan-gram.l, src/reader.h (scanner_last_string_free):
10397 Restore.
10398 * src/scan-gram.l (last_string): Is global to the file, not to
10399 yylex.
10400 * src/parse-gram.y (input): Don't append the epilogue here,
10401 (epilogue.opt): do it here, and free the scanner's obstack.
10402 * src/reader.c (epilogue_set): Rename as...
10403 (epilogue_augment): this.
10404 * data/c.m4 (b4_epilogue): Defaults to empty.
10405
573a6cd3
AD
104062002-11-12 Akim Demaille <akim@epita.fr>
10407
10408 * src/getargs.c (long_options): Remove duplicates.
10409 * src/vmsgetargs.c, src/build.com, src/bison.cld, src/vmshlp.mar:
10410 Remove.
10411 * doc/bison.rnh: Remove.
10412 * doc/bison.texinfo (VMS Invocation): Remove.
10413
95612cfa
AD
104142002-11-12 Akim Demaille <akim@epita.fr>
10415
10416 * src/struniq.h, src/struniq.c (struniq_t): Is const.
10417 (STRUNIQ_EQ, struniq_assert, struniq_assert_p): New.
10418
10419 Use struniq for symbols.
10420
10421 * src/symtab.h (symbol_t): The tag member is a struniq.
10422 (symbol_type_set): Adjust.
10423 * src/symtab.c (symbol_new): Takes a struniq.
10424 (symbol_free): Don't free the tag member.
10425 (hash_compare_symbol_t, hash_symbol_t): Rename as...
10426 (hash_compare_symbol, hash_symbol): these.
10427 Use the fact that tags as struniqs.
10428 (symbol_get): Use struniq_new.
10429 * src/symlist.h, src/symlist.c (symbol_list_n_type_name_get):
10430 Returns a strniq.
10431 * src/reader.h (merger_list, grammar_currentmerge_set): The name
10432 and type members are struniqs.
10433 * src/reader.c (get_merge_function)
10434 (grammar_current_rule_merge_set): Adjust.
10435 (TYPE, current_type): Are struniq.
10436
10437 Use struniq for file names.
10438
10439 * src/files.h, src/files.c (infile): Split into...
10440 (grammar_file, current_file): these.
10441 * src/scan-gram.c (YY_USER_INIT, handle_syncline): Adjust.
10442 * src/reduce.c (reduce_print): Likewise.
10443 * src/getargs.c (getargs): Likewise.
10444 * src/complain.h, src/complain.c: Likewise.
10445 * src/main.c (main): Call struniqs_new early enough to use it for
10446 file names.
10447 Don't free the input file name.
10448
3e6656f9
AD
104492002-11-12 Akim Demaille <akim@epita.fr>
10450
10451 * src/symtab.c (symbol_free): Remove dead deactivated code:
10452 type_name are properly removed.
10453 Don't use XFREE to free items that cannot be NULL.
10454 * src/struniq.h, src/struniq.c: New.
10455 * src/main.c (main): Initialize/free struniqs.
10456 * src/parse-gram.y (%union): Add astruniq member.
10457 (yyprint): Adjust.
10458 * src/scan-gram.l (<{tag}>): Return a struniq.
10459 Free the obstack bit that used to store it.
10460 * src/symtab.h (symbol_t): The 'type_name' member is a struniq.
10461
7672019c
PE
104622002-11-11 Paul Eggert <eggert@twinsun.com>
10463
10464 Revamp to fix many (but not all) of the C- and M4-related quoting
10465 problems. Among other things, this fixes the Bison bug reported
10466 by Jan Hubicka when processing the Bash grammar; see:
161a71f3 10467 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00039.html>
7672019c
PE
10468
10469 Use new @ escapes consistently. Represent brackets with @{ and @}
10470 rather than @<:@ and @:>@, since this works a bit better with dumb
10471 editors like vi. Represent @ with @@, since @ is now consistently
10472 an escape. Use @oline@ and @ofile@ rather than __oline__ and
10473 __ofile__, to avoid unexpected expansions. Similarly, use @output
10474 rather than #output.
10475
10476 * data/c.m4 (b4_copyright): Omit file name from comment, since
10477 the file name could contain "*/".
10478 (b4_synclines_flag): Don't quote the 2nd argument; it should already
10479 be quoted. All uses changed.
10480
10481 * data/glr.c: Use new @ escapes consistently.
10482 (b4_input_suffix, b4_output_parser_suffix, b4_output_parser_name,
10483 b4_output_header_suffix, b4_output_header_name, b4_header_guard):
10484 Remove, since they couldn't handle arbitrary characters in file
10485 names.
10486 * data/lalr1.cc: Likewise.
10487 * data/yacc.c: Likewise.
10488
10489 * src/files.c (output_infix): Remove; all uses removed.
10490 * src/files.h: Likewise.
10491
10492 * data/glr.c: Remove use of "#ifdef b4_header_guard", since it
10493 mishandled funny characters in file names, and anyway it isn't
10494 needed any more.
10495 * data/yacc.c: Likewise.
10496 * data/lalr1.cc: Use YYSLP_NEEDED instead of b4_header_guard.
10497
10498 * data/glr.c (YYSTYPE_IS_TRIVIAL): Define when the .h file would.
10499 * data/yacc.c: Likewise.
10500
10501 * src/muscle_tab.c: Include quotearg.h, since we need to quote C
10502 strings now.
10503 (muscle_init): Quote filename as a C string.
10504 * src/muscle_tab.h (MUSCLE_GROW_STRING_PAIR): Remove; unused.
10505 (MUSCLE_OBSTACK_SGROW, MUSCLE_INSERT_C_STRING): New macros.
10506 * src/output.c (escaped_file_name_output): New function.
10507 (prepare_symbols): Quote tokens for M4.
10508 (prepare): Don't insert output_infix, output_prefix,
10509 output_parser_name, output_header_name; this is now down by scan-skel.
10510 Insert skeleton as a C string.
10511
10512 * src/output.c (user_actions_output, symbol_destructors_output,
10513 symbol_printers_output): Quote filenames for C and M4.
10514 * src/reader.c (prologue_augment, epilogue_set): Likewise.
10515
10516 * src/scan-gram.l (<SC_CHARACTER>): Don't worry about any backslash
10517 escapes other than \\ and \'; this simplifies the code.
10518 (<SC_STRING>): Likewise, for \\ and \".
10519 (<SC_COMMENT,SC_LINE_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,
10520 SC_PROLOGUE,SC_EPILOGUE>): Escape $ and @, too.
10521 Use new escapes @{ and @} for [ and ].
10522
10523 * src/scan-skel.l (yylineno, yyoutname): Remove static vars, replacing
10524 them with auto vars.
10525 Switch to new escape scheme, where @ is the escape character uniformly.
10526 Abort if a stray escape character is found. Avoid unbounded input
10527 buffer when parsing non-escaped text.
10528
10529 * tests/input.at (Torturing the Scanner): Add tests that @oline@,
10530 __oline__, #output, $@, and @{ do not have unintended meanings.
10531
acea4f3b
PE
105322002-11-09 Paul Eggert <eggert@twinsun.com>
10533
10534 Fix the test failure due to GCC warnings described in
161a71f3 10535 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00000.html>.
acea4f3b
PE
10536 * data/glr.c (yyis_pact_ninf, yyis_table_ninf): New macros, which
10537 evaluate to 0 if it's impossible for NINF to be in the respective
10538 table.
10539 (yygetLRActions, yyrecoverParseError): Use them.
10540
10541 * src/scan-gram.l (unexpected_end_of_file): Fix bug: columns were
10542 counted in the token inserted at end of file. Now takes
10543 location_t *, not location_t, so that the location can be
10544 adjusted. All uses changed.
10545
10546 * tests/regression.at (Invalid inputs): Adjust wording in
10547 diagnostic to match the new behavior.
10548
10549 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR,
10550 AT_DATA_HORIZONTAL_GRAMMAR, AT_DATA_LOOKAHEADS_GRAMMAR,
10551 AT_DATA_STACK_TORTURE): Replace `assert (x);' with `if (! (x))
10552 abort ();'. This reduces the runtime of the "Many lookaheads"
10553 test from 27.6 to 2.7 minutes on a 440 MHz Ultrasparc III running
10554 GCC 3.2.
10555
20ef1ad5
PE
105562002-11-07 Paul Eggert <eggert@twinsun.com>
10557
10558 * src/parse-gram.y (CHARACTER): Remove unused token.
10559 All uses removed.
10560
10561 * src/scan-gram.l: Remove stack option. We no longer use the
10562 stack, since the stack was never deeper than 1; instead, use the
10563 new auto var c_context to record the stacked value.
10564
10565 Remove nounput option. At an unexpected end of file, we now unput
10566 the minimal input necessary to end cleanly; this simplifies the
10567 code.
10568
10569 Avoid unbounded token sizes where this is easy.
10570
10571 (unexpected_end_of_file): New function.
10572 Use it to systematize the error message on unexpected EOF.
10573 (last-string): Now auto, not static.
10574 (YY_OBS_FREE): Remove unnecessary do while (0) wrapper.
10575 (scanner_last_string_free): Remove; not used.
10576 (percent_percent_count): Move decl to just before use.
10577 (SC_ESCAPED_CHARACTER): Return ID at unexpected end of file,
10578 not the (never otherwised-used) CHARACTER.
10579
93724f13
AD
105802002-11-07 Akim Demaille <akim@epita.fr>
10581
10582 Let yyerror always receive the msg as last argument, so that
10583 yyerror can be variadic.
10584
10585 * data/yacc.c (b4_yyerror_args): New.
10586 Use it when calling yyerror.
10587 * data/glr.c (b4_yyerror_args, b4_lyyerror_args): New.
10588 Use it when calling yyerror.
10589 * doc/bison.texinfo (Error Reporting): Adjust.
10590 * tests/calc.at (_AT_DATA_CALC_Y): Adjust.
10591 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Adjust.
10592
6e40b4eb
AD
105932002-11-06 Akim Demaille <akim@epita.fr>
10594
10595 #line should have quoted strings.
10596 Ideally, this should be done by m4_quotearg.
10597
10598 * src/scan-skel.l: Include quotearg.h.
10599 Quote __ofile__.
10600 * src/output.c (symbol_printers_output)
10601 (symbol_destructors_output): Quote the file name.
10602
2dfbfc12
AD
106032002-11-06 Akim Demaille <akim@epita.fr>
10604
10605 * tests/regression.at (Invalid inputs): Adjust to the recent
10606 messages.
10607
437c2d80
AD
106082002-11-06 Akim Demaille <akim@epita.fr>
10609
10610 Restore --no-lines.
10611 Reported by Jim Kent.
10612
10613 * data/c.m4 (b4_syncline): New.
10614 * data/glr.c, data/yacc.c, data/lalr1.cc: Use it.
10615 * src/reader.c (prologue_augment, epilogue_set): Use b4_syncline.
10616 * src/output.c (user_actions_output): Likewise.
10617 (prepare): Define 'b4_synclines_flag'.
2dfbfc12 10618 * src/muscle_tab.c (muscle_init): Don't define b4_linef.
437c2d80 10619
900c5db5
AD
106202002-11-06 Akim Demaille <akim@epita.fr>
10621
10622 * src/main.c (main): Free `infile'.
10623 * src/scan-gram.l (handle_syncline): New.
10624 Recognize `#line'.
10625 * src/output.c (user_actions_output, symbol_destructors_output)
10626 (symbol_printers_output): Use the location's file name, not
10627 infile.
10628 * src/reader.c (prologue_augment, epilogue_set): Likewise.
10629
e183b123 106302002-11-05 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
51b4a04c 10631
e183b123 10632 * src/tables.c (matching_state): Don't allow states to match if
51b4a04c 10633 either has GLR conflict entries.
e183b123 10634
193eb6b7
PE
106352002-11-05 Paul Eggert <eggert@twinsun.com>
10636
e183b123
PE
10637 * src/scan-gram.l: Use more accurate diagnostics, e.g.
10638 "integer out of range" rather than "invalid value".
10639 * tests/input.at (Invalid $n, Invalid @n): Change expected wording
10640 accordingly.
10641
193eb6b7
PE
10642 Scan <% and %> digraphs in C code as POSIX 1003.1-2001 requires.
10643 Also, remove one static variable in the scanner.
10644
10645 * src/scan-gram.l (braces_level): Now auto, not static.
10646 Initialize to zero if the compiler is being picky.
10647 (INITIAL): Clear braces_level instead of incrementing it.
10648 (SC_BRACED_CODE): Treat <% and %> as { and } when inside C code,
10649 as POSIX 1003.1-2001 requires.
10650 * src/system.h (IF_LINT): New macro, taken from coreutils.
10651 * configure.ac: Define "lint" if --enable-gcc-warnings.
10652
29c01725
AD
106532002-11-05 Akim Demaille <akim@epita.fr>
10654
10655 * src/scan-gram.l: When it starts with `%', complain about the
10656 whole directive, not just that `invalid character: %'.
10657
8aeac3ca
AD
106582002-11-04 Akim Demaille <akim@epita.fr>
10659
10660 * Makefile.maint: Update from Autoconf.
10661 (update, cvs-update, po-update, do-po-update): New.
10662
793a58bb
AD
106632002-11-04 Akim Demaille <akim@epita.fr>
10664
10665 * tests/glr-regr1.at (Badly Collapsed GLR States): Prototype yylex
10666 and yyerror.
10667 Have yyerror `use' its arguments.
10668 * tests/calc.at (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF
10669 returns true when location & yacc & pure & parse-param.
10670 (_AT_DATA_CALC_Y): Let yyerror ``use'' its arguments.
10671
c4d720cd
AD
106722002-11-04 Akim Demaille <akim@epita.fr>
10673
10674 * src/location.h (LOCATION_PRINT): Use quotearg slot 3 to avoid
10675 clashes.
10676 * src/scan-gram.l: Use [\'] instead of ['] to pacify
10677 font-lock-mode.
10678 Use complain_at.
10679 Use quote, not quote_n since LOCATION_PRINT no longer uses the
10680 slot 0.
10681
613a0dc5
PE
106822002-11-03 Paul Eggert <eggert@twinsun.com>
10683
10684 * src/reader.c (get_merge_function, grammar_current_rule_check):
10685 Use consistent diagnostics for reporting type name clashes.
10686 Quote the types with <>, for consistency with Yacc.
10687 * tests/input.at (Type Clashes): Adjust to diagnostic changes.
10688
2a8d363a
AD
106892002-11-03 Akim Demaille <akim@epita.fr>
10690
10691 * data/c.m4 (b4_identification, b4_user_args, b4_parse_param):
10692 New.
10693 * data/yacc.m4 (b4_pure_args, b4_Pure_args): New.
10694 (b4_parse_param): Remove.
10695 Use b4_identification.
10696 Propagate b4_pure_args where needed to pass them to yyerror.
10697 * data/glr.m4 (b4_parse_param): Remove.
10698 (b4_user_formals, b4_pure_args, b4_pure_formals, b4_lpure_args)
10699 (b4_lpure_formals): New.
10700 Use b4_identification.
10701 (YY_USER_FORMALS, YY_USER_ARGS): Remove, replaced by
10702 b4_user_formals and b4_user_args.
10703 (yyexpandGLRStack, yyFail, yyaddDeferredAction, yyglrShiftDefer)
10704 (yyreportAmbiguity): When using a pure parser, also need
10705 the location, and the parse-params.
10706 Adjust callers.
10707 (yyuserAction, yyglrShift, yyreportParseError, yyrecoverParseError):
10708 When using a pure parser, also need the parse-params.
10709 Adjust callers.
10710 * tests/calc.at: Test pure (%pure-parser) and absolutely pure
10711 (%pure-parser + %parse-param) LALR and GLR parsers.
10712 (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): New, define AT_PARAM_IF,
10713 AT_LOCATION_IF, AT_PURE_IF, AT_GLR_IF, AAT_PURE_AND_LOC_IF,
10714 AT_GLR_OR_PARAM_IF, AT_YYERROR_ARG_LOC_IF, AT_YYERROR_SEES_LOC_IF.
10715 (_AT_DATA_CALC_Y): Equip for purity of yyerror.
10716 (_AT_CHECK_CALC_ERROR): Use AT_YYERROR_SEES_LOC_IF.
10717 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Equip for yyerror purity.
10718 * doc/bison.texinfo: Untabify the whole file.
10719 (Parser Function): Document %parse-param, deprecate YYPARSE_PARAM.
10720 (Pure Calling): Document %lex-param, deprecate YYLEX_PARAM.
10721 (Error Reporting): Adjust to these new directives.
10722 Document %error-verbose, deprecate YYERROR_VERBOSE.
10723
9e32add8
AD
107242002-11-03 Akim Demaille <akim@epita.fr>
10725
10726 * tests/calc.at: Change all the AT_CHECK_CALC_LALR and
10727 AT_CHECK_CALC_GLR invocations to use % directives, instead of
10728 command line options.
10729 * tests/cxx-type.at: Formatting changes.
10730
b02d90a5
PE
107312002-11-03 Paul Eggert <eggert@twinsun.com>
10732
10733 * src/scan-gram.l: Revamp to fix POSIX incompatibilities,
10734 to count columns correctly, and to check for invalid inputs.
9e32add8 10735
b02d90a5
PE
10736 Use mbsnwidth to count columns correctly. Account for tabs, too.
10737 Include mbswidth.h.
10738 (YY_USER_ACTION): Invoke extend_location rather than LOCATION_COLUMNS.
10739 (extend_location): New function.
10740 (YY_LINES): Remove.
10741
10742 Handle CRLF in C code rather than in Lex code.
10743 (YY_INPUT): New macro.
10744 (no_cr_read): New function.
10745
10746 Scan UCNs, even though we don't fully handle them yet.
10747 (convert_ucn_to_byte): New function.
10748
10749 Handle backslash-newline correctly in C code.
10750 (SC_LINE_COMMENT, SC_YACC_COMMENT): New states.
10751 (eols, blanks): Remove. YY_USER_ACTION now counts newlines etc.;
10752 all uses changed.
10753 (tag, splice): New EREs. Do not allow NUL or newline in tags.
10754 Use {splice} wherever C allows backslash-newline.
10755 YY_STEP after space, newline, vertical-tab.
10756 ("/*"): BEGIN SC_YACC_COMMENT, not yy_push_state (SC_COMMENT).
9e32add8 10757
b02d90a5
PE
10758 (letter, id): Don't assume ASCII; e.g., spell out a-z.
10759
10760 ({int}, handle_action_dollar, handle_action_at): Check for integer
10761 overflow.
9e32add8 10762
b02d90a5
PE
10763 (YY_STEP): Omit trailing semicolon, so that it's more like C.
10764
10765 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>): Allow \0 and \00
10766 as well as \000. Check for UCHAR_MAX, not 255.
10767 Allow \x with an arbitrary positive number of digits, as in C.
10768 Check for overflow here.
10769 Allow \? and UCNs, for compatibility with C.
10770
10771 (handle_symbol_code_dollar): Use quote_n slot 1 to avoid collision
10772 with quote slot used by complain_at.
10773
10774 * tests/input.at: Add tests for backslash-newline, m4 quotes
10775 in symbols, long literals, and funny escapes in strings.
10776
10777 * configure.ac (jm_PREREQ_MBSWIDTH): Add.
10778 * lib/Makefile.am (libbison_a_SOURCES): Add mbswidth.h, mbswidth.c.
10779 * lib/mbswidth.h, lib/mbswidth.c: New files, from GNU gettext.
10780 * m4/Makefile.am (EXTRA_DIST): Add mbswidth.m4.
10781 * m4/mbswidth.m4: New file, from GNU coreutils.
10782
10783 * doc/bison.texinfo (Grammar Outline): Document // comments.
10784 (Symbols): Document that trigraphs have no special meaning in Bison,
10785 nor is backslash-newline allowed.
10786 (Actions): Document that trigraphs have no special meaning.
10787
10788 * src/location.h (LOCATION_COLUMNS, LOCATION_LINES): Remove;
10789 no longer used.
10790
107912002-11-02 Paul Eggert <eggert@twinsun.com>
10792
10793 * src/reader.c: Don't include quote.h; not needed.
10794 (get_merge_function): Reword warning to be consistent with
10795 type clash diagnostic in grammar_current_rule_check.
10796
10797 * lib/quotearg.c (quotearg_buffer_restyled): Fix off-by-two
10798 bug in trigraph handling.
10799
10800 * src/output.c (prepare_symbols): When printing token names,
10801 escape "[" as "@<:@" and likewise for "]".
10802
10803 * src/system.h (errno): Remove declaration, as we are now
10804 assuming C89 or better, and C89 guarantees errno.
10805
762b212b
PE
108062002-10-30 Paul Eggert <eggert@twinsun.com>
10807
10808 * lib/bitset_stats.c (bitset_stats_read, bitset_stats_write):
10809 Check for close failures.
10810 * src/files.h (xfclose): Return void, not int, since it always
10811 returned zero.
10812 * src/files.c (xfclose): Likewise. Report I/O error if ferror
10813 indicates one.
10814 * src/output.c (output_skeleton): Use xfclose rather than fclose
10815 and ferror. xfclose now checks ferror.
10816
10817 * data/glr.c (YYLEFTMOST_STATE): Remove.
10818 (yyreportTree): Use a stack-based leftmost state. This avoids
10819 our continuing battles with bogus warnings about initializers.
10820
56100c60
AD
108212002-10-30 Akim Demaille <akim@epita.fr>
10822
10823 * src/system.h: Don't use #ifdef/#ifndef on HAVE_ values, only
10824 #if.
10825
51b4a04c
PH
108262002-10-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10827
10828 * tests/glr-regr1.at: New test for reported regressions.
10829 * tests/testsuite.at: Add glr-regr1.at test.
10830 * tests/Makefile.am: Add glr-regr1.at test.
e183b123 10831
bf1ebda2
PE
108322002-10-24 Paul Eggert <eggert@twinsun.com>
10833
5c16c6b1
PE
10834 Version 1.75a.
10835
bf1ebda2
PE
10836 * tests/calc.at (_AT_DATA_CALC_Y): Remove unused strcat declaration.
10837 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Include stdlib.h, since
10838 we use malloc. Don't assume 'A' through 'Z' are contiguous.
10839 Don't assume strdup exists; POSIX says its an XSI extension.
10840 Check for buffer overflow on input.
10841
b526ee61
AD
108422002-10-24 Akim Demaille <akim@epita.fr>
10843
10844 * src/output.c (output_skeleton): Don't disable M4sugar comments
10845 too soon: it results in comments being expanded.
10846 * data/yacc.c, data/glr.c, data/lalr1.cc: Do it right before the
10847 first output.
10848
f1886bb2
AD
108492002-10-24 Akim Demaille <akim@epita.fr>
10850
10851 * data/yacc.c (m4_int_type): New.
10852 * data/c.m4 (m4_int_type): Don't use yysigned_char, but `signed
10853 char' as only yacc.c wants K&R portability.
10854 * data/glr.c (yysigned_char): Remove.
10855 * data/lalr1.cc: Rename the trailing b4_name as b4_parser_class_name.
10856 Reported by Quoc Peyrot.
10857
c5576256
PE
108582002-10-23 Paul Eggert <eggert@twinsun.com>
10859
10860 * src/main.c (main): With --trace=time, report times even if a
10861 non-fatal error occurs. Formerly, the times were reported in some
10862 such cases but not in others.
10863 * src/reader.c (reader): Just return if a complaint has been issued,
10864 instead of exiting, so that 'main' can report times.
10865
27b0ffea
AD
108662002-10-22 Akim Demaille <akim@epita.fr>
10867
10868 * src/system.h: Include sys/types.
10869 Reported by Bert Deknuydt.
10870
223a7883
PE
108712002-10-23 Paul Eggert <eggert@twinsun.com>
10872
10873 * configure.ac (AC_PROG_LEX): Use instead of AM_PROG_LEX.
10874 Suggested by Art Haas.
10875
108762002-10-22 Paul Eggert <eggert@twinsun.com>
10877
10878 * src/complain.c (exit) [! (STDC_HEADERS || _LIBC)]: Remove exit
10879 decl; not needed any more.
10880 * src/main.c (main): Use return to exit, undoing yesterday's change.
10881 The last OS that we could find where this wouldn't work is
10882 SunOS 3.5, and that's too old to worry about now.
10883
10884 * data/glr.c (struct yyltype): Define members even when not
10885 doing locations. This is more consistent with yacc.c, and it
10886 works around the following bug reports:
161a71f3
PE
10887 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00106.html
10888 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00111.html
27b0ffea 10889
223a7883
PE
10890 * doc/bison.texinfo: Minor spelling and typographical fixes. Use
10891 @acronym consistently. Standardize on "Yacc" instead of "YACC",
10892 "Algol" instead of "ALGOL". Give a bit more history about BNF.
10893
8b76775a
AD
108942002-10-22 Akim Demaille <akim@epita.fr>
10895
10896 * data/README: New.
10897
6db10d14
PE
108982002-10-21 Paul Eggert <eggert@twinsun.com>
10899
10900 Be consistent about 'bool'; the old code used an enum in one
10901 module and an int in another, and this violates the C standard.
10902 * m4/stdbool.m4: New file, from coreutils 4.5.3.
10903 * configure.ac (AC_HEADER_STDBOOL): Add.
10904 * m4/Makefile.am (EXTRA_DIST): Add stdbool.m4.
10905 * src/muscle_tab.c (hash_compare_muscles): (a ? FALSE : TRUE) -> (! a)
10906 * src/symtab.c (hash_compare_symbol_t): Likewise.
10907 * src/system.h (bool, false, true): Use a definition consistent
10908 with ../lib/hash.c. All uses changed.
10909
10910 * src/complain.c (warning_issued): Renamed from warn_message_count,
10911 so that we needn't worry about integer overflow (!).
10912 Now of type bool. All uses changed.
10913 (complaint_issued): Renamed from complain_message_count; likewise.
10914
10915 * src/main.c (main): Use exit to exit with failure.
27b0ffea 10916
6db10d14
PE
10917 * src/complain.c (fatal_at, fatal): Use EXIT_FAILURE and EXIT_SUCCESS
10918 rather than 1 and 0.
10919 * src/main.c (main): Likewise.
10920 * src/getargs.c (getargs): Likewise.
10921 * src/reader.c (reader): Likewise.
10922
10923 * src/getarg.c (getargs): Remove duplicate code for
10924 "Try `bison --help'".
10925
10926 * src/files.c (xfopen, xfclose): Use EXIT_FAILURE rather than 2.
10927 What was that "2" for?
10928
10929 * src/complain.h (fatal, fatal_at): Add __attribute__((__noreturn__)).
10930 * src/getargs.c (usage): Likewise.
10931
10932 * src/getargs.c (getargs): When there are too few operands, report
10933 the last one. When there are too many, report the first extra
10934 one. This is how diffutils does it.
10935
92a060fd
PE
109362002-10-20 Paul Eggert <eggert@twinsun.com>
10937
10938 Remove K&R vestiges.
10939 * configure.ac (AC_C_CONST, AM_C_PROTOTYPES): Remove.
10940 * src/complain.c (VA_START): Remove. Assume prototypes.
10941 (vfprintf) [! (HAVE_VPRINTF || defined vfprintf)]: New macro.
10942 (private_strerror, warn_at, warn, complain_at, complain, fatal_at,
10943 fatal): Assume prototypes.
10944 * src/complain.h: Assume prototypes.
10945 * src/system.h (PARAMS): Remove.
10946 Include <limits.h> unconditionally, since it's guaranteeed even
10947 for a freestanding C89 compiler.
10948 (SHRT_MIN, SHRT_MAX): Remove, since C89 guarantees them.
10949 * src/vmsgetargs.c (getargs, cli_present, cli_get_value): Prototype.
8b76775a 10950
e7cb57c0
AD
109512002-10-20 Akim Demaille <akim@epita.fr>
10952
10953 * src/muscle_tab.c (muscle_grow): Remove trailing debugging code.
10954 * data/glr.c (YY_USER_FORMALS, YY_USER_ARGS): New.
10955 (yyuserAction, yydoAction, yyglrReduce, yyresolveValue)
10956 (yyresolveStates, yyresolveAction, yyresolveStack)
10957 (yyprocessOneStack): Use them.
10958 (yy_reduce_print): New.
10959 * tests/calc.at (_AT_DATA_CALC_Y): Exercise %parse-param.
10960
0245f82d
AD
109612002-10-20 Akim Demaille <akim@epita.fr>
10962
10963 * data/c.m4 (b4_c_ansi_args): Recognize functions with no
10964 arguments and output `void'.
10965 (b4_c_function): Rename as...
10966 (b4_c_function_def): this.
10967 (b4_c_function_decl, b4_c_ansi_function_def)
10968 (b4_c_ansi_function_decl): New.
10969 Change the interpretation of the arguments: before `int, foo', now
10970 `int foo, foo'.
10971 * data/yacc.c (yyparse): Prototype and define thanks to these.
10972 Adjust b4_c_function_def uses.
10973 * data/glr.c (yyparse): Likewise, but ANSI only.
10974
39912f52
AD
109752002-10-20 Akim Demaille <akim@epita.fr>
10976
10977 * src/output.c (prepare): Move the definition of `tokens_number',
10978 `nterms_number', `undef_token_number', `user_token_number_max'
10979 to...
10980 (prepare_tokens): Here.
10981 (prepare_tokens): Rename as...
10982 (prepare_symbols): this.
10983 (prepare): Move the definition of `rules_number' to...
10984 (prepare_rules): here.
10985 (prepare): Move the definition of `last', `final_state_number',
10986 `states_number' to...
10987 (prepare_states): here.
10988 * data/yacc.c, data/lalr1.cc, data/glr.c: Normalize `>' into `<'.
10989
20c1e2ad
AD
109902002-10-20 Akim Demaille <akim@epita.fr>
10991
10992 * src/tables.h, src/tables.c, src/output.c: Comment changes.
10993
21964f43
AD
109942002-10-20 Akim Demaille <akim@epita.fr>
10995
10996 * data/yacc.c, data/yacc.c (b4_location_if, b4_pure_if): Move to...
10997 * data/c.m4: here.
10998
66d30cd4
AD
109992002-10-20 Akim Demaille <akim@epita.fr>
11000
11001 * src/output.c (prepare): Use MUSCLE_INSERT_STRING.
11002 * src/muscle_tab.c (muscle_pair_list_grow): Rename `val as
11003 `pair'.
11004 (muscle_init): Move the `b4_ltype', `b4_maxdepth', `b4_initdepth',
11005 `name' to...
11006 * data/glr.c, data/lalr1.cc, data/yacc.c (b4_location_type)
11007 (b4_stack_depth_init, b4_stack_depth_max, b4_parser_class_name):
11008 These.
11009
95f2c9fe
PE
110102002-10-19 Paul Eggert <eggert@twinsun.com>
11011
11012 Do not create a temporary file, as that involves security and
11013 cleanup headaches. Instead, use a pair of pipes.
11014 Derived from a suggestion by Florian Krohm.
11015 * lib/subpipe.c, lib/subpipe.h, m4/subpipe.m4: New files.
11016 * lib/mkstemp.c, lib/readpipe.c, lib/tempname.c, m4/mkstemp.m4: Remove.
11017 * configure.ac (UTILS_FUNC_MKSTEMP, jm_PREREQ_TEMPNAME): Remove.
11018 (BISON_PREREQ_SUBPIPE): Add.
11019 * lib/Makefile.am (libbison_a_SOURCES): Remove readpipe.c.
11020 Add subpipe.h, subpipe.c.
11021 * m4/Makefile.am (EXTRA_DIST): Remove mkstemp.m4. Add subpipe.m4.
11022 * po/POTFILES.in: Add lib/subpipe.c.
11023 * src/output.c: Include "subpipe.h".
11024 (m4_invoke): Remove decl.
11025 (scan_skel): New decl.
11026 (output_skeleton): Use pipe rather than temporary file for m4 input.
11027 Check that m4sugar.m4 is readable, to avoid deadlock.
11028 Check for pipe I/O error.
11029 * src/scan-skel.l (readpipe): Remove decl.
11030 (scan_skel): New function, to be used in place of m4_invoke.
11031 Read from stream rather than file.
66d30cd4 11032
95f2c9fe
PE
11033 * lib/timevar.c (TICKS_TO_MSEC, CLOCKS_TO_MSEC): Do not cast to
11034 float, as this generates a warning on Solaris 8 + GCC 3.2 with
11035 --enable-gcc-warnings. Instead, divide into 1.0 rather than 1;
11036 this generates a more-accurate value anyway.
11037
11038 * lib/timevar.c (timervar_accumulate): Rename locals to
11039 avoid confusion with similarly-named more-global.
11040 * src/muscle_tab.c (muscle_pair_list_grow): Likewise.
11041
11042 * src/output.c (prepare): Use xstrdup to convert char const *
11043 to char *, to avoid GCC warning.
11044
c19988b7
AD
110452002-10-19 Akim Demaille <akim@epita.fr>
11046
11047 * tests/calc.at (_AT_DATA_CALC_Y): Define VAL, LOC, LEX_FORMALS,
11048 LEX_PRE_FORMALS, LEX_ARGS, LEX_PRE_ARGS, USE_LEX_ARGS.
11049 Use them to have `calc.y' ready for %pure-parser.
11050 * data/yacc.c (YYLEX): Pass a yylex return type to
11051 b4_c_function_call.
11052
ae7453f2
AD
110532002-10-19 Akim Demaille <akim@epita.fr>
11054
11055 Prototype support of %lex-param and %parse-param.
11056
11057 * src/parse-gram.y: Add the definition of the %lex-param and
11058 %parse-param tokens, plus their rules.
11059 Drop the `_' version of %glr-parser.
11060 Add the "," token.
11061 * src/scan-gram.l (INITIAL): Scan them.
11062 * src/muscle_tab.c: Comment changes.
11063 (muscle_insert, muscle_find): Rename `pair' as `probe'.
11064 * src/muscle_tab.h (MUSCLE_INSERT_PREFIX): Remove unused.
11065 (muscle_entry_s): The `value' member is no longer const.
11066 Adjust all dependencies.
11067 * src/muscle_tab.c (muscle_init): Adjust: use
11068 MUSCLE_INSERT_STRING.
11069 Initialize the obstack earlier.
11070 * src/muscle_tab.h, src/muscle_tab.c (muscle_grow)
11071 (muscle_pair_list_grow): New.
11072 * data/c.m4 (b4_c_function_call, b4_c_args): New.
11073 * data/yacc.c (YYLEX): Use b4_c_function_call to honor %lex-param.
11074 * tests/calc.at: Use %locations, not --locations.
11075 (AT_CHECK_CALC_GLR): Use %glr-parser, not %glr_parser.
11076
0e575721
AD
110772002-10-19 Akim Demaille <akim@epita.fr>
11078
11079 * src/getargs.c (usage): Take status as argument and exit
11080 accordingly.
11081 Report the traditional `Try ... --help' message when status != 0.
11082 (usage, version): Don't take a FILE * as arg, it is pointless.
11083 (getargs): When there is an incorrect number of arguments, make it
11084 an error, and report it GNUlically thanks to `usage ()'.
11085
724ce7f5
PE
110862002-10-18 Paul Eggert <eggert@twinsun.com>
11087
3a781eb2
PE
11088 * data/glr.c (yyreportParseError): Don't assume that sprintf
11089 yields the length of the printed string, as this is not true
11090 on SunOS 4.1.4. Reported by Peter Klein.
11091
724ce7f5
PE
11092 * tests/calc.at (_AT_DATA_CALC_Y): #undef memcmp and realloc.
11093 * tests/conflicts.at (%nonassoc and eof): Likewise.
11094 Fixes SunOS 4.1.4 test failure reported by Peter Klein.
11095
473d0a75
AD
110962002-10-17 Akim Demaille <akim@epita.fr>
11097
11098 * src/getargs.h (trace_e): Add trace_scan, and trace_parse.
11099 * src/getargs.c (trace_types, trace_args): Adjust.
11100 * src/reader.c (grammar_current_rule_prec_set)
11101 (grammar_current_rule_dprec_set, grammar_current_rule_merge_set):
11102 Standardize error messages.
11103 And s/@prec/%prec/!
11104 (reader): Use trace_flag to enable scanner/parser debugging,
11105 instead of an adhoc scheme.
11106 * src/scan-gram.l: Remove trailing debugging code.
11107
e76d2469
PE
111082002-10-16 Paul Eggert <eggert@twinsun.com>
11109
93e2236a
PE
11110 * src/muscle_tab.h (MUSCLE_TAB_H_): Was misspelled as
11111 MUSCLE_TAB_H.
11112
e76d2469
PE
11113 * NEWS: Officially drop support for building Bison with K&R C,
11114 since it didn't work anyway and it's not worth worrying about.
11115 * Makefile.maint (wget_files): Remove ansi2knr.c.
11116 (ansi2knr.c-url_prefix): Remove.
11117 * lib/.cvsignore: Remove ansi2knr, ansi2knr.*.
11118 * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
11119 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
11120
5bd1c419
PE
111212002-10-15 Paul Eggert <eggert@twinsun.com>
11122
11123 Stop using the "enum_" trick for K&R-style function definitions;
11124 it confused me, and I was the author! Instead, assume that people
11125 who want to use K&R C compilers (when using these modules in GCC,
11126 perhaps?) will run ansi2knr.
11127
11128 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): Remove.
11129 All uses of "enum_" changed to "enum ".
11130 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
11131 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
e76d2469 11132
5bd1c419
PE
11133 * lib/abitset.c (abitset_and, abitset_and_cmp, abitset_and_or,
11134 abitset_and_or_cmp, abitset_andn, abitset_andn_cmp,
11135 abitset_andn_or, abitset_andn_or_cmp, abitset_bytes, abitset_copy,
11136 abitset_copy1, abitset_disjoint_p, abitset_empty_p,
11137 abitset_equal_p, abitset_init, abitset_list, abitset_list_reverse,
11138 abitset_not, abitset_ones, abitset_or, abitset_or_and,
11139 abitset_or_and_cmp, abitset_or_cmp, abitset_reset, abitset_set,
11140 abitset_size, abitset_small_list, abitset_subset_p, abitset_test,
11141 abitset_unused_clear, abitset_xor, abitset_xor_cmp, abitset_zero):
11142 Use function prototypes; this removes the need for declaring
11143 static functions simply to provide their prototypes.
11144 * lib/bitset.c (bitset_alloc, bitset_and_or_, bitset_and_or_cmp_,
11145 bitset_andn_or_, bitset_andn_or_cmp_, bitset_bytes, bitset_copy_,
11146 bitset_count_, bitset_create, bitset_dump, bitset_first,
11147 bitset_free, bitset_init, bitset_last, bitset_next,
11148 bitset_obstack_alloc, bitset_obstack_free, bitset_only_set_p,
11149 bitset_op4_cmp, bitset_or_and_, bitset_or_and_cmp_, bitset_prev,
11150 bitset_print, bitset_release_memory, bitset_toggle_,
11151 bitset_type_choose, bitset_type_get, bitset_type_name_get,
11152 debug_bitset): Likewise.
11153 * lib/bitset.h (bitset_set, bitset_reset, bitset_test): Likewise.
11154 * lib/bitset_stats.c (bitset_log_histogram_print,
11155 bitset_percent_histogram_print, bitset_stats_and,
11156 bitset_stats_and_cmp, bitset_stats_and_or,
11157 bitset_stats_and_or_cmp, bitset_stats_andn, bitset_stats_andn_cmp,
11158 bitset_stats_andn_or, bitset_stats_andn_or_cmp, bitset_stats_copy,
11159 bitset_stats_count, bitset_stats_disable, bitset_stats_disjoint_p,
11160 bitset_stats_dump, bitset_stats_empty_p, bitset_stats_enable,
11161 bitset_stats_equal_p, bitset_stats_free, bitset_stats_init,
11162 bitset_stats_list, bitset_stats_list_reverse, bitset_stats_not,
11163 bitset_stats_ones, bitset_stats_or, bitset_stats_or_and,
11164 bitset_stats_or_and_cmp, bitset_stats_or_cmp, bitset_stats_print,
11165 bitset_stats_print_1, bitset_stats_read, bitset_stats_reset,
11166 bitset_stats_set, bitset_stats_size, bitset_stats_subset_p,
11167 bitset_stats_test, bitset_stats_toggle, bitset_stats_type_get,
11168 bitset_stats_write, bitset_stats_xor, bitset_stats_xor_cmp,
11169 bitset_stats_zero): Likewise.
11170 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
11171 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
11172 bitsetv_dump, debug_bitsetv): Likewise.
11173 * lib/ebitset.c (ebitset_and, ebitset_and_cmp, ebitset_andn,
11174 ebitset_andn_cmp, ebitset_bytes, ebitset_copy, ebitset_copy_,
11175 ebitset_copy_cmp, ebitset_disjoint_p, ebitset_elt_add,
11176 ebitset_elt_alloc, ebitset_elt_calloc, ebitset_elt_find,
11177 ebitset_elt_free, ebitset_elt_last, ebitset_elt_remove,
11178 ebitset_elt_zero_p, ebitset_elts_grow, ebitset_empty_p,
11179 ebitset_equal_p, ebitset_free, ebitset_init, ebitset_list,
11180 ebitset_list_reverse, ebitset_not, ebitset_ones, ebitset_op3_cmp,
11181 ebitset_or, ebitset_or_cmp, ebitset_release_memory, ebitset_reset,
11182 ebitset_set, ebitset_size, ebitset_subset_p, ebitset_test,
11183 ebitset_weed, ebitset_xor, ebitset_xor_cmp, ebitset_zero):
11184 Likewise.
11185 * lib/lbitset.c (debug_lbitset, lbitset_and, lbitset_and_cmp,
11186 lbitset_andn, lbitset_andn_cmp, lbitset_bytes, lbitset_copy,
11187 lbitset_copy_cmp, lbitset_disjoint_p, lbitset_elt_alloc,
11188 lbitset_elt_calloc, lbitset_elt_find, lbitset_elt_free,
11189 lbitset_elt_link, lbitset_elt_unlink, lbitset_elt_zero_p,
11190 lbitset_empty_p, lbitset_equal_p, lbitset_free, lbitset_init,
11191 lbitset_list, lbitset_list_reverse, lbitset_not, lbitset_ones,
11192 lbitset_op3_cmp, lbitset_or, lbitset_or_cmp, lbitset_prune,
11193 lbitset_release_memory, lbitset_reset, lbitset_set, lbitset_size,
11194 lbitset_subset_p, lbitset_test, lbitset_weed, lbitset_xor,
11195 lbitset_xor_cmp, lbitset_zero): Likewise.
e76d2469 11196
ae26e1f0
AD
111972002-10-14 Akim Demaille <akim@epita.fr>
11198
11199 Version 1.75.
11200
d43baf71
AD
112012002-10-14 Akim Demaille <akim@epita.fr>
11202
11203 * tests/Makefile.am (maintainer-check-posix): New.
11204
7ebc83e3
AD
112052002-10-14 Akim Demaille <akim@epita.fr>
11206
11207 * data/glr.c [YYDEBUG] (YYLEFTMOST_STATE): Initialize the yyloc
11208 member.
11209
05846dae
AD
112102002-10-14 Akim Demaille <akim@epita.fr>
11211
11212 * src/tables.c (table_ninf_remap): base -> tab.
11213 Reported by Matt Rosing.
11214
1318e37d
PE
112152002-10-14 Paul Eggert <eggert@twinsun.com>
11216
447fbb17
PE
11217 * tests/action.at, tests/calc.at, tests/conflicts.at,
11218 tests/cxx-type.at, tests/headers.at, tests/input.at,
11219 tests/regression.at, tests/synclines.at, tests/torture.at:
11220 Say "bison -o foo.c foo.y", not "bison foo.y -o foo.c",
11221 so that the tests still work even if POSIXLY_CORRECT is set.
11222 * doc/bison.texinfo (Rpcalc Compile, Invocation): Likewise.
05846dae 11223
1318e37d
PE
11224 * data/c.m4 (b4_int_type): Use yysigned_char instead of signed char,
11225 for portability to K&R hosts. Fix typo: signed char is guaranteed
11226 only to 127, not to 128.
11227 * data/glr.c (yysigned_char): New type.
11228 * data/yacc.c (yysigned_char): Likewise.
11229 * tests/regression.at (Web2c Actions): signed char -> yysigned_char.
11230
cc0f0794
PE
112312002-10-13 Paul Eggert <eggert@twinsun.com>
11232
5038f418
PE
11233 * data/yacc.c (yyparse): Rewrite to avoid "comparison is always
11234 true due to limited range of data type" warning from GCC.
11235
cc0f0794
PE
11236 * data/c.m4 (b4_token_defines): Protect against double-inclusion
11237 by wrapping enum yytokentype's definition inside #ifndef
11238 YYTOKENTYPE. This undoes a bug I introduced on 2002-10-12.
11239
6fed0802
AD
112402002-10-13 Akim Demaille <akim@epita.fr>
11241
11242 * data/glr.c (yyglrShiftDefer, yyaddDeferredAction, yydoAction):
11243 Un yy- yyrhs to avoid the name clash with the global YYRHS.
11244
32f0598d
AD
112452002-10-13 Akim Demaille <akim@epita.fr>
11246
11247 * Makefile.maint: Update from Autoconf 2.54.
11248 * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Remove, shipped with 2.54.
11249
7ea9a33f
AD
112502002-10-13 Akim Demaille <akim@epita.fr>
11251
11252 * src/print.c (print_state): Separate the list of solved conflicts
11253 from the other items.
11254 * tests/conflicts.at (Resolved SR Conflicts): Adjust.
11255
ea99527d
AD
112562002-10-13 Akim Demaille <akim@epita.fr>
11257
11258 Let nondeterministic skeletons be usable with deterministic
11259 tables.
11260
11261 With the patch, GAWK compiled by GCC without -O2 passes its test
11262 suite using a GLR parser driven by LALR tables. It fails with -O2
11263 because `struct stat' gives two different answers on my machine:
11264 88 (definition of an auto var) and later 96 (memset on this var).
11265 Hence the stack is badly corrumpted. The headers inclusion is to
11266 blame: if I move the awk.h inclusion before GLR's system header
11267 inclusion, the two struct stat have the same size.
11268
11269 * src/tables.c (pack_table): Always create conflict_table.
11270 (token_actions): Always create conflict_list.
11271 * data/glr.c (YYFLAG): Remove, unused.
11272
f377f69f
AD
112732002-10-13 Akim Demaille <akim@epita.fr>
11274
11275 * configure.ac (AC_GNU_SOURCE): Use it instead of hand written code.
11276 (O0FLAGS): New.
11277 (VALGRIND, GXX): New.
11278 * tests/atlocal.in (CFLAGS): Use O0FLAGS.
11279 * tests/bison.in: Run $PREBISON a pre-command.
11280 * tests/Makefile.am (maintainer-check, maintainer-check-valgrind)
11281 (maintainer-check-g++): New.
11282 * Makefile.am (maintainer-check): New.
11283
2a1fe6ed
AD
112842002-10-13 Akim Demaille <akim@epita.fr>
11285
11286 * data/glr.c: Formatting changes.
11287 Tweak some trace messages to match yacc.c's.
11288
f50adbbd
AD
112892002-10-13 Akim Demaille <akim@epita.fr>
11290
11291 GLR parsers sometimes raise parse errors instead of performing the
11292 default reduction.
11293 Reported by Charles-Henry de Boysson.
11294
11295 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Don't
ba0fe3c7 11296 check the length of the traces when %glr.
f50adbbd
AD
11297 (_AT_CHECK_CALC_ERROR): Also skip `^Stack' lines, coming from
11298 GLR's traces.
11299 (AT_CHECK_CALC_LALR, AT_CHECK_CALC_GLR): New.
11300 Test GLR parsers.
11301 * data/glr.c (YYLEFTMOST_STATE): Fix its value.
11302 (yyltype): Remove the yy prefix from the member names.
11303 (yytable): Complete its comment.
11304 (yygetLRActions): Map error action number from YYTABLE from
11305 YYTABLE_NINF to 0.
11306 (yyisErrorAction): No longer compare YYACTION to YYPACT_NINF
11307 (which was a bug: it should have been YYTABEL_NINF, and yet it was
11308 not satisfying as we could compare an YYACTION computed from
11309 YYDEFACT to YYTABLE_NINF although they are unrelated): 0 is the
11310 only value for error actions.
11311 (yyreportParseError): In verbose parse error messages, don't issue
11312 `error' in the list of expected tokens.
11313 * data/yacc.c (yyparse) <yybackup>: Rewrite the decoding of the
11314 next action to perform to match glr.c's decoding.
11315 (yytable): Complete its comment.
11316
bcbad5b9
PE
113172002-10-13 Paul Eggert <eggert@twinsun.com>
11318
11319 Fix problem reported by Henrik Grubbstroem in
161a71f3 11320 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00098.html>:
bcbad5b9
PE
11321 "nonterm: { $$ = 123; } { $$ = $1; };" was wrongly rejected,
11322 because the Bison parser reads the second action before reducing
11323 the first one.
11324 * src/scan-gram.l (rule_length): New static var.
11325 Use it to keep track of the rule length in the scanner, since
11326 we can't expect the parser to be in lock-step sync with the scanner.
11327 (handle_action_dollar, handle_action_at): Use this var.
11328 * tests/actions.at (Exotic Dollars): Test for the problem.
05846dae 11329
14904b89
PE
113302002-10-12 Paul Eggert <eggert@twinsun.com>
11331
1fe611e5
PE
11332 * lib/timevar.c [! IN_GCC && HAVE_SYS_TIME_H]: Include <sys/time.h>.
11333 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): Check for <sys/time.h>.
11334 Include <sys/time.h> when checking for clock_t and struct tms.
11335 Use same include order as source.
11336 This is for the SunOS 4.1.4 porting bug reported by Peter Klein in
161a71f3 11337 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00016.html>.
05846dae 11338
1fe611e5
PE
11339 * lib/timevar.c: Update copyright date and clarify comments.
11340 (get_time) [IN_GCC]: Keep the GCC version for reference.
05846dae 11341
1fe611e5
PE
11342 * lib/timevar.c, lib/timevar.h, lib/timevar.def: Import
11343 GCC version as of today, then merge Bison's changes.
11344 Change "GCC" to "Bison" in copyright notice. timevar.def's
11345 author is Akim, so change that too.
11346
98194095
PE
11347 * src/reader.c (grammar_current_rule_check):
11348 Don't worry about the default action if $$ is untyped.
11349 Prevents bogus warnings reported by Jim Gifford in
161a71f3 11350 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00015.html>.
98194095 11351
14904b89
PE
11352 * data/c.m4 (b4_token_enum): Do not define YYTOKENTYPE.
11353 * data/glr.c, data/lalr1.cc, data/yacc.c:
11354 Output token definitions before the first part of user declarations.
11355 Fixes compatibility problem reported by Jim Gifford for kbd in
161a71f3 11356 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00014.html>.
14904b89 11357
ff6dca18
PE
113582002-10-11 Paul Eggert <eggert@twinsun.com>
11359
11360 * data/yacc.c (yyreport_parse_error): Remove, putting its body into...
11361 (yyparse): here. This undoes some of the 2002-07-25 change.
11362 Compatibility problem reported by Ralf S. Engelschall with
11363 OSSP cfg <http://www.ossp.org/pkg/lib/cfg/>.
11364
eb714592
AD
113652002-10-11 Akim Demaille <akim@epita.fr>
11366
11367 * tests/regression.at Characters Escapes): New.
11368 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Accept \' in strings and
11369 characters.
11370 Reported by Jan Nieuwenhuizen.
11371
b7195100
AD
113722002-10-11 Akim Demaille <akim@epita.fr>
11373
11374 * po/id.po: New.
11375
f28a0f2d
PE
113762002-10-10 Paul Eggert <eggert@twinsun.com>
11377
11378 Portability fixes for bitsets; this also avoids several GCC
11379 warnings.
11380
11381 * lib/abitset.c: Include <stddef.h>, for offsetof.
11382 * lib/lbitset.c: Likewise.
11383
11384 * lib/abitset.c (abitset_bytes): Return a size that is aligned
11385 properly for vectors of objects. Do not assume that adding a
11386 header size to a multiple of a word size yields a value that is
11387 properly aligned for the whole union.
11388 * lib/bitsetv.c (bitsetv_alloc): Likewise.
11389
11390 * lib/bitset_stats.c (bitset_stats_bytes): Adjust to new,
11391 unique names for structures.
11392 * lib/ebitset.c (ebitset_bytes): Likewise.
11393 * lib/lbitset.c (lbitset_bytes): Likewise.
11394
11395 * lib/abitset.c (abitset_ones, abitset_zero, abitset_empty_p,
11396 abitset_copy1, abitset_not, abitset_equal_p, abitset_subset_p,
11397 abitset_disjoint_p, abitset_and, abitset_and_cmp, abitset_andn,
11398 abitset_andn_cmp, abitset_or, abitset_or_cmp, abitset_xor,
11399 abitset_xor_cmp, abitset_and_or, abitset_and_or_cmp,
11400 abitset_andn_or, abitset_andn_or_cmp, abitset_or_and,
11401 abitset_or_and_cmp, abitset_copy): Supply prototype decls,
11402 to improve the type-checking that GCC can do.
11403 * lib/bitset.c (bitset_op4_cmp): Likewise.
11404 * lib/bitset_stats.c (bitset_stats_count,
11405 bitset_stats_empty_p, bitset_stats_ones, bitset_stats_zero,
11406 bitset_stats_copy, bitset_stats_disjoint_p,
11407 bitset_stats_equal_p, bitset_stats_not, bitset_stats_subset_p,
11408 bitset_stats_and, bitset_stats_and_cmp, bitset_stats_andn,
11409 bitset_stats_andn_cmp, bitset_stats_or, bitset_stats_or_cmp,
11410 bitset_stats_xor, bitset_stats_xor_cmp, bitset_stats_and_or,
11411 bitset_stats_and_or_cmp, bitset_stats_andn_or,
11412 bitset_stats_andn_or_cmp, bitset_stats_or_and,
11413 bitset_stats_or_and_cmp): Likewise.
11414 * lib/lbitset.c (lbitset_and, lbitset_and_cmp, lbitset_andn,
11415 lbitset_andn_cmp, lbitset_or, lbitset_or_cmp, lbitset_xor,
11416 lbitset_xor_cmp, lbitset_empty_p, lbitset_ones, lbitset_not,
11417 lbitset_subset_p, lbitset_disjoint_p, debug_lbitset): Likewise.
11418
11419 * lib/abitset.h: Include bitset.h, not bbitset.h.
11420 * lib/ebitset.h: Likewise.
11421 * lib/lbitset.h: Likewise.
11422
11423 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): New types.
11424 All instances of parameters of type enum bitset_opts are now of
11425 type enum_bitset_opts, to conform to the C Standard, and similarly
11426 for enum_bitset_type.
11427 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
11428 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
11429
11430 Do not use "struct bitset_struct" to mean different things in
11431 different modules. Not only is this confusing, it violates
11432 the C Standard, which requires that structure types in different
11433 modules must be compatible if one is to be passed to the other.
11434 * lib/bbitset.h (bitset): Now points to a union, not to a struct.
11435 All instances of "struct bitset_struct *" replaced with "bitset".
11436 * lib/bitset.h (struct bitset_struct): Remove, replacing with....
11437 (union bitset_union, struct abitset_struct, struct ebitset_struct,
11438 struct lbitset_struct, struct bitset_stats_struct): New types.
11439 All uses of struct bitset_struct changed to union bitset_union,
11440 etc.
ba0fe3c7 11441 * lib/abitset.c (struct abitset_struct, abitset,
f28a0f2d
PE
11442 struct bitset_struct): Remove.
11443 * lib/bitset_stats.c (struct bitset_stats_struct, bitset_stats,
11444 struct bitset_struct): Remove.
11445 * lib/ebitset.c (struct ebitset_struct, ebitset, struct
11446 bitset_struct): Remove.
11447 * lib/lbitset.c (struct lbitset_struct, lbitset, bitset_struct):
11448 Likewise.
11449
11450 Do not call a function of type T using a call that assumes the
11451 function is of a different type U. Standard C requires that a
11452 function must be called with a type that is compatible with its
11453 definition.
11454 * lib/bbitset.h (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
11455 New decls.
11456 * lib/bitset.c (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
11457 New functions.
11458 * lib/ebitset.c (PFV): Remove.
11459 * lib/lbitset.c (PFV): Likewise.
11460 * lib/ebitset.c (ebitset_and, ebitset_andn, ebitset_or,
11461 ebitset_xor, ebitset_copy, ebitset_ones, ebitset_empty_p): New
11462 decls.
11463 (ebitset_and, ebitset_andn, ebitset_or, ebitset_xor): New functions.
11464 (ebitset_vtable): Use them.
11465 * lib/lbitset.c (lbitset_and, lbitset_andn, lbitset_or,
11466 lbitset_xor): New functions.
11467 (lbitset_vtable): Use them.
11468
11469 * lib/bitset.h (bitset_next, bitset_prev, bitset_only_set_p):
11470 Declare.
11471
11472 * lib/bitsetv.c (bitsetv_alloc): Add a cast to (void *) to avoid a
11473 GCC warning.
11474 * lib/lbitset.c (LBITSET_CURRENT1): Likewise.
11475 Use offsetof, for simplicity.
11476
6fbe4984
PE
114772002-10-06 Paul Eggert <eggert@twinsun.com>
11478
11479 * lib/bitset.h (bitset_reset): Do not assume that bitset_word is
11480 the same width as int. This reapplies a hunk of the 2002-08-12 patch
161a71f3 11481 <http://lists.gnu.org/archive/html/bison-patches/2002-08/msg00007.html>,
6fbe4984
PE
11482 which was inadvertently undone by the 2002-09-30 patch.
11483 * lib/lbitset.c (debug_lbitset): Do not assume that bitset_word is
11484 the same width as int.
11485
420f93c8
PE
114862002-10-04 Paul Eggert <eggert@twinsun.com>
11487
11488 Version 1.50.
11489
11490 * configure.ac (AC_INIT), NEWS: Increment version number.
11491
11492 * doc/bison.texinfo: Minor spelling, grammar, and white space
11493 fixes.
11494 (Symbols): Mention that any negative value returned from yylex
11495 signifies end-of-input. Warn about negative chars. Mention
11496 the portable Standard C character set.
11497
11498 The GNU coding standard says CFLAGS and YFLAGS are reserved
11499 for the installer to set.
11500 * lib/Makefile.am (AM_CFLAGS): Renamed from CFLAGS.
11501 * src/Makefile.am (AM_CFLAGS): Likewise.
11502 (AM_YFLAGS): Renamed from YFLAGS.
11503
11504 Fix some MAX and MIN problems.
11505 * src/gram.h (ITEM_NUMBER_MIN): MIN_MAX -> INT_MIN.
11506 * src/lalr.h (GOTO_NUMBER_MAX): INT_MAX -> SHRT_MAX.
11507 * src/symtab.h (SYMBOL_NUMBER_MAX): New macro.
11508 * src/reader.c (reader): Use it.
11509
11510 * tests/regression.at (Braces parsing): Use grep, not fgrep, as
11511 POSIX 1003.1-2001 has removed fgrep.
11512
115132002-10-04 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
11514
11515 * lib/bbitset.h (BITSET_WINDEX_MAX): Redefine so that it cannot be
11516 interpreted as signed.
11517 * lib/ebitset.c (ebitset_list): Fix bug.
11518
ff68026d
PE
115192002-10-01 Paul Eggert <eggert@twinsun.com>
11520
11521 More fixes for 64-bit hosts and large bitsets.
11522
11523 * lib/abitset.c (struct abitset_struct.n_bits, abitset_small_list,
11524 abitset_size, abitset_list, abitset_list_reverse, abitset_list):
11525 Use bitset_bindex, not int or unsigned int or size_t, to count bits.
11526 * lib/bbitset.h (struct bitset_vtable.size, struct bitset_vtable.count,
11527 struct bitset_vtable.list, struct bitset_vtable.list_reverse,
11528 bitset_count_, bitset_next, bitset_prev, bitset_first, bitset_last,
11529 bitset_count_): Likewise.
11530 * lib/bitset.h (bitset_iterator.num, bitset_iterator.i,
11531 bitset_first, bitset_last): Likewise.
11532 * lib/bitset_stats.c (bitset_stats_size, bitset_stats_list,
11533 bitset_stats_list_reverse, bitset_stats_size,
11534 bitset_stats_count, bitset_stats_list, bitset_stat_list_reverse):
11535 Likewise.
11536 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
11537 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
11538 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
11539 bitsetv_reflexive_transitive_closure): Likewise.
11540 * lib/bitsetv.h (bitsetv_alloc, bitsetv_create): Likewise.
11541 * lib/ebitset.c (ebitset_size, ebitset_list, ebitset_list_reverse):
11542 Likewise.
11543 * lib/lbitset.c (lbitset_size, lbitset_list, lbitset_list_merge):
11544 Likewise.
420f93c8 11545
ff68026d
PE
11546 * lib/abitset.c (abitset_ones, abitset_zero, abitset_bytes):
11547 Use size_t, not unsigned int, to count bytes.
11548 * lib/abitset.h (abitset_bytes): Likewise.
11549 * lib/bitset.c (bitset_bytes, bitset_alloc, bitset_obstack_alloc):
11550 Likewise.
11551 * lib/bitset.h (bitset_bytes): Likewise.
11552 * lib/bitset_stats.c (bitset_stats_bytes, bitset_stats_init): Likewise.
11553 * lib/bitset_stats.h (bitset_stats_bytes): Likewise.
11554 * lib/bitsetv.c (bitsetv_alloc): Likewise.
11555 * lib/ebitset.c (ebitset_bytes): Likewise.
11556 * lib/ebitset.h (ebitset_bytes): Likewise.
11557 * lib/lbitset.c (lbitset_bytes): Likewise.
11558 * lib/lbitset.h (lbitset_bytes): Likewise.
420f93c8 11559
ff68026d
PE
11560 * lib/abitset.c (abitset_empty_p, abitset_not, abitset_equal_p,
11561 abitset_subset_p, abitset_disjoint_p, abitset_and,
11562 abitset_and_cmp, abitset_andn, abitset_andn_cmp, abitset_or,
11563 abitset_or_cmp, abitset_xor, abitset_xor_cmp, abitset_and_or,
11564 abitset_and_or_cmp, abitset_andn_or, abitset_andn_or_cmp,
11565 abitset_or_and, abitset_or_and_cmp):
11566 Use bitset_windex instead of unsigned int.
11567 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
11568 * lib/ebitset.c (struct ebitset_struct.size, ebitset_elts_grow,
11569 ebitset_elt_add, ebitset_elt_remove, ebitset_weed,
11570 ebitset_elt_find, ebitset_list_reverse, ebitset_list, ebitset_init):
11571 Likewise.
11572 * lib/lbitset.c (lbitset_ones, lbitset_not): Likewise.
420f93c8 11573
ff68026d
PE
11574 * lib/bitset.c (bitset_print):
11575 Use proper printf formats for widths of integer types.
11576 * lib/bitset_stats.c (bitset_percent_histogram_print,
11577 bitset_log_histogram_print, bitset_stats_print_1): Likewise.
11578 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
11579 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
11580 * lib/lbitset.c (lbitset_bytes): Likewise.
420f93c8 11581
ff68026d
PE
11582 * lib/bbitset.h (BITSET_BINDEX_MAX, BITSET_WINDEX_MAX,
11583 BITSET_SIZE_MAX): New macros.
11584 (BITSET_INDEX_MAX): Remove. It wasn't right, since it assumed that
11585 sizeof (bitset_word) == sizeof (bitset_windex). All uses changed
11586 to BITSET_WINDEX_MAX.
11587
11588 * lib/bitset.c (bitset_next, bitset_prev, bitset_first,
11589 bitset_last): Return BITSET_BINDEX_MAX (not -1) for no value,
11590 since we now return the bitset_bindex type (not int).
11591
11592 * lib/bitsetv.c (bitsetv_alloc): Check for arithmetic overflow
11593 when computing sizes.
11594 * lib/ebitset.c (ebitset_elts_grow): Likewise.
11595
11596 * lib/lbitset.c (lbitset_elt_find): Simplify windex calculation
11597 and avoid cast to unsigned.
11598
6aa452a6
AD
115992002-09-30 Akim Demaille <akim@epita.fr>
11600
11601 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
11602 * lib/bitset_stats.c, lib/bitsetv.c, lib/ebitset.c, lib/lbitset.c:
11603 Updates from Michael Hayes.
11604
927f7817
AD
116052002-09-30 Art Haas <ahaas@neosoft.com>
11606
11607 * configure.ac: Update AC_OUTPUT and AM_CONFIG_HEADER
11608 invocations.
11609 * tests/cxx-type.at (declarator): Don't rely on NDEBUG being not
11610 defined.
11611
9738f41e
AD
116122002-09-27 Akim Demaille <akim@epita.fr>
11613
11614 Version 1.49c.
11615
a5c75d7f
AD
116162002-09-27 Akim Demaille <akim@epita.fr>
11617
11618 * configure.ac (AM_INIT_AUTOMAKE): We _need_ 1.7.
11619 (Because of AC_LIBSOURCE).
11620
8280e179
AD
116212002-09-27 Akim Demaille <akim@epita.fr>
11622
11623 Playing with Autoscan.
11624
11625 * configure.ac: Remove the old LIBOBJ tweaks.
11626 (AC_REPLACE_FUNCS): Add strrchr and strtol.
11627 * lib/strrchr.c: New.
11628 * lib/strtol.c: New, from the Coreutils 4.5.1.
11629
ae64af35
AD
116302002-09-27 Akim Demaille <akim@epita.fr>
11631
11632 Playing with Autoscan.
11633
11634 * m4/prereq.m4 (jm_PREREQ_ARGMATCH, jm_FUNC_ARGMATCH): New.
11635 * lib/Makefile.am (libbison_a_SOURCES): No longer include
11636 argmatch.c and argmatch.h, since they are AC_LIBSOURCE'd.
11637 * lib/strcasecmp.c, lib/strncasecmp.c, lib/memcmp.c: New, from the
11638 Coreutils 4.5.1.
11639
d1a1114f
AD
116402002-09-24 Akim Demaille <akim@epita.fr>
11641
11642 * doc/bison.texinfo (Stack Overflow): xref to Recursion.
11643 (Frequently Asked Questions, Parser Stack Overflow): New.
11644
b906441c
AD
116452002-09-13 Akim Demaille <akim@epita.fr>
11646
11647 Playing with autoscan.
11648
11649 * src/reader.c (get_merge_function): Use xstrdup, not strdup.
11650 * src/files.c (skeleton_find): Remove, unused.
11651 * m4/memcmp.m4: New, from the Coreutils 4.5.1.
11652 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Run jm_FUNC_MEMCMP.
11653
bd701811
AD
116542002-09-13 Akim Demaille <akim@epita.fr>
11655
11656 * configure.ac (AM_INIT_AUTOMAKE): Require Automake 1.6.3.
11657 * Makefile.am (AUTOMAKE_OPTIONS): Don't.
11658
e0a13e7b
AD
116592002-09-13 Akim Demaille <akim@epita.fr>
11660
11661 * configure.ac: Require 2.54.
11662 s/jm_FUNC_MALLOC/AC_FUNC_MALLOC/.
11663 s/jm_FUNC_REALLOC/AC_FUNC_REALLOC/.
11664 * m4/c-bs-a.m4, m4/malloc.m4, m4/mbstate_t.m4, m4/realloc.m4:
11665 Remove, provided by Autoconf macros.
11666
c97011bf
AD
116672002-09-12 Akim Demaille <akim@epita.fr>
11668
11669 * m4/prereq.m4: Update, from Coreutils 4.5.1.
11670
d862b1be
AD
116712002-09-12 Akim Demaille <akim@epita.fr>
11672
11673 * m4/prereq.m4: Update, from Fileutils 4.1.5.
11674 * configure.ac (jm_PREREQ_TEMPNAME): Invoke it.
11675 Reported by Martin Mokrejs.
11676
3d38c03a
AD
116772002-09-10 Akim Demaille <akim@epita.fr>
11678
11679 * src/parse-gram.y: Associate a human readable string to each
11680 token type.
11681 * tests/regression.at (Invalid inputs): Adjust.
11682
b6347355
AD
116832002-09-10 Gary V. Vaughan <gary@gnu.org>
11684
11685 * tests/Makefile.am ($(srcdir)/package.m4): Bison now ships
11686 with an Autoconf-2.5x style configure.ac.
11687
09ba4ab2
PE
116882002-09-06 Paul Eggert <eggert@twinsun.com>
11689
11690 * doc/bison.texinfo (Conditions): Make explicit that the GPL
11691 exception applies only to yacc.c. This is a modification of a
11692 patch originally suggested by Akim Demaille.
11693
21846f69
AD
116942002-09-06 Akim Demaille <akim@epita.fr>
11695
09ba4ab2
PE
11696 * data/c.m4 (b4_copyright): Move the GPL exception comment from
11697 here to...
11698 * data/yacc.c: here.
11699
21846f69
AD
11700 * data/lalr1.cc (struct yyltype): Don't define it, since we use
11701 LocationType.
11702 (b4_ltype): Default to yy::Location from location.hh.
11703
c0ad8bf3
AD
117042002-09-04 Jim Meyering <jim@meyering.net>
11705
11706 * data/yacc.c: Guard the declaration of yytoknum also with
11707 `#ifdef YYPRINT', so it is declared only when used.
11708
3a93251e
AD
117092002-09-04 Akim Demaille <akim@epita.fr>
11710
11711 * configure.in: Rename as...
11712 * configure.ac: this.
11713 Bump to 1.49c.
11714
427c0dda
AD
117152002-09-04 Akim Demaille <akim@epita.fr>
11716
11717 * src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
11718 * src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't
11719 translate maintainer only messages.
11720
6a254321
PE
117212002-08-12 Paul Eggert <eggert@twinsun.com>
11722
645e30d1
PE
11723 Version 1.49b.
11724
6a254321
PE
11725 * Makefile.am (SUBDIRS): Remove intl.
11726 (DISTCLEANFILES): Remove.
11727 * NEWS: Mention that GNU M4 is now required. Clarify what is
11728 meant by "larger grammars". Mention the pt_BR translation.
11729 * configure.in (AC_CHECK_DECLS): Add getenv, getopt.
11730 (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var.
11731 Bump version from 0.11.2 to 0.11.5.
11732 (BISON_PREREQ_STAGE): Remove.
11733 (AM_GNU_GETTEXT): Use external gettext.
11734 (AC_OUTPUT): Remove intl/Makefile.
11735
11736 * config/depcomp, config/install-sh: Sync with Automake 1.6.3.
11737
11738 * data/glr.c: Include string.h, for strlen.
11739 (yyreportParseError): Use size_t for yysize.
11740 (yy_yypstack): No longer nested inside yypstates, as nested
11741 functions are not portable. Do not assume size_t is the
11742 same width as int.
11743 (yypstates): Do not assume that ptrdiff_t is the same width
11744 as int, and similarly for yyposn and YYINDEX.
11745
11746 * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.
11747
11748 * lib/Makefile.am (INCLUDES): Do not include from the intl
11749 directory, which has been removed.
11750 * src/Makefile.am (INCLUDES): Likewise.
11751
11752 * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
11753 (bitsets_sources, additional_bitsets_sources, timevars_sources):
11754 New vars.
11755
11756 * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
11757 * tests/Makefile.am (EXTRA_DIST): Likewise.
11758
11759 * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
11760 Do not assume that bitset_windex is the same width as unsigned.
11761
11762 * lib/abitset.c (abitset_unused_clear): Do not assume that
11763 bitset_word is the same width as int.
11764 * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise.
11765 * lib/bitset.h (bitset_set, bitset_reset): Likewise.
11766 * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise.
11767 * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise.
11768 * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise.
11769
11770 * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for
11771 portability to one's complement hosts!).
11772 * lib/ebitset.c (ebitset_op1): Likewise.
11773 * lib/lbitset.c (lbitset_op1): Likewise.
11774
11775 * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar.
11776 * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
11777 lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c:
11778 Sync with fileutils.
11779 * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
11780 lib/gettext.h: Sync with diffutils.
11781
11782 * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
11783 lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.
11784
11785 * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
11786 PROTOTYPES to check for prototypes, and "defined __STDC__" to
11787 check for void *.
11788
11789 * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not
11790 size_t; the old version tried to do this but casted improperly.
11791 (bitset_bindex, bitset_windex): Now size_t, not unsigned long.
11792 (bitset_test): Now returns int, not unsigned long.
11793
11794 * lib/bitset_stats.c: Include "gettext.h".
11795 (_): New macro.
11796 (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
11797 name locals "index", as it generates unnecessary warnings on some
11798 hosts that have an "index" function.
11799
11800 * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print,
11801 bitset_stats_read, bitset_stats_write): Wrap strings in _() if
11802 they need translation.
11803 * src/LR0.c (state_list_append, new_itemsets, get_state,
11804 append_states, generate_states): Likewise.
11805 * src/assoc.c (assoc_to_string): Likewise.
11806 * src/closure.c (print_closure, set_firsts, closure): Likewise.
11807 * src/gram.c (grammar_dump): Likewise.
11808 * src/injections.c (injections_compute): Likewise.
11809 * src/lalr.c (lookaheads_print): Likewise.
11810 * src/relation.c (relation_transpose): Likewise.
11811 * src/scan-gram.l: Likewise.
11812 * src/tables.c (table_grow, pack_vector): Likewise.
11813
11814 * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4,
11815 glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4.
11816 * m4/malloc.m4, m4/realloc.m4: Sync with diffutils.
11817 * m4/mbstate_t.m4: Sync with fileutils.
11818 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T.
11819
11820 * po/LINGUAS: Add pt_BR.
11821 * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c,
11822 src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c,
11823 lib/timevar.c.
11824 Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
11825 manual recommends.
11826 Similarly, use src/scan-gram.l instead of src/scan-gram.c.
11827
11828 * src/complain.c (strerror_r): Remove decl; not needed.
11829 (strerror): Use same pattern as ../lib/error.c.
11830
11831 * src/files.c, src/files.h (compute_header_macro): Remove; unused.
11832
11833 * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.
11834
11835 * src/main.c (main): Cast result of bindtextdomain and textdomain
11836 to void, to avoid a GCC warning when --disable-nls is in effect.
11837
11838 * src/scan-gram.l: Use strings rather than escapes when possible,
11839 to minimize the number of warnings from xgettext.
11840 (handle_action_dollar, handle_action_at): Don't use isdigit,
11841 as it mishandles negative chars and it may not work as expected
11842 outside the C locale.
11843
11844 * src/symtab.c (symbol_get): Don't cast LHS of an assignment;
11845 this is a GCC extension and is not portable to other compilers.
11846
11847 * src/system.h (alloca): Use same pattern as ../lib/error.c.
11848 Do not include <ctype.h>; no longer needed.
11849 Do not include <malloc.h>; no longer needed (and generates
11850 warnings on OpenBSD 3.0).
11851
11852 * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
11853 it's not portable.
11854
11855 * tests/regression.at: Do not use 'cc -c input.c -o input';
11856 Sun C rejects this. Instead, use 'cc -c input.c -o input.o'.
11857
11858 * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero
11859 exit status as failure, not just exit status 1. Sun C exits
11860 with status 2 sometimes.
11861
11862 * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
11863 Use it for the two large tests.
11864
c8f002c7
AD
118652002-08-02 Akim Demaille <akim@epita.fr>
11866
11867 * src/conflicts.c (conflicts_output): Don't output rules never
11868 reduced here, since anyway that computation doesn't work.
11869 * src/gram.h, src/gram.h (rule_filter_t, rule_useful_p)
11870 (rule_useless_p, rule_never_reduced_p): New.
11871 (grammar_rules_partial_print): Use a filter instead of a range.
11872 Display the title only if needed.
11873 (grammar_rules_print): Adjust.
11874 (grammar_rules_never_reduced_report): New.
11875 * src/tables.c (action_row): Move the computation of rules never
11876 reduced to...
11877 (token_actions): here.
11878 * src/main.c (main): Make the parser before making the report, so
11879 that rules never reduced are computed.
11880 Call grammar_rules_never_reduced_report.
11881 * src/print.c (print_results): Report rules never reduced.
11882 * tests/conflicts.at, tests/reduce.at: Adjust.
11883
cd08e51e
AD
118842002-08-01 Akim Demaille <akim@epita.fr>
11885
11886 Instead of attaching lookaheads and duplicating the rules being
11887 reduced by a state, attach the lookaheads to the reductions.
11888
11889 * src/state.h (state_t): Remove the `lookaheads',
11890 `lookaheads_rule' member.
11891 (reductions_t): Add a `lookaheads' member.
11892 Use a regular array for the `rules'.
11893 * src/state.c (reductions_new): Initialize the lookaheads member
11894 to 0.
11895 (state_rule_lookaheads_print): Adjust.
11896 * src/state.h, src/state.c (state_reductions_find): New.
11897 * src/conflicts.c (resolve_sr_conflict, set_conflicts)
11898 (count_rr_conflicts): Adjust.
11899 * src/lalr.c (LArule): Remove.
11900 (add_lookback_edge): Adjust.
11901 (state_lookaheads_count): New.
11902 (states_lookaheads_initialize): Merge into...
11903 (initialize_LA): this.
11904 (lalr_free): Adjust.
11905 * src/main.c (main): Don't free nullable and derives too early: it
11906 is used by --verbose.
11907 * src/print.c, src/print_graph.c, src/tables.c: Adjust.
11908
bb0027a9
AD
119092002-08-01 Akim Demaille <akim@epita.fr>
11910
11911 * src/derives.h, src/derives.c (derives): A `rule_t***' instead of
11912 `rule_number_t**'.
11913 (set_derives, free_derives): Rename as...
11914 (derives_compute, derives_free): this.
11915 Adjust all dependencies.
11916 * src/nullable.c (set_nullable, free_nullable): Rename as...
11917 (nullable_compute, nullable_free): these.
11918 (rule_list_t): Store rule_t *, not rule_number_t.
11919 * src/state.c (state_rule_lookaheads_print): Directly compare rule
11920 pointers, instead of their numbers.
11921 * src/main.c (main): Call nullable_free, and derives_free earlier,
11922 as they were lo longer used.
11923
3325ddc4
AD
119242002-08-01 Akim Demaille <akim@epita.fr>
11925
11926 * lib/timevar.c (get_time): Include children time.
11927 * src/lalr.h (LA, LArule): Don't export them: used with the
11928 state_t.
11929 * src/lalr.c (LA, LArule): Static.
11930 * src/lalr.h, src/lalr.c (lalr_free): New.
11931 * src/main.c (main): Call it.
11932 * src/tables.c (pack_vector): Check whether loc is >= to the
11933 table_size, not >.
11934 (pack_tables): Don't free froms, tos, conflict_tos, and pos...
11935 (tables_generate): do it, since that's also it which allocates
11936 them.
11937 Don't free LA and LArule, main does.
11938
c6f1a33c
AD
119392002-07-31 Akim Demaille <akim@epita.fr>
11940
11941 Separate parser tables computation and output.
11942
11943 * src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
11944 (conflict_list, conflict_list_cnt, table, check, table_ninf)
11945 (yydefgoto, yydefact, high): Move to...
11946 * src/tables.h, src/tables.c: here.
11947 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
11948 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
11949 (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
11950 (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
11951 (ACTION_MIN, actrow, order, nentries, pos, conflrow)
11952 (conflict_list_free, table_size, lowzero, table_grow, conflict_row)
11953 (action_row, save_row, token_actions, save_column, default_goto)
11954 (goto_actions, sort_actions, matching_state, pack_vector)
11955 (table_ninf_remap, pack_table, prepare_actions): Move to...
11956 * src/tables.c: here.
11957 * src/tables.h, src/tables.c(tables_generate, tables_free): New.
11958 * src/output.c (token_actions, output_base, output_conflicts)
11959 (output_check): Merge into...
11960 (prepare_actions): this.
11961 (actions_output): Rename as...
11962 (user_actions_output): this.
11963 * src/main.c (main): Call tables_generate and tables_free.
11964
1509d42f
AD
119652002-07-31 Akim Demaille <akim@epita.fr>
11966
11967 Steal GCC's --time-report support.
11968
11969 * lib/timevar.c, lib/timevar.h, lib/timevar.def: New,
11970 stolen/adjusted from GCC.
11971 * m4/stage.m4: Remove time related checks.
11972 * m4/timevar.m4: New.
11973 * configure.in: Adjust.
11974 * src/system.h: Adjust to using timevar.h.
11975 * src/getargs.h, src/getargs.c: Support trace_time for
11976 --trace=time.
11977 * src/main.c (stage): Remove.
11978 (main): Replace `stage' invocations with timevar calls.
11979 * src/output.c: Insert pertinent timevar calls.
11980
273a74fa
AD
119812002-07-31 Akim Demaille <akim@epita.fr>
11982
11983 Let --trace have arguments.
11984
11985 * src/getargs.h (enum trace_e): New.
11986 * src/getargs.c (trace_args, trace_types, trace_argmatch): New.
11987 (long_options, short_options): --trace/-T takes an optional
11988 argument.
11989 Change all the uses of trace_flag to reflect the new flags.
11990 * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
11991
11992 Strengthen `stage' portability.
11993
11994 * m4/stage.m4 (BISON_PREREQ_STAGE): New.
11995 * configure.in: Use it.
11996 Don't check for malloc.h and sys/times.h.
11997 * src/system.h: Include them when appropriate.
11998 * src/main.c (stage): Compile only when mallinfo, struct mallinfo,
11999 times and struct tms are available.
12000
217598da
AD
120012002-07-30 Akim Demaille <akim@epita.fr>
12002
12003 In verbose parse error message, don't report `error' as an
12004 expected token.
12005 * tests/actions.at (Printers and Destructors): Adjust.
12006 * tests/calc.at (Calculator $1): Adjust.
12007 * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose
12008 error message, do not report the parser accepts the error token in
12009 that state.
12010
52489d44
AD
120112002-07-30 Akim Demaille <akim@epita.fr>
12012
12013 Normalize conflict related messages.
12014
12015 * src/complain.h, src/complain.c (warn, complain): New.
12016 * src/conflicts.c (conflicts_print): Use them.
12017 (conflict_report_yacc): New, extracted from...
12018 (conflicts_print): here.
12019 * tests/conflicts.at, tests/existing.at: Adjust.
12020
e8832397
AD
120212002-07-30 Akim Demaille <akim@epita.fr>
12022
12023 Report rules which are never reduced by the parser: those hidden
12024 by conflicts.
12025
12026 * src/LR0.c (save_reductions): Don't make the final state too
12027 different: save its reduction (accept) instead of having a state
12028 without any action (no shift or goto, no reduce).
12029 Note: the final state is now a ``regular'' state, i.e., the
12030 parsers now contain `reduce 0' as default reduction.
12031 Nevertheless, since they decide to `accept' when yystate =
12032 final_state, they still will not reduce rule 0.
12033 * src/print.c (print_actions, print_reduction): Adjust.
12034 * src/output.c (action_row): Track reduced rules.
12035 (token_actions): Report rules never reduced.
12036 * tests/conflicts.at, tests/regression.at: Adjust.
12037
caf23d24
AD
120382002-07-30 Akim Demaille <akim@epita.fr>
12039
12040 `stage' was accidently included in a previous patch.
12041 Initiate its autoconfiscation.
12042
12043 * configure.in: Look for malloc.h and sys/times.h.
12044 * src/main.c (stage): Adjust.
12045 Report only when trace_flag.
12046
640748ee
AD
120472002-07-29 Akim Demaille <akim@epita.fr>
12048
12049 * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not
12050 state_number_t.
12051 (errs_t): symbol_t*, not symbol_number_t.
12052 (reductions_t): rule_t*, not rule_number_t.
12053 (FOR_EACH_SHIFT): New.
12054 * src/LR0.c, src/conflicts.c, src/lalr.c, src/output.c
12055 * src/print.c, src/print_graph.c: Adjust.
12056
88bce5a2
AD
120572002-07-29 Akim Demaille <akim@epita.fr>
12058
12059 Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
12060
12061 * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
12062 (endtoken, accept): these.
12063 * src/reader.c (reader): Set endtoken's default tag to "$end".
12064 Set undeftoken's tag to "$undefined" instead of "$undefined.".
12065 * doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
12066 Adjust.
12067
1bfb97db
AD
120682002-07-29 Akim Demaille <akim@epita.fr>
12069
12070 * src/reduce.c (reduce_grammar): When the language is empty,
12071 complain about the start symbol, not the axiom.
12072 Use its location.
12073 * tests/reduce.at (Empty Language): New.
12074
fc5734fe
AD
120752002-07-26 Akim Demaille <akim@epita.fr>
12076
12077 * src/reader.h, src/reader.c (gram_error): ... can't get
12078 yycontrol without making too strong assumptions on the parser
12079 itself.
12080 * src/output.c (prepare_tokens): Use the real 0th value of
12081 token_translations instead of `0'.
12082 * src/parse-gram.y (yyerror): Don't rely on yycontrol being
12083 visible here.
12084 * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
12085 for the time being: %locations ought to provide it to yyerror.
12086
3650b4b8
AD
120872002-07-25 Akim Demaille <akim@epita.fr>
12088
12089 * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
12090 * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
12091 * tests/regression.at (Web2c Actions): Adjust.
12092
4b3d3a8e
AD
120932002-07-25 Akim Demaille <akim@epita.fr>
12094
12095 Stop storing rules from 1 to nrules + 1.
12096
12097 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
12098 * src/nullable.c, src/output.c, src/print.c, src/reader.c
12099 * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
12100 Iterate from 0 to nrules.
12101 Use rule_number_as_item_number and item_number_as_rule_number.
12102 Adjust to `derive' now containing possibly 0.
12103 * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
12104 Handle the `- 1' part in rule numbers from/to item numbers.
12105 * src/conflicts.c (log_resolution): Fix the message which reversed
12106 shift and reduce.
12107 * src/output.c (action_row): Initialize default_rule to -1.
12108 (token_actions): Adjust.
12109 * tests/sets.at (Nullable, Firsts): Fix the previously bogus
12110 expected output.
12111 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
12112
4a2a22f4
AD
121132002-07-25 Akim Demaille <akim@epita.fr>
12114
12115 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
12116 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
12117 (b4_c_knr_arg_decl): New.
12118 * data/yacc.c: Use it to define yysymprint, yydestruct, and
12119 yyreport_parse_error.
12120
b8df3223
AD
121212002-07-25 Akim Demaille <akim@epita.fr>
12122
12123 * data/yacc.c (yyreport_parse_error): New, extracted from...
12124 (yyparse): here.
12125 (yydestruct, yysymprint): Move above yyparse.
12126 Be K&R compliant.
12127
a762e609
AD
121282002-07-25 Akim Demaille <akim@epita.fr>
12129
12130 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
12131 replace...
12132 (b4_sint_type, b4_uint_type): these.
12133 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
12134 * tests/regression.at (Web2c Actions): Adjust.
12135
12b0043a
AD
121362002-07-25 Akim Demaille <akim@epita.fr>
12137
12138 * src/gram.h (TIEM_NUMBER_MAX): New.
12139 (item_number_of_rule_number, rule_number_of_item_number): Rename
12140 as...
12141 (rule_number_as_item_number, item_number_as_rule_number): these.
12142 Adjust dependencies.
12143 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
12144 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
12145 (symbol_number_to_vector_number): New.
12146 (order): Of vector_number_t* type.
12147 (base_t, BASE_MAX, BASE_MIN): New.
12148 (froms, tos, width, pos, check): Of base_t type.
12149 (action_number_t, ACTION_MIN, ACTION_MAX): New.
12150 (actrow): Of action_number_t type.
12151 (conflrow): Of unsigned int type.
12152 (table_ninf, base_ninf): New.
12153 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
12154 (muscle_insert_int_table, muscle_insert_base_table)
12155 (muscle_insert_rule_number_table): New.
12156 (prepare_tokens): Output `toknum' as int_table.
12157 (action_row): Returns a rule_number_t.
12158 Use ACTION_MIN, not SHRT_MIN.
12159 (token_actions): yydefact is rule_number_t*.
12160 (table_ninf_remap): New.
12161 (pack_table): Use it for `base' and `table'.
12162 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
12163 replaced with...
12164 (YYPACT_NINF, YYTABLE_NINF): these.
12165 (yypact, yytable): Compute their types instead of hard-coded
12166 `short'.
12167 * tests/regression.at (Web2c Actions): Adjust.
12168
5dde258a
AD
121692002-07-19 Akim Demaille <akim@epita.fr>
12170
12171 * src/scan-gram.l (id): Can start with an underscore.
12172
a945ec39
AD
121732002-07-16 Akim Demaille <akim@epita.fr>
12174
12175 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
12176 Adjust all former `associativity' dependencies.
12177 * src/symtab.c (symbol_new): Default associativity is `undef', not
12178 `right'.
12179 (symbol_check_alias_consistence): Adjust.
12180
fae437e8
AD
121812002-07-09 Akim Demaille <akim@epita.fr>
12182
12183 * doc/bison.texinfo: Properly set the ``header'' part.
12184 Use @dircategory ``GNU programming tools'' as per Texinfo's
12185 documentation.
12186 Use @copying.
12187
1a715ef2
AD
121882002-07-09 Akim Demaille <akim@epita.fr>
12189
12190 * lib/quotearg.h: Protect against multiple inclusions.
12191 * src/location.h (location_t): Add a `file' member.
12192 (LOCATION_RESET, LOCATION_PRINT): Adjust.
12193 * src/complain.c (warn_at, complain_at, fatal_at): Drop
12194 `error_one_per_line' support.
12195
a5d50994
AD
121962002-07-09 Akim Demaille <akim@epita.fr>
12197
12198 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
12199 * src/reader.c (lineno): Remove.
12200 Adjust all dependencies.
12201 (get_merge_function): Take a location and use complain_at.
12202 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
12203 * tests/regression.at (Invalid inputs, Mixing %token styles):
12204 Adjust.
12205
b275314e
AD
122062002-07-09 Akim Demaille <akim@epita.fr>
12207
12208 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
12209 recovery rule, and forbid extensions when --yacc.
12210 (gram_error): Use complain_at.
12211 * src/reader.c (reader): Exit if there were parse errors.
12212
865b9df1
AD
122132002-07-09 Akim Demaille <akim@epita.fr>
12214
12215 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
12216 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
12217 Reported by R Blake <blakers@mac.com>.
12218
c76e14da
AD
122192002-07-09 Akim Demaille <akim@epita.fr>
12220
12221 * data/yacc.c: Output the copyright notive in the header.
12222
7db2ed2d
AD
122232002-07-03 Akim Demaille <akim@epita.fr>
12224
12225 * src/output.c (froms, tos): Are state_number_t.
12226 (save_column): sp, sp1, and sp2 are state_number_t.
12227 (prepare): Rename `final' as `final_state_number', `nnts' as
12228 `nterms_number', `nrules' as `rules_number', `nstates' as
12229 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
12230 unused.
12231 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
12232 * data/lalr1.cc (nsym_): Remove, unused.
12233
e68e0410
AD
122342002-07-03 Akim Demaille <akim@epita.fr>
12235
12236 * src/lalr.h, src/lalr.c (goto_number_t): New.
12237 * src/lalr.c (goto_list_t): New.
12238 Propagate them.
12239 * src/nullable.c (rule_list_t): New.
12240 Propagate.
12241 * src/types.h: Remove.
12242
e1a4f3a4
AD
122432002-07-03 Akim Demaille <akim@epita.fr>
12244
12245 * src/closure.c (print_fderives): Use rule_rhs_print.
12246 * src/derives.c (print_derives): Use rule_rhs_print.
12247 (rule_list_t): New, replaces `shorts'.
12248 (set_derives): Add comments.
12249 * tests/sets.at (Nullable, Firsts): Adjust.
12250
536545f3
AD
122512002-07-03 Akim Demaille <akim@epita.fr>
12252
12253 * src/output.c (prepare_actions): Free `tally' and `width'.
12254 (prepare_actions): Allocate and free `order'.
12255 * src/symtab.c (symbols_free): Free `symbols'.
12256 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
12257 * src/output.c (m4_invoke): Move to...
12258 * src/scan-skel.l: here.
12259 (<<EOF>>): Close yyout, and free its name.
12260
8b752b00
AD
122612002-07-03 Akim Demaille <akim@epita.fr>
12262
12263 Fix some memory leaks, and fix a bug: state 0 was examined twice.
12264
12265 * src/LR0.c (new_state): Merge into...
12266 (state_list_append): this.
12267 (new_states): Merge into...
12268 (generate_states): here.
12269 (set_states): Don't ensure a proper `errs' state member here, do it...
12270 * src/conflicts.c (conflicts_solve): here.
12271 * src/state.h, src/state.c: Comment changes.
12272 (state_t): Rename member `shifts' as `transitions'.
12273 Adjust all dependencies.
12274 (errs_new): For consistency, also take the values as argument.
12275 (errs_dup): Remove.
12276 (state_errs_set): New.
12277 (state_reductions_set, state_transitions_set): Assert that no
12278 previous value was assigned.
12279 (state_free): New.
12280 (states_free): Use it.
12281 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
12282 temporary storage: use `errs' and `nerrs' as elsewhere.
12283 (set_conflicts): Allocate and free this `errs'.
12284
613f5e1a
AD
122852002-07-02 Akim Demaille <akim@epita.fr>
12286
12287 * lib/libiberty.h: New.
12288 * lib: Update the bitset implementation from upstream.
12289 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
12290 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
12291 * src/main.c: Adjust bitset stats calls.
12292
26e0cadc
PE
122932002-07-01 Paul Eggert <eggert@twinsun.com>
12294
12295 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
12296 char, so that negative chars don't collide with $.
12297
1154cced
AD
122982002-06-30 Akim Demaille <akim@epita.fr>
12299
12300 Have the GLR tests be `warning' checked, and fix the warnings.
12301
12302 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
12303 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
12304 (yyremoveDeletes): `yyi' and `yyj' are size_t.
12305 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
12306 (yyaddDeferredAction): static.
12307 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
12308 (yyreportParseError): yyprefix is const.
12309 yytokenp is used only when verbose.
12310 (yy__GNUC__): Replace with __GNUC__.
12311 (yypdumpstack): yyi is size_t.
12312 (yypreference): Un-yy local variables and arguments, to avoid
12313 clashes with `yyr1'. Anyway, we are not in the user name space.
12314 (yytname_size): be an int, as is compared with ints.
12315 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
12316 Use them.
12317 * tests/cxx-gram.at: Use quotation to protect $1.
12318 Use AT_COMPILE to enable warnings hunts.
12319 Prototype yylex and yyerror.
12320 `Use' argc.
12321 Include `string.h', not `strings.h'.
12322 Produce and prototype stmtMerge only when used.
12323 yylex takes a location.
12324
97650f4e
AD
123252002-06-30 Akim Demaille <akim@epita.fr>
12326
12327 We spend a lot of time in quotearg, in particular when --verbose.
12328
12329 * src/symtab.c (symbol_get): Store a quoted version of the key.
12330 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
12331 Adjust all callers.
12332
d2576365
AD
123332002-06-30 Akim Demaille <akim@epita.fr>
12334
12335 * src/state.h (reductions_t): Rename member `nreds' as num.
12336 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
12337 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
12338
ccaf65bc
AD
123392002-06-30 Akim Demaille <akim@epita.fr>
12340
12341 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
12342 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
12343 (shifts_to): Rename as...
12344 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
12345 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
12346 (TRANSITION_IS_DISABLED, transitions_to): these.
12347
87675353
AD
123482002-06-30 Akim Demaille <akim@epita.fr>
12349
12350 * src/print.c (print_shifts, print_gotos): Merge into...
12351 (print_transitions): this.
12352 (print_transitions, print_errs, print_reductions): Align the
12353 lookaheads columns.
12354 (print_core, print_transitions, print_errs, print_state,
12355 print_grammar): Output empty lines separator before, not after.
12356 (state_default_rule_compute): Rename as...
12357 (state_default_rule): this.
12358 * tests/conflicts.at (Defaulted Conflicted Reduction),
12359 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
12360 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
12361
ce4ccb4b
AD
123622002-06-30 Akim Demaille <akim@epita.fr>
12363
12364 Display items as we display rules.
12365
12366 * src/gram.h, src/gram.c (rule_lhs_print): New.
12367 * src/gram.c (grammar_rules_partial_print): Use it.
12368 * src/print.c (print_core): Likewise.
12369 * tests/conflicts.at (Defaulted Conflicted Reduction),
12370 (Unresolved SR Conflicts): Adjust.
12371 (Unresolved SR Conflicts): Adjust and rename as...
12372 (Resolved SR Conflicts): this, as was meant.
12373 * tests/regression.at (Web2c Report): Adjust.
12374
bc933ef1
AD
123752002-06-30 Akim Demaille <akim@epita.fr>
12376
12377 * src/print.c (state_default_rule_compute): New, extracted from...
12378 (print_reductions): here.
12379 Pessimize, but clarify the code.
12380 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
12381
53d4308d
AD
123822002-06-30 Akim Demaille <akim@epita.fr>
12383
12384 * src/output.c (action_row): Let default_rule be always a rule
12385 number.
12386
574fb2d5
AD
123872002-06-30 Akim Demaille <akim@epita.fr>
12388
12389 * src/closure.c (print_firsts, print_fderives, closure):
12390 Use BITSET_EXECUTE.
12391 * src/lalr.c (lookaheads_print): Likewise.
12392 * src/state.c (state_rule_lookaheads_print): Likewise.
12393 * src/print_graph.c (print_core): Likewise.
12394 * src/print.c (print_reductions): Likewise.
12395 * src/output.c (action_row): Likewise.
12396 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
12397
05811fd7
AD
123982002-06-30 Akim Demaille <akim@epita.fr>
12399
12400 * src/print_graph.c: Use report_flag.
12401
0e4d5753
AD
124022002-06-30 Akim Demaille <akim@epita.fr>
12403
12404 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
12405 to...
12406 * src/relation.h, src/relation.c (traverse, relation_digraph)
12407 (relation_print, relation_transpose): New.
12408
24c7d800
AD
124092002-06-30 Akim Demaille <akim@epita.fr>
12410
12411 * src/state.h, src/state.c (shifts_to): New.
12412 * src/lalr.c (build_relations): Use it.
12413
9222837b
AD
124142002-06-30 Akim Demaille <akim@epita.fr>
12415
12416 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
12417 (item_number_of_rule_number, rule_number_of_item_number): New.
12418 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
12419 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
12420 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
12421 Propagate their use.
12422 Much remains to be done, in particular wrt `shorts' from types.h.
12423
260008e5
AD
124242002-06-30 Akim Demaille <akim@epita.fr>
12425
12426 * src/symtab.c (symbol_new): Initialize the `printer' member.
12427
8a731ca8
AD
124282002-06-30 Akim Demaille <akim@epita.fr>
12429
12430 * src/LR0.c (save_reductions): Remove, replaced by...
12431 * src/state.h, src/state.c (state_reductions_set): New.
12432 (reductions, errs): Rename as...
12433 (reductions_t, errs_t): these.
12434 Adjust all dependencies.
12435
32e1e0a4
AD
124362002-06-30 Akim Demaille <akim@epita.fr>
12437
12438 * src/LR0.c (state_list_t, state_list_append): New.
12439 (first_state, last_state): Now symbol_list_t.
12440 (this_state): Remove.
12441 (new_itemsets, append_states, save_reductions): Take a state_t as
12442 argument.
12443 (set_states, generate_states): Adjust.
12444 (save_shifts): Remove, replaced by...
12445 * src/state.h, src/state.c (state_shifts_set): New.
12446 (shifts): Rename as...
12447 (shifts_t): this.
12448 Adjust all dependencies.
12449 * src/state.h (state_t): Remove the `next' member.
12450
e5fb6710
AD
124512002-06-30 Akim Demaille <akim@epita.fr>
12452
12453 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
12454 escaped in slot 0.
12455
c7ca99d4
AD
124562002-06-30 Akim Demaille <akim@epita.fr>
12457
12458 Use hash.h for the state hash table.
12459
12460 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
12461 (allocate_storage): Use state_hash_new.
12462 (free_storage): Use state_hash_free.
12463 (new_state, get_state): Adjust.
12464 * src/lalr.h, src/lalr.c (states): Move to...
12465 * src/states.h (state_t): Remove the `link' member, no longer
12466 used.
12467 * src/states.h, src/states.c: here.
12468 (state_hash_new, state_hash_free, state_hash_lookup)
12469 (state_hash_insert, states_free): New.
12470 * src/states.c (state_table, state_compare, state_hash): New.
12471 * src/output.c (output_actions): Do not free states now, since we
12472 still need to know the final_state number in `prepare', called
12473 afterwards. Do it...
12474 * src/main.c (main): here: call states_free after `output'.
12475
df0e7316
AD
124762002-06-30 Akim Demaille <akim@epita.fr>
12477
12478 * src/state.h, src/state.c (state_new): New, extracted from...
12479 * src/LR0.c (new_state): here.
12480 * src/state.h (STATE_ALLOC): Move to...
12481 * src/state.c: here.
12482 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
12483 * src/state.h, src/state.c: here.
12484
39f41916
AD
124852002-06-30 Akim Demaille <akim@epita.fr>
12486
12487 * src/reader.c (gensym): Rename as...
12488 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
12489 (getsym): Rename as...
12490 (symbol_get): this.
12491
d57650a5
AD
124922002-06-30 Akim Demaille <akim@epita.fr>
12493
12494 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
12495 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
12496 * src/output.c, src/print.c, src/print_graph.c: Propagate.
12497 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
12498
5a08f1ce
AD
124992002-06-30 Akim Demaille <akim@epita.fr>
12500
12501 Make the test suite pass with warnings checked.
12502
12503 * tests/actions.at (Printers and Destructors): Improve.
12504 Avoid unsigned vs. signed issues.
12505 * tests/calc.at: Don't exercise the scanner here, do it...
12506 * tests/input.at (Torturing the Scanner): here.
12507
720623af
PH
125082002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12509
88e7e941 12510 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
720623af
PH
12511 reorganize first lines parallel to yacc.c.
12512
fb8135fa
AD
125132002-06-28 Akim Demaille <akim@epita.fr>
12514
12515 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
12516 (b4_token_enum, b4_token_defines): New, factored from...
12517 * data/lalr1.cc, data/yacc.c, glr.c: here.
12518
41442480
AD
125192002-06-28 Akim Demaille <akim@epita.fr>
12520
12521 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
12522 unused variables.
12523 * src/output.c (merger_output): static.
12524
e0e5bf84
AD
125252002-06-28 Akim Demaille <akim@epita.fr>
12526
ba0fe3c7 12527 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
e0e5bf84
AD
12528 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
12529 pacify GCC.
12530 * src/output.c (save_row): Initialize all the variables to pacify GCC.
e0e5bf84 12531
676385e2
PH
125322002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12533
12534 Accumulated changelog for new GLR parsing features.
12535
6a254321 12536 * src/conflicts.c (count_total_conflicts): Change name to
676385e2
PH
12537 conflicts_total_count.
12538 * src/conflicts.h: Ditto.
12539 * src/output.c (token_actions): Use the new name.
12540 (output_conflicts): Change conflp => conflict_list_heads, and
12541 confl => conflict_list for better readability.
12542 * data/glr.c: Use the new names.
12543 * NEWS: Add self to GLR announcement.
e0e5bf84 12544
676385e2
PH
12545 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
12546
12547 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
12548 Akim Demaille.
12549
12550 * data/bison.glr: Change name to glr.c
12551 * data/glr.c: Renamed from bison.glr.
12552 * data/Makefile.am: Add glr.c
e0e5bf84
AD
12553
12554 * src/getargs.c:
12555
676385e2 12556 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
ba0fe3c7 12557 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
e0e5bf84 12558
676385e2
PH
12559 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12560
12561 * data/bison.glr: Be sure to restore the
12562 current #line when returning to the skeleton contents after having
12563 exposed the input file's #line.
12564
12565 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12566
12567 * data/bison.glr: Bring up to date with changes to bison.simple.
12568
12569 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12570
12571 * data/bison.glr: Correct definitions that use b4_prefix.
12572 Various reformatting.
12573 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
12574 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
12575 yytokenp argument; now part of stack.
12576 (yychar): Define to behave as documented.
12577 (yyclearin): Ditto.
e0e5bf84 12578
676385e2
PH
12579 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12580
12581 * src/reader.h: Add declaration for free_merger_functions.
12582
12583 * src/reader.c (merge_functions): New variable.
12584 (get_merge_function): New function.
12585 (free_merger_functions): New function.
12586 (readgram): Check for %prec that is not followed by a symbol.
12587 Handle %dprec and %merge declarations.
12588 (packgram): Initialize dprec and merger fields in rules array.
12589
12590 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
12591 conflict_list_cnt, conflict_list_free): New variables.
12592 (table_grow): Also grow conflict_table.
e0e5bf84 12593 (prepare_rules): Output dprec and merger tables.
676385e2 12594 (conflict_row): New function.
e0e5bf84 12595 (action_row): Output conflict lists for GLR parser. Don't use
676385e2
PH
12596 default reduction in conflicted states for GLR parser so that there
12597 are spaces for the conflict lists.
12598 (save_row): Also save conflict information.
12599 (token_actions): Allocate conflict list.
12600 (merger_output): New function.
12601 (pack_vector): Pack conflict table, too.
12602 (output_conflicts): New function to output yyconflp and yyconfl.
12603 (output_check): Allocate conflict_tos.
12604 (output_actions): Output conflict tables, also.
12605 (output_skeleton): Output b4_mergers definition.
12606 (prepare): Output b4_max_rhs_length definition.
12607 Use 'bison.glr' as default skeleton for GLR parsers.
12608
12609 * src/gram.c (glr_parser): New flag.
12610 (grammar_free): Call free_merger_functions.
12611
12612 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
12613 all pairs of conflicting reductions, rather than just all tokens
12614 causing conflicts. Needed to size conflict tables.
e0e5bf84 12615 (conflicts_output): Modify call to count_rr_conflicts for new
676385e2
PH
12616 interface.
12617 (conflicts_print): Ditto.
12618 (count_total_conflicts): New function.
12619
12620 * src/reader.h (merger_list): New type.
12621 (merge_functions): New variable.
12622
12623 * src/lex.h (tok_dprec, tok_merge): New token types.
12624
12625 * src/gram.h (rule_s): Add dprec and merger fields.
12626 (glr_parser): New flag.
12627
12628 * src/conflicts.h (count_total_conflicts): New function.
12629
12630 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
12631
12632 * doc/bison.texinfo (Generalized LR Parsing): New section.
12633 (GLR Parsers): New section.
12634 (Language and Grammar): Mention GLR parsing.
12635 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
12636 Correct typo ("tge" -> "the").
12637
12638 * data/bison.glr: New skeleton for GLR parsing.
12639
12640 * tests/cxx-gram.at: New tests for GLR parsing.
12641
12642 * tests/testsuite.at: Include cxx-gram.at.
12643
12644 * tests/Makefile.am: Add cxx-gram.at.
e0e5bf84 12645
676385e2
PH
12646 * src/parse-gram.y:
12647
12648 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
12649
12650 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
e0e5bf84 12651
b5480d74 126522002-06-27 Akim Demaille <akim@epita.fr>
e2aaf4c4
AD
12653
12654 * src/options.h, src/options.c: Remove.
12655 * src/getargs.c (short_options, long_options): New.
12656
60491a94
AD
126572002-06-27 Akim Demaille <akim@epita.fr>
12658
12659 * data/bison.simple, data/bison.c++: Rename as...
12660 * data/yacc.c, data/lalr1.cc: these.
12661 * doc/bison.texinfo (Environment Variables): Remove.
12662
9be0c25b
AD
126632002-06-25 Raja R Harinath <harinath@cs.umn.edu>
12664
12665 * src/getargs.c (report_argmatch): Initialize strtok().
12666
1ae72863
AD
126672002-06-20 Akim Demaille <akim@epita.fr>
12668
12669 * data/bison.simple (b4_symbol_actions): New, replaces...
12670 (b4_symbol_destructor, b4_symbol_printer): these.
12671 (yysymprint): Be sure to call YYPRINT only for tokens, and using
12672 user token numbers.
12673
87542d29
AD
126742002-06-20 Akim Demaille <akim@epita.fr>
12675
12676 * data/bison.simple (yydestructor): Rename as...
12677 (yydestruct): this.
12678
1a31ed21
AD
126792002-06-20 Akim Demaille <akim@epita.fr>
12680
12681 * src/symtab.h, src/symtab.c (symbol_type_set)
12682 (symbol_destructor_set, symbol_precedence_set): The location is
12683 the last argument.
12684 Adjust all callers.
12685
e776192e
AD
126862002-06-20 Akim Demaille <akim@epita.fr>
12687
12688 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
12689 internals.
12690 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
12691 Takes a location.
12692 * src/symtab.h, src/symtab.c (symbol_class_set)
12693 (symbol_user_token_number_set): Likewise.
12694 Adjust all callers.
12695 Promote complain_at.
12696 * tests/input.at (Type Clashes): Adjust.
12697
5c1180b3
AD
126982002-06-20 Akim Demaille <akim@epita.fr>
12699
12700 * data/bison.simple (YYLEX): Fix the declaration when
12701 %pure-parser.
12702
e3170060
AD
127032002-06-20 Akim Demaille <akim@epita.fr>
12704
12705 * data/bison.simple (yysymprint): Don't print the token number,
12706 just its name.
12707 * tests/actions.at (Destructors): Rename as...
12708 (Printers and Destructors): this.
12709 Also exercise %printer.
12710
253862fd
AD
127112002-06-20 Akim Demaille <akim@epita.fr>
12712
12713 * data/bison.simple (YYDSYMPRINT): New.
12714 Use it to remove many of the #if YYDEBUG/if (yydebug).
12715
366eea36
AD
127162002-06-20 Akim Demaille <akim@epita.fr>
12717
12718 * src/symtab.h, src/symtab.c (symbol_t): printer and
12719 printer_location are new members.
12720 (symbol_printer_set): New.
12721 * src/parse-gram.y (PERCENT_PRINTER): New token.
12722 Handle its associated rule.
12723 * src/scan-gram.l: Adjust.
12724 (handle_destructor_at, handle_destructor_dollar): Rename as...
12725 (handle_symbol_code_at, handle_symbol_code_dollar): these.
12726 * src/output.c (symbol_printers_output): New.
12727 (output_skeleton): Call it.
12728 * data/bison.simple (yysymprint): New. Cannot be named yyprint
12729 since there are already many grammar files with a user `yyprint'.
12730 Replace the calls to YYPRINT to calls to yysymprint.
12731 * tests/calc.at: Adjust.
12732 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
12733 taking advantage of parser very internal details (stack size!).
12734
4f25ebb0
AD
127352002-06-20 Akim Demaille <akim@epita.fr>
12736
12737 * src/scan-gram.l: Complete the scanner with the missing patterns
12738 to pacify Flex.
12739 Use `quote' and `symbol_tag_get' where appropriate.
12740
93b68a0e
AD
127412002-06-19 Akim Demaille <akim@epita.fr>
12742
12743 * tests/actions.at (Destructors): Augment to test locations.
12744 * data/bison.simple (yydestructor): Pass it the current location
12745 if locations are enabled.
12746 Prototype only when __STDC__ or C++.
12747 Change the argument names to move into the yy name space: there is
12748 user code here.
12749
58612f1d
AD
127502002-06-19 Akim Demaille <akim@epita.fr>
12751
74310291
AD
12752 * data/bison.simple (b4_pure_if): New.
12753 Use it instead of #ifdef YYPURE.
12754
127552002-06-19 Akim Demaille <akim@epita.fr>
12756
12757 * data/bison.simple (b4_location_if): New.
58612f1d
AD
12758 Use it instead of #ifdef YYLSP_NEEDED.
12759
f25bfb75
AD
127602002-06-19 Akim Demaille <akim@epita.fr>
12761
12762 Prepare @$ in %destructor, but currently don't bind it in the
12763 skeleton, as %location use is not cleaned up yet.
12764
12765 * src/scan-gram.l (handle_dollar, handle_destructor_at)
12766 (handle_action_at): New.
12767 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
12768 a braced_code_t and a location as additional arguments.
12769 (handle_destructor_dollar): Instead of requiring `b4_eval', just
12770 unquote one when outputting `b4_dollar_dollar'.
12771 Adjust callers.
12772 * data/bison.simple (b4_eval): Remove.
12773 (b4_symbol_destructor): Adjust.
12774 * tests/input.at (Invalid @n): Adjust.
12775
c732d2c6
AD
127762002-06-19 Zack Weinberg <zack@codesourcery.com>
12777
12778 * doc/bison.texinfo: Document ability to have multiple
12779 prologue sections.
12780
8c165d89
AD
127812002-06-18 Akim Demaille <akim@epita.fr>
12782
12783 * src/files.c (compute_base_names): When computing the output file
12784 names from the input file name, strip the directory part.
12785
ca98bf57
AD
127862002-06-18 Akim Demaille <akim@epita.fr>
12787
12788 * data/bison.simple.new: Comment changes.
12789 Reported by Andreas Schwab.
12790
0bfb02ff
AD
127912002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
12792
12793 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
12794 there are no `label `yyoverflowlab' defined but not used' warnings
12795 when yyoverflow is defined.
12796
24c0aad7
AD
127972002-06-18 Akim Demaille <akim@epita.fr>
12798
12799 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
12800 new member.
12801 (symbol_destructor_set): Adjust.
12802 * src/output.c (symbol_destructors_output): Output the destructor
12803 locations.
12804 Output the symbol name.
12805 * data/bison.simple (b4_symbol_destructor): Adjust.
12806
5719c109
AD
128072002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
12808 and Akim Demaille <akim@epita.fr>
12809
12810 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
12811 what's left on the stack when the error recovery hits EOF.
12812 * tests/actions.at (Destructors): Complete to exercise this case.
12813
9280d3ef
AD
128142002-06-17 Akim Demaille <akim@epita.fr>
12815
12816 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
12817 arguments is really empty, not only equal to `[]'.
12818 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
12819 member.
12820 (symbol_destructor_set): New.
12821 * src/output.c (symbol_destructors_output): New.
12822 * src/reader.h (brace_code_t, current_braced_code): New.
12823 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
12824 (handle_dollar): Rename as...
12825 (handle_action_dollar): this.
12826 (handle_destructor_dollar): New.
12827 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
12828 (grammar_declaration): Use it.
12829 * data/bison.simple (yystos): Is always defined.
12830 (yydestructor): New.
12831 * tests/actions.at (Destructors): New.
12832 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
12833
dafdc66f
AD
128342002-06-17 Akim Demaille <akim@epita.fr>
12835
12836 * src/symlist.h, src/symlist.c (symbol_list_length): New.
12837 * src/scan-gram.l (handle_dollar, handle_at): Compute the
12838 rule_length only when needed.
12839 * src/output.c (actions_output, token_definitions_output): Output
12840 the full M4 block.
12841 * src/symtab.c: Don't access directly to the symbol tag, use
12842 symbol_tag_get.
12843 * src/parse-gram.y: Use symbol_list_free.
12844
56c47203
AD
128452002-06-17 Akim Demaille <akim@epita.fr>
12846
12847 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
12848 (symbol_list_prepend, get_type_name): Move to...
12849 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
12850 (symbol_list_prepend, symbol_list_n_type_name_get): here.
12851 Adjust all callers.
12852 (symbol_list_free): New.
12853 * src/scan-gram.l (handle_dollar): Takes a location.
12854 * tests/input.at (Invalid $n): Adjust.
12855
1e0bab92
AD
128562002-06-17 Akim Demaille <akim@epita.fr>
12857
12858 * src/reader.h, src/reader.c (symbol_list_new): Export it.
12859 (symbol_list_prepend): New.
12860 * src/parse-gram.y (%union): `list' is a new member.
12861 (symbols.1): New, replaces...
12862 (terms_to_prec.1, nterms_to_type.1): these.
12863 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
12864 Take a location as additional argument.
12865 Adjust all callers.
12866
04e60654
AD
128672002-06-15 Akim Demaille <akim@epita.fr>
12868
12869 * src/parse-gram.y: Move %token in the declaration section so that
12870 we don't depend upon CVS Bison.
12871
10e5b8bd
AD
128722002-06-15 Akim Demaille <akim@epita.fr>
12873
12874 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
12875 * src/print.c (print_core): Use it.
12876
9801d40c
AD
128772002-06-15 Akim Demaille <akim@epita.fr>
12878
12879 * src/conflicts.c (log_resolution): Accept the rule involved in
12880 the sr conflicts instead of the lookahead number that points to
12881 that rule.
12882 (flush_reduce): Accept the current lookahead vector as argument,
12883 instead of the index in LA.
12884 (resolve_sr_conflict): Accept the current number of lookahead
12885 bitset to consider for the STATE, instead of the index in LA.
12886 (set_conflicts): Adjust.
12887 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
12888
c0263492
AD
128892002-06-15 Akim Demaille <akim@epita.fr>
12890
12891 * src/state.h (state_t): Replace the `lookaheadsp' member, a
12892 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
12893 Adjust all dependencies.
12894 * src/lalr.c (initialize_lookaheads): Split into...
12895 (states_lookaheads_count, states_lookaheads_initialize): these.
12896 (lalr): Adjust.
12897
9757c359
AD
128982002-06-15 Akim Demaille <akim@epita.fr>
12899
12900 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
12901 out of...
12902 (grammar_rules_print): here.
12903 * src/reduce.c (reduce_output): Use it.
12904 * tests/reduce.at (Useless Rules, Reduced Automaton)
12905 (Underivable Rules): Adjust.
12906
6b98e4b5
AD
129072002-06-15 Akim Demaille <akim@epita.fr>
12908
12909 Copy BYacc's nice way to report the grammar.
12910
12911 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
12912 New.
12913 Don't print the rules' location, it is confusing and useless.
12914 (rule_print): Use grammar_rhs_print.
12915 * src/print.c (print_grammar): Use grammar_rules_print.
12916
6b98e4b5
AD
129172002-06-15 Akim Demaille <akim@epita.fr>
12918
12919 Complete and rationalize `useless thing' warnings.
12920
12921 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
12922 (symbol_tag_print): New.
12923 Use them everywhere in place of accessing directly the tag member.
12924 * src/gram.h, src/gram.c (rule_print): New.
12925 Use it where a rule used to be printed `by hand'.
12926 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
12927 (reduce_grammar_tables): Report the useless rules.
12928 (reduce_print): Useless things are a warning, not an error.
12929 Report it as such.
12930 * tests/reduce.at (Useless Nonterminals, Useless Rules):
12931 (Reduced Automaton, Underivable Rules): Adjust.
12932 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
12933 * tests/conflicts.at (Unresolved SR Conflicts)
12934 (Solved SR Conflicts): Adjust.
12935
ee000ba4
AD
129362002-06-15 Akim Demaille <akim@epita.fr>
12937
12938 Let symbols have a location.
12939
12940 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
12941 (getsym): Adjust.
12942 Adjust all callers.
12943 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
12944 Use location_t, not int.
12945 * src/symtab.c (symbol_check_defined): Take advantage of the
12946 location.
12947 * tests/regression.at (Invalid inputs): Adjust.
12948
8efe435c
AD
129492002-06-15 Akim Demaille <akim@epita.fr>
12950
12951 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
12952 (input): Don't try to initialize yylloc here, do it in the
12953 scanner.
12954 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
12955 * src/gram.h (rule_t): Change line and action_line into location
12956 and action_location, of location_t type.
12957 Adjust all dependencies.
12958 * src/location.h, src/location.c (empty_location): New.
12959 * src/reader.h, src/reader.c (grammar_start_symbol_set)
12960 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
12961 (grammar_current_rule_symbol_append)
12962 (grammar_current_rule_action_append): Expect a location as argument.
12963 * src/reader.c (grammar_midrule_action): Adjust to attach an
12964 action's location as dummy symbol location.
12965 * src/symtab.h, src/symtab.c (startsymbol_location): New.
12966 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
12967 the line numbers.
12968
1921f1d7
AD
129692002-06-14 Akim Demaille <akim@epita.fr>
12970
12971 Grammar declarations may be found in the grammar section.
12972
12973 * src/parse-gram.y (rules_or_grammar_declaration): New.
12974 (declarations): Each declaration may end with a semicolon, not
12975 just...
12976 (grammar_declaration): `"%union"'.
12977 (grammar): Branch to rules_or_grammar_declaration.
12978
4515534c
AD
129792002-06-14 Akim Demaille <akim@epita.fr>
12980
12981 * src/main.c (main): Invoke scanner_free.
12982
f958596b
AD
129832002-06-14 Akim Demaille <akim@epita.fr>
12984
12985 * src/output.c (m4_invoke): Extracted from...
12986 (output_skeleton): here.
12987 Free tempfile.
12988
2c569025
AD
129892002-06-14 Akim Demaille <akim@epita.fr>
12990
12991 * src/parse-gram.y (directives, directive, gram)
12992 (grammar_directives, precedence_directives, precedence_directive):
12993 Rename as...
12994 (declarations, declaration, grammar, grammar_declaration)
12995 (precedence_declaration, precedence_declarator): these.
12996 (symbol_declaration): New.
12997
592e8d4d
AD
129982002-06-14 Akim Demaille <akim@epita.fr>
12999
13000 * src/files.c (action_obstack): Remove, unused.
13001 (output_obstack): Remove it, and all its dependencies, as it is no
13002 longer needed.
13003 * src/reader.c (epilogue_set): Build the epilogue in the
13004 muscle_obstack.
13005 * src/output.h, src/output.c (muscle_obstack): Move to...
13006 * src/muscle_tab.h, src/muscle_tab.h: here.
13007 (muscle_init): Initialize muscle_obstack.
13008 (muscle_free): New.
13009 * src/main.c (main): Call it.
13010
0c15323d
AD
130112002-06-14 Akim Demaille <akim@epita.fr>
13012
13013 * src/location.h: New, extracted from...
13014 * src/reader.h: here.
13015 * src/Makefile.am (noinst_HEADERS): Merge into
13016 (bison_SOURCES): this.
13017 Add location.h.
13018 * src/parse-gram.y: Use location_t instead of Bison's.
13019 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
13020 Use location_t instead of ints.
13021
e96c9728
AD
130222002-06-14 Akim Demaille <akim@epita.fr>
13023
13024 * data/bison.simple, data/bison.c++: Be sure to restore the
13025 current #line when returning to the skeleton contents after having
13026 exposed the input file's #line.
13027
75d1fe16
AD
130282002-06-12 Akim Demaille <akim@epita.fr>
13029
13030 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
13031 eager.
13032 * tests/actions.at (Exotic Dollars): New.
13033
6c35d22c
AD
130342002-06-12 Akim Demaille <akim@epita.fr>
13035
13036 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
13037 ['"/] too eagerly.
13038 * tests/input.at (Torturing the Scanner): New.
13039
1d6412ad
AD
130402002-06-11 Akim Demaille <akim@epita.fr>
13041
13042 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
13043 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
13044 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
13045 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
13046 * src/reader.c (reader): Use it.
13047
4cdb01db
AD
130482002-06-11 Akim Demaille <akim@epita.fr>
13049
13050 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
13051 Adjust all callers.
13052 (scanner_last_string_free): New.
13053
44995b2e
AD
130542002-06-11 Akim Demaille <akim@epita.fr>
13055
13056 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
13057 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
13058 (last_string, YY_OBS_FREE): New.
13059 Use them when returning an ID.
13060
e9955c83
AD
130612002-06-11 Akim Demaille <akim@epita.fr>
13062
13063 Have Bison grammars parsed by a Bison grammar.
13064
13065 * src/reader.c, src/reader.h (prologue_augment): New.
13066 * src/reader.c (copy_definition): Remove.
13067
13068 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
13069 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
13070 (grammar_current_rule_prec_set, grammar_current_rule_check)
13071 (grammar_current_rule_symbol_append)
13072 (grammar_current_rule_action_append): Export.
13073 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
13074 (symbol_list_action_append): Remove.
13075 Hook the routines from reader.
13076 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
13077 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
13078
13079 * src/reader.c (read_declarations): Remove, unused.
13080
13081 * src/parse-gram.y: Handle the epilogue.
13082 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
13083 (grammar_start_symbol_set): this.
13084 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
13085 * src/reader.c (readgram): Remove, unused.
13086 (reader): Adjust to insert eoftoken and axiom where appropriate.
13087
13088 * src/reader.c (copy_dollar): Replace with...
13089 * src/scan-gram.h (handle_dollar): this.
13090 * src/parse-gram.y: Remove `%thong'.
13091
13092 * src/reader.c (copy_at): Replace with...
13093 * src/scan-gram.h (handle_at): this.
13094
13095 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
13096 New.
13097
13098 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
13099 time being.
13100
13101 * src/reader.h, src/reader.c (grammar_rule_end): New.
13102
13103 * src/parse.y (current_type, current_class): New.
13104 Implement `%nterm', `%token' support.
13105 Merge `%term' into `%token'.
13106 (string_as_id): New.
13107 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
13108 type name.
13109
13110 * src/parse-gram.y: Be sure to handle properly the beginning of
13111 rules.
13112
13113 * src/parse-gram.y: Handle %type.
13114 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
13115
13116 * src/parse-gram.y: More directives support.
13117 * src/options.c: No longer handle source directives.
13118
13119 * src/parse-gram.y: Fix %output.
13120
13121 * src/parse-gram.y: Handle %union.
13122 Use the prologue locations.
13123 * src/reader.c (parse_union_decl): Remove.
13124
13125 * src/reader.h, src/reader.c (epilogue_set): New.
13126 * src/parse-gram.y: Use it.
13127
13128 * data/bison.simple, data/bison.c++: b4_stype is now either not
13129 defined, then default to int, or to the contents of %union,
13130 without `union' itself.
13131 Adjust.
13132 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
13133
13134 * src/output.c (actions_output): Don't output braces, as they are
13135 already handled by the scanner.
13136
13137 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
13138 characters to themselves.
13139
13140 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
13141 that the epilogue has a proper #line.
13142
13143 * src/parse-gram.y: Handle precedence/associativity.
13144
13145 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
13146 a terminal.
13147 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
13148 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
13149 at all to define terminals that cannot be emitted.
13150
13151 * src/scan-gram.l: Escape M4 characters.
13152
13153 * src/scan-gram.l: Working properly with escapes in user
13154 strings/characters.
13155
13156 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
13157 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
13158 grammar.
13159 Use more modest sizes, as for the time being the parser does not
13160 release memory, and therefore the process swallows a huge amount
13161 of memory.
13162
13163 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
13164 stricter %token grammar.
13165
13166 * src/symtab.h (associativity): Add `undef_assoc'.
13167 (symbol_precedence_set): Do nothing when passed an undef_assoc.
13168 * src/symtab.c (symbol_check_alias_consistence): Adjust.
13169
13170 * tests/regression.at (Invalid %directive): Remove, as it is now
13171 meaningless.
13172 (Invalid inputs): Adjust to the new error messages.
13173 (Token definitions): The new grammar doesn't allow too many
13174 eccentricities.
13175
13176 * src/lex.h, src/lex.c: Remove.
13177 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
13178 (copy_character, copy_string2, copy_string, copy_identifier)
13179 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
13180 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
13181 (parse_action): Remove.
13182 * po/POTFILES.in: Adjust.
13183
2e047461
AD
131842002-06-11 Akim Demaille <akim@epita.fr>
13185
cd05d13c 13186 * src/reader.c (parse_action): Don't store directly into the
2e047461
AD
13187 rule's action member: return the action as a string.
13188 Don't require `rule_length' as an argument: compute it.
13189 (grammar_current_rule_symbol_append)
13190 (grammar_current_rule_action_append): New, eved out from
13191 (readgram): here.
13192 Remove `action_flag', `rulelength', unused now.
13193
9af3fbce
AD
131942002-06-11 Akim Demaille <akim@epita.fr>
13195
13196 * src/reader.c (grammar_current_rule_prec_set).
13197 (grammar_current_rule_check): New, eved out from...
13198 (readgram): here.
13199 Remove `xaction', `first_rhs': useless.
13200 * tests/input.at (Type clashes): New.
13201 * tests/existing.at (GNU Cim Grammar): Adjust.
13202
1485e106
AD
132032002-06-11 Akim Demaille <akim@epita.fr>
13204
13205 * src/reader.c (grammar_midrule_action): New, Eved out from
13206 (readgram): here.
13207
da4160c3
AD
132082002-06-11 Akim Demaille <akim@epita.fr>
13209
13210 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
13211 New.
13212 (readgram): Use them as replacement of inlined code, crule and
13213 crule1.
13214
f6d0f937
AD
132152002-06-11 Akim Demaille <akim@epita.fr>
13216
13217 * src/reader.c (grammar_end, grammar_symbol_append): New.
13218 (readgram): Use them.
13219 Make the use of `p' as local as possible.
13220
69078d4b
AD
132212002-06-10 Akim Demaille <akim@epita.fr>
13222
13223 GCJ's parser requires the tokens to be defined before the prologue.
13224
13225 * data/bison.simple: Output the token definition before the user's
13226 prologue.
13227 * tests/regression.at (Braces parsing, Duplicate string)
13228 (Mixing %token styles): Check the output from bison.
13229 (Early token definitions): New.
13230
5e424082
AD
132312002-06-10 Akim Demaille <akim@epita.fr>
13232
13233 * src/symtab.c (symbol_user_token_number_set): Don't complain when
13234 assigning twice the same user number to a token, so that we can
13235 use it in...
13236 * src/lex.c (lex): here.
13237 Also use `symbol_class_set' instead of hand written code.
13238 * src/reader.c (parse_assoc_decl): Likewise.
13239
44536b35
AD
132402002-06-10 Akim Demaille <akim@epita.fr>
13241
13242 * src/symtab.c, src/symtab.c (symbol_class_set)
13243 (symbol_user_token_number_set): New.
13244 * src/reader.c (parse_token_decl): Use them.
13245 Use a switch instead of ifs.
13246 Use a single argument.
13247
8b9f2372
AD
132482002-06-10 Akim Demaille <akim@epita.fr>
13249
13250 Remove `%thong' support as it is undocumented, unused, duplicates
13251 `%token's job, and creates useless e-mail traffic with people who
13252 want to know what it is, why it is undocumented, unused, and
13253 duplicates `%token's job.
13254
13255 * src/reader.c (parse_thong_decl): Remove.
13256 * src/options.c (option_table): Remove "thong".
13257 * src/lex.h (tok_thong): Remove.
13258
3ae2b51f
AD
132592002-06-10 Akim Demaille <akim@epita.fr>
13260
13261 * src/symtab.c, src/symtab.c (symbol_type_set)
13262 (symbol_precedence_set): New.
13263 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
13264 (value_components_used): Remove, unused.
13265
2f1afb73
AD
132662002-06-09 Akim Demaille <akim@epita.fr>
13267
13268 Move symbols handling code out of the reader.
13269
13270 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
13271 (axiom): Move to...
13272 * src/symtab.h, src/symtab.c: here.
13273
13274 * src/gram.c (start_symbol): Remove: use startsymbol->number.
13275 * src/reader.c (startval): Rename as...
13276 * src/symtab.h, src/symtab.c (startsymbol): this.
13277 * src/reader.c: Adjust.
13278
13279 * src/reader.c (symbol_check_defined, symbol_make_alias)
13280 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
13281 (token_translations_init)
13282 Move to...
13283 * src/symtab.c: here.
13284 * src/reader.c (packsymbols): Move to...
13285 * src/symtab.h, src/symtab.c (symbols_pack): here.
13286 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
13287 argument.
13288
e9bca3ad
AD
132892002-06-03 Akim Demaille <akim@epita.fr>
13290
13291 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
13292 then statements.
13293
86eff183
AD
132942002-06-03 Akim Demaille <akim@epita.fr>
13295
13296 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
13297 structs with non literals.
13298 * src/scan-skel.l: never-interactive.
13299 * src/conflicts.c (enum conflict_resolution_e): No trailing
13300 comma.
13301 * src/getargs.c (usage): Split long literal strings.
13302 Reported by Hans Aberg.
13303
717be197
AD
133042002-05-28 Akim Demaille <akim@epita.fr>
13305
13306 * data/bison.c++: Use C++ ostreams.
13307 (cdebug_): New member.
13308
670ddffd
AD
133092002-05-28 Akim Demaille <akim@epita.fr>
13310
13311 * src/output.c (output_skeleton): Be sure to allocate enough room
13312 for `/' _and_ for `\0' in full_skeleton.
13313
769b430f
AD
133142002-05-28 Akim Demaille <akim@epita.fr>
13315
13316 * data/bison.c++: Catch up with bison.simple:
13317 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13318 and Paul Eggert <eggert@twinsun.com>: `error' handing.
13319 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
13320 and popping traces.
13321
7067cb36
PH
133222002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13323
13324 * src/output.c (output_skeleton): Put an explicit path in front of
13325 the skeleton file name, rather than relying on the -I directory,
13326 to partially alleviate effects of having a skeleton file lying around
13327 in the current directory.
769b430f 13328
4a713ec2
PH
133292002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13330
769b430f 13331 * src/conflicts.c (log_resolution): Correct typo:
4a713ec2
PH
13332 obstack_printf should be obstack_fgrow1.
13333
b408954b
AD
133342002-05-26 Akim Demaille <akim@epita.fr>
13335
13336 * src/state.h (state_t): `solved_conflicts' is a new member.
13337 * src/LR0.c (new_state): Set it to 0.
13338 * src/conflicts.h, src/conflicts.c (print_conflicts)
13339 (free_conflicts, solve_conflicts): Rename as...
13340 (conflicts_print, conflicts_free, conflicts_solve): these.
13341 Adjust callers.
13342 * src/conflicts.c (enum conflict_resolution_e)
13343 (solved_conflicts_obstack): New, used by...
13344 (log_resolution): this.
13345 Adjust to attach the conflict resolution to each state.
13346 Complete the description with the precedence/associativity
13347 information.
13348 (resolve_sr_conflict): Adjust.
13349 * src/print.c (print_state): Output its solved_conflicts.
13350 * tests/conflicts.at (Unresolved SR Conflicts)
13351 (Solved SR Conflicts): Exercise --report=all.
13352
a49aecd5
AD
133532002-05-26 Akim Demaille <akim@epita.fr>
13354
13355 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
13356 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
13357 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
13358 (token_number_t, item_number_as_token_number)
13359 (token_number_as_item_number, muscle_insert_token_number_table):
13360 Rename as...
13361 (symbol_number_t, item_number_as_symbol_number)
13362 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
13363 these, since it is more appropriate.
13364
5504898e
AD
133652002-05-26 Akim Demaille <akim@epita.fr>
13366
13367 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
13368 `Error:' lines.
13369 * data/bison.simple (yystos) [YYDEBUG]: New.
13370 (yyparse) [YYDEBUG]: Display the symbols which are popped during
13371 error recovery.
13372 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
13373
ec3bc396
AD
133742002-05-25 Akim Demaille <akim@epita.fr>
13375
13376 * doc/bison.texinfo (Debugging): Split into...
13377 (Tracing): this new section, its former contents, and...
13378 (Understanding): this new section.
13379 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
13380 by...
13381 (report_flag): this.
13382 Adjust all dependencies.
13383 (report_args, report_types, report_argmatch): New.
13384 (usage, getargs): Report/support -r, --report.
13385 * src/options.h
13386 (struct option_table_struct): Rename as..,
13387 (struct option_table_s): this.
13388 Rename the `set_flag' member to `flag' to match with getopt_long's
13389 struct.
13390 * src/options.c (option_table): Split verbose into an entry for
13391 %verbose, and another for --verbose.
13392 Support --report/-r, so remove -r from the obsolete --raw.
13393 * src/print.c: Attach full item sets and lookaheads reports to
13394 report_flag instead of trace_flag.
13395 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
13396
78df8250
PE
133972002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13398 and Paul Eggert <eggert@twinsun.com>
769b430f 13399
78df8250
PE
13400 * data/bison.simple (yyparse): Correct error handling to conform to
13401 POSIX and yacc. Specifically, after syntax error is discovered,
13402 do not reduce further before shifting the error token.
13403 Clean up the code a bit by removing the labels yyerrdefault,
13404 yyerrhandle, yyerrpop.
13405 * NEWS: Document the above.
13406
c0c9ea05
PH
134072002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13408
13409 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
13410 type; it isn't always big enough, since it doesn't necessarily
13411 include non-terminals.
769b430f 13412 (yytranslate): Expand definition of yy_token_number_type, so that
c0c9ea05
PH
13413 the latter can be removed.
13414 (yy_token_number_type): Remove, only one use.
13415 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
13416 don't use TokenNumberType as element type.
769b430f 13417
c0c9ea05
PH
13418 * tests/regression.at: Modify expected output to agree with change
13419 to yyr1 and yytranslate.
769b430f 13420
6390a83f
FK
134212002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
13422
13423 * src/reader.c (parse_action): Use copy_character instead of
13424 obstack_1grow.
13425
db7c8e9a
AD
134262002-05-13 Akim Demaille <akim@epita.fr>
13427
13428 * tests/regression.at (Token definitions): Prototype yylex and
13429 yyerror.
13430
fcc61800
PH
134312002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13432
158c687b 13433 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
fcc61800
PH
13434 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
13435 32-bit arithmetic.
13436 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
13437
5683e9b2
AD
134382002-05-07 Akim Demaille <akim@epita.fr>
13439
13440 * tests/synclines.at: Be sure to prototype yylex and yyerror to
13441 avoid GCC warnings.
13442
0c2d3f4c
AD
134432002-05-07 Akim Demaille <akim@epita.fr>
13444
13445 Kill GCC warnings.
13446
13447 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
13448 over the RHS of each rule.
13449 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
13450 * src/state.h (state_t): Member `nitems' is unsigned short.
13451 * src/LR0.c (get_state): Adjust.
13452 * src/reader.c (packgram): Likewise.
13453 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
13454 `Type'.
13455 (muscle_insert_int_table): Remove, unused.
13456 (prepare_rules): Remove `max'.
13457
1565b720
AD
134582002-05-06 Akim Demaille <akim@epita.fr>
13459
13460 * src/closure.c (print_firsts): Display of the symbol tags.
13461 (bitmatrix_print): Move to...
13462 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
13463 here.
13464 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
13465
cfaee611
AD
134662002-05-06 Akim Demaille <akim@epita.fr>
13467
13468 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
13469 hash_do_for_each.
13470
458be8e0
AD
134712002-05-06 Akim Demaille <akim@epita.fr>
13472
13473 * src/LR0.c (new_state, get_state): Instead of using the global
13474 `kernel_size' and `kernel_base', have two new arguments:
13475 `core_size' and `core'.
13476 Adjust callers.
13477
a900a624
AD
134782002-05-06 Akim Demaille <akim@epita.fr>
13479
13480 * src/reader.c (packgram): No longer end `ritem' with a 0
13481 sentinel: it is not used.
13482
d4e7d3a1
AD
134832002-05-05 Akim Demaille <akim@epita.fr>
13484
13485 New experimental feature: display the lookaheads in the report and
13486 graph.
13487
13488 * src/print (print_core): When --trace-flag, display the rules
13489 lookaheads.
13490 * src/print_graph.c (print_core): Likewise.
13491 Swap the arguments.
13492 Adjust caller.
13493
39ceb25b
AD
134942002-05-05 Akim Demaille <akim@epita.fr>
13495
13496 * tests/torture.at (Many lookaheads): New test.
13497
5372019f
AD
134982002-05-05 Akim Demaille <akim@epita.fr>
13499
13500 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
13501 (GENERATE_MUSCLE_INSERT_TABLE): this.
13502 (output_int_table, output_unsigned_int_table, output_short_table)
13503 (output_token_number_table, output_item_number_table): Replace with...
13504 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
13505 (muscle_insert_short_table, muscle_insert_token_number_table)
13506 (muscle_insert_item_number_table): these.
13507 Adjust all callers.
13508 (prepare_tokens): Don't free `translations', since...
13509 * src/reader.h, src/reader.c (grammar_free): do it.
13510 Move to...
13511 * src/gram.h, src/gram.c (grammar_free): here.
13512 * data/bison.simple, data/bison.c++: b4_token_number_max is now
13513 b4_translate_max.
13514
5df5f6d5
AD
135152002-05-05 Akim Demaille <akim@epita.fr>
13516
13517 * src/output.c (output_unsigned_int_table): New.
13518 (prepare_rules): `i' is unsigned.
13519 `prhs', `rline', `r2' are unsigned int.
13520 Rename muscle `rhs_number_max' as `rhs_max'.
13521 Output muscles `prhs_max', `rline_max', and `r2_max'.
13522 Free rline and r1.
13523 * data/bison.simple, data/bison.c++: Adjust to use these muscles
13524 to compute types instead of constant types.
13525 * tests/regression.at (Web2c Actions): Adjust.
13526
b87f8b21
AD
135272002-05-04 Akim Demaille <akim@epita.fr>
13528
13529 * src/symtab.h (SALIAS, SUNDEF): Rename as...
13530 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
13531 Adjust dependencies.
13532 * src/output.c (token_definitions_output): Be sure not to output a
13533 `#define 'a'' when fed with `%token 'a' "a"'.
13534 * tests/regression.at (Token definitions): New.
13535
8bb936e4
PE
135362002-05-03 Paul Eggert <eggert@twinsun.com>
13537
13538 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
13539 for K&R C.
13540
135412002-05-03 gettextize <bug-gnu-gettext@gnu.org>
13542
13543 * Makefile.am (SUBDIRS): Remove intl.
13544 (EXTRA_DIST): Add config/config.rpath.
13545
53c71a12
AD
135462002-05-03 Akim Demaille <akim@epita.fr>
13547
13548 * data/bison.simple (m4_if): Don't output empty enums.
13549 And actually, output valid enum definitions :(.
13550
289dd0cf
AD
135512002-05-03 Akim Demaille <akim@epita.fr>
13552
13553 * configure.bat: Remove, completely obsolete.
13554 * Makefile.am (EXTRA_DIST): Adjust.
13555 Don't distribute config.rpath...
13556 * config/Makefile.am (EXTRA_DIST): Do it.
13557
db85e524
AD
135582002-05-03 Akim Demaille <akim@epita.fr>
13559
13560 * configure.in (GETTEXT_VERSION): New.
13561 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
13562
83ccf991
AD
135632002-05-03 Akim Demaille <akim@epita.fr>
13564
13565 * data/bison.simple (b4_token_enum): New.
13566 (b4_token_defines): Use it to output tokens both as #define and
13567 enums.
13568 Suggested by Paul Eggert.
13569 * src/output.c (token_definitions_output): Don't output spurious
13570 white spaces.
13571
1f418995
AD
135722002-05-03 Akim Demaille <akim@epita.fr>
13573
13574 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
13575
45119f04
RA
135762002-05-02 Robert Anisko <robert@lrde.epita.fr>
13577
13578 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
13579 Update the stack class, give a try to deque as the default container.
13580
b2d52318
AD
135812002-05-02 Akim Demaille <akim@epita.fr>
13582
13583 * data/bison.simple (yyparse): Do not implement @$ = @1.
13584 (YYLLOC_DEFAULT): Adjust to do it.
13585 * doc/bison.texinfo (Location Default Action): Fix.
13586
3a8b4109
AD
135872002-05-02 Akim Demaille <akim@epita.fr>
13588
13589 * src/reader.c (parse_braces): Merge into...
13590 (parse_action): this.
13591
84614e13
AD
135922002-05-02 Akim Demaille <akim@epita.fr>
13593
13594 * configure.in (ALL_LINGUAS): Remove.
13595 * po/LINGUAS, hr.po: New.
13596
fdbcd8e2
AD
135972002-05-02 Akim Demaille <akim@epita.fr>
13598
13599 Remove the so called hairy (semantic) parsers.
13600
13601 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
13602 * src/gram.h, src/gram.c (semantic_parser): Remove.
13603 (rule_t): Remove the guard and guard_line members.
13604 * src/lex.h (token_t): remove tok_guard.
13605 * src/options.c (option_table): Remove %guard and %semantic_parser
13606 support.
13607 * src/output.c, src/output.h (guards_output): Remove.
13608 (prepare): Adjust.
13609 (token_definitions_output): Don't output the `T'
13610 tokens (???).
13611 (output_skeleton): Don't output the guards.
13612 * src/files.c, src/files.c (attrsfile): Remove.
13613 * src/reader.c (symbol_list): Remove the guard and guard_line
13614 members.
13615 Adjust dependencies.
13616 (parse_guard): Remove.
13617 * data/bison.hairy: Remove.
13618 * doc/bison.texinfo (Environment Variables): Remove occurrences of
13619 BISON_HAIRY.
13620
82b6cb3f
AD
136212002-05-02 Akim Demaille <akim@epita.fr>
13622
13623 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
13624 (parse_guard): Rename the formal argument `stack_offset' as
13625 `rule_length', which is more readable.
13626 Adjust callers.
13627 (copy_at, copy_dollar): Instead of outputting the hard coded
13628 values of $$, $n and so forth, output invocation to b4_lhs_value,
13629 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
900c877b
AD
13630 Note: this patch partially drops `semantic-parser' support: it
13631 always does `rule_length - n', where semantic parsers ought to
13632 always use `-n'.
82b6cb3f
AD
13633 * data/bison.simple, data/bison.c++ (b4_lhs_value)
13634 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
13635
6cbfbcc5
AD
136362002-05-02 Akim Demaille <akim@epita.fr>
13637
13638 * configure.in (AC_INIT): Bump to 1.49b.
13639 (AM_INIT_AUTOMAKE): Short invocation.
13640
b8548114
AD
136412002-05-02 Akim Demaille <akim@epita.fr>
13642
13643 Version 1.49a.
13644
c20cd1fa
AD
136452002-05-01 Akim Demaille <akim@epita.fr>
13646
13647 * src/skeleton.h: Remove.
13648
8a9566d4
AD
136492002-05-01 Akim Demaille <akim@epita.fr>
13650
13651 * src/skeleton.h: Fix the #endif.
13652 Reported by Magnus Fromreide.
13653
8c6d399a
PE
136542002-04-26 Paul Eggert <eggert@twinsun.com>
13655
13656 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
13657 Define if we define YYSTYPE and YYLTYPE, respectively.
b756bb75 13658 (YYCOPY): Fix [] quoting problem in the non-GCC case.
8a9566d4 13659
2b7ed18a
RA
136602002-04-25 Robert Anisko <robert@lrde.epita.fr>
13661
13662 * src/scan-skel.l: Postprocess quadrigraphs.
13663
13664 * src/reader.c (copy_character): New function, used to output
13665 single characters while replacing `[' and `]' with quadrigraphs, to
13666 avoid troubles with M4 quotes.
13667 (copy_comment): Output characters with copy_character.
13668 (read_additionnal_code): Likewise.
13669 (copy_string2): Likewise.
13670 (copy_definition): Likewise.
13671
13672 * tests/calc.at: Exercise M4 quoting.
13673
34a89c50
AD
136742002-04-25 Akim Demaille <akim@epita.fr>
13675
13676 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
13677 between `!' and the command.
13678 Reported by Paul Eggert.
13679
0dd1580a
RA
136802002-04-24 Robert Anisko <robert@lrde.epita.fr>
13681
13682 * tests/calc.at: Exercise prologue splitting.
13683
13684 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
13685 `b4_post_prologue' instead of `b4_prologue'.
13686
13687 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
13688 muscles.
13689 (output): Free pre_prologue_obstack and post_prologue_obstack.
13690 * src/files.h, src/files.c (attrs_obstack): Remove.
13691 (pre_prologue_obstack, post_prologue_obstack): New.
13692 * src/reader.c (copy_definition): Add a parameter to specify the
13693 obstack to fill, instead of using attrs_obstack unconditionally.
13694 (read_declarations): Pass pre_prologue_obstack to copy_definition if
13695 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
13696
83c1796f
PE
136972002-04-23 Paul Eggert <eggert@twinsun.com>
13698
13699 * data/bison.simple: Remove unnecessary commentary and white
13700 space differences from 1_29-branch.
13701 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
13702
13703 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
13704 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
13705 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
13706 constructors or destructors.
13707
13708 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
13709
1207eeac
AD
137102002-04-23 Akim Demaille <akim@epita.fr>
13711
13712 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
13713 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
13714 location with columns.
13715 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
13716 All reported by Paul Eggert.
13717
78ab8f67
AD
137182002-04-22 Akim Demaille <akim@epita.fr>
13719
13720 * src/reduce.c (dump_grammar): Move to...
13721 * src/gram.h, src/gram.c (grammar_dump): here.
13722 Be sure to separate long item numbers.
13723 Don't read the members of a rule's prec if its nil.
13724
133c20e2
AD
137252002-04-22 Akim Demaille <akim@epita.fr>
13726
13727 * src/output.c (table_size, table_grow): New.
13728 (MAXTABLE): Remove, replace uses with table_size.
13729 (pack_vector): Instead of dying when the table is too big, grow it.
13730
9515e8a7
AD
137312002-04-22 Akim Demaille <akim@epita.fr>
13732
13733 * data/bison.simple (yyr1): Its type is that of a token number.
13734 * data/bison.c++ (r1_): Likewise.
13735 * tests/regression.at (Web2c Actions): Adjust.
13736
23c5a174
AD
137372002-04-22 Akim Demaille <akim@epita.fr>
13738
13739 * src/reader.c (token_translations_init): 256 is now the default
13740 value for the error token, i.e., it will be assigned another
13741 number if the user assigned 256 to one of her tokens.
13742 (reader): Don't force 256 to error.
13743 * doc/bison.texinfo (Symbols): Adjust.
13744 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
13745 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
13746 etc. instead of 10, 20, 30 (which was used to `jump' over error
13747 (256) and undefined (2)).
13748
5fbb0954
AD
137492002-04-22 Akim Demaille <akim@epita.fr>
13750
13751 Propagate more token_number_t.
13752
13753 * src/gram.h (token_number_as_item_number)
13754 (item_number_as_token_number): New.
13755 * src/output.c (GENERATE_OUTPUT_TABLE): New.
13756 Use it to create output_item_number_table and
13757 output_token_number_table.
13758 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
13759 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
13760 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
13761 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
13762
4f940944
AD
137632002-04-22 Akim Demaille <akim@epita.fr>
13764
13765 * src/output.h, src/output.c (get_lines_number): Remove.
13766
3ded9a63
AD
137672002-04-19 Akim Demaille <akim@epita.fr>
13768
13769 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
13770 as Lex/Flex'.
13771 (Debugging): More details about enabling the debugging features.
13772 (Table of Symbols): Describe $$, $n, @$, and @n.
13773 Suggested by Tim Josling.
13774
e0c471a9
AD
137752002-04-19 Akim Demaille <akim@epita.fr>
13776
13777 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
13778
fecc10cd
AD
137792002-04-10 Akim Demaille <akim@epita.fr>
13780
13781 * src/system.h: Rely on HAVE_LIMITS_H.
13782 Suggested by Paul Eggert.
13783
51dec47b
AD
137842002-04-09 Akim Demaille <akim@epita.fr>
13785
13786 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
13787 full stderr, and strip it according to the bison options, instead
13788 of composing the error message from different bits.
13789 This makes it easier to check for several error messages.
13790 Adjust all the invocations.
13791 Add an invocation exercising the error token.
13792 Add an invocation demonstrating a stupid error message.
13793 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
13794 Adjust the tests.
13795 Error message are for stderr, not stdout.
13796
007a50a4
AD
137972002-04-09 Akim Demaille <akim@epita.fr>
13798
13799 * src/gram.h, src/gram.c (error_token_number): Remove, use
13800 errtoken->number.
13801 * src/reader.c (reader): Don't specify the user token number (2)
13802 for $undefined, as it uselessly prevents using it.
13803 * src/gram.h (token_number_t): Move to...
13804 * src/symtab.h: here.
13805 (state_t.number): Is a token_number_t.
13806 * src/print.c, src/reader.c: Use undeftoken->number instead of
13807 hard coded 2.
13808 (Even though this 2 is not the same as above: the number of the
13809 undeftoken remains being 2, it is its user token number which
13810 might not be 2).
13811 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
13812 `user_token_number_max'.
13813 Output `undef_token_number'.
13814 * data/bison.simple, data/bison.c++: Use them.
13815 Be sure to map invalid yylex return values to
13816 `undef_token_number'. This saves us from gratuitous SEGV.
13817
13818 * tests/conflicts.at (Solved SR Conflicts)
13819 (Unresolved SR Conflicts): Adjust.
13820 * tests/regression.at (Web2c Actions): Adjust.
13821
06446ccf
AD
138222002-04-08 Akim Demaille <akim@epita.fr>
13823
13824 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
13825 Adding #line.
13826 Remove the duplicate `typedefs'.
13827 (RhsNumberType): Fix the declaration and various other typos.
13828 Use __ofile__.
13829 * data/bison.simple: Use __ofile__.
13830 * src/scan-skel.l: Handle __ofile__.
13831
62a3e4f0
AD
138322002-04-08 Akim Demaille <akim@epita.fr>
13833
13834 * src/gram.h (item_number_t): New, the type of item numbers in
13835 RITEM. Note that it must be able to code symbol numbers as
13836 positive number, and the negation of rule numbers as negative
13837 numbers.
13838 Adjust all dependencies (pretty many).
13839 * src/reduce.c (rule): Remove this `short *' pointer: use
13840 item_number_t.
13841 * src/system.h (MINSHORT, MAXSHORT): Remove.
13842 Include `limits.h'.
13843 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
13844 (shortcpy): Remove.
13845 (MAXTABLE): Move to...
13846 * src/output.c (MAXTABLE): here.
13847 (prepare_rules): Use output_int_table to output rhs.
13848 * data/bison.simple, data/bison.c++: Adjust.
13849 * tests/torture.at (Big triangle): Move the limit from 254 to
13850 500.
13851 * tests/regression.at (Web2c Actions): Ajust.
13852
13853 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
13854 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
13855 passes, but produces negative #line number, once fixed, GCC is
13856 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
13857 C), it passes.
13858 * src/state.h (state_h): Code input lines on ints, not shorts.
13859
bb88b0fc
AD
138602002-04-08 Akim Demaille <akim@epita.fr>
13861
13862 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
13863 and then the grammar.
13864
9a636f47
AD
138652002-04-08 Akim Demaille <akim@epita.fr>
13866
13867 * src/system.h: No longer using strndup.
13868
680e8701
AD
138692002-04-07 Akim Demaille <akim@epita.fr>
13870
13871 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
13872 * src/output.c (output_table_data): Return the longest number.
13873 (prepare_tokens): Output `token_number_max').
13874 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
13875 New.
13876 Use them to define yy_token_number_type/TokenNumberType.
13877 Use this type for yytranslate.
13878 * tests/torture.at (Big triangle): Push the limit from 124 to
13879 253.
13880 * tests/regression.at (Web2c Actions): Adjust.
13881
817e9f41
AD
138822002-04-07 Akim Demaille <akim@epita.fr>
13883
13884 * tests/torture.at (Big triangle): New.
13885 (GNU AWK Grammar, GNU Cim Grammar): Move to...
13886 * tests/existing.at: here.
13887
5123689b
AD
138882002-04-07 Akim Demaille <akim@epita.fr>
13889
13890 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
13891 nritems.
13892 Adjust dependencies.
13893
f3849179
AD
138942002-04-07 Akim Demaille <akim@epita.fr>
13895
13896 * src/reader.c: Normalize increments to prefix form.
13897
bd02036a
AD
138982002-04-07 Akim Demaille <akim@epita.fr>
13899
13900 * src/reader.c, symtab.c: Remove debugging code.
13901
db8837cb
AD
139022002-04-07 Akim Demaille <akim@epita.fr>
13903
13904 Rename all the `bucket's as `symbol_t'.
13905
13906 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
13907 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
13908 * src/symtab.c, src/symtab.h (bucket): Rename as...
13909 (symbol_t): this.
13910 (symbol_list_new, bucket_check_defined, bucket_make_alias)
13911 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
13912 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
13913 (buckets_new, buckets_free, buckets_do): Rename as...
13914 (symbol_list_new, symbol_check_defined, symbol_make_alias)
13915 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
13916 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
13917 (symbols_new, symbols_free, symbols_do): these.
13918
72a23c97
AD
139192002-04-07 Akim Demaille <akim@epita.fr>
13920
13921 Use lib/hash for the symbol table.
13922
13923 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
13924 EOF.
13925 * src/lex.c (lex): Set the `number' member of new terminals.
13926 * src/reader.c (bucket_check_defined, bucket_make_alias)
13927 (bucket_check_alias_consistence, bucket_translation): New.
13928 (reader, grammar_free, readgram, token_translations_init)
13929 (packsymbols): Adjust.
13930 (reader): Number the predefined tokens.
13931 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
13932 for predefined tokens.
13933 * src/symtab.h (bucket): Remove all the hash table related
13934 members.
13935 * src/symtab.c (symtab): Replace by...
13936 (bucket_table): this.
13937 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
13938 (buckets_new, buckets_do): New.
13939
280a38c3
AD
139402002-04-07 Akim Demaille <akim@epita.fr>
13941
13942 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
13943 (start_symbol, max_user_token_number, semantic_parser)
13944 (error_token_number): Initialize.
13945 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
13946 Initialize.
13947 (reader): Don't.
13948 (errtoken, eoftoken, undeftoken, axiom): Extern.
13949
03b31c0c
AD
139502002-04-07 Akim Demaille <akim@epita.fr>
13951
13952 * src/gram.h (rule_s): prec and precsym are now pointers
13953 to the bucket giving the priority/associativity.
13954 Member `associativity' removed: useless.
13955 * src/reduce.c, src/conflicts.c: Adjust.
13956
8b3df748
AD
139572002-04-07 Akim Demaille <akim@epita.fr>
13958
13959 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
13960 Properly escape the symbols' TAG when outputting them.
13961
e601aa1d
AD
139622002-04-07 Akim Demaille <akim@epita.fr>
13963
13964 * src/lalr.h (LA): Is a bitsetv, not bitset*.
13965
b0299a2e
AD
139662002-04-07 Akim Demaille <akim@epita.fr>
13967
13968 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
13969 (LArule): this, which is an array to rule_t*.
13970 * src/print.c, src/conflicts.c: Adjust.
13971
d7e1f00c
AD
139722002-04-07 Akim Demaille <akim@epita.fr>
13973
13974 * src/gram.h (rule_t): Rename `number' as `user_number'.
13975 `number' is a new member.
13976 Adjust dependencies.
13977 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
13978
cc9305dd
AD
139792002-04-07 Akim Demaille <akim@epita.fr>
13980
13981 As a result of the previous patch, it is no longer needed
13982 to reorder ritem itself.
13983
13984 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
13985
b0940840
AD
139862002-04-07 Akim Demaille <akim@epita.fr>
13987
13988 Be sure never to walk through RITEMS, but use only data related to
13989 the rules themselves. RITEMS should be banished.
13990
13991 * src/output.c (output_token_translations): Rename as...
13992 (prepare_tokens): this.
13993 In addition to `translate', prepare the muscles `tname' and
13994 `toknum', which were handled by...
13995 (output_rule_data): this.
13996 Remove, and move the remainder of its outputs into...
13997 (prepare_rules): this new routines, which also merges content from
13998 (output_gram): this.
13999 (prepare_rules): Be sure never to walk through RITEMS.
14000 (output_stos): Rename as...
14001 (prepare_stos): this.
14002 (output): Always invoke prepare_states, after all, just don't use it
14003 in the output if you don't need it.
14004
643a5994
AD
140052002-04-07 Akim Demaille <akim@epita.fr>
14006
14007 * src/LR0.c (new_state): Display `nstates' as the name of the
14008 newly created state.
14009 Adjust to initialize first_state and last_state if needed.
14010 Be sure to distinguish the initial from the final state.
14011 (new_states): Create the itemset of the initial state, and use
14012 new_state.
14013 * src/closure.c (closure): Now that the initial state has its
14014 items properly set, there is no need for a special case when
14015 creating `ruleset'.
14016
14017 As a result, now the rule 0, reducing to $axiom, is visible in the
14018 outputs. Adjust the test suite.
14019
14020 * tests/conflicts.at (Solved SR Conflicts)
14021 (Unresolved SR Conflicts): Adjust.
14022 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
14023 * tests/conflicts.at (S/R in initial): New.
14024
b4c4ccc2
AD
140252002-04-07 Akim Demaille <akim@epita.fr>
14026
14027 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
14028 the RHS of the rules.
14029 * src/output.c (output_gram): Likewise.
14030
bba97eb2
AD
140312002-04-07 Akim Demaille <akim@epita.fr>
14032
14033 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
14034 bucket.
14035 Adjust all dependencies.
14036 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
14037 `number' of the buckets too.
14038 * src/gram.h: Include `symtab.h'.
14039 (associativity): Move to...
14040 * src/symtab.h: here.
14041 No longer include `gram.h'.
14042
c3b407f4
AD
140432002-04-07 Akim Demaille <akim@epita.fr>
14044
14045 * src/gram.h, src/gram.c (rules_rhs_length): New.
14046 (ritem_longest_rhs): Use it.
14047 * src/gram.h (rule_t): `number' is a new member.
14048 * src/reader.c (packgram): Set it.
14049 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
14050 the end of `rules', and count them out of `nrules'.
14051 (reduce_output, dump_grammar): Adjust.
14052 * src/print.c (print_grammar): It is no longer needed to check for
14053 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
14054 * tests/reduce.at (Reduced Automaton): New test.
14055
11652ab3
AD
140562002-04-07 Akim Demaille <akim@epita.fr>
14057
14058 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
14059 lacking `+ 1' to nrules, Bison reported as useless a token if it
14060 was used solely to set the precedence of the last rule...
14061
26b23c1a
AD
140622002-04-07 Akim Demaille <akim@epita.fr>
14063
14064 * data/bison.c++, data/bison.simple: Don't output the current file
14065 name in #line, to avoid useless diffs between two identical
14066 outputs under different names.
14067
18bcecb0
AD
140682002-04-07 Akim Demaille <akim@epita.fr>
14069
14070 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
14071 Normalize loops to using `< nrules + 1', not `<= nrules'.
14072
fa770c86
AD
140732002-04-07 Akim Demaille <akim@epita.fr>
14074
14075 * TODO: Update.
14076
d9b739c3
AD
140772002-04-07 Akim Demaille <akim@epita.fr>
14078
14079 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
14080 bucket.value as bucket.number.
14081
99013900
AD
140822002-04-07 Akim Demaille <akim@epita.fr>
14083
14084 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
14085 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
14086 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
14087 RHS, instead of being an index in RITEMS.
14088
e966383b
PE
140892002-04-04 Paul Eggert <eggert@twinsun.com>
14090
14091 * doc/bison.texinfo: Update copyright date.
14092 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
14093 (Symbols): Warn about running Bison in one character set,
14094 but compiling and/or running in an incompatible one.
14095 Warn about character code 256, too.
14096
140972002-04-03 Paul Eggert <eggert@twinsun.com>
14098
14099 * src/bison.data (YYSTACK_ALLOC): Depend on whether
14100 YYERROR_VERBOSE is nonzero, not whether it is defined.
14101
14102 Merge changes from bison-1_29-branch.
c307773e 14103
8d6c48b9
PE
141042002-03-20 Paul Eggert <eggert@twinsun.com>
14105
14106 Merge fixes from Debian bison_1.34-1.diff.
14107
14108 * configure.in (AC_PREREQ): 2.53.
14109
e53c6322
AD
141102002-03-20 Akim Demaille <akim@epita.fr>
14111
14112 * src/conflicts.c (log_resolution): Argument `resolution' is const.
14113
9ffbeca7
PE
141142002-03-19 Paul Eggert <eggert@twinsun.com>
14115
21db0b2a
PE
14116 * src/bison.simple (YYCOPY): New macro.
14117 (YYSTACK_RELOCATE): Use it.
14118 Remove Type arg; no longer needed. All callers changed.
14119 (yymemcpy): Remove; no longer needed.
14120
9ffbeca7
PE
14121 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
14122 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
14123
642cb8f8
AD
141242002-03-19 Akim Demaille <akim@epita.fr>
14125
14126 Test and fix the #line outputs.
14127
14128 * tests/atlocal.at (GCC): New.
14129 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
0ffd4fd1 14130 (Prologue synch line, %union synch line, Postprologue synch line)
642cb8f8
AD
14131 (Action synch line, Epilogue synch line): New tests.
14132 * src/reader.c (parse_union_decl): Define the muscle stype_line.
14133 * data/bison.simple, data/bison.c++: Use it.
14134
3c31a486
AD
141352002-03-19 Akim Demaille <akim@epita.fr>
14136
14137 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
14138 (Solved SR Conflicts, %expect not enough, %expect right)
14139 (%expect too much): Move to...
14140 * tests/conflicts.at: this new file.
14141
0d8bed56
AD
141422002-03-19 Akim Demaille <akim@epita.fr>
14143
14144 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
14145 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
14146 that we can move to enums for instance.
14147 * src/output.c (token_definitions_output): Output a list of
14148 `token-name, token-number' instead of the #define.
14149 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
14150
9208d17f
AD
141512002-03-14 Akim Demaille <akim@epita.fr>
14152
14153 Use Gettext 0.11.1.
14154
af27eacb
RA
141552002-03-09 Robert Anisko <robert@lrde.epita.fr>
14156
14157 * data/bison.c++: Make the user able to add members to the generated
14158 parser by subclassing.
14159
9101a310
RA
141602002-03-05 Robert Anisko <robert@lrde.epita.fr>
14161
14162 * src/reader.c (read_additionnal_code): `c' should be an integer, not
14163 a character.
14164 Reported by Nicolas Tisserand and Nicolas Burrus.
14165
fff9bf0b
RA
141662002-03-04 Robert Anisko <robert@lrde.epita.fr>
14167
14168 * src/reader.c: Warn about lacking semi-colons, do not complain.
14169
64dba31e
RA
141702002-03-04 Robert Anisko <robert@lrde.epita.fr>
14171
14172 * data/bison.c++: Remove a debug line.
14173
374f5a14
RA
141742002-03-04 Robert Anisko <robert@lrde.epita.fr>
14175
14176 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
14177 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
14178 provide a default implementation.
14179
bfcf1f3a
AD
141802002-03-04 Akim Demaille <akim@epita.fr>
14181
14182 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
14183 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
14184 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
14185 * tests/semantic.at (Parsing Guards): Similarly.
14186 * src/reader.at (readgram): Complain if the last rule is not ended
14187 with a semi-colon.
14188
65ccf9fc
AD
141892002-03-04 Akim Demaille <akim@epita.fr>
14190
14191 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
14192 * src/closure.c: here.
14193 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
14194 RTC.
14195 * src/warshall.h, src/warshall.c: Remove.
14196 * tests/sets.at (Broken Closure): Adjust.
14197
d0039cbc
AD
141982002-03-04 Akim Demaille <akim@epita.fr>
14199
14200 * src/output.c (output_skeleton): tempdir is const.
14201 bytes_read is unused.
14202
345cea78
AD
142032002-03-04 Akim Demaille <akim@epita.fr>
14204
14205 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
14206 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
14207 Update.
14208 From Michael Hayes.
14209
564801f7
AD
142102002-03-04 Akim Demaille <akim@epita.fr>
14211
14212 * src/closure.c (closure): `r' is unused.
14213
e5352bc7
AD
142142002-03-04 Akim Demaille <akim@epita.fr>
14215
14216 * tests/sets.at (Broken Closure): Add the ending `;'.
14217 * src/reader.at (readgram): Complain if a rule is not ended with a
14218 semi-colon.
14219
914feea9
AD
142202002-03-04 Akim Demaille <akim@epita.fr>
14221
14222 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
14223 (count_sr_conflicts): Use bitset_count.
14224 * src/reduce.c (inaccessable_symbols): Ditto.
14225 (bits_size): Remove.
14226 * src/warshall.h, src/warshall.c: Convert to bitsetv.
14227
f0250de6
AD
142282002-03-04 Akim Demaille <akim@epita.fr>
14229
14230 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
14231 * src/reduce.c: Remove the `bitset_zero's following the
14232 `bitset_create's, as now it is performed by the latter.
14233
ef017502
AD
142342002-03-04 Akim Demaille <akim@epita.fr>
14235
14236 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
14237 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
14238 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
14239 latest sources from Michael.
14240
76514394
AD
142412002-03-04 Akim Demaille <akim@epita.fr>
14242
14243 * src/output.c (output): Don't free the grammar.
14244 * src/reader.c (grammar_free): New.
14245 * src/main.c (main): Call it and don't free symtab here.
14246
55024580
AD
142472002-03-04 Akim Demaille <akim@epita.fr>
14248
14249 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
14250 before returning.
14251 Reported by Benoit Perrot.
14252
f9abaa2c
AD
142532002-03-04 Akim Demaille <akim@epita.fr>
14254
14255 Use bitset operations when possible, not loops over bits.
14256
14257 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
14258 bitset_or.
14259 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
14260 * src/reduce.c (useless_nonterminals): Formatting changes.
14261 * src/warshall.c (TC): Use bitset_or.
14262
0e721e75
AD
142632002-03-04 Akim Demaille <akim@epita.fr>
14264
14265 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
14266 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
14267 Ditto.
14268
0fb1ffb1
AD
142692002-03-04 Akim Demaille <akim@epita.fr>
14270
14271 * src/lalr.c (F): Now a bitset*.
14272 Adjust all dependencies.
14273
b86796bf
AD
142742002-03-04 Akim Demaille <akim@epita.fr>
14275
14276 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
14277 Adjust all dependencies.
14278
602bbf31
AD
142792002-03-04 Akim Demaille <akim@epita.fr>
14280
14281 * src/L0.c, src/LR0.h (nstates): Be size_t.
14282 Adjust comparisons (signed vs unsigned).
14283 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
14284 bitset*.
14285 Adjust all dependencies.
14286
d8a0245c
AD
142872002-03-04 Akim Demaille <akim@epita.fr>
14288
14289 * src/closure.c (firsts): Now, also a bitset.
14290 Adjust all dependencies.
14291 (varsetsize): Remove, now unused.
14292 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
14293
34ba9743
AD
142942002-03-04 Akim Demaille <akim@epita.fr>
14295
14296 * src/print.c: Convert to use bitset.h, not hand coded iterations
14297 over ints.
14298
ed86e78c
AD
142992002-03-04 Akim Demaille <akim@epita.fr>
14300
14301 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
14302
dfdb1797
AD
143032002-03-04 Akim Demaille <akim@epita.fr>
14304
14305 * src/closure.c (ruleset): Be a bitset.
14306 (rulesetsize): Remove.
14307
7086e707
AD
143082002-03-04 Akim Demaille <akim@epita.fr>
14309
14310 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
14311 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
14312 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
14313 * src/closure.c (fderives): Be an array of bitsets.
14314
98254360
RA
143152002-02-28 Robert Anisko <robert@lrde.epita.fr>
14316
14317 * data/bison.c++: Merge the two generated headers. Insert a copyright
14318 notice in each output file.
14319
a75c057f
AD
143202002-02-28 Akim Demaille <akim@epita.fr>
14321
14322 * data/bison.c++: Copy the prologue of bison.simple to fetch
14323 useful M4 definitions, such as b4_header_guard.
14324
06b00abc
AD
143252002-02-25 Akim Demaille <akim@epita.fr>
14326
14327 * src/getargs.c (version): Give the name of the authors, and use a
a75c057f
AD
14328 translator friendly scheme for the bgr
14329 copyright notice.
06b00abc 14330
70e7d534
AD
143312002-02-25 Akim Demaille <akim@epita.fr>
14332
14333 * src/output.c (header_output): Remove, now handled completely via
14334 M4.
14335
abe017f6
AD
143362002-02-25 Akim Demaille <akim@epita.fr>
14337
14338 * m4/m4.m4: New, from CVS Autoconf.
14339 * configure.in: Invoke it.
14340 * src/output.c (output_skeleton): Use its result instead of the
14341 hard coded name.
14342
381fb12e
AD
143432002-02-25 Akim Demaille <akim@epita.fr>
14344
14345 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
14346 Fileutils 4.1.5.
14347 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
14348 * src/output.c (output_skeleton): Use mkstemp to create a real
14349 temporary file.
14350 Move the filling of `skeleton' and its muscle to...
14351 (prepare): here.
14352 (output): Move the definition of the prologue muscle to...
14353 (prepare): here.
14354 * src/system.h (DEFAULT_TMPDIR): New.
14355
6f38107f
PE
143562002-02-14 Paul Eggert <eggert@twinsun.com>
14357
14358 Remove the support for C++ namespace cleanliness; it was
14359 causing more problems than it was curing, since it didn't work
14360 properly on some nonstandard C++ compilers. This can wait
14361 for a proper C++ parser.
14362
14363 * NEWS: Document this.
14364 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
14365 of C++, as it's treated like C now.
14366 * src/bison.simple (YYSTD): Remove.
14367 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
14368 Treat C++ just like Standard C instead of trying to support
14369 namespace cleanliness.
14370
80cce3da
AD
143712002-02-14 Akim Demaille <akim@epita.fr>
14372
14373 * tests/regression.at (else): Adjust to Andreas' change.
14374
842e8679
AD
143752002-02-14 Akim Demaille <akim@epita.fr>
14376
14377 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
14378
4bda3f10
AD
143792002-02-13 Andreas Schwab <schwab@suse.de>
14380
14381 * src/output.c (output_rule_data): Don't output NULL, it might
14382 not be defined yet.
14383
4162fa07 143842002-02-11 Robert Anisko <robert@lrde.epita.fr>
b418ecd8 14385
4162fa07
RA
14386 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
14387 (Copyright notice): Update.
b418ecd8 14388
bd16a5dc
AD
143892002-02-11 Akim Demaille <akim@epita.fr>
14390
14391 * tests/regression.at (%nonassoc and eof): Don't include
14392 nonportable headers.
14393
8d69a1a3
RA
143942002-02-08 Robert Anisko <robert@lrde.epita.fr>
14395
14396 * data/bison.c++: Correct error recovery. Make the user able to
14397 initialize the starting location.
14398
9b2d0677
AD
143992002-02-07 Akim Demaille <akim@epita.fr>
14400
14401 * tests/input.at: New.
14402
69e2658b
RA
144032002-02-07 Robert Anisko <robert@lrde.epita.fr>
14404
14405 * data/bison.c++: Replace some direct m4 expansions by constants. Be
9b2d0677 14406 more consistent when naming methods and variables. Put preprocessor
69e2658b
RA
14407 directives around tables only needed for debugging.
14408
4aacc3a7
RA
144092002-02-07 Robert Anisko <robert@lrde.epita.fr>
14410
14411 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
14412 C++ parsers.
14413 (yy::b4_name::parse): Use print_.
14414
762a801e
RA
144152002-02-07 Robert Anisko <robert@lrde.epita.fr>
14416
14417 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
14418
4bb2bc3f
RA
144192002-02-07 Robert Anisko <robert@lrde.epita.fr>
14420
14421 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
14422 C++ parsers.
14423 (yy::b4_name::parse): Build verbose error messages, and use error_.
14424
6b45a3ca
RA
144252002-02-06 Robert Anisko <robert@lrde.epita.fr>
14426
14427 * data/bison.c++: Fix m4 quoting in comments.
14428
50997c6e
RA
144292002-02-06 Robert Anisko <robert@lrde.epita.fr>
14430
14431 * data/bison.c++: Adjust the parser code. Fix some muscles that were
14432 not expanded by m4.
14433
3f3eed27
AD
144342002-02-05 Akim Demaille <akim@epita.fr>
14435
14436 * data/bison.c++: Adjust to the M4 back end.
14437 More is certainly needed.
14438
be2a1a68
AD
144392002-02-05 Akim Demaille <akim@epita.fr>
14440
14441 Give a try to M4 as a back end.
14442
14443 * lib/readpipe.c: New, from wdiff.
14444 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
14445 BISON_HAIRY.
14446 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
14447 specific values. Now it is m4 that performs the lookup.
14448 * src/parse-skel.y: Remove.
14449 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
14450 * src/output.c (actions_output, guards_output)
14451 (token_definitions_output): No longer keeps track of the output
14452 line number, hence remove the second argument.
14453 (guards_output): Check against the guard member of a rule, not the
14454 action member.
14455 Adjust callers.
14456 (output_skeleton): Don't look for the skeleton location, let m4 do
14457 that.
14458 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
14459 file will be used.
14460 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
14461 (prepare): Given that for the time being changesyntax is not
14462 usable in M4, rename the muscles using `-' to `_'.
14463 Define `defines_flag', `output_parser_name' and `output_header_name'.
14464 * src/output.h (actions_output, guards_output)
14465 (token_definitions_output): Adjust prototypes.
14466 * src/scan-skel.l: Instead of scanning the skeletons, it now
14467 processes the output of m4: `__oline__' and `#output'.
14468 * data/bison.simple: Adjust to be used by M4(sugar).
14469 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
14470 to date.
14471 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
14472 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
14473 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
14474 shamelessly stolen from CVS Autoconf.
14475
beda758b
AD
144762002-02-05 Akim Demaille <akim@epita.fr>
14477
14478 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
14479 * configure.in: Check for the declarations of free and malloc.
14480 * src/muscle_tab.c: Adjust.
14481
5ece6d43
AD
144822002-02-05 Akim Demaille <akim@epita.fr>
14483
14484 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
14485 which have no values.
14486
5bb18f9a
AD
144872002-02-05 Akim Demaille <akim@epita.fr>
14488
14489 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
14490 * data/: here.
14491
894dd62e
PE
144922002-01-29 Paul Eggert <eggert@twinsun.com>
14493
14494 * src/bison.simple (YYSIZE_T): Do not define merely because
14495 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
14496 On some platforms, <alloca.h> does not declare YYSTD (size_t).
14497
82841af7
AD
144982002-01-27 Akim Demaille <akim@epita.fr>
14499
14500 Fix `%nonassoc and eof'.
14501
14502 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
14503 which were not properly copied! Replace
14504 memcpy (res->errs, src->errs, src->nerrs);
14505 with
14506 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
14507 !!!
14508 * tests/regression.at (%nonassoc and eof): Adjust to newest
14509 Autotest: `.' is not in the PATH.
14510
318b76e9
AD
145112002-01-27 Akim Demaille <akim@epita.fr>
14512
14513 * tests/sets.at (AT_EXTRACT_SETS): New.
14514 (Nullable): Use it.
14515 (Firsts): New.
14516
30d2f3d5
AD
145172002-01-26 Akim Demaille <akim@epita.fr>
14518
14519 * tests/actions.at, tests/calc.at, tests/headers.at,
14520 * tests/torture.at: Adjust to the newest Autotest which no longer
14521 forces `.' in the PATH.
14522
30f8c395
AD
145232002-01-25 Akim Demaille <akim@epita.fr>
14524
14525 * tests/regression.at (%nonassoc and eof): New.
14526 Suggested by Robert Anisko.
14527
29ae55f1
AD
145282002-01-24 Akim Demaille <akim@epita.fr>
14529
14530 Bison dumps core when trying to complain about broken input files.
14531 Reported by Cris van Pelt.
14532
14533 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
14534 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
14535 into...
14536 (Invalid inputs): Strengthen: exercise parse_percent_token.
14537
2b548aa6
RA
145382002-01-24 Robert Anisko <robert.anisko@epita.fr>
14539
14540 * src/Makefile.am: Add bison.c++.
14541 * src/bison.c++: New skeleton.
14542
bb0146c2
AD
145432002-01-21 Paolo Bonzini <bonzini@gnu.org>
14544
14545 * po/it.po: New.
14546
bec30531
AD
145472002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
14548
14549 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
14550
fc6edc45
MA
145512002-01-20 Marc Autret <marc@gnu.org>
14552
14553 * src/files.c (compute_output_file_names): Fix
14554
5e5d5415
MA
145552002-01-20 Marc Autret <marc@gnu.org>
14556
14557 * tests/output.at: New test.
14558 * src/files.c (compute_base_names): Don't map extensions when
14559 the YACC flag is set, use defaults.
14560 Reported by Evgeny Stambulchik.
14561
44ea3fbd
MA
145622002-01-20 Marc Autret <marc@gnu.org>
14563
ba0fe3c7
PE
14564 * src/system.h: Need to define __attribute__ away for non-GCC
14565 compilers as well (i.e., the vendor C compiler).
44ea3fbd
MA
14566 Suggested by Albert Chin-A-Young.
14567
338963d1
TVH
145682002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
14569
14570 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
14571 canonical definition.
14572 * src/system.h: Use the canonical definition for PARAMS (avoids
14573 a conflict with the macro from lib/hash.h).
14574
c57b2479
AD
145752002-01-11 Akim Demaille <akim@epita.fr>
14576
14577 * configure.in: Use AC_FUNC_STRNLEN.
d9e9746c 14578 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
c57b2479 14579
b85810ae
AD
145802002-01-09 Akim Demaille <akim@epita.fr>
14581
14582 * src/files.c, src/files.h (output_infix): New.
14583 (tab_extension): Remove.
14584 (compute_base_names): Compute the former, drop the latter.
14585 * src/output.c (prepare): Insert the muscles `output-infix', and
14586 `output-suffix'.
14587 * src/parse-skel.y (string, string.1): New.
14588 (section.header): Use it.
14589 (section.yacc): Remove.
14590 (prefix): Remove too.
14591 * src/scan-skel.l: Adjust.
14592 * src/bison.simple, src/bison.hairy: Adjust.
14593
cae60122
AD
145942002-01-09 Akim Demaille <akim@epita.fr>
14595
14596 * configure.in (WERROR_CFLAGS): Compute it.
14597 * src/Makefile.am (CFLAGS): Pass it.
14598 * tests/atlocal.in (CFLAGS): Idem.
14599 * src/files.c: Fix a few warnings.
14600 (get_extension_index): Remove, unused.
14601
ae404801
AD
146022002-01-08 Akim Demaille <akim@epita.fr>
14603
14604 * src/getargs.c (AS_FILE_NAME): New.
14605 (getargs): Use it to convert DOSish file names.
14606 * src/files.c (base_name): Rename as full_base_name to avoid
14607 clashes with `base_name ()'.
14608 (filename_split): New.
14609 (compute_base_names): N-th rewrite, using filename_split.
14610
22312b71
AD
146112002-01-08 Akim Demaille <akim@epita.fr>
14612
14613 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
14614 New, stolen from the Fileutils 4.1.
14615 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
14616 * configure.in: Check for the presence of memrchr, and of its
14617 prototype.
14618
a67cef01
TVH
146192002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
14620
14621 * lib/hash.h (__P): Added definition for this macro.
14622 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
14623 BUILT_SOURCES, to ensure they are generated first.
14624 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
14625 %error-verbose to allow bootstrapping with bison 1.30x.
14626
2b25d624
AD
146272002-01-06 Akim Demaille <akim@epita.fr>
14628
14629 * src/reader.c (parse_braces): Don't fetch the next char, the
14630 convention is to fetch on entry.
14631 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
14632 'switch' without a following semicolon.
14633 * tests/regression.at (braces parsing): New.
14634
3460813b
AD
146352002-01-06 Akim Demaille <akim@epita.fr>
14636
14637 Bison is dead wrong in its RR conflict reports.
14638
14639 * tests/torture.at (GNU Cim Grammar): New.
14640 * src/conflicts.c (count_rr_conflicts): Fix.
14641
73784c64
AD
146422002-01-06 Akim Demaille <akim@epita.fr>
14643
14644 Creating package.m4 from configure.ac causes too many problems.
14645
14646 * tests/Makefile.am (package.m4): Create it by hand,
14647 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
14648
25d81090
AD
146492002-01-06 Akim Demaille <akim@epita.fr>
14650
14651 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
14652 skeleton.h.
14653
a9b8959e
PE
146542002-01-04 Paul Eggert <eggert@twinsun.com>
14655
14656 * doc/bison.texinfo (Debugging):
14657 Remove YYSTDERR; it's no longer defined or used.
14658 Also, s/cstdio.h/cstdio/.
14659
25d81090
AD
146602002-01-03 Akim Demaille <akim@epita.fr>
14661
14662 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
14663
1109455c
AD
146642002-01-03 Akim Demaille <akim@epita.fr>
14665
14666 * src/parse-skel.y (process_skeleton): Don't bind the parser's
14667 tracing code to --trace, wait for a better --trace option, with
14668 args.
14669
7ea5e977
AD
146702002-01-03 Akim Demaille <akim@epita.fr>
14671
14672 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
14673 The ISO C++ standard is extremely clear about it: stderr is
14674 considered a macro, not a regular symbol (see table 94 `Header
14675 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
14676 Therefore std:: does not apply to it. It still does with fprintf.
14677 Also, s/cstdio.h/cstdio/.
14678
fab5b110
AD
146792002-01-03 Akim Demaille <akim@epita.fr>
14680
14681 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
14682 for non system headers.
14683
aed7fd9b
AD
146842002-01-02 Akim Demaille <akim@epita.fr>
14685
14686 Equip the skeleton chain with location tracking, runtime trace,
14687 pure parser and scanner.
14688
14689 * src/parse-skel.y: Request a pure parser, locations, and prefix
14690 renaming.
14691 (%union): Having several members with the same type does not help
14692 type mismatches, simplify.
14693 (YYPRINT, yyprint): New.
14694 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
14695 (skel_error): this.
14696 Handle locations.
14697 * src/scan-skel.l: Adjust to these changes.
14698 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
14699 (LOCATION_PRINT, skel_control_t): New.
14700
24fad99e
AD
147012001-12-30 Akim Demaille <akim@epita.fr>
14702
14703 * src/parse-skel.y: Get rid of the shift/reduce conflict:
14704 replace `gb' with BLANKS.
14705 * src/scan-skel.l: Adjust.
14706
a4b36db4
AD
147072001-12-30 Akim Demaille <akim@epita.fr>
14708
14709 * src/system.h: We don't need nor want bcopy.
14710 Throw away MS-DOS crap: we don't need getpid.
14711 * configure.in: We don't need strndup. It was even causing
14712 problems: because Flex includes the headers *before* us,
14713 _GNU_SOURCE is not defined by config.h, and therefore strndup was
14714 not visible.
14715 * lib/xstrndup.c: New.
14716 * src/scan-skel.l: Use it.
14717 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
14718 * src/parse-skel.y: Use %directives instead of #defines.
14719
1239777d
AD
147202001-12-30 Akim Demaille <akim@epita.fr>
14721
14722 * src/skeleton.h: New.
14723 * src/output.c (output_parser, output_master_parser): Remove, dead
14724 code.
14725 * src/output.h (get_lines_number, actions_output, guards_output)
14726 (token_definitions_output): Prototype them.
14727 * src/parse-skel.y: Add the license notice.
14728 Include output.h and skeleton.h.
14729 (process_skeleton): Returns void, and takes a single parameter.
14730 * src/scan-skel.l: Add the license notice.
14731 Include skeleton.h.
14732 Don't use %option yylineno: it seems that then Flex imagines
14733 REJECT has been used, and therefore it won't reallocate its
14734 buffers (which makes no other sense to me than a bug). It results
14735 in warnings for `unused: yy_flex_realloc'.
14736
9b3add5b
RA
147372001-12-30 Robert Anisko <robert.anisko@epita.fr>
14738
14739 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
14740 (MUSCLE_INSERT_PREFIX): ...to there.
14741 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
14742 (MUSCLE_INSERT_PREFIX): Move from here...
14743
14744 * src/bison.hairy: Add a section directive. Put braces around muscle
14745 names. This parser skeleton is still broken, but Bison should not
14746 choke on a bad muscle 'syntax'.
14747 * src/bison.simple: Add a section directive. Put braces around muscle
14748 names.
14749
14750 * src/files.h (strsuffix, stringappend): Add declarations.
14751 (tab_extension): Add declaration.
14752 (short_base_name): Add declaration.
14753
14754 * src/files.c (strsuffix, stringappend): No longer static. These
14755 functions are used in the skeleton parser.
14756 (tab_extension): New.
14757 (compute_base_names): Use the computations done in this function
fab5b110 14758 to guess if the generated parsers should have '.tab' in their
9b3add5b
RA
14759 names.
14760 (short_base_name): No longer static.
14761
14762 * src/output.c (output_skeleton): New.
14763 (output): Disable call to output_master_parser, and give a try to
14764 a new skeleton handling system.
14765 (guards_output, actions_output): No longer static.
14766 (token_definitions_output, get_lines_number): No longer static.
14767
14768 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
14769
fab5b110 14770 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
9b3add5b
RA
14771 parse-skel.y.
14772
14773 * src/parse-skel.y: New file.
14774 * src/scan-skel.l: New file.
14775
b5b61c61
AD
147762001-12-29 Akim Demaille <akim@epita.fr>
14777
14778 %name-prefix is broken.
14779
14780 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
14781 Adjust all dependencies.
14782 * tests/headers.at (export YYLTYPE): Strengthen this test: use
14783 %name-prefix.
14784
14785 Renaming yylval but not yylloc is not consistent. Now we do.
14786
14787 * src/bison.simple: Prefix yylloc if used.
14788 * doc/bison.texinfo (Decl Summary): Document that.
14789
8c9a50be
AD
147902001-12-29 Akim Demaille <akim@epita.fr>
14791
14792 * doc/bison.texinfo: Promote `%long-directive' over
14793 `%long_directive'.
14794 Remove all references to fixed-output-files, yacc is enough.
14795
d99361e6
AD
147962001-12-29 Akim Demaille <akim@epita.fr>
14797
14798 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
14799 user prologue. These are defaults.
14800 * tests/actions.at (Mid-rule actions): Make sure the user can
14801 define YYDEBUG and YYERROR_VERBOSE.
14802
b9cecb91
AD
148032001-12-29 Akim Demaille <akim@epita.fr>
14804
14805 * src/output.c (header_output): Don't forget to export YYLTYPE and
14806 yylloc.
14807 * tests/headers.at (export YYLTYPE): New, make sure it does.
14808 * tests/regression.at (%union and --defines, Invalid CPP headers):
14809 Move to...
14810 * tests/headers.at: here.
14811
aea13e97
AD
148122001-12-29 Akim Demaille <akim@epita.fr>
14813
14814 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
14815
931394cb
AD
148162001-12-29 Akim Demaille <akim@epita.fr>
14817
14818 * tests/actions.at (Mid-rule actions): Output on a single line
14819 instead of several.
14820
704a47c4
AD
148212001-12-29 Akim Demaille <akim@epita.fr>
14822
14823 * doc/bison.texinfo: Formatting changes.
14824
091e20bb
AD
148252001-12-29 Akim Demaille <akim@epita.fr>
14826
14827 Don't store the token defs in a muscle, just be ready to output it
14828 on command. Now possible via `symbols'. Fixes a memory leak.
14829
14830 * src/output.c (token_definitions_output): New.
14831 (output_parser, header_output): Use it.
14832 * src/reader.c (symbols_save): Remove.
14833
cce71710
AD
148342001-12-29 Akim Demaille <akim@epita.fr>
14835
14836 * src/bison.simple: Do not provide a default for YYSTYPE and
14837 YYLTYPE before the user's prologue. Otherwise it's hardly... a
14838 default.
14839
82c035a8
AD
148402001-12-29 Akim Demaille <akim@epita.fr>
14841
14842 Mid-rule actions are simply... ignored!
14843
14844 * src/reader.c (readgram): Be sure to attach mid-rule actions to
14845 the empty-rule associated to the dummy symbol, not to the host
14846 rule.
14847 * tests/actions.at (Mid-rule actions): New.
14848
8419d367
AD
148492001-12-29 Akim Demaille <akim@epita.fr>
14850
14851 Memory leak.
14852
14853 * src/reader.c (reader): Free grammar.
14854
375d5806
AD
148552001-12-29 Akim Demaille <akim@epita.fr>
14856
14857 Memory leak.
14858
14859 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
14860 since it allocates it for each state, although only one is needed.
14861 (allocate_storage): Do it here.
14862
f51cb8ff
AD
148632001-12-29 Akim Demaille <akim@epita.fr>
14864
14865 * src/options.h, src/options.c (create_long_option_table): Rename
14866 as...
14867 (long_option_table_new): this, with a clearer prototype.
14868 (percent_table): Remove, unused,
14869 * src/getargs.c (getargs): Adjust.
14870
29e88316
AD
148712001-12-29 Akim Demaille <akim@epita.fr>
14872
14873 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
14874 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
14875 as states.
14876
b9f71f19
AD
148772001-12-29 Akim Demaille <akim@epita.fr>
14878
14879 * src/lalr.c (build_relations): Rename `states' as `states1'.
14880 Sorry, I don't understand exactly what it is, no better name...
14881
1a2b5d37
AD
148822001-12-29 Akim Demaille <akim@epita.fr>
14883
14884 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
14885 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
14886 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
14887 as rules.
14888
1cca533e
AD
148892001-12-29 Akim Demaille <akim@epita.fr>
14890
14891 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
14892 ago.
14893
c03ae966
AD
148942001-12-29 Akim Demaille <akim@epita.fr>
14895
14896 * src/reader.c, src/reader.h (user_toknums): Remove.
14897 Adjust all users to use symbols[i]->user_token_number.
14898
5a670b1e
AD
148992001-12-29 Akim Demaille <akim@epita.fr>
14900
14901 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
14902 Adjust all users to use symbols[i]->prec or ->assoc.
14903
ad949da9
AD
149042001-12-29 Akim Demaille <akim@epita.fr>
14905
14906 * src/reader.c, src/reader.h (tags): Remove.
14907 Adjust all users to use symbols[i]->tag.
14908
0e78e603
AD
149092001-12-29 Akim Demaille <akim@epita.fr>
14910
14911 * src/gram.h, src/gram.c (symbols): New, similar to state_table
14912 and rule_table.
14913 * src/reader.c (packsymbols): Fill this table.
14914 Drop sprec.
14915 * src/conflicts.c (resolve_sr_conflict): Adjust.
14916 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
14917 single table.
14918 Use symbols[i]->tag instead of tags[i].
14919
213e640e
AD
149202001-12-29 Akim Demaille <akim@epita.fr>
14921
14922 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
14923 In addition, put a comment in there, to replace...
14924 * tests/regression.at (%union and C comments): Remove.
14925
e7b8bef1
AD
149262001-12-29 Akim Demaille <akim@epita.fr>
14927
14928 * tests/regression.at (Web2c Actions): Blindly move the actual
14929 output as expected output. The contents *seem* right to me, but I
14930 can't pretend reading perfectly parser tables... Nonetheless, all
14931 the other tests pass correctly, the table look OK, even though the
14932 presence of `$axiom' is to be noted: AFAICS it is useless (but
14933 harmless).
14934
b68e7744
AD
149352001-12-29 Akim Demaille <akim@epita.fr>
14936
14937 * src/reader.c (readgram): Don't add the rule 0 if there were no
14938 rules read. In other words, add it _after_ having performed
14939 grammar sanity checks.
14940 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
14941
78d5bae9
AD
149422001-12-29 Akim Demaille <akim@epita.fr>
14943
14944 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
14945 visible, and some states have now a different number.
14946
ff442794
AD
149472001-12-29 Akim Demaille <akim@epita.fr>
14948
14949 * src/reader.c (readgram): Bind the initial rule's lineno to that
14950 of the first rule.
14951 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
14952 (Solved SR Conflicts): Adjust rule 0's line number.
14953
610ab194
AD
149542001-12-29 Akim Demaille <akim@epita.fr>
14955
14956 Fix the `GAWK Grammar' failure.
14957
14958 * src/LR0.c (final_state): Initialize to -1 so that we do compute
14959 the reductions of the first state which was mistakenly confused
14960 with the final state because precisely final_state was initialized
14961 to 0.
14962 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
14963 now noticed by Bison.
14964 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
14965 have a reduction on $default.
14966
29d29c8f
AD
149672001-12-29 Akim Demaille <akim@epita.fr>
14968
14969 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
14970 rule line numbers.
14971 * src/closure.c (print_closure): Likewise.
14972 * src/derives.c (print_derives): Likewise.
14973 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
14974 now.
14975
7c6b64d0
AD
149762001-12-29 Akim Demaille <akim@epita.fr>
14977
14978 * src/lalr.c (lookaheads_print): New.
14979 (lalr): Call it when --trace-flag.
14980 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
14981 are dumped.
14982
3d4daee3
AD
149832001-12-29 Akim Demaille <akim@epita.fr>
14984
14985 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
14986 when walking through ritem, even via rule->rhs.
14987 * src/reduce.c (dump_grammar, useful_production, reduce_output)
14988 (useful_production, useless_nonterminals): Likewise.
14989 (reduce_grammar_tables): Likewise, plus update nritems.
14990 * src/nullable.c (set_nullable): Likewise.
14991 * src/lalr.c (build_relations): Likewise.
14992 * tests/sets.at (Nullable): Adjust.
14993 Fortunately, now, the $axiom is no longer nullable.
14994
9e7f6bbd
AD
149952001-12-29 Akim Demaille <akim@epita.fr>
14996
14997 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
14998 the 0-sentinel.
14999 * src/gram.c (ritem_longest_rhs): Likewise.
15000 * src/reduce.c (nonterminals_reduce): Likewise.
15001 * src/print_graph.c (print_graph): Likewise.
15002 * src/output.c (output_rule_data): Likewise.
15003 * src/nullable.c (set_nullable): Likewise.
15004
255ef638
AD
150052001-12-29 Akim Demaille <akim@epita.fr>
15006
15007 * src/output.c: Comment changes.
15008
0d8a7363
AD
150092001-12-27 Paul Eggert <eggert@twinsun.com>
15010
15011 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
15012 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
15013 Sparc, as they were causing more porting problems than the
15014 (minor) performance improvement was worth.
15015
15016 Also, catch up with 1.31's YYSTD.
15017
3db472b9
AD
150182001-12-27 Akim Demaille <akim@epita.fr>
15019
15020 * src/output.c (output_gram): Rely on nritems, not the
15021 0-sentinel. See below.
15022 Use -1 as separator, not 0.
15023 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
15024 Rely on -1 as separator in yyrhs, instead of 0.
15025 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
15026 twice `Now at end of input', therefore there are two lines less to
15027 expect.
15028
b365aa05
AD
150292001-12-27 Akim Demaille <akim@epita.fr>
15030
15031 * tests/regression.at (Unresolved SR Conflicts):
15032 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
15033 below.
15034
30171f79
AD
150352001-12-27 Akim Demaille <akim@epita.fr>
15036
15037 * src/LR0.c (new_state): Recognize the final state by the fact it
15038 is reached by eoftoken.
15039 (insert_start_shifting_state, insert_eof_shifting_state)
15040 (insert_accepting_state, augment_automaton): Remove, since now
15041 these states are automatically computed from the initial state.
15042 (generate_states): Adjust.
15043 * src/print.c: When reporting a rule number to the user, substract
15044 1, so that the axiom rule is rule 0, and the first user rule is 1.
15045 * src/reduce.c: Likewise.
15046 * src/print_graph.c (print_core): For the time being, just as for
15047 the report, depend upon --trace-flags to dump the full set of
15048 items.
15049 * src/reader.c (readgram): Once the grammar read, insert the rule
15050 0: `$axiom: START-SYMBOL $'.
15051 * tests/set.at: Adjust: rule 0 is now displayed, and since the
15052 number of the states has changed (the final state is no longer
15053 necessarily the last), catch up.
15054
75142d45
AD
150552001-12-27 Akim Demaille <akim@epita.fr>
15056
15057 Try to make the use of the eoftoken valid. Given that its value
15058 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
15059 is used instead of > 0 where appropriate, (ii), depend upon nritems
15060 instead of the 0-sentinel.
15061
15062 * src/gram.h, src/gram.c (nritems): New.
15063 Expected to be duplication of nitems, but for the time being...
15064 * src/reader.c (packgram): Assert nritems and nitems are equal.
15065 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
15066 * src/closure.c (print_closure, print_fderives): Likewise.
15067 * src/gram.c (ritem_print): Likewise.
15068 * src/print.c (print_core, print_grammar): Likewise.
15069 * src/print_graph.c: Likewise.
15070
b7c49edf
AD
150712001-12-27 Akim Demaille <akim@epita.fr>
15072
15073 * src/main.c (main): If there are complains after grammar
15074 reductions, then output the report anyway if requested, then die.
15075 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
15076 * src/reader.c (eoftoken): New.
15077 (parse_token_decl): If the token being defined has value `0', it
15078 is the eoftoken.
15079 (packsymbols): No longer hack `tags' to insert `$' by hand.
15080 Be sure to preserve the value of the eoftoken.
15081 (reader): Make sure eoftoken is defined.
15082 Initialize nsyms to 0: now eoftoken is created just like the others.
15083 * src/print.c (print_grammar): Don't special case the eof token.
15084 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
15085 lie anyway, albeit pleasant.
15086 * tests/calc.at: Exercise error messages with eoftoken.
15087 Change the grammar so that empty input is invalid.
15088 Adjust expectations.
15089 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
15090
ec2da99f
AD
150912001-12-27 Akim Demaille <akim@epita.fr>
15092
15093 * configure.in: Check the protos of strchr ans strspn.
15094 Replace strchr if needed.
15095 * src/system.h: Provide the protos of strchr, strspn and memchr if
15096 missing.
15097 * lib/strchr.c: New.
15098 * src/reader.c (symbols_save): Use strchr.
15099
8adfa272
AD
151002001-12-27 Akim Demaille <akim@epita.fr>
15101
15102 * src/print.c, src/print_graph.c (escape): New.
15103 Use it to quote the TAGS outputs.
15104 * src/print_graph.c (print_state): Now errors are in red, and
15105 reductions in green.
15106 Prefer high to wide: output the state number on a line of its own.
15107
80dac38c
AD
151082001-12-27 Akim Demaille <akim@epita.fr>
15109
15110 * src/state.h, src/state.c (reductions_new): New.
15111 * src/LR0.c (set_state_table): Let all the states have a
15112 `reductions', even if reduced to 0.
15113 (save_reductions): Adjust.
15114 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
15115 * src/print.c (print_reductions, print_actions): Adjust.
15116 * src/output.c (action_row): Adjust.
15117
2cec70b9
AD
151182001-12-27 Akim Demaille <akim@epita.fr>
15119
15120 * src/state.h, src/state.c (errs_new, errs_dup): New.
15121 * src/LR0.c (set_state_table): Let all the states have an errs,
15122 even if reduced to 0.
15123 * src/print.c (print_errs, print_reductions): Adjust.
15124 * src/output.c (output_actions, action_row): Adjust.
15125 * src/conflicts.c (resolve_sr_conflict): Adjust.
15126
13ca549a
AD
151272001-12-27 Akim Demaille <akim@epita.fr>
15128
15129 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
15130
5092aba5
AD
151312001-12-27 Akim Demaille <akim@epita.fr>
15132
15133 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
15134 * src/print.c: here.
15135 (lookaheadset, shiftset): New, used as additional storage by
15136 print_reductions.
15137 (print_results): Adjust.
15138 (print_shifts, print_gotos, print_errs): New, extracted from...
15139 (print_actions): here.
15140 * src/print_graph.c (print_actions): Remove dead code.
15141
11e2beca
AD
151422001-12-27 Akim Demaille <akim@epita.fr>
15143
15144 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
15145 `$n' and `@n'.
15146
dac3c910
AD
151472001-12-27 Akim Demaille <akim@epita.fr>
15148
15149 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
15150 (build_relations): Adjust.
15151
d0b0fefa
AD
151522001-12-27 Akim Demaille <akim@epita.fr>
15153
15154 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
15155 duplication.
15156
adc8c848
AD
151572001-12-27 Akim Demaille <akim@epita.fr>
15158
15159 * src/reader.c (packgram): Catch nitems overflows.
15160
14d293ac
AD
151612001-12-27 Akim Demaille <akim@epita.fr>
15162
15163 * src/files.c, src/files.h (guard_obstack): Remove.
15164 * src/output.c (output): Adjust.
15165 * src/reader.c (parse_braces): New, factoring...
15166 (copy_action, copy_guard): these two which are renamed as...
15167 (parse_action, parse_guard): these.
15168 As a voluntary consequence, using braces around guards is now
15169 mandatory.
15170
f499b062
AD
151712001-12-27 Akim Demaille <akim@epita.fr>
15172
15173 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
15174 * src/reader.c (symbol_list): `guard' and `guard_line' are new
15175 members.
15176 (symbol_list_new): Adjust.
15177 (copy_action): action_line is the first line, not the last.
15178 (copy_guard): Just as for actions, store the `action' only, not
15179 the switch/case/break flesh.
15180 Don't parse the user action that might follow the guard, let...
15181 (readgram): do it, i.e., now, there can be an action after a
15182 guard.
15183 In other words the guard is just explicitly optional.
15184 (packgram): Adjust.
15185 * src/output.c (guards_output): New.
15186 (output_parser): Call it when needed.
15187 (output): Also free the guard and attrs obstacks.
15188 * src/files.c, src/files.h (obstack_save): Remove.
15189 (output_files): Remove.
15190 As a result, if one needs the former `.act' file, using an
15191 appropriate skeleton which requires actions and guards is now
15192 required.
15193 * src/main.c (main): Adjust.
15194 * tests/semantic.at: New.
15195 * tests/regression.at: Use `input.y' as input file name.
15196 Avoid 8+3 problems by requiring input.c when the test needs the
15197 parser.
15198
d945f5cd
AD
151992001-12-27 Akim Demaille <akim@epita.fr>
15200
15201 * src/reader.c (symbol_list_new): Be sure to initialize all the
15202 fields.
15203
d200e455
AD
152042001-12-27 Akim Demaille <akim@epita.fr>
15205
15206 All the hacks using a final pseudo state are now useless.
15207
15208 * src/LR0.c (set_state_table): state_table holds exactly nstates.
15209 * src/lalr.c (nLA): New.
15210 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
15211 instead of lookaheadsp from the pseudo state (nstate + 1).
15212
f9507c28
AD
152132001-12-27 Akim Demaille <akim@epita.fr>
15214
15215 * src/output.c (action_row, token_actions): Use a state_t instead
15216 of a integer, and nlookaheads instead of the following state's
15217 lookaheadsp.
15218
065fbd27
AD
152192001-12-27 Akim Demaille <akim@epita.fr>
15220
15221 * src/conflicts.c (log_resolution, flush_shift)
15222 (resolve_sr_conflict, set_conflicts, solve_conflicts)
15223 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
15224 (conflicts_print, print_reductions): Use a state_t instead of an
15225 integer when referring to a state.
15226 As much as possible, depend upon nlookaheads, instead of the
15227 `lookaheadsp' member of the following state (since lookaheads of
15228 successive states are successive, the difference between state n + 1
15229 and n served as the number of lookaheads for state n).
15230 * src/lalr.c (add_lookback_edge): Likewise.
15231 * src/print.c (print_core, print_actions, print_state)
15232 (print_results): Likewise.
15233 * src/print_graph.c (print_core, print_actions, print_state)
15234 (print_graph): Likewise.
15235 * src/conflicts.h: Adjust.
15236
1b177bd7
AD
152372001-12-27 Akim Demaille <akim@epita.fr>
15238
15239 * src/bison.hairy: Formatting/comment changes.
15240 ANSIfy.
15241 Remove `register' indications.
15242 Add plenty of `static'.
15243
7742ddeb
AD
152442001-12-27 Akim Demaille <akim@epita.fr>
15245
15246 * src/output.c (prepare): Drop the muscle `ntbase' which
15247 duplicates ntokens.
15248 * src/bison.simple: Formatting/comment changes.
15249 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
15250 is an undocumented synonym.
15251
1fa14068
AD
152522001-12-22 Akim Demaille <akim@epita.fr>
15253
15254 * src/output.c (output_table_data): Change the prototype to use
15255 `int' for array ranges: some invocations do pass an int, not a
15256 short.
15257 Reported by Wayne Green.
15258
b9752825
AD
152592001-12-22 Akim Demaille <akim@epita.fr>
15260
15261 Some actions of web2c.y are improperly triggered.
15262 Reported by Mike Castle.
15263
15264 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
15265 * tests/regression.at (Web2c): Rename as...
15266 (Web2c Report): this.
15267 (Web2c Actions): New.
15268
776209d6
AD
152692001-12-22 Akim Demaille <akim@epita.fr>
15270
15271 Reductions in web2c.y are improperly reported.
15272 Reported by Mike Castle.
15273
15274 * src/conflicts.c (print_reductions): Fix.
15275 * tests/regression.at (Web2c): New.
15276
275fc3ad
AD
152772001-12-18 Akim Demaille <akim@epita.fr>
15278
15279 Some host fail on `assert (!"foo")', which expands to
15280 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
15281 Reported by Nelson Beebee.
15282
15283 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
15284 `#define it_succeeded 0' and `assert (it_succeeded)'.
15285
897668ee
MA
152862001-12-17 Marc Autret <autret_m@epita.fr>
15287
15288 * src/bison.simple: Don't hard code the skeleton line and filename.
15289 * src/output.c (output_parser): Rename 'line' as 'output_line'.
15290 New line counter 'skeleton_line' (skeleton-line muscle).
15291
ab3399e0
PE
152922001-12-17 Paul Eggert <eggert@twinsun.com>
15293
15294 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
15295 YYDEBUG must be defined to a nonzero value.
15296
15297 * src/bison.simple (yytname): Do not assume that the user defines
15298 YYDEBUG to a properly parenthesized expression.
15299
3877f72b
AD
153002001-12-17 Akim Demaille <akim@epita.fr>
15301
15302 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
15303 nlookaheads is a new member.
15304 Adjust all users.
15305 * src/lalr.h (nlookaheads): Remove this orphan declaration.
15306 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
15307 state.
776209d6 15308
331dbc1b
AD
153092001-12-17 Akim Demaille <akim@epita.fr>
15310
15311 * src/files.h, src/files.c (open_files, close_files): Remove.
15312 * src/main.c (main): Don't open/close files, nor invoke lex_free,
15313 let...
15314 * src/reader.c (reader): Do it.
776209d6 15315
be750e4c
AD
153162001-12-17 Akim Demaille <akim@epita.fr>
15317
15318 * src/conflicts.c (print_reductions): Formatting changes.
776209d6 15319
709ae8c6
AD
153202001-12-17 Akim Demaille <akim@epita.fr>
15321
15322 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
15323 (flush_reduce): New.
15324 (resolve_sr_conflict): Adjust.
776209d6 15325
f87685c3
AD
153262001-12-17 Akim Demaille <akim@epita.fr>
15327
15328 * src/output.c (output_obstack): Be static and rename as...
15329 (format_obstack): this, to avoid any confusion with files.c's
15330 output_obstack.
15331 * src/reader.h (muscle_obstack): Move to...
15332 * src/output.h: here, since it's defined in output.c.
15333
837491d8
AD
153342001-12-17 Akim Demaille <akim@epita.fr>
15335
15336 * src/output.c (action_row, save_column, default_goto)
15337 (sort_actions, matching_state, pack_vector): Better variable
15338 locality.
15339
796d61fb
AD
153402001-12-17 Akim Demaille <akim@epita.fr>
15341
15342 * src/output.c: Various formatting changes.
776209d6 15343
64d15509
AD
153442001-12-17 Akim Demaille <akim@epita.fr>
15345
15346 * src/files.c (output_files): Free the output_obstack.
15347 * src/main.c (main): Call print and print_graph conditionally.
15348 * src/print.c (print): Work unconditionally.
15349 * src/print_graph.c (print_graph): Work unconditionally.
15350 * src/conflicts.c (log_resolution): Output only if verbose_flag.
15351
fbc8ecb7
MA
153522001-12-16 Marc Autret <autret_m@epita.fr>
15353
15354 * src/output.c (actions_output): Fix. When we use %no-lines,
15355 there is one less line per action.
15356
f0440388
MA
153572001-12-16 Marc Autret <autret_m@epita.fr>
15358
15359 * src/bison.simple: Remove a useless #line directive.
15360 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
15361 * src/output.c (get_lines_number): New.
776209d6 15362 (output_parser): Adjust, now takes care about the lines of a
f0440388
MA
15363 output muscles.
15364 Fix line numbering.
15365 (actions_output): Computes the number of lines taken by actions.
15366 (output_master_parser): Insert new skeleton which is the name of
15367 the output parser file name.
15368
a79986b8
MA
153692001-12-15 Marc Autret <autret_m@epita.fr>
15370
15371 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
15372
4ec8e00f
MA
153732001-12-15 Marc Autret <autret_m@epita.fr>
15374
15375 * src/output.c (output_gram): Keep track of the hairy one.
15376
1a4648ff
AD
153772001-12-15 Akim Demaille <akim@epita.fr>
15378
15379 Make `make distcheck' work.
15380
15381 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
15382 system.h which uses libgettext.h.
15383
9c2c67e6
AD
153842001-12-15 Akim Demaille <akim@epita.fr>
15385
15386 * src/nullable.c (set_nullable): Useless rules must be skipped,
15387 otherwise, since we range over their symbols, we might look at a
15388 nonterminal which no longer ``exists'', i.e., it is not counted in
15389 `nvars', hence we overflow our arrays.
15390
93ede233
AD
153912001-12-15 Akim Demaille <akim@epita.fr>
15392
15393 The header can also be produced directly, without any obstack!
15394 Yahoo!
15395
15396 * src/files.c, src/files.h (defines_obstack): Remove.
15397 (compute_header_macro): Global.
15398 (defines_obstack_save): Remove.
15399 * src/reader.c (parse_union_decl): No longer output to
15400 defines_obstack: its content can be found in the `stype' muscle
15401 anyway.
15402 (output_token_translations): Merge into...
15403 (symbols_output): this.
15404 Rename as...
15405 (symbols_save): this.
15406 (reader): Adjust.
15407 * src/output.c (header_output): New.
15408 (output): Call it.
15409
2666f928
AD
154102001-12-15 Akim Demaille <akim@epita.fr>
15411
15412 * src/reader.c (parse_union_decl): Instead of handling two obstack
15413 simultaneously, use one to define the `stype' muscle, and use the
15414 value of the latter to fill defines_obstack.
15415 (copy_comment): Remove.
15416 (copy_comment2): Work for a single obstack.
15417 Rename as...
15418 (copy_comment): this.
15419
428046f8
AD
154202001-12-15 Akim Demaille <akim@epita.fr>
15421
15422 * src/lex.c, src/lex.h (xgetc): No longer static.
15423 * src/reader.c (parse_union_decl): Revamp.
15424
ea52d706
AD
154252001-12-15 Akim Demaille <akim@epita.fr>
15426
15427 Still making progress in separating Bison into (i) input, (ii)
15428 process, (iii) output: now we can directly output the parser file
15429 without using table_obstack at all.
15430
15431 * src/files.c, src/files.h (table_obstack): Bye bye.
15432 (parser_file_name): New.
15433 * src/files.c (compute_output_file_names): Compute it.
15434 * src/output.c (actions_output, output_parser)
15435 (output_master_parser): To a file instead of an obstack.
15436
3f96f4dc
AD
154372001-12-15 Akim Demaille <akim@epita.fr>
15438
15439 Attach actions to rules, instead of pre-outputting them to
15440 actions_obstack.
15441
15442 * src/gram.h (rule_t): action and action_line are new members.
15443 * src/reader.c (symbol_list): Likewise.
15444 (copy_action): Save the actions within the rule.
15445 (packgram): Save them in rule_table.
15446 * src/output.c (actions_output): New.
15447 (output_parser): Use it on `%%actions'.
15448 (output_rule_data): Don't free rule_table.
15449 (output): Do it.
15450 (prepare): Don't save the `action' muscle.
15451 * src/bison.simple: s/%%action/%%actions/.
15452
51576fb3
AD
154532001-12-15 Akim Demaille <akim@epita.fr>
15454
15455 * src/reader.c (copy_action): When --yacc, don't append a `;'
15456 to the user action: let it fail if lacking.
dee049eb 15457 Suggested by Arnold Robbins and Tom Tromey.
51576fb3 15458
2648a72d
AD
154592001-12-14 Akim Demaille <akim@epita.fr>
15460
15461 * src/lex.c (literalchar): Simply return the char you decoded, non
15462 longer mess around with obstacks and int pointers.
15463 Adjust all callers.
15464
92790e5b
AD
154652001-12-14 Akim Demaille <akim@epita.fr>
15466
15467 * src/lex.c (literalchar): Don't escape the special characters,
15468 just decode them, and keep them as char (before, eol was output as
15469 the 2 char string `\n' etc.).
15470 * src/output.c (output_rule_data): Use quotearg to output the
15471 token strings.
15472
927c1557
PE
154732001-12-13 Paul Eggert <eggert@twinsun.com>
15474
15475 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
15476 Do not infringe on the global user namespace when using C++.
15477 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
15478 All uses of `fprintf' and `stderr' changed.
15479
15480 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
15481
ed8e1f68
AD
154822001-12-13 Akim Demaille <akim@epita.fr>
15483
15484 The computation of nullable is broken: it doesn't handle empty
15485 RHS's properly.
15486
15487 * tests/torture.at (GNU AWK Grammar): New.
15488 * tests/sets.at (Nullable): New.
15489 * src/nullable.c (set_nullable): Instead of blindly looping over
15490 `ritems', loop over the rules, and then over their rhs's.
15491
15492 Work around Autotest bugs.
15493
15494 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
15495 frame, because Autotest understand lines starting with a `+' as
15496 traces from the shell. Then, they are not processed properly.
15497 Admittedly an Autotest bug, but we don't have time to wait for
15498 Autotest to catch up.
15499 * tests/regression.at (Broken Closure): Adjust to the new table
15500 frames.
15501 Move to...
15502 * tests/sets.at: here.
15503
cb581495
AD
155042001-12-13 Akim Demaille <akim@epita.fr>
15505
15506 * src/closure.c (closure): Use nrules instead of playing tricks
15507 with BITS_PER_WORD.
15508
2e729273
AD
155092001-12-13 Akim Demaille <akim@epita.fr>
15510
15511 * src/print.c (print_actions): Output the handling of `$' as the
15512 traces do: shifting the token EOF. Before EOF was treated as a
15513 nonterminal.
15514 * tests/regression.at: Adjust some tests.
15515 * src/print_graph.c (print_core): Complete the set of items via
15516 closure. The next-to-final and final states are still unsatisfying,
15517 but that's to be addressed elsewhere.
15518 No longer output the rule numbers, but do output the state number.
15519 A single loop for the shifts + gotos is enough, but picked a
15520 distinct color for each.
15521 (print_graph): Initialize and finalize closure.
15522
107f7dfb
AD
155232001-12-13 Akim Demaille <akim@epita.fr>
15524
15525 * src/reader.c (readgram): Remove dead code, an strip useless
15526 braces.
15527 (get_type): Remove, unused.
15528
9b53a24f
AD
155292001-12-12 Akim Demaille <akim@epita.fr>
15530
15531 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
15532 on that of lib/error.c.
15533
dbfb6dcd
AD
155342001-12-12 Akim Demaille <akim@epita.fr>
15535
15536 Some hosts don't like `/' in includes.
15537
15538 * src/system.h: Include libgettext.h without qualifying the path.
15539 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
15540 $(top_srcdir).
15541
c25fb648
MA
155422001-12-11 Marc Autret <autret_m@epita.fr>
15543
15544 * src/output.c (output_parser): Remove useless muscle.
15545
710ddc4f
MA
155462001-12-11 Marc Autret <autret_m@epita.fr>
15547
15548 * src/bison.simple: Remove #line just before %%epilogue. It
15549 is now handled in ...
15550 * src/reader.c (read_additionnal_code): Add the output of a
15551 #line for the epilogue.
15552
e83d80b8
MA
155532001-12-10 Marc Autret <autret_m@epita.fr>
15554
927c1557 15555 * src/reader.c (copy_definition): Re-use CPP-outed code which
e83d80b8
MA
15556 replace precedent remove.
15557 * src/bison.simple: Remove #line before %%prologue because
15558 %%input-line is wrong at this time.
15559
971d5158
MA
155602001-12-10 Marc Autret <autret_m@epita.fr>
15561
15562 * src/reader.c (symbols_output): Clean up.
927c1557 15563 * src/output.c (output_gram, output): Clean up.
971d5158 15564
5edafffd
AD
155652001-12-10 Akim Demaille <akim@epita.fr>
15566
15567 * src/lalr.c (initialize_lookaheads): New. Extracted from...
15568 * src/LR0.c (set_state_table): here.
15569 * src/lalr.c (lalr): Call it.
15570
0279f8e9
AD
155712001-12-10 Akim Demaille <akim@epita.fr>
15572
15573 * src/state.h (shifts): Remove the `number' member: shifts are
15574 attached to state, hence no longer need to be labelled with a
15575 state number.
15576
190c4f5f
AD
155772001-12-10 Akim Demaille <akim@epita.fr>
15578
15579 Now that states have a complete set of members, the linked list of
15580 shifts is useless: just fill directly the state's shifts member.
15581
15582 * src/state.h (shifts): Remove the `next' member.
15583 * src/LR0.c (first_state, last_state): Remove.
15584 Adjust the callers.
15585 (augment_automaton): Don't look for the shifts that must be added
15586 a shift on EOF: it is those of the state we looked for! But now,
15587 since shifts are attached, it is no longer needed to looking
15588 merely by its id: its number.
15589
2a73b93d
AD
155902001-12-10 Akim Demaille <akim@epita.fr>
15591
15592 * src/LR0.c (augment_automaton): Better variable locality.
15593 Remove an impossible branch: if there is a state corresponding to
15594 the start symbol being shifted, then there is shift for the start
15595 symbol from the initial state.
15596
74392f6a
AD
155972001-12-10 Akim Demaille <akim@epita.fr>
15598
15599 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
15600 only when appropriate: when insert_start_shifting_state' is not
15601 invoked.
15602 * tests/regression.at (Rule Line Numbers): Adjust.
15603
37c82725
AD
156042001-12-10 Akim Demaille <akim@epita.fr>
15605
15606 * src/LR0.c (augment_automaton): Now that all states have shifts,
15607 merge the two cases addition shifts to the initial state.
15608
6a164e0c
AD
156092001-12-10 Akim Demaille <akim@epita.fr>
15610
15611 * src/lalr.c (set_state_table): Move to...
15612 * src/LR0.c: here.
15613 * src/lalr.c (lalr): Don't call it...
15614 * src/LR0.c (generate_states): do it.
15615 * src/LR0.h (first_state): Remove, only the table is used.
15616
7215de24
AD
156172001-12-10 Akim Demaille <akim@epita.fr>
15618
15619 * src/LR0.h (first_shift, first_reduction): Remove.
15620 * src/lalr.c: Don't use first_shift: find shifts through the
15621 states.
15622
80e25d4d
AD
156232001-12-10 Akim Demaille <akim@epita.fr>
15624
15625 * src/LR0.c: Attach shifts to states as soon as they are
15626 computed.
15627 * src/lalr.c (set_state_table): Instead of assigning shifts to
15628 state, just assert that the mapping was properly done.
15629
0ab3728b
AD
156302001-12-10 Akim Demaille <akim@epita.fr>
15631
15632 * src/LR0.c (insert_start_shift): Rename as...
15633 (insert_start_shifting_state): this.
15634 (insert_eof_shifting_state, insert_accepting_state): New.
15635 (augment_automaton): Adjust.
15636 Better locality of the variables.
15637 When looking if the start_symbol is shifted from the initial
15638 state, using `while (... symbol != start_symbol ...)' sounds
15639 better than `while (... symbol < start_symbol ...)': If fail
15640 to see how the order between symbols could be relevant!
15641
78af9bbc
AD
156422001-12-10 Akim Demaille <akim@epita.fr>
15643
15644 * src/getargs.h: Don't declare `spec_name_prefix' and
15645 `spec_file_prefix', declared by src/files.h.
15646 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
15647 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
15648 * src/output.c (prepare): Adjust.
15649 * src/reader.c (symbols_output): Likewise.
15650 * src/vmsgetargs.c: Vaguely adjust, but who cares?
15651
bdef2a41
AD
156522001-12-10 Akim Demaille <akim@epita.fr>
15653
15654 * src/muscle_tab.c (muscle_init): NULL is a better default than
15655 `"0"'.
15656
3735969c
AD
156572001-12-10 Akim Demaille <akim@epita.fr>
15658
15659 * src/reader.c (reader): Calling symbols_output once is enough.
15660
49701457
AD
156612001-12-10 Akim Demaille <akim@epita.fr>
15662
15663 Now that states have a complete set of members, the linked list of
15664 reductions is useless: just fill directly the state's reductions
15665 member.
15666
15667 * src/state.h (struct reductions): Remove member `number' and
15668 `next'.
15669 * src/LR0.c (first_reduction, last_reduction): Remove.
15670 (save_reductions): Don't link the new reductions, store them in
15671 this_state.
15672 * src/lalr.c (set_state_table): No need to attach reductions to
15673 states, it's already done.
15674 * src/output.c (output_actions): No longer free the shifts, then
15675 the reductions, then the states: free all the states and their
15676 members.
15677
0edad749
AD
156782001-12-10 Akim Demaille <akim@epita.fr>
15679
15680 * src/options.c (OPTN, DRTV, BOTH): New.
15681 (option_table): Use them.
15682
0edad749
AD
15683 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
15684 the job of system.h.
15685 * src/options.c: Don't include stdio.h and xalloc.h for the same
15686 reasons.
15687
5449dd0f
AD
156882001-12-10 Akim Demaille <akim@epita.fr>
15689
15690 * src/output.c (output, prepare): Make sure the values of the
15691 muscles `action' and `prologue' are 0-terminated.
15692
a870c567
AD
156932001-12-10 Akim Demaille <akim@epita.fr>
15694
15695 Clean up GCC warnings.
15696
15697 * src/reader.c (copy_action): `buf' is not used.
15698 (parse_skel_decl): Be static.
15699 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
15700 * src/options.h (create_long_option_table): Have a real prototype.
15701 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
15702 (hash_delete_at): Return const void *.
15703 Adjust casts to preserve the const.
15704
80df8768
AD
157052001-12-10 Akim Demaille <akim@epita.fr>
15706
15707 * configure.in: Require 2.52g.
15708 M4 is not needed, but AUTOM4TE is.
15709 * m4/m4.m4: Remove.
15710 * tests/Makefile.am: Adjust.
15711
f693ad14
AD
157122001-12-10 Akim Demaille <akim@epita.fr>
15713
15714 One structure for states is enough, even though theoretically
15715 there are LR(0) states and LALR(1) states.
15716
15717 * src/lalr.h (state_t): Remove.
15718 (state_table): Be state_t **, not state_t *.
15719 * src/state.h (core, CORE_ALLOC): Rename as...
15720 (state_t, STATE_ALLOC): this.
15721 Add the LALR(1) members: shifts, reductions, errs.
15722 * src/LR0.c (state_table): Rename as...
15723 (state_hash): this, to avoid name clashes with the global
15724 `state_table'.
15725 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
15726 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
15727
74ffbcb6
AD
157282001-12-10 Akim Demaille <akim@epita.fr>
15729
15730 Bison dumps core on bash.y.
15731 Reported by Pascal Bart.
15732
15733 * src/warshall.c (bitmatrix_print): New.
15734 (TC): Use it.
ba0fe3c7 15735 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
74ffbcb6
AD
15736 j must be the outer loop.
15737 * tests/regression.at (Broken Closure): New.
15738
07708e19
AD
157392001-12-05 Akim Demaille <akim@epita.fr>
15740
15741 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
15742 its argument.
ba1ecc07 15743 Reported by Peter Hamorsky.
07708e19 15744
92b16366
AD
157452001-12-05 Akim Demaille <akim@epita.fr>
15746
15747 * src/conflicts.c (err_table): Remove.
15748 (resolve_sr_conflict): Adjust.
15749 * src/lalr.h (state_t.reduction_table, state_t.shift_table):
15750 Rename as...
15751 (state_t.reductions, state_t.shifts): this.
15752
076ab033
AD
157532001-12-05 Akim Demaille <akim@epita.fr>
15754
15755 * src/reduce.c (reduce_grammar_tables): No longer disable the
15756 removal of useless rules via CPP but via `if (0)', so that the
15757 compiler still check the code is valid.
15758 For instance, it should have noticed `rline' no longer exists: use
15759 the `line' member of rule_t.
15760 * src/gram.c (dummy, rline): Remove, unused.
15761
3843c413
AD
157622001-12-05 Akim Demaille <akim@epita.fr>
15763
15764 * src/output.c (pack_vector): Use assert, not berror.
15765 * src/main.c (berror): Remove, unused.
15766
43168960
AD
157672001-12-05 Akim Demaille <akim@epita.fr>
15768
15769 New experimental feature: if --verbose --trace output all the
15770 items of a state, not only its kernel.
15771
15772 * src/print.c (print_core): If `trace_flag', then invoke closure
15773 before outputting the items of the state (print_core is no longer
15774 a correct name them).
15775 (print_results): Invoke new_closure/free_closure if needed.
15776
b2872512
AD
157772001-12-05 Akim Demaille <akim@epita.fr>
15778
15779 * src/LR0.c (new_itemsets): Use nshifts only, not shiftcount.
15780 * src/closure.c, src/closure.h (itemsetsize): Rename as...
15781 (nitemset): for consistency with the rest of the project.
15782
23cbcc6c
AD
157832001-12-05 Akim Demaille <akim@epita.fr>
15784
15785 * src/closure.c (print_closure): Improve.
15786 (closure): Use it for printing input and output.
15787
03ec521c
AD
157882001-12-05 Akim Demaille <akim@epita.fr>
15789
15790 * src/closure.c (FIRSTS, FDERIVES): Adjust to reality: they are
15791 indexed by nonterminals.
15792
3a7456dd
AD
157932001-12-05 Akim Demaille <akim@epita.fr>
15794
15795 * src/warshall.c (TC, RTC): De-obsfucate (source reduced to 22% of
15796 what it was!).
15797 * src/warshall.h: Remove accidental duplication of the content.
15798
1cbcf2e7
AD
157992001-12-05 Akim Demaille <akim@epita.fr>
15800
15801 * src/closure.c (set_fderives): De-obfuscate.
15802
84182270
AD
158032001-12-05 Akim Demaille <akim@epita.fr>
15804
15805 * src/closure.c (print_firsts, print_fderives): De-obfuscate.
15806
3f6f053c
AD
158072001-12-05 Akim Demaille <akim@epita.fr>
15808
15809 * src/closure.c (set_firsts): De-obfuscate.
15810
7a5350ba
AD
158112001-12-05 Akim Demaille <akim@epita.fr>
15812
15813 * src/output.c (action_row): De-obfuscate
15814 using the good o' techniques: arrays not pointers, variable
15815 locality, BITISSET, RESETBIT etc.
15816
d954473d
AD
158172001-12-05 Akim Demaille <akim@epita.fr>
15818
15819 Pessimize the code to simplify it: from now on, all the states
15820 have a valid SHIFTS, which NSHIFTS is possibly 0.
15821
15822 * src/LR0.c (shifts_new): Be global and move to..
15823 * src/state.c, src/state.h: here.
15824 * src/conflicts, src/lalr.c, src/output.c, src/print.c,
15825 * src/print_graph: Adjust.
15826
9839bbe5
AD
158272001-12-05 Akim Demaille <akim@epita.fr>
15828
15829 * src/state.h (SHIFT_DISABLE, SHIFT_IS_DISABLED): New.
15830 * src/conflicts.c: Use it.
15831 Restore a few missing `if (!SHIFT_IS_DISABLED)' which were
15832 incorrectly ``simplified''.
15833
9f136c07
AD
158342001-12-05 Akim Demaille <akim@epita.fr>
15835
15836 * src/conflicts.c (flush_shift, resolve_sr_conflict): De-obfuscate
15837 using the good o' techniques: arrays not pointers, variable
15838 locality, BITISSET, RESETBIT etc.
15839
b608206e
AD
158402001-12-05 Akim Demaille <akim@epita.fr>
15841
15842 * src/state.h (SHIFT_SYMBOL): New.
15843 * src/conflicts.c: Use it to deobfuscate.
15844
52afa962
AD
158452001-12-05 Akim Demaille <akim@epita.fr>
15846
15847 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts)
15848 (print_reductions): De-obfuscate using the good o' techniques:
15849 arrays not pointers, variable locality, BITISSET.
15850
e74dc321
AD
158512001-12-05 Akim Demaille <akim@epita.fr>
15852
15853 * src/conflicts.c (print_reductions): Arrays, not pointers.
15854 Use BITISSET.
15855
768fca83
AD
158562001-12-05 Akim Demaille <akim@epita.fr>
15857
15858 * src/conflicts.c (print_reductions): Pessimize, but clarify.
15859
a17e599f
AD
158602001-12-05 Akim Demaille <akim@epita.fr>
15861
15862 * src/conflicts.c (print_reductions): Improve variable locality.
15863
a04bc341
AD
158642001-12-05 Akim Demaille <akim@epita.fr>
15865
15866 * src/conflicts.c (print_reductions): Pessimize, but clarify.
15867
c8ea038e
AD
158682001-12-05 Akim Demaille <akim@epita.fr>
15869
15870 * src/conflicts.c (print_reductions): Improve variable locality.
15871
aa2aab3c
AD
158722001-12-05 Akim Demaille <akim@epita.fr>
15873
15874 * src/state.h (SHIFT_IS_ERROR, SHIFT_IS_GOTO, SHIFT_IS_SHIFT): New.
15875 * src/lalr.c: Use them.
15876
b178c8cc
AD
158772001-12-05 Akim Demaille <akim@epita.fr>
15878
15879 * src/LR0.c (augment_automaton): Formatting changes.
15880 Better variable locality.
15881
f67d13aa
AD
158822001-12-05 Akim Demaille <akim@epita.fr>
15883
15884 * src/lalr.c (matrix_print): New.
15885 (transpose): Use it.
15886 Use arrays instead of pointers.
15887
c2713865
AD
158882001-12-05 Akim Demaille <akim@epita.fr>
15889
15890 * src/lalr.c (maxrhs): Move to...
15891 * src/gram.c, src/gram.h (ritem_longest_rhs): here.
15892 * src/lalr.c (build_relations): Adjust.
15893
9887c18a
AD
158942001-12-05 Akim Demaille <akim@epita.fr>
15895
15896 * src/lalr.c (transpose): Free the memory allocated to the
15897 argument, as it is replaced by the results by the unique caller.
15898 (build_relations): Merely invoke transpose: it handles the memory
15899 deallocation.
15900 Improve variable locality.
15901 Avoid variables used as mere abbreviations.
15902 (compute_lookaheads): Use arrays instead of pointers.
15903
4d4f699c
AD
159042001-12-05 Akim Demaille <akim@epita.fr>
15905
15906 * src/lalr.c (initialize_F): Improve variable locality.
15907 Avoid variables used as mere abbreviations.
15908
80a69750
AD
159092001-12-05 Akim Demaille <akim@epita.fr>
15910
15911 * src/derives.c (print_derives): Display the ruleno.
15912 * src/lalr.c (initialize_F, transpose): Better variable locality
15913 to improve readability.
15914 Avoid variables used as mere abbreviations.
15915
fe961097
AD
159162001-12-05 Akim Demaille <akim@epita.fr>
15917
15918 * src/lalr.c (traverse): Use arrays instead of pointers.
15919
e3e4e814
AD
159202001-12-05 Akim Demaille <akim@epita.fr>
15921
15922 * src/nullable.c (set_nullable): Use a for loop to de-obfuscate
15923 the handling of squeue.
15924 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
15925
630e182b
AD
159262001-12-05 Akim Demaille <akim@epita.fr>
15927
15928 Because useless nonterminals are now kept alive (instead of being
15929 `destroyed'), we now sometimes examine them, and store information
15930 related to them. Hence we need to know their number, and adjust
15931 memory allocations.
15932
15933 * src/reduce.c, src/reduce.h (nuseless_nonterminals): No longer
15934 static.
15935 * src/LR0.c (allocate_itemsets): The memory allocated to
15936 `symbol_count' was used for two different purpose: once to count
15937 the number of occurrences of each symbol, and later reassigned to
15938 `shift_symbol', containing the symbol that can be shifted from a
15939 given state.
15940 Deobfuscate, i.e., allocate, use and free `symbol_count' here
15941 only, and...
15942 (new_itemsets): Allocate `shift_symbol' here.
15943 (allocate_itemsets): symbol_count includes useless nonterminals.
15944 Make room for them.
15945 (free_storage): Use `free', not `XFREE', for pointers that cannot
15946 be null.
15947
81b51460
AD
159482001-12-05 Akim Demaille <akim@epita.fr>
15949
15950 * src/nullable.c (set_nullable): Deobfuscate the handling of
15951 ritem.
15952 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
15953
3067fbef
AD
159542001-12-05 Akim Demaille <akim@epita.fr>
15955
15956 * src/gram.c, src/gram.h (ritem_print): New.
15957 * src/gram.c (dummy): Remove, now there is actual code in gram.c.
15958 (This useless function was defined only to work around VMS linkers
15959 that can't handle compilation units with variables only).
15960 * src/reduce.c (dump_grammar): Use it to trace the construction of
15961 ritem.
15962
c2bea5f9
PE
159632001-12-04 Paul Eggert <eggert@twinsun.com>
15964
7d27c823
PE
15965 * src/bison.simple (union yyalloc): Change member names
15966 to be the same as the stack names.
15967 (yyparse): yyptr is now union yyalloc *, not char *.
15968 (YYSTACK_RELOCATE): Likewise. This avoids a GCC warning,
15969 and may generate better code on some machines.
c2bea5f9
PE
15970 (yystpcpy): Use prototype if __STDC__ is defined, not just
15971 if __cplusplus is defined.
35687a9d 15972
2c8a9dfa
AD
159732001-11-30 Akim Demaille <akim@epita.fr>
15974
15975 * configure.in (WARNING_CFLAGS): Add -Werror when possible.
15976 (CFLAGS): Do not include the WARNING_CFLAGS here, since GNU
15977 Gettext doesn't compile cleanly, and dies with -Werror.
15978 * src/Makefile.am, lib/Makefile.am, tests/atlocal.in (CFLAGS):
15979 Include WARNING_CFLAGS here.
15980 * lib/xstrdup.c: Include xalloc.h, so that xstrdup be declared
15981 before being defined.
15982
f4e421e6
AD
159832001-11-27 Paul Eggert <eggert@twinsun.com>
15984
15985 * lib/quotearg.h (quotearg_n, quotearg_n_style):
15986 First arg is int, not unsigned.
15987 * lib/quotearg.c (quotearg_n, quotearg_n_style): Likewise.
15988 (SIZE_MAX, UINT_MAX): New macros.
15989 (quotearg_n_options): Abort if N is negative.
15990 Avoid overflow check on hosts where size_t is 64 bits and int
15991 is 32 bits, as overflow is impossible there.
15992 Fix off-by-one typo that caused unnecessary reallocation.
15993
7093d0f5
AD
159942001-11-29 Paul Eggert <eggert@twinsun.com>
15995
15996 Name space cleanup in generated parser.
15997
15998 * doc/bison.texinfo (Bison Parser): Discuss system headers
15999 and their effect on the user name space.
16000
16001 * src/bison.simple:
16002 (YYSTACK_ALLOC, YYSTACK_FREE, union yyalloc, YYSTACK_GAP_MAX,
16003 YYSTACK_BYTES, YYSTACK_RELOCATE): Do not define unless necessary,
16004 i.e. unless ! defined (yyoverflow) || defined (YYERROR_VERBOSE).
16005
16006 (YYSIZE_T): New macro. Use it instead of size_t, to avoid infringing
16007 on user names when possible.
16008
16009 (YYSTACK_USE_ALLOCA): Do not define; just use any existing defn.
16010 Simplify test for whather <alloca.h> exists.
16011
16012 (<stdlib.h>): Include if we will use malloc, and if standard C or C++.
16013
16014 (<stdio.h>): Include if YYDEBUG.
16015
16016 (yymemcpy): Renamed from __yy_memcpy. Do not define unless
16017 ! defined (yyoverflow) && ! defined (yymemcpy).
16018
16019 (yymemcpy, yyparse): Rename local variables as needed so that
16020 they all begin with 'yy'.
16021
16022 (yystrlen, yystpcpy): New functions.
16023
16024 (YY_DECL_NON_LSP_VARIABLES): Renamed from _YY_DECL_VARIABLES.
16025 All uses changed.
16026
16027 (yyparse): size_t -> YYSIZE_T. Use yystrlen and yystpcpy
16028 instead of relying on string.h functions. Use YYSTACK_ALLOC
16029 and YYSTACK_FREE instead of malloc and free.
16030
fd51e5ff
AD
160312001-11-30 Akim Demaille <akim@epita.fr>
16032
16033 * src/bison.simple (YYSTYPE, YYLTYPE): Move their definitions
16034 before their first uses.
16035 (YYBISON, YYPURE): Move to the top of the output.
16036
7d13ff5f
AD
160372001-11-30 Akim Demaille <akim@epita.fr>
16038
16039 * tests/reduce.at (Useless Nonterminals): Fix.
16040
892a3995
AD
160412001-11-30 Akim Demaille <akim@epita.fr>
16042
16043 * src/bison.simple (YYSTACK_FREE): Use `do {;} while (0)' as empty
16044 if body instead of `;' to pacify GCC's warnings.
16045
68f1e3ed
AD
160462001-11-30 Akim Demaille <akim@epita.fr>
16047
16048 Instead of mapping the LHS of unused rules to -1, keep the LHS
16049 valid, but flag the rules as invalid.
16050
16051 * src/gram.h (rule_t): `useful' is a new member.
16052 * src/print.c (print_grammar): Adjust.
16053 * src/derives.c (set_derives): Likewise.
16054 * src/reader.c (packgram, reduce_output): Likewise.
16055 * src/reduce.c (reduce_grammar_tables): Likewise.
16056 * tests/reduce.at (Underivable Rules, Useless Rules): New.
16057
d2d1b42b
AD
160582001-11-30 Akim Demaille <akim@epita.fr>
16059
16060 * src/reduce.c (reduce_output): Formatting changes.
16061 * src/print.c (print_results, print_grammar): Likewise.
16062 * tests/regression.at (Rule Line Numbers)
16063 (Solved SR Conflicts, Unresolved SR Conflicts): Adjust.
16064
760b53a8
AD
160652001-11-30 Akim Demaille <akim@epita.fr>
16066
16067 * src/reduce.c (nonterminals_reduce): Instead of throwing away
16068 useless nonterminals, move them at the end of the symbol arrays.
16069 (reduce_output): Adjust.
16070 * tests/reduce.at (Useless Nonterminals): Adjust.
16071
00238958
AD
160722001-11-30 Akim Demaille <akim@epita.fr>
16073
16074 * src/reduce.c: Various comment/formatting changes.
16075 (nonterminals_reduce): New, extracted from...
16076 (reduce_grammar_tables): here.
16077 (reduce_grammar): Call nonterminals_reduce.
16078
396452de
PE
160792001-11-29 Paul Eggert <eggert@twinsun.com>
16080
16081 * src/bison.simple (YYSTACK_REALLOC): Remove.
16082 (YYSTACK_ALLOC): Resurrect this macro, with its old meaning.
16083 (YYSTACK_FREE, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYSTACK_RELOCATE):
16084 New macros.
16085 (union yyalloc): New type.
16086 (__yy_memcpy): Last arg is size_t, not unsigned int, to remove
16087 an arbitrary restriction on hosts where size_t is wider than int.
16088
16089 (yyparse): Don't dump core if alloca or malloc fails; instead, report
16090 a parser stack overflow. Allocate just one block of memory for all
16091 three stacks, instead of allocating three blocks; this typically is
16092 faster and reduces fragmentation.
16093
16094 Do not limit the number of items in the stack to a value that fits
16095 in 'int', as this is an arbitrary limit on hosts with 64-bit
16096 size_t and 32-bit int.
16097
147e184c
MA
160982001-11-29 Marc Autret <autret_m@epita.fr>
16099
16100 * tests/calc.at [AT_DATA_CALC_Y]: Use %error-verbose instead
16101 of defining YYERROR_VERBOSE.
16102 [AT_DATA]: $4 is now out of C declarations in the prologue.
16103
426cf563
MA
161042001-11-28 Marc Autret <autret_m@epita.fr>
16105
16106 * src/reader.c (parse_dquoted_param): New.
16107 (parse_skel_decl): Use it.
16108 * src/lex.h: Add its prototype.
16109 * src/lex.c (literalchar): Become not static.
16110
c7925b99
MA
161112001-11-28 Marc Autret <autret_m@epita.fr>
16112
16113 * src/output.h: And put its extern declaration here.
16114 * src/output.c (error_verbose): Define here.
16115 (prepare): Echo name modification.
16116 * src/getargs.h: Clean its extern declaration.
16117 * src/getargs.c (error_verbose_flag): Remove.
16118 (getargs): Remove case 'e'.
16119 * src/options.c (option_table): 'error-verbose' is now seen as simple
16120 percent option.
16121 Include output.h.
16122
16123 * src/reader.c (read_declarations): Remove case tok_include.
16124 (parse_include_decl): Remove.
16125 * src/lex.h (token_t): Remove tok_include.
16126 * src/options.c (option_table): 'include' is now a simple command line
16127 option.
16128
5b5d1929
MA
161292001-11-28 Marc Autret <autret_m@epita.fr>
16130
16131 * src/bison.simple: Adjust muscle names.
16132 * src/muscle_tab.c (muscle_init): Also rename the muscles.
16133 * src/output.c (prepare): s/_/-/ for the muscles names.
16134 (output_parser): When scanning for a muscle, allow '-' instead of '_'.
16135
8850be4b
MA
161362001-11-28 Marc Autret <autret_m@epita.fr>
16137
16138 * src/bison.simple: Fix debug.
16139 [YYERROR_VERBOSE]: Re-integrate as an internal macro.
16140
4a38e613
AD
161412001-11-28 Akim Demaille <akim@epita.fr>
16142
16143 * src/LR0.c (shifts_new): New.
16144 (save_shifts, insert_start_shift, augment_automaton): Use it.
16145
4b35e1c1
AD
161462001-11-28 Akim Demaille <akim@epita.fr>
16147
16148 * src/closure.c (closure): `b' and `ruleno' denote the same value:
16149 keep ruleno only.
16150
d2b04478
AD
161512001-11-28 Akim Demaille <akim@epita.fr>
16152
16153 * src/closure.c (closure): Instead of looping over word in array
16154 then bits in words, loop over bits in array.
16155
2c4c30aa
AD
161562001-11-28 Akim Demaille <akim@epita.fr>
16157
16158 * src/closure.c (closure): No longer optimize the special case
16159 where all the bits of `ruleset[r]' are set to 0, to make the code
16160 clearer.
16161
576890b7
AD
161622001-11-28 Akim Demaille <akim@epita.fr>
16163
16164 * src/closure.c (closure): `r' and `c' are new variables, used to
16165 de-obfuscate accesses to RULESET and CORE.
16166
cb487d7d
AD
161672001-11-28 Akim Demaille <akim@epita.fr>
16168
16169 * src/reduce.c (reduce_print): Use ngettext.
16170 (dump_grammar): Improve the trace accuracy.
16171
6013d43f
AD
161722001-11-28 Akim Demaille <akim@epita.fr>
16173
16174 * src/reduce.c (dump_grammar): Don't translate trace messages.
16175
cb4956ee
AD
161762001-11-28 Akim Demaille <akim@epita.fr>
16177
16178 * tests/reduce.at (Useless Terminals, Useless Nonterminals): New.
16179 * src/reduce.c (reduce_grammar_tables): Do not free useless tags,
16180 as all tags are free'ed afterwards.
16181 From Enrico Scholz.
16182
648185ab
PE
161832001-11-27 Paul Eggert <eggert@twinsun.com>
16184
16185 * src/bison.simple (YYSTACK_REALLOC): Fix typo that caused us to
16186 use alloca when we didn't want to, and vice versa.
16187
68254a03
MA
161882001-11-27 Marc Autret <autret_m@epita.fr>
16189
9113b58f
AD
16190 * src/muscle_tab.c (muscle_init): Remove 'verbose' muscle
16191 initialization.
68254a03
MA
16192 * src/output.c (prepare): Remove its update.
16193
04d843a2
MA
161942001-11-27 Marc Autret <autret_m@epita.fr>
16195
16196 * tests/torture.at [AT_DATA]: Remove YYERROR_VERBOSE definition.
16197 Use %error-verbose.
16198
d2079671 161992001-11-27 Marc Autret <autret_m@epita.fr>
eeeb962b
MA
16200
16201 * src/bison.simple: Remove YYERROR_VERBOSE using.
16202 Use %%error_verbose.
16203 (yyparse): Likewise.
16204 * src/output.c (prepare): Give its final value.
16205 * src/muscle_tab.c (muscle_init): Init new muscle 'error_verbose'.
16206 * src/getargs.h: Add its extern declaration.
16207 * src/getargs.c (error_verbose_flag): New int.
16208 (getargs): Update to catch new case.
16209 * src/options.c (option_table): 'error-verbose' is a new option.
16210 (shortopts): Update.
16211
e0327bc8
AD
162122001-11-27 Akim Demaille <akim@epita.fr>
16213
16214 * src/system.h: Use intl/libgettext.h.
16215 * src/Makefile.am (INCLUDES): Add -I $(top_srcdir).
16216
000f1a3c
AD
162172001-11-27 Akim Demaille <akim@epita.fr>
16218
16219 * tests/torture.at (Exploding the Stack Size with Malloc):
16220 s/YYSTACK_USE_ALLOCA_ALLOCA/YYSTACK_USE_ALLOCA/.
16221
26cfe0be
AD
162222001-11-27 Akim Demaille <akim@epita.fr>
16223
16224 * src/files.c: Include error.h.
16225 Reported by Hans Aberg.
16226
f6bd5427
MA
162272001-11-26 Marc Autret <autret_m@epita.fr>
16228
d2079671 16229 * src/reader.c (parse_include_decl): New, not yet implemented.
f6bd5427
MA
16230 (read_declarations): Add case tok_include.
16231 * src/getargs.h (include): Add its extern definition.
16232 * src/getargs.c (include): New const char *.
16233 (getargs): Add case '-I'.
16234 * src/options.c (option_table): Add include as command line and
16235 percent option.
16236 * src/lex.h (token_t): Add tok_include.
16237
2ca209c1
AD
162382001-11-26 Akim Demaille <akim@epita.fr>
16239
16240 * src/reader.c (readgram): Make sure rules for mid-rule actions
16241 have a lineno equal to that of their host rule.
16242 Reported by Hans Aberg.
16243 * tests/regression.at (Rule Line Numbers): New.
16244
0e41b407
AD
162452001-11-26 Akim Demaille <akim@epita.fr>
16246
16247 * src/LR0.c (allocate_itemsets): kernel_size contains ints, not
16248 size_ts.
16249
162502001-11-26 Akim Demaille <akim@epita.fr>
16251
16252 * src/complain.c, src/complain.h (error): Remove, provided by
16253 lib/error.[ch].
16254
e0c40012
AD
162552001-11-26 Akim Demaille <akim@epita.fr>
16256
16257 * src/reader.c (read_declarations): Don't abort on tok_illegal,
16258 issue an error message.
16259 * tests/regression.at (Invalid %directive): New.
16260 Reported by Hans Aberg.
16261
5e147124
AD
162622001-11-26 Akim Demaille <akim@epita.fr>
16263
16264 * configure.in: Invoke AC_FUNC_OBSTACK and AC_FUNC_ERROR_AT_LINE.
16265 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
16266
a034c8b8
AD
162672001-11-26 Akim Demaille <akim@epita.fr>
16268
16269 * src/conflicts.c (conflicts_print): Don't complain at all when
16270 there are no reduce/reduce conflicts, and as many shift/reduce
16271 conflicts as expected.
16272 * tests/regression.at (%expect right): Adjust.
16273
c64a20f3
AD
162742001-11-23 Akim Demaille <akim@epita.fr>
16275
16276 * lib/alloca.c: Update, from fileutils.
16277
5b0d29bb
AD
162782001-11-23 Akim Demaille <akim@epita.fr>
16279
16280 * lib/Makefile.am (libbison_a_LIBADD): Add @ALLOCA@.
16281
722c4bfe
AD
162822001-11-23 Akim Demaille <akim@epita.fr>
16283
16284 * src/system.h: Include alloca.h.
16285 * src/main.c (main) [C_ALLOCA]: Call alloca (0).
16286
6255b435
AD
162872001-11-23 Akim Demaille <akim@epita.fr>
16288
16289 * src/print_graph.c (print_actions): Remove `rule', unused.
16290 * src/LR0.c (kernel_size): Contain `int' instead of `size_t' to
16291 pacify GCC's signed < unsigned warnings.
16292 * src/closure.c (itemsetsize): Likewise.
16293 * src/reader.c (symbol_list_new): Static.
16294
b29b2ed5
AD
162952001-11-23 Akim Demaille <akim@epita.fr>
16296
16297 Attaching lineno to buckets is stupid, since only one copy of each
16298 symbol is kept, only the line of the first occurrence is kept too.
16299
16300 * src/symtab.h, src/symtab.c (bucket): Remove the line member.
16301 * src/reader.c (rline_allocated): Remove, unused.
16302 (symbol_list): Have a `line' member.
16303 (symbol_list_new): New.
16304 (readgram): Use it.
16305 * src/print.c (print_grammar): Output the rule line numbers.
16306 * tests/regression.at (Solved SR Conflicts)
16307 (Unresolved SR Conflicts): Adjust.
16308 Reported by Hans Aberg.
16309
a81b1d4a
MA
163102001-11-22 Marc Autret <autret_m@epita.fr>
16311
16312 * src/bison.simple [YYERROR_VERBOSE]: Force its value to be 1 or 0.
16313
c1ecb3c1
MA
163142001-11-22 Marc Autret <autret_m@epita.fr>
16315
16316 * src/muscle_tab.c (muscle_init): Remove initialization of
16317 skeleton muscle.
16318 * src/output.c (output_master_parser): Do it here.
16319
fbe01355
AD
163202001-11-20 Akim Demaille <akim@epita.fr>
16321
16322 * po/sv.po: New.
16323 * configure.in (ALL_LINGUAS): Adjust.
16324 * po/POTFILE.in: Remove `nullable.c' and `derives.c' which no
16325 longer contains strings to translate.
16326
81e895c0
AD
163272001-11-19 Akim Demaille <akim@epita.fr>
16328
16329 * src/conflicts.c (conflicts_print): Add a missing \n.
16330
6bb1878b
AD
163312001-11-19 Akim Demaille <akim@epita.fr>
16332
16333 * src/nullable.c (nullable_print): New.
16334 (set_nullable): Call it when tracing.
16335 Better locality of variables.
16336
d9ec2d07
AD
163372001-11-19 Akim Demaille <akim@epita.fr>
16338
16339 * src/print.c (print_actions): Better locality of variables.
16340
720e5c1b
AD
163412001-11-19 Akim Demaille <akim@epita.fr>
16342
16343 * src/derives.c (print_derives): Fix and enrich.
16344 * src/closure.c (print_fderives): Likewise.
16345
fb908786
AD
163462001-11-19 Akim Demaille <akim@epita.fr>
16347
16348 * src/closure.c (itemsetend): Remove, replaced with...
16349 (itemsetsize): new.
16350
125ecb56
AD
163512001-11-19 Akim Demaille <akim@epita.fr>
16352
16353 * src/LR0.c (kernel_end): Remove, replaced with...
16354 (kernel_size): new.
16355
d8cf039f
AD
163562001-11-19 Akim Demaille <akim@epita.fr>
16357
16358 * src/conflicts.c (set_conflicts): Use arrays instead of pointers
16359 to clarify.
16360
7bec0760
AD
163612001-11-19 Akim Demaille <akim@epita.fr>
16362
16363 * src/closure.c (closure): Use arrays instead of pointers to clarify.
16364
c87d4863
AD
163652001-11-19 Akim Demaille <akim@epita.fr>
16366
16367 * src/closure.c, src/derives.c, src/nullable.c: Adjust various
16368 trace messages.
16369 * src/LR0.c: Likewise.
16370 (allocate_itemsets): Use arrays instead of pointers to clarify.
16371
9bfe901c
AD
163722001-11-19 Akim Demaille <akim@epita.fr>
16373
16374 * src/getargs.c (statistics_flag): Replace with...
16375 (trace_flag): New.
16376 (longopts): Accept --trace instead of --statistics.
16377 * src/getargs.h, src/options.c: Adjust.
16378 * src/LR0.c, src/closure.c, src/derives.c, src/nullable.c,
16379 * src/reduce.c: Use trace_flags instead of the CPP conditional TRACE.
16380
97db7bd4
AD
163812001-11-19 Akim Demaille <akim@epita.fr>
16382
cc72668c 16383 * src/LR0.c (new_itemsets, get_state): Use more arrays and fewer
97db7bd4
AD
16384 pointers to clarify the code.
16385 (save_reductions, save_shifts): Factor common parts of alternatives.
16386
2c5f66ed
AD
163872001-11-19 Akim Demaille <akim@epita.fr>
16388
16389 * src/LR0.c (new_state, get_state): Complete TRACE code.
16390 * src/closure.c: Include `reader.h' to get `tags', needed by the
16391 trace code.
16392 Rename the conditional DEBUG as TRACE.
16393 Output consistently TRACEs to stderr, not stdout.
16394 * src/derives.c: Likewise.
16395 * src/reduce.c: (inaccessable_symbols): Using if is better style
16396 than goto.
16397 Use `#if TRACE' instead of `#if 0' for tracing code.
16398
300f275f
AD
163992001-11-19 Akim Demaille <akim@epita.fr>
16400
16401 * src/system.h (LIST_FREE, shortcpy): New.
16402 * src/LR0.c: Use them.
16403 * src/output.c (free_itemsets, free_reductions, free_shifts):
16404 Remove, replaced by LIST_FREE.
16405
f59c437a
AD
164062001-11-19 Akim Demaille <akim@epita.fr>
16407
16408 * src/state.h (CORE_ALLOC, SHIFTS_ALLOC, ERRS_ALLOC)
16409 (REDUCTIONS_ALLOC): New.
16410 * src/LR0.c, src/conflicts.c: Use them to de-obfuscate memory
16411 allocation.
16412
6986fd9e
AD
164132001-11-19 Akim Demaille <akim@epita.fr>
16414
16415 * src/LR0.c (new_state): Complete trace code.
16416 * src/nullable.c (set_nullable): Don't translate traces.
16417
4bc30f78
AD
164182001-11-19 Akim Demaille <akim@epita.fr>
16419
16420 * src/print_graph.c (print_core): Better locality of variables.
16421 * src/print.c (print_core): Likewise.
16422
08a946e0
AD
164232001-11-19 Akim Demaille <akim@epita.fr>
16424
16425 * src/vcg.c: You do the output, so you are responsible of the
16426 handling of VCG syntax, in particular: use quotearg.
16427 * src/print_graph.c: Don't.
16428 (print_actions): Don't output the actions as part of the nodes,
16429 since that's the job of the edges.
16430 (print_state): Don't output by hand: fill the node description,
9bfe901c 16431 and ask for its output.
08a946e0 16432
f0473484
AD
164332001-11-19 Akim Demaille <akim@epita.fr>
16434
cc72668c
AD
16435 * src/bison.simple (yyparse): When verbosely reporting an error,
16436 no longer put additional quotes around token names.
f0473484
AD
16437 * tests/calc.at: Adjust.
16438
e41dc700
AD
164392001-11-19 Akim Demaille <akim@epita.fr>
16440
16441 * src/symtab.h, src/symtab.c: `line' is a new member of `bucket'.
16442 * src/reader.c (record_rule_lines, rline, rline_allocated): Remove.
16443 * src/output.c: Adjust.
16444
652a871c
AD
164452001-11-19 Akim Demaille <akim@epita.fr>
16446
16447 * src/gram.h (rprec, rprecsym, rassoc): Remove, now part of...
16448 (rule_t): this.
16449 * src/conflicts.c, src/reader.c, src/reduce.c: Adjust.
16450
b2ed6e58
AD
164512001-11-19 Akim Demaille <akim@epita.fr>
16452
16453 * src/gram.h (rule_t): New.
16454 (rule_table): New.
16455 (rrhs, rlhs): Remove, part of state_t.
16456 * src/print_graph.c, src/closure.c, src/conflicts.c, src/derives.c,
16457 * src/lalr.c, src/nullable.c, src/output.c, src/print.c,
16458 * src/reader.c, src/reduce.c: Adjust.
16459
edad7067
AD
164602001-11-19 Akim Demaille <akim@epita.fr>
16461
16462 * src/reader.c (symbols_output): New, extracted from...
16463 (packsymbols): Here.
16464 (reader): Call it.
16465
3feec034
AD
164662001-11-19 Akim Demaille <akim@epita.fr>
16467
16468 * src/lalr.c (set_maxrhs, maxrhs): Remove, replaced with...
16469 (maxrhs): this new function.
16470
ddcd5fdf
AD
164712001-11-19 Akim Demaille <akim@epita.fr>
16472
cc72668c 16473 * src/lalr.c (F): New macro to access the variable F.
ddcd5fdf
AD
16474 Adjust.
16475
bb527fc2
AD
164762001-11-19 Akim Demaille <akim@epita.fr>
16477
cc72668c 16478 * src/lalr.h (LA): New macro to access the variable LA.
bb527fc2
AD
16479 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
16480 * src/lalr.c: Adjust.
16481
a845a697
AD
164822001-11-19 Akim Demaille <akim@epita.fr>
16483
16484 * src/lalr.c (initialize_LA): Only initialize LA. Let...
16485 (set_state_table): handle the `lookaheads' members.
16486
f004bf6a
AD
164872001-11-19 Akim Demaille <akim@epita.fr>
16488
cc72668c
AD
16489 * src/lalr.h (lookaheads): Removed array, whose contents is now
16490 a member of...
f004bf6a
AD
16491 (state_t): this structure.
16492 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
16493 Adjust.
16494
de326cc0
AD
164952001-11-19 Akim Demaille <akim@epita.fr>
16496
cc72668c
AD
16497 * src/lalr.h (consistent): Removed array, whose contents is now
16498 a member of...
de326cc0
AD
16499 (state_t): this structure.
16500 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
16501 Adjust.
16502
90b4416b
AD
165032001-11-19 Akim Demaille <akim@epita.fr>
16504
cc72668c
AD
16505 * src/lalr.h (reduction_table, shift_table): Removed arrays, whose
16506 contents are now members of...
90b4416b
AD
16507 (state_t): this structure.
16508 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
16509 Adjust.
16510
9703cc49
AD
165112001-11-19 Akim Demaille <akim@epita.fr>
16512
16513 * src/lalr.h (state_t): New.
16514 (state_table): Be a state_t * instead of a core **.
16515 (accessing_symbol): Remove, part of state_t.
16516 * src/lalr.c: Adjust.
16517 (set_accessing_symbol): Merge into...
16518 (set_state_table): this.
16519 * src/print_graph.c, src/conflicts.c: Adjust.
16520
d803322e
AD
165212001-11-14 Akim Demaille <akim@epita.fr>
16522
16523 * tests/calc.at, tests/output.at, tests/regression.at,
16524 * tests/testsuite.at, tests/torture.at: Rely on Autotest 2.52g:
16525 now the tests are run in private dirs, therefore AC_CLEANUP and
16526 family can be simplified to 0-ary.
16527 * tests/atlocal.in: Now that we run `elsewhere' than in tests/,
16528 use abs. path to find config.h.
16529 * tests/calc.at (AT_CHECK_CALC): Don't try to check the compiler's
16530 stderr, there can be way too much random noise.
16531 Instead pass -Werror to GCC and rely on the exit status.
16532 Reported by Wolfram Wagner.
16533
3d76b07d
AD
165342001-11-14 Akim Demaille <akim@epita.fr>
16535
16536 * src/bison.simple (yyparse): Let yyls1, yyss1 and yyvs1 be
16537 defined only if yyoverflow is defined, to avoid `warning: unused
16538 variable `yyvs1''.
16539 Reported by The Test Suite.
16540
09b503c8
AD
165412001-11-14 Akim Demaille <akim@epita.fr>
16542
16543 * src/print.c: Include reduce.h.
16544 Reported by Hans Aberg.
16545
165462001-11-14 Akim Demaille <akim@epita.fr>
16547
16548 * src/lex.c, src/lex.h (token_buffer, unlexed_token_buffer):
16549 Revert a previous patch: these are really const.
16550 * src/conflicts.c (conflict_report): Additional useless pair of
16551 braces to pacify GCC's warnings for `if () if () {} else {}'.
16552 * src/lex.c (parse_percent_token): Replace equal_offset with
16553 arg_offset.
16554 arg is const.
16555 Be sure to strdup `arg' when used, since there is no reason for
16556 token_buffer not to change.
16557
0f37a994
AD
165582001-11-14 Akim Demaille <akim@epita.fr>
16559
16560 * src/system.h (EXIT_SUCCESS, EXIT_FAILURE): Ensure a proper
16561 definition.
16562 * src/main.c (main): Use them.
16563 Suggested by Hans Aberg.
16564
d39d93b8
AD
165652001-11-12 Akim Demaille <akim@epita.fr>
16566
16567 * src/system.h (ngettext): Now that we use ngettext, be sure to
16568 provide a default definition when NLS are not used.
16569
9edcd895
AD
165702001-11-12 Akim Demaille <akim@epita.fr>
16571
16572 * doc/bison.texinfo: Use `$' as shell prompt, not `%'.
16573 Use @kbd to denote user input.
16574 (Language and Grammar): ANSIfy the example.
16575 Adjust its layout for info/notinfo.
16576 (Location Tracking Calc): Output error messages to stderr.
16577 Output locations in a more GNUtically correct way.
16578 Fix a couple of Englishos.
16579 Adjust @group/@end group pairs.
16580
7da99ede
AD
165812001-11-12 Akim Demaille <akim@epita.fr>
16582
e3aa65c5 16583 %expect was not functioning at all.
7da99ede
AD
16584
16585 * src/conflicts.c (expected_conflicts): Set to -1.
16586 (conflict_report): Use ngettext.
16587 (conflicts_print): Check %expect and make its violation an error.
16588 * doc/bison.texinfo (Expect Decl): Adjust.
16589 * configure.in (AM_GNU_GETTEXT): Ask for ngettext.
16590 * tests/regression.at (%expect not enough, %expect right)
16591 (%expect too much): New.
16592
ba9dda1a
AD
165932001-11-12 Akim Demaille <akim@epita.fr>
16594
16595 * tests/regression.at (Conflicts): Rename as...
16596 (Unresolved SR Conflicts): this.
16597 (Solved SR Conflicts): New.
16598
337c5bd1
AD
165992001-11-12 Akim Demaille <akim@epita.fr>
16600
16601 * src/reduce.c (print_results): Rename as...
16602 (reduce_output): This.
16603 Output to OUT, passed as argument, instead of output_obstack.
16604 (dump_grammar): Likewise.
16605 (reduce_free): New.
16606 Also free V1.
16607 (reduce_grammar): No longer call reduce_output, since...
16608 * src/print.c (print_results): do it.
16609 * src/main.c (main): Call reduce_free;
16610
c73a41af
AD
166112001-11-12 Akim Demaille <akim@epita.fr>
16612
16613 * src/conflicts.c (print_reductions): Accept OUT as argument.
16614 Output to it, not to output_obstack.
16615 * src/print.c (print_actions): Adjust.
16616
0df87bb6
AD
166172001-11-12 Akim Demaille <akim@epita.fr>
16618
16619 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts): Return
16620 the result instead of using...
16621 (src_total, rrc_total, src_count, rrc_count): Remove.
16622 (any_conflicts): Remove.
16623 (print_conflicts): Split into...
16624 (conflicts_print, conflicts_output): New.
16625 * src/conflicts.h: Adjust.
16626 * src/main.c (main): Invoke both conflicts_output and conflicts_print.
0f37a994 16627 * src/print.c (print_grammar): Issue `\n' between two rules.
0df87bb6
AD
16628 * tests/regression.at (Conflicts): New.
16629 Reported by Tom Lane.
16630
e4d3d4de
AD
166312001-11-12 Akim Demaille <akim@epita.fr>
16632
16633 * tests/regression.at (Invalid input): Remove, duplicate with
16634 ``Invalid input: 1''.
16635
6d7d248e
AD
166362001-11-12 Akim Demaille <akim@epita.fr>
16637
16638 * tests/torture.at (AT_DATA_STACK_TORTURE)
16639 (Exploding the Stack Size with Alloca)
16640 (Exploding the Stack Size with Malloc): New.
16641
e9e4c321
AD
166422001-11-12 Akim Demaille <akim@epita.fr>
16643
16644 * src/bison.simple (YYSTACK_REALLOC): New.
16645 (yyparse) [!yyoverflow]: Use it and free the old stack.
0f37a994 16646 Reported by Per Allansson.
e9e4c321 16647
5f7e0832
AD
166482001-11-12 Pascal Bart <pascal.bart@epita.fr>
16649
16650 * src/bison.simple: Define type yystype instead of YYSTYPE, and
16651 define CPP macro, which substitute YYSTYPE by yystype.
16652 * src/reader.c (parse_union_decl): Output yystype/YYSTYPE as we do
16653 with yyltype/YYLTYPE. This allows inclusion of the generated
16654 header within the parser if the compiler, such as GGC, accepts
16655 multiple equivalent #defines.
16656 From Akim.
16657
e3f1699f
AD
166582001-11-05 Akim Demaille <akim@epita.fr>
16659
16660 * src/reader.c (symbols_output): New, extracted from...
16661 (packsymbols): here.
16662 (reader): Adjust.
16663
65be0866
AD
166642001-11-05 Akim Demaille <akim@epita.fr>
16665
16666 * src/lex.c (parse_percent_token): s/quotearg/quote/.
16667
e4d910bf
AD
166682001-11-05 Akim Demaille <akim@epita.fr>
16669
16670 * tests/regression.at (AT_TEST_CPP_GUARD_H): Adjust the clean up
16671 pattern.
16672
951366c1
AD
166732001-11-05 Akim Demaille <akim@epita.fr>
16674
16675 * src/options.h (struct option_table_struct): set_flags is void*.
16676 * src/options.c (longopts): Support `--output' and `%output'.
16677 (usage): Adjust.
16678 * src/lex.h (tok_setopt): Remove, replaced with...
16679 (tok_intopt, tok_stropt): these new guys.
16680 * src/lex.c (getopt.h): Not needed.
16681 (token_buffer, unlexed_token_buffer): Not const.
16682 (percent_table): Promote `-' over `_' in directive names.
16683 Active `%name-prefix', `file-prefix', and `output'.
16684 (parse_percent_token): Accept possible arguments to directives.
16685 Promote `-' over `_' in directive names.
16686
d8988b2f
AD
166872001-11-04 Akim Demaille <akim@epita.fr>
16688
16689 * doc/bison.texinfo (Decl Summary): Split the list into
16690 `directives for grammars' and `directives for bison'.
16691 Sort'em.
16692 Add description of `%name-prefix', `file-prefix', and `output'.
16693 Promote `-' over `_' in directive names.
16694 (Bison Options): s/%locactions/%locations/. Nice Freudian slip.
16695 Simplify the description of `--name-prefix'.
16696 Promote `-' over `_' in directive names.
16697 Promote `--output' over `--output-file'.
16698 Fix the description of `--defines'.
16699 * tests/output.at: Exercise %file-prefix and %output.
16700
6468d18e
AD
167012001-11-02 Akim Demaille <akim@epita.fr>
16702
16703 * doc/refcard.tex: Update.
16704
6b7e85b9
AD
167052001-11-02 Akim Demaille <akim@epita.fr>
16706
16707 * src/symtab.h (SUNDEF): New.
16708 * src/symtab.c (bucket_new): Init user_token_number to SUNDEF to
16709 stand for `uninitialized', instead of 0.
16710 * src/reader.c (packsymbols, parse_thong_decl): Adjust.
16711 * src/lex.c (lex): Adjust.
16712
16713 * tests/calc.at (_AT_DATA_CALC_Y): Declare a token for EOF.
16714 Number it 0.
16715 Let yylex return it instead of a plain 0.
16716 Reported by Dick Streefland.
16717
cd5aafcf
AD
167182001-11-02 Akim Demaille <akim@epita.fr>
16719
16720 * tests/regression.at (Mixing %token styles): New test.
16721
037ca2f1
AD
167222001-11-02 Akim Demaille <akim@epita.fr>
16723
16724 * src/reader.c (parse_thong_decl): Formatting changes.
16725 (token_translations_init): New, extracted from...
16726 (packsymbols): Here.
16727 Adjust.
16728
270a173c
AD
167292001-11-01 Akim Demaille <akim@epita.fr>
16730
16731 * tests/regression.at (AT_TEST_CPP_GUARD_H): New.
16732 Check that `9foo.y' produces correct cpp guards.
16733 * src/files.c (compute_header_macro): Prepend `BISON_' to CPP
16734 guards.
16735 Reported by Wwp.
16736
561f9a30
AD
167372001-11-01 Akim Demaille <akim@epita.fr>
16738
16739 * tests/regression.at (Invalid input: 2): New.
16740 * src/lex.c (unlexed_token_buffer): New.
16741 (lex, unlex): Adjust: when unlexing, be sure to save token_buffer
16742 too.
16743 Reported by Wwp.
16744
f987e9d2
AD
167452001-11-01 Akim Demaille <akim@epita.fr>
16746
16747 * tests/calc.at: Catch up with 1.30.
16748 * configure.in: Bump to 1.49a.
16749 Adjust to newer Autotest.
16750
0846f581
PB
167512001-10-19 Pascal Bart <pascal.bart@epita.fr>
16752
16753 * src/conflicts.c: Move global variables rrc_total and src_total ...
16754 (print_conflicts): here.
16755 * src/output.c (output): Free global variable user_toknums.
16756 * src/lex.c (token_obstack): Become static.
16757
3c1a79b3
AD
167582001-10-18 Akim Demaille <akim@epita.fr>
16759
16760 * tests/atlocal.in (GCC): Add.
16761 * tests/calc.at: s/m4_match/m4_bmatch/.
16762 s/m4_patsubst/m4_bpatsubst/.
16763 (AT_CHECK_CALC): Check the compiler's stderr only if it's GCC.
16764 * configure.in: AC_SUBST(GCC).
16765
5d52e7d0
MA
167662001-10-14 Marc Autret <autret_m@epita.fr>
16767
16768 * src/options.c (create_long_option_table): Fix.
16769
631aa1d3
AD
167702001-10-10 Akim Demaille <akim@epita.fr>
16771
16772 * src/bison.simple: Be sure to set YYSTACK_USE_ALLOCA.
16773
f6ec6d13
AD
167742001-10-04 Akim Demaille <akim@epita.fr>
16775
16776 * src/reader.c (parse_union_decl): Push the caracters in
16777 union_obstack, not attrs_obstack.
16778
342b8b6e
AD
167792001-10-04 Akim Demaille <akim@epita.fr>
16780
16781 Merge in the branch 1.29.
16782
16783 * src/reader.c (packsymbols): Use a temporary obstack for
16784 `%%tokendef', since output_stack is already used elsewhere.
16785
16786 2001-10-02 Akim Demaille <akim@epita.fr>
16787
16788 Bump 1.29d.
16789
16790 2001-10-02 Akim Demaille <akim@epita.fr>
16791
16792 Version 1.29c.
16793
16794 2001-10-02 Akim Demaille <akim@epita.fr>
16795
16796 * tests/regression.at (Invalid CPP headers): New.
16797 From Alexander Belopolsky.
16798 * src/files.c (compute_header_macro): Map non alnum chars to `_'.
16799
16800 2001-10-02 Akim Demaille <akim@epita.fr>
16801
16802 * tests/regression.at (Invalid input): New.
16803 * src/lex.c (lex): Be sure to set `token_buffer' in any case.
16804 Reported by Shura.
16805
16806 2001-10-02 Akim Demaille <akim@epita.fr>
16807
16808 * tests/calc.at: Now that --debug works, the tests must be adjusted.
16809
16810 2001-10-02 Akim Demaille <akim@epita.fr>
16811
16812 * src/output.c (output_parser): Assert `skeleton'.
16813 * src/files.c (skeleton_find): Look harder for skeletons on DOSish
16814 systems.
16815 From Shura.
16816
16817 2001-10-01 Marc Autret <autret_m@epita.fr>
16818
16819 * src/lex.h: Echo modifications.
16820 * src/lex.c (unlex): Parameter is now token_t.
16821 From Hans Aberg.
16822
16823 2001-10-01 Marc Autret <autret_m@epita.fr>
16824
16825 * src/main.c: Include lex.h.
16826 From Hans Aberg.
16827
16828 2001-09-29 Akim Demaille <akim@epita.fr>
16829
16830 * src/getargs.c (longopts): `--debug' is `-t', not `-d'.
16831
16832 2001-09-28 Akim Demaille <akim@epita.fr>
16833
16834 * tests/testsuite.at: Update to newer Autotest.
16835 * tests/Makefile.am (EXTRA_DIST): bison is not to be shipped.
16836
16837 2001-09-27 Akim Demaille <akim@epita.fr>
16838
16839 Position independent wrapper.
16840
16841 * tests/bison: Remove.
16842 * tests/bison.in: New.
16843 * configure.in: Adjust.
16844
16845 2001-09-27 Paul Eggert <eggert@twinsun.com>
16846
16847 Port quotearg fixes from tar 1.13.24.
16848
16849 * lib/quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
16850 tm to be declared.
16851 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
16852 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
16853
16854 * m4/Makefile.am (EXTRA_DIST): Add mbrtowc.m4.
16855 * m4/mbrtowc.m4: New file.
16856 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Check for mbsinit and stddef.h.
16857 Use jm_FUNC_MBRTOWC instead of AC_CHECK_FUNCS(mbrtowc).
16858
16859 2001-09-27 Akim Demaille <akim@epita.fr>
16860
16861 Bump to 1.29c.
16862
16863 2001-09-27 Akim Demaille <akim@epita.fr>
16864
16865 Version 1.29b.
16866
16867 2001-09-25 Akim Demaille <akim@epita.fr>
16868
16869 * src/system.h: Include `xalloc.h'.
16870 Remove it from the C files.
16871 * src/files.c (output_files): Free the obstacks.
16872 * src/lex.c (init_lex): Rename as...
16873 (lex_init): this.
16874 (lex_free): New.
16875 * src/main.c (main): Use it.
16876
16877 2001-09-24 Marc Autret <autret_m@epita.fr>
16878
16879 * src/vcg.c (open_edge, close_edge, open_node, close_node): Change
16880 to output informations in fout (FILE*).
16881 (open_graph, close_graph): Likewise.
16882 (output_graph, output_edge, output_node): Likewise.
16883 * src/vcg.h: Update function prototypes.
16884 * src/print_graph.c (print_graph): Open output graph file.
16885 (print_actions): Adjust.
16886 * src/files.h: Remove extern declaration.
16887 * src/files.c: Remove graph_obstack declaration.
16888 (open_files): Remove graph_obstack initialization.
16889 (output_files): Remove graph_obstack saving.
16890
16891 2001-09-24 Marc Autret <autret_m@epita.fr>
16892
16893 * src/files.c (compute_output_file_names): Fix.
16894
16895 2001-09-24 Marc Autret <autret_m@epita.fr>,
16896 Akim Demaille <akim@epita.fr>
16897
16898 * src/reader.c (reader): Remove call to free_symtab ().
16899 * src/main.c (main): Call it here.
16900 Include symtab.h.
16901 * src/conflicts.c (initialize_conflicts): Rename as...
16902 (solve_conflicts): this.
16903 * src/print.c (print_core, print_actions, print_state)
16904 (print_grammar): Dump to a file instead a `output_obstack'.
16905 (print_results): Dump `output_obstack', and then proceed with the
16906 FILE *.
16907 * src/files.c (compute_output_file_names, close_files): New.
16908 (output_files): Adjust.
16909 * src/main.c (main): Adjust.
16910
16911 2001-09-23 Marc Autret <autret_m@epita.fr>
16912
16913 * src/files.c (compute_header_macro): Computes header macro name
16914 from spec_defines_file when given.
16915
16916 2001-09-23 Marc Autret <autret_m@epita.fr>
16917
16918 * src/files.c (output_files): Add default extensions.
16919
16920 2001-09-22 Akim Demaille <akim@epita.fr>
16921
16922 * src/conflicts.c (finalize_conflicts): Rename as...
16923 (free_conflicts): this.
16924
16925 2001-09-22 Akim Demaille <akim@epita.fr>
16926
16927 * src/gram.c (gram_free): Rename back as...
16928 (dummy): this.
16929 (output_token_translations): Free `token_translations'.
16930 * src/symtab.c (free_symtab): Free the tag field.
16931
16932 2001-09-22 Akim Demaille <akim@epita.fr>
16933
16934 Remove `translations' as it is always set to true.
16935
16936 * src/gram.h: Adjust.
16937 * src/reader.c (packsymbols, parse_token_decl): Adjust
16938 * src/print.c (print_grammar): Adjust.
16939 * src/output.c (output_token_translations): Adjust.
16940 * src/lex.c (lex): Adjust.
16941 * src/gram.c: Be sure the set pointers to NULL.
16942 (dummy): Rename as...
16943 (gram_free): this.
16944
16945 2001-09-22 Akim Demaille <akim@epita.fr>
16946
16947 * configure.in: Invoke AM_LIB_DMALLOC.
16948 * src/system.h: Use dmalloc.
16949 * src/LR0.c: Be sure to have pointers initialized to NULL.
16950 (allocate_itemsets): Allocate kernel_items only if needed.
16951
16952 2001-09-22 Akim Demaille <akim@epita.fr>
16953
16954 * configure.in: Bump to 1.29b.
16955 * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
16956 * tests/calc.at (_AT_DATA_CALC_Y): #undef malloc so that we don't
16957 need xmalloc.c in calc.y.
16958 From Pascal Bart.
16959
16960 2001-09-21 Akim Demaille <akim@epita.fr>
16961
16962 Version 1.29a.
16963 * Makefile.maint, config/config.guess, config/config.sub,
16964 * config/missing: Update from masters.
16965 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): No longer depend
16966 upon package.m4.
16967 * configure.in (ALL_LINGUAS): Add `tr'.
16968
16969 2001-09-21 Akim Demaille <akim@epita.fr>
16970
16971 * tests/Makefile.am (package.m4): Move to...
16972 ($(srcdir)/$(TESTSUITE)): here.
16973
16974 2001-09-20 Akim Demaille <akim@epita.fr>
16975
16976 * src/complain.c: No longer try to be standalone: use system.h.
16977 Don't assume __STDC__ is defined to 1. Just test if it is defined.
16978 * src/complain.h: Likewise.
16979 * src/reduce.c (useless_nonterminals, inaccessable_symbols):
16980 Remove the unused variable `n'.
16981 From Albert Chin-A-Young.
16982
16983 2001-09-18 Marc Autret <autret_m@epita.fr>
16984
16985 * doc/bison.1: Update.
16986 * doc/bison.texinfo (Bison Options): Update --defines and --graph
16987 descriptions.
16988 (Option Cross Key): Update.
16989 Add --graph.
16990
16991 2001-09-18 Marc Autret <autret_m@epita.fr>
16992
16993 * tests/regression.at: New test (comment in %union).
16994
16995 2001-09-18 Marc Autret <autret_m@epita.fr>
16996
16997 * src/reader.c (parse_union_decl): Do not output '/'. Let copy_comment
16998 do that.
16999 Reported by Keith Browne.
17000
17001 2001-09-18 Marc Autret <autret_m@epita.fr>
17002
17003 * tests/output.at: Add tests for --defines and --graph.
17004
17005 2001-09-18 Marc Autret <autret_m@epita.fr>
17006
17007 * tests/output.at: Removes tests of %{header,src}_extension features.
17008
17009 2001-09-18 Akim Demaille <akim@epita.fr>
17010
17011 * tests/Makefile.am (package.m4): New.
17012 * tests/calc.at (_AT_CHECK_CALC): Just run `calc input'.
17013 (_AT_CHECK_CALC_ERROR): Likewise.
17014 Factor the `, ' part of verbose error messages.
17015
17016 2001-09-18 Marc Autret <autret_m@epita.fr>
17017
17018 * src/getargs.c (longopts): Declare --defines and --graph as options
17019 with optional arguments.
17020 * src/files.h: Add extern declarations.
17021 * src/files.c (spec_graph_file, spec_defines_file): New.
17022 (output_files): Update.
17023 Remove CPP-outed code.
17024
17025 2001-09-18 Marc Autret <autret_m@epita.fr>
17026
17027 Turn off %{source,header}_extension feature.
17028
17029 * src/files.c (compute_exts_from_gf): Update.
17030 (compute_exts_from_src): Update.
17031 (output_files): CPP-out useless code.
17032 * src/files.h: Remove {header,source}_extension extern declarations.
17033 * src/reader.c (parse_dquoted_param): CPP-out.
17034 (parse_header_extension_decl): Remove.
17035 (parse_source_extension_decl): Remove.
17036 (read_declarations): Remove cases tok_{hdrext,srcext}.
17037 * src/lex.c (percent_table): Remove {header,source}_extension entries.
17038 * src/lex.h (token_t): Remove tok_hdrext and tok_srcext.
17039
17040 2001-09-10 Akim Demaille <akim@epita.fr>
17041
17042 * tests/output.at (AT_CHECK_BISON_FLAGS, AT_CHECK_BISON_PERCENT):
17043 (AT_CHECK_BISON_PERCENT_FLAGS): Merge into...
17044 (AT_CHECK_OUTPUT): this.
17045 Merely check ls' exit status, its output is useless.
17046
17047 2001-09-10 Akim Demaille <akim@epita.fr>
17048
17049 * tests/calc.at: Use m4_match.
17050 (_AT_DATA_CALC_Y): Check `yyin != NULL', not `stdin != NULL'.
17051
17052 2001-09-10 Marc Autret <autret_m@epita.fr>,
17053 Akim Demaille <akim@epita.fr>
17054
17055 * src/vcg.h (graph_s): color, textcolor, bordercolor are now
17056 enum color_e.
17057 * src/print_graph.c (print_graph): Initalize graph.layoutalgorithm
17058 to `normal'.
17059 * src/reader.c (parse_token_decl): Initialize token with tok_eof.
17060 * src/lex.h: Adjust prototype.
17061 (token_t): Add `tok_undef'.
17062 * src/lex.c (struct percent_table_struct): Retval is now a token_t.
17063 (parse_percent_token): Now returns token_t.
17064 Add default statement in switch.
17065 (lex): Separate `c' as an input variable, from the token_t result
17066 part.
17067 (unlexed): Is a token_t.
17068
17069 2001-09-10 Akim Demaille <akim@epita.fr>
17070
17071 * configure.in: Bump to 1.29a.
17072
17073 2001-09-07 Akim Demaille <akim@epita.fr>
17074
17075 Version 1.29.
17076
17077 2001-08-30 Akim Demaille <akim@epita.fr>
17078
17079 * tests/atgeneral.m4, tests/atconfig.in, tests/suite.at: Remove.
17080 * m4/atconfig.m4: Remove.
17081 * tests/testsuite.at, tests/atlocal.in, tests/output.at,
17082 * tests/bison: New.
17083 * tests/regression.at, tests/calc.at: Use m4_define, AT_BANNER,
17084 m4_if, m4_patsubst, and m4_regexp.
17085 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Use an
17086 `input' file instead of echo.
17087
17088 2001-08-29 Akim Demaille <akim@epita.fr>
17089
17090 Bump to 1.28e.
17091
17092 2001-08-29 Akim Demaille <akim@epita.fr>
17093
17094 Version 1.28d.
17095
17096 2001-08-29 Paul Eggert <eggert@twinsun.com>
17097
17098 * src/bison.simple (yyparse): Don't take the address of an
17099 item before the start of an array, as that doesn't conform to
17100 the C Standard.
17101
17102 2001-08-29 Robert Anisko <anisko_r@epita.fr>
17103
17104 * doc/bison.texinfo (Location Tracking Calc): New node.
17105
17106 2001-08-29 Paul Eggert <eggert@twinsun.com>
17107
17108 * src/output.c (output): Do not define const, as this now
17109 causes more problems than it cures.
17110
17111 2001-08-29 Akim Demaille <akim@epita.fr>
17112
17113 * doc/bison.texinfo: Modernize `@node' and `@top' use: just name
17114 the nodes.
17115 Be sure to tag the `detailmenu'.
17116
17117 2001-08-29 Akim Demaille <akim@epita.fr>
17118
17119 * Makefile.maint (do-po-update): Wget refuses to overwrite files:
17120 download in a tmp dir.
17121
17122 2001-08-28 Marc Autret <autret_m@epita.fr>
17123
17124 * config/depcomp: New file.
17125
17126 2001-08-28 Marc Autret <autret_m@epita.fr>
17127
17128 * doc/bison.1 (mandoc): Adjust.
17129 From Juan Manuel Guerrero.
17130
17131 2001-08-28 Marc Autret <autret_m@epita.fr>
17132
17133 * src/print_graph.c (print_state): Fix.
17134
17135 2001-08-27 Marc Autret <autret_m@epita.fr>
17136
17137 * src/vcg.h (classname_s, infoname_s, node_s): Constify the
17138 char * members.
17139 Echo modifications to the functions prototypes.
17140 * src/vcg.c (add_classname, add_infoname): Adjust arguments.
17141
17142 2001-08-27 Marc Autret <autret_m@epita.fr>
17143
17144 * src/vcg.c: Include `xalloc.h'.
17145 (add_colorentry): New.
17146 (add_classname): New.
17147 (add_infoname): New.
17148 * src/vcg.h: Add new prototypes.
17149
17150 2001-08-27 Akim Demaille <akim@epita.fr>
17151
17152 * Makefile.maint: Sync. again with CVS Autoconf.
17153
17154 2001-08-27 Akim Demaille <akim@epita.fr>
17155
17156 * Makefile.maint: Formatting changes.
17157 (po-update, cvs-update, update): New targets.
17158 (AMTAR): Remove.
17159
17160 2001-08-27 Akim Demaille <akim@epita.fr>
17161
17162 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
17163 * Makefile.maint: Sync. with CVS Autoconf.
17164
17165 2001-08-27 Marc Autret <autret_m@epita.fr>
17166
17167 * src/vcg.h (struct infoname_s): New.
17168 (struct colorentry_s): New.
17169 (graph_s): New fields {vertical,horizontal}_order in structure.
17170 Add `infoname' field.
17171 Add `colorentry' field;
17172 * src/vcg_defaults.h (G_VERTICAL_ORDER): New.
17173 (G_HORIZONTAL_ORDER): New.
17174 (G_INFONAME): New.
17175 (G_COLORENTRY): New.
17176 * src/vcg.c (output_graph): Add output of {vertical,horizontal}_order.
17177 Add output of `infoname'.
17178 Add output of `colorentry'.
17179
17180 2001-08-27 Marc Autret <autret_m@epita.fr>
17181
17182 * src/reader.c (parse_dquoted_param): Rename variable `index' to `i'.
17183 This one shadowed a global parameter.
17184
17185 2001-08-24 Marc Autret <autret_m@epita.fr>
17186
17187 * src/print_graph.c (node_output_size): Declared POSIX `size_t' type,
17188 instead of `unsigned'.
17189 (print_state): Do not call obstack_object_size () in obstack_grow ()
17190 to avoid macro variables shadowing.
17191
17192 2001-08-23 Marc Autret <autret_m@epita.fr>
17193
17194 * src/lex.c (percent_table): Typo: s/naem/name/.
17195 Add graph option.
17196 Normalize new options declarations.
17197
17198 2001-08-20 Pascal Bart <pascal.bart@epita.fr>
17199
17200 * tests/suite.at: Exercise %header_extension and %source_extension.
17201
17202 2001-08-16 Marc Autret <autret_m@epita.fr>
17203
17204 * src/reader.c (parse_dquoted_param): New.
17205 (parse_header_extension_decl): Use it.
17206 (parse_source_extension_decl): Likewise.
17207
17208 2001-08-16 Marc Autret <autret_m@epita.fr>
17209
17210 * src/vcg.c: Remove includes of `complain.h' and `xalloc.h'.
17211 (get_xxxx_str): Use assert () instead of complain ().
17212 Remove return invokations in default cases.
17213 (get_decision_str): Modify default behaviour. Remove second argument.
17214 Echo modifications on calls.
17215 (output_graph): Fix.
17216
17217 2001-08-16 Marc Autret <autret_m@epita.fr>
17218
17219 * src/getargs.c (usage): Update with ``-g, --graph''.
17220
17221 2001-08-16 Marc Autret <autret_m@epita.fr>
17222
17223 * doc/bison.texinfo (Bison Options): Add items `-g', `--graph'.
17224 (Option Cross Key): Likewise.
17225 * doc/bison.1: Update.
17226
1c8c2190
PB
172272001-09-25 Pascal Bart <pascal.bart@epita.fr>
17228
17229 * src/output.c (output_master_parser): Don't finish action_obstack.
17230 (output_parser): Don't care about the muscle action, here.
17231 (prepare): Copy the action_obstack in the action muscle.
17232 (output): Free action_obstack.
17233
180d45ba
PB
172342001-09-23 Pascal Bart <pascal.bart@epita.fr>
17235
17236 * src/reader.c (parse_union_decl): Add new obstack union_obstack. Which
17237 will contain `%union' declaration.
17238 (parse_union_decl): Delete #line directive output.
17239 (parse_union_decl): Substitute /attrs_obstack/union_obstack for all
17240 informations about %union.
17241 (parse_union_decl): Copy the union_obstack in the muscle stype.
17242 * src/bison.simple: Add new #line directive.
17243 Add typdef %%stype YYSTYPE.
17244
c51d1a19
PB
172452001-09-23 Pascal Bart <pascal.bart@epita.fr>
17246
17247 * src/bison.simple: Add new `#line' directive.
17248
6f9344da
PB
172492001-09-22 Pascal Bart <pascal.bart@epita.fr>
17250
17251 * src/bison.simple: New `#line' directive.
17252 * src/output.c (output_parser): Support new dynamic muscle input_line.
17253
652def80
MA
172542001-09-22 Marc Autret <autret_m@epita.fr>
17255
17256 * src/output.c (output_master_parser): New.
17257 (output_parser): Be more re-entrant.
17258
25b222fa
MA
172592001-09-21 Marc Autret <autret_m@epita.fr>
17260
17261 * src/reader.c (copy_definition, parse_union_decl): Update and use
17262 `linef' muscle.
17263 (copy_action): Likewise.
17264 Use obstack_1grow ().
17265 * src/muscle_tab.c (muscle_init): Add muscle `linef'.
17266
6bc35ae5
MA
172672001-09-21 Marc Autret <autret_m@epita.fr>
17268
17269 * src/options.c (option_table): Adjust.
17270 * src/lex.c (parse_percent_token): Fix.
17271
c0629aa1
PB
172722001-09-20 Pascal Bart <pascal.bart@epita.fr>
17273
17274 * src/options.c (symtab.h): Include it, need by lex.h.
342b8b6e 17275
82b6d266
PB
172762001-09-20 Pascal Bart <pascal.bart@epita.fr>
17277
17278 * src/lex.c (parse_percent_token): Change type of variable `tx', which
17279 is now an option_table_struct*.
17280 (option_strcmp): New function option_strcmp.
17281 (parse_percent_token): Call option_strcmp.
17282 * src/getargs.c (xalloc.h, options.h): Include it.
17283 (getargs): Call create_long_option_table.
17284 (getargs): Free longopts at the end of the function.
17285 (shortopts): Move in options.c.
17286 * src/options.c (create_long_option_table): New function. Convert
17287 information from option_table to option structure.
17288 * src/reader.c (options.h): Include it.
17289
17290 * src/Makefile.am: Adjust.
17291 * src/options.c (option_table): Create from longopts and percent_table.
17292 * src/getargs.c (longopts): Delete.
17293 * src/lex.c (struct percent_table_struct): Delete.
17294 (percent_table): Delete.
17295 (options.h): Include it.
17296 * src/options.c: Create.
17297 * src/options.h: Create.
17298 Declare enum opt_access_e.
17299 Define struct option_table_struct.
17300
75f5aaea
MA
173012001-09-20 Marc Autret <autret_m@epita.fr>
17302
17303 * doc/bison.texinfo: Adjust terminologies about prologue and epilogue
17304 sections of Bison.
17305
f508cb0a
PB
173062001-09-19 Pascal Bart <pascal.bart@epita.fr>
17307
17308 * src/bison.simple: s/%%filename/%%skeleton.
17309 * src/muscle_tab.c (getargs.h): Include it.
17310 (muscle_init): Insert new muscle skeleton.
17311
13105fc1
PB
173122001-09-18 Pascal Bart <pascal.bart@epita.fr>
17313
17314 * src/output.c (output_parser): Delete unused variable actions_dumped.
17315
b0c4483e
PB
173162001-09-07 Pascal Bart <pascal.bart@epita.fr>
17317
17318 * src/output.c (output): Delete call to reader_output_yylsp.
17319 * src/reader.c (reader): Likewise.
ba0fe3c7 17320 * src/reader.h: Delete declaration of reader_output_yylsp.
342b8b6e 17321
11d82f03
MA
173222001-09-02 Marc Autret <autret_m@epita.fr>
17323
17324 * src/reader.c: Include muscle_tab.h.
17325 (parse_union_decl): Update.
17326 (parse_macro_decl): Rename parse_muscle_decl.
17327 Update to use renamed functions and variable.
17328 (read_declarations, copy_action, read_additionnal_code, : Updated
17329 with correct variables and functions names.
17330 (packsymbols, reader): Likewise.
342b8b6e 17331
11d82f03 17332 * src/reader.h (muscle_obstack): Extern declaration update.
342b8b6e 17333
11d82f03
MA
17334 * src/output.c: Include muscle_tab.h
17335 In all functions using macro_insert, change by using muscle_insert ().
17336 (macro_obstack): Rename muscle_obstack.
17337 Echo modifications in the whole file.
17338 (MACRO_INSERT_INT): Rename MUSCLE_INSERT_INT.
17339 (MACRO_INSERT_STRING): Rename MUSCLE_INSERT_STRING.
17340 (MACRO_INSERT_PREFIX): Rename MUSCLE_INSERT_PREFIX.
17341
17342 * src/muscle_tab.h: Update double inclusion macros.
17343 (macro_entry_s): Rename muscle_entry_s.
17344 Update prototypes.
342b8b6e 17345
11d82f03
MA
17346 * src/muscle_tab.c: Include muscle_tab.h.
17347 Rename macro_tabble to muscle_table.
17348 (mhash1, mhash2, mcmp): Use muscle_entry.
17349 (macro_init): Rename muscle_init. Update.
17350 (macro_insert): Rename muscle_insert. Update.
17351 (macro_find): Rename muscle_find. Update.
17352
17353 * src/main.c: Include muscle_tab.h.
17354 (main): Call muscle_init ().
17355 * src/Makefile.am (bison_SOURCES): Echo modifications.
17356
93a37297
MA
173572001-09-02 Marc Autret <autret_m@epita.fr>
17358
f753cd62 17359 Now the files macro_tab.[ch] are named muscle_tab.[ch].
342b8b6e 17360
f753cd62
MA
17361 * src/muscle_tab.c, src/muscle_tab.h: Add files.
17362
173632001-09-02 Marc Autret <autret_m@epita.fr>
17364
17365 * src/macrotab.c, src/macrotab.h: Remove.
93a37297 17366
682d48cd
PB
173672001-09-01 Pascal Bart <pascal.bart@epita.fr>
17368
342b8b6e 17369 * src/reader.c (copy_guard): Use muscle to specify the `#line'
682d48cd
PB
17370 filename.
17371
087c8fda
MA
173722001-09-01 Marc Autret <autret_m@epita.fr>
17373
17374 * tests/calc.at (exp): Now, YYERROR_VERBOSE need to be set
17375 to an explicit value to activate the feature. We do it here.
17376
dda680cb
PB
173772001-08-31 Pascal Bart <pascal.bart@epita.fr>
17378
17379 * src/output.c (prepare): Delete the `filename' muscule insertion.
17380 * src/reader.c (copy_action): Use `filename' muscule with `#line'.
17381 (parse_union_decl): Likewise.
17382 * src/macrotab.c (macro_init): Initialize filename by infile.
17383
9e644e64
MA
173842001-08-31 Marc Autret <autret_m@epita.fr>
17385
17386 * src/bison.simple (YYLSP_NEEDED): New definition.
17387 * src/output.c (prepare): Add macro insertion of `locations_flag'
17388
17da6427
PB
173892001-08-31 Pascal Bart <pascal.bart@epita.fr>
17390
17391 * src/output.c (prepare): Delete insertion of previous muscles,
17392 and insert the `prefix' muscles.
17393 * src/macrotab.c (macro_init): Likewise.
17394 (macro_init): Initialization prefix directive by `yy'.
342b8b6e 17395 * src/bison.simple: Substitute all %%yylex, %%yychar, %%yylval,
17da6427
PB
17396 %%yydebug, %%yyerror, %%yynerrs and %%yyparse by yylex, yychar,
17397 yylval, yydebug, yyerror, yynerrs and yyparse.
342b8b6e 17398 New directive `#define' to substitute yydebug, ... with option
17da6427
PB
17399 name_prefix.
17400
e8cb70b9
PB
174012001-08-31 Pascal Bart <pascal.bart@epita.fr>
17402
17403 * src/main.c (main): Standardize.
17404 * src/output.c (output_table_data, output_parser): Likewise.
17405 * src/macrotab.h, src/macrotab.c, src/bison.simple: Likewise.
17406
63c2d5de
MA
174072001-08-31 Pascal Bart <pascal.bart@epita.fr>, Marc Autret <autret_m@epita.fr>
17408
342b8b6e 17409 * src/reader.c (read_additionnal_code): Rename %%user_code to
63c2d5de
MA
17410 %%epilogue.
17411 * src/output.c (output): Rename %%declarations to %%prologue.
17412 * src/bison.simple: Echo modifications.
342b8b6e 17413
d8cb5183
MA
174142001-08-31 Marc Autret <autret_m@epita.fr>
17415
17416 * src/reader.c (readgram): CleanUp.
17417 (output_token_defines): Likewise.
17418 (packsymbols): Likewise.
17419 (reader): Likewise.
17420 * src/output.c (output): CPP-out useless code.
17421
6c686258
PB
174222001-08-31 Pascal Bart <pascal.bart@epita.fr>
17423
342b8b6e 17424 * src/reader.c (reader): Delete obsolete call to function
6c686258
PB
17425 output_trailers and output_headers.
17426 * src/output.h: Remove obsolete functions prototypes of output_headers
17427 and output_trailers.
17428
8f451ef7
PB
174292001-08-30 Pascal Bart <pascal.bart@epita.fr>
17430
17431 * src/main.c: Include macrotab.h.
342b8b6e 17432 * src/macrotab.h (macro_entry_s): Constify fields.
8f451ef7
PB
17433 Adjust functions prototypes.
17434 * src/macrotab.c (macro_insert): Constify key and value.
17435 (macro_find): Constify key.
17436 (macro_insert): Include 'xalloc.h'
17437 (macro_insert): Use XMALLOC.
17438 (macro_find): Constify return value.
17439 * src/output.c (output_table_data): Rename table to table_data.
17440 (output_parser): Constify macro_key, macro_value.
17441
997b6fd0 174422001-08-30 Marc Autret <autret_m@epita.fr>
2ba3b73c
MA
17443
17444 * src/reader.c (parse_skel_decl): New.
342b8b6e 17445 (read_declarations): Add case `tok_skel', call parse_skel_decl ().
2ba3b73c
MA
17446 * src/lex.h (token_t): New token `tok_skel'.
17447 * src/lex.c (percent_table): Add skeleton option entry.
17448 Standardize.
17449
ff48177d
MA
174502001-08-29 Marc Autret <autret_m@epita.fr>
17451
17452 * src/bison.simple: Add %%user_code directive at the end.
17453 * src/reader.c (read_additionnal_code): New.
17454 (reader): Use it.
17455 * src/output.c (output_program): Remove.
17456 (output): Update.
17457
b33160bf
MA
174582001-08-28 Marc Autret <autret_m@epita.fr>
17459
17460 * src/output.c (output_actions): Clean up.
4e5caae2 17461 (output_gram): CPP-out useless code.
b33160bf
MA
17462 * src/reader.c (reader): Clean up, CPP-out useless code.
17463
d1a2daf7
PB
174642001-08-28 Pascal Bart <pascal.bart@epita.fr>
17465
342b8b6e 17466 * src/output.c (output): Copy attrs_obstack in the '%%definitions'
535c0e75 17467 directive.
d1a2daf7
PB
17468 * src/bison.simple: Add `%%definitions'.
17469
2b763dfe
MA
174702001-08-28 Marc Autret <autret_m@epita.fr>
17471
17472 * config/depcomp: New file.
17473
f1a87ef6
PE
174742001-08-27 Paul Eggert <eggert@twinsun.com>
17475
17476 * src/bison.simple (yyparse): Don't take the address of an
17477 item before the start of an array, as that doesn't conform to
17478 the C Standard.
17479
82e236e2
RA
174802001-08-27 Robert Anisko <robert.anisko@epita.fr>
17481
f1a87ef6 17482 * src/output.c (output): Remove the initialization of the macro
82e236e2
RA
17483 obstack. It was done too late here.
17484
17485 * src/reader.c (parse_macro_decl): Fix. Use of the macro obstack was
17486 completely wrong.
17487 (reader): Initialize the macro obstack here, since we need it to grow
17488 '%define' directives.
17489
17490 * src/reader.h: Declare the macro obstack as extern.
17491
b0cfa28a
RA
174922001-08-27 Robert Anisko <robert.anisko@epita.fr>
17493
17494 * src/output.c (output_parser): Fix. Store single '%' characters in
17495 the output obstack instead of throwing them away.
17496
6fc74234
AD
174972001-08-27 Akim Demaille <akim@epita.fr>
17498
17499 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
17500
9c76d118
RA
175012001-08-25 Robert Anisko <robert.anisko@epita.fr>
17502
17503 * lib/Makefile.am: Adjust.
17504
a8289c62
RA
175052001-08-25 Robert Anisko <robert.anisko@epita.fr>
17506
17507 * src/bison.simple: Update and add '%%' directives.
17508
b6610515
RA
175092001-08-25 Robert Anisko <robert.anisko@epita.fr>
17510
17511 * src/reader.c (reader): Remove calls to 'output_headers' and
17512 'output_trailers'. Remove some C output.
17513 (readgram): Disable a piece of code that was writing a default
17514 definition for 'YYSTYPE'.
17515 (reader_output_yylsp): Remove.
17516 (packsymbols): Output token defintions to a macro.
17517 (copy_definition): Disable C output.
6fc74234 17518
b6610515
RA
17519 * src/reader.c (parse_macro_decl): New function used to parse macro
17520 declarations.
17521 (copy_string2): Put the body of copy_string into this new function.
17522 Add a parameter to let the caller choose whether he wants to copy the
17523 string delimiters or not.
17524 (copy_string): Be a simple call to copy_string2 with the last argument
17525 bound to true.
17526 (read_declarations): Add case for macro definition.
17527 (copy_identifier): New.
6fc74234 17528 (parse_macro_decl): Read macro identifiers using copy_identifier
b6610515
RA
17529 rather than lex.
17530
26f609ff
RA
175312001-08-25 Robert Anisko <robert.anisko@epita.fr>
17532
17533 * src/output.c (prepare): Add prefixed names.
17534 (output_parser): Output semantic actions.
17535 (output_parser): Fix bug on '%%line' directives.
6fc74234 17536
26f609ff
RA
17537 * src/output.c (output_headers): Remove. The C code printed by this
17538 function should now be in the skeletons.
17539 (output_trailers): Remove.
17540 (output): Disable call to 'reader_output_yylsp'.
17541 (output_rule_data): Do not output tables to the table obstack.
17542
17543 * src/output.c: Remove some C dedicated output.
17544 Improve the use of macro and output obstacks.
17545 (output_defines): Remove.
6fc74234 17546
26f609ff
RA
17547 * src/output.c (output_token_translations): Associate 'translate'
17548 table with a macro. No output to the table obstack.
17549 (output_gram): Same for 'rhs' and 'prhs'.
17550 (output_stos): Same for 'stos'.
17551 (output_rule_data): Same for 'r1' and 'r2'.
17552 (token_actions): Same for 'defact'.
17553 (goto_actions): Same for 'defgoto'.
17554 (output_base): Same for 'pact' and 'pgoto'.
17555 (output_table): Same for 'table'.
17556 (output_check): Same for 'check'.
6fc74234 17557
26f609ff
RA
17558 * src/output.c (output_table_data): New function.
17559 (output_short_table): Remove.
17560 (output_short_or_char_table): Remove.
6fc74234 17561
26f609ff
RA
17562 * src/output.c (output_parser): Replace most of the skeleton copy code
17563 with something new. Skeletons are now processed character by character
17564 rather than line by line, and Bison looks for '%%' macros. This is the
17565 first step in making Bison's output process (a lot) more flexible.
17566 (output_parser): Use the macro table.
17567
6f43b113
RA
175682001-08-25 Robert Anisko <robert.anisko@epita.fr>
17569
17570 * src/main.c (main): Initialize the macro table.
17571
dd3127cf
RA
175722001-08-25 Robert Anisko <robert.anisko@epita.fr>
17573
17574 * src/lex.c (percent_table): Add tok_define.
17575 * src/lex.h: Add tok_define.
17576
aa321494
RA
175772001-08-25 Robert Anisko <robert.anisko@epita.fr>
17578
17579 * src/macrotab.c: New file.
17580 * src/macrotab.h: New file.
17581 * src/Makefile.am: Update.
17582
68bd3b6b
RA
175832001-08-25 Robert Anisko <robert.anisko@epita.fr>
17584
17585 * lib/hash.c: New file.
17586 * lib/hash.h: New file.
17587 * lib/Makefile.am: Update.
17588
45f8dd1e
AD
175892001-08-15 Akim Demaille <akim@epita.fr>
17590
17591 Version 1.28c.
17592
40a64a7a 175932001-08-15 Marc Autret <autret_m@epita.fr>
0b8afb77
AD
17594
17595 * src/reader.c (readgram): Indent output macro YYSTYPE.
17596 (packsymbols): Likewise.
17597 (output_token_defines): Likewise.
17598 * src/files.c: Standardize.
17599 (compute_header_macro): New.
17600 (defines_obstack_save): New. Use compute_header_macro.
17601 (output_files): Update. Use defines_obstack_save.
17602
f9a8293a
AD
176032001-08-15 Akim Demaille <akim@epita.fr>
17604
17605 * doc/bison.texinfo (Table of Symbols): Document
17606 YYSTACK_USE_ALLOCA.
17607
150ca7a7
AD
176082001-08-15 Akim Demaille <akim@epita.fr>
17609
17610 * missing: Update from CVS Automake.
17611 * config/config.guess, config/config.sub, config/texinfo.tex:
17612 Update from gnu.org.
17613
69b5cec4
AD
176142001-08-15 Akim Demaille <akim@epita.fr>
17615
17616 * Makefile.maint: Sync with CVS Autoconf.
17617
f2b5126e
PB
176182001-08-14 Pascal Bart <pascal.bart@epita.fr>
17619
69b5cec4 17620 * doc/bison.texinfo: Include GNU Free Documentation License from
f2b5126e
PB
17621 `fdl.texi'.
17622 * doc/fdl.texi: Add to package.
17623
4ecbf796
MA
176242001-08-14 Marc Autret <autret_m@epita.fr>
17625
17626 Turn on %{source,header}_extension features.
17627
69b5cec4 17628 * src/lex.c (percent_table): Un-CPP out header_extension and
4ecbf796
MA
17629 source_extension.
17630 * src/files.c (compute_exts_from_gf): Compare pointers with NULL.
69b5cec4 17631 (compute_exts_from_src): Remove conditions. It restores priorities
4ecbf796
MA
17632 between options.
17633
95fb5662
MA
176342001-08-14 Marc Autret <autret_m@epita.fr>
17635
17636 * src/files.c (compute_base_names): Add extensions computing when
17637 `--file-prefix' used.
17638 Standardize function calls.
17639
78d09da9
MA
176402001-08-13 Marc Autret <autret_m@epita.fr>
17641
69b5cec4 17642 * src/bison.simple (YYSTACK_USE_ALLOCA): Changed to allow users
78d09da9
MA
17643 defining it (defined but null disables alloca).
17644
5a009f2c
MA
176452001-08-13 Marc Autret <autret_m@epita.fr>
17646
17647 * src/bison.simple (_yy_memcpy): CPP reformat.
17648
1e41465a
PB
176492001-08-13 Pascal Bart <pascal.bart@epita.fr>
17650
17651 * tests/atconfig.in (CPPFLAGS): Fix.
17652
c67a198d
PB
176532001-08-10 Pascal Bart <pascal.bart@epita.fr>
17654
79282c6c 17655 * doc/bison.texinfo: Include GNU General Public License from
c67a198d
PB
17656 `gpl.texi'.
17657 * doc/gpl.texi: Add to package.
17658
09a6de7e
MA
176592001-08-10 Marc Autret <autret_m@epita.fr>
17660
17661 * src/print_graph.h: Fix.
17662 * src/reader.c (read_declarations): Use parse_header_extension_decl ().
17663
b77b9ee0
AD
176642001-08-10 Akim Demaille <akim@epita.fr>
17665
17666 * src/system.h: Provide default declarations for stpcpy, strndup,
17667 and strnlen.
17668
3e259915
MA
176692001-08-10 Robert Anisko <anisko_r@epita.fr>
17670
17671 * doc/bison.texinfo (Locations): Update @$ stuff.
17672
ca96bc2d
MA
176732001-08-09 Robert Anisko <anisko_r@epita.fr>
17674
17675 * src/bison.simple (YYLLOC_DEFAULT): Update.
17676 (yyparse): Adjust.
17677
fdc6758b
MA
176782001-08-08 Marc Autret <autret_m@epita.fr>
17679
b77b9ee0 17680 * doc/bison.texinfo: Change @samp{$<@dots{}>} to
fdc6758b
MA
17681 @samp{$<@dots{}>@var{n}} in Section Actions in Mid-Rule.
17682 Reported by Fabrice Bauzac.
957d4dbf 17683
600cad3b
MA
176842001-08-08 Marc Autret <autret_m@epita.fr>
17685
17686 * src/vcg_default.h: Use NULL instead of 0 to initialize pointers.
17687 * src/vcg.c (output_node): Fix.
17688 * src/vcg.h: Cleanup.
17689 * src/print_graph.c: Add comments.
b77b9ee0 17690 (node_output_size): New global variable. Simplify the formatting of
600cad3b 17691 the VCG graph output.
b77b9ee0 17692 (print_actions): Unused code is now used. It notifies the final state
600cad3b 17693 and no action states in the VCG graph. It also give the reduce actions.
b77b9ee0 17694 The `shift and goto' edges are red and the `go to state' edges are
600cad3b
MA
17695 blue.
17696 Get the current node name and node_obstack by argument.
17697 (node_obstack): New variable.
17698 (print_state): Manage node_obstack.
17699 (print_core): Use node_obstack given by argument.
17700 A node is not only computed here but in print_actions also.
17701 (print_graph): CPP out useless code instead of commenting it.
17702
976e528f
AD
177032001-08-07 Pascal Bart <pascal.bart@epita.fr>
17704
17705 * tests/atconfig.in (CPPFLAGS): Fix.
17706
20e8e5ca
AD
177072001-08-07 Akim Demaille <akim@epita.fr>
17708
17709 * src/print_graph.c (quote): New.
17710 (print_core): Use it.
17711
957d4dbf 177122001-08-06 Akim Demaille <akim@epita.fr>, Marc Autret <autret_m@epita.fr>
3e3da797 17713
3e3da797
AD
17714 * src/vcg.c (complain.h): Include it.
17715 Unepitaize `return' invocations.
c4b66126 17716 [NDEBUG] (main): Remove.
79282c6c 17717 * src/vcg.h (node_t, edge_t, graph_t): Constify the char * members.
c4b66126
AD
17718 * src/files.c (open_files): Initialize graph_obstack.
17719 * src/print_graph.c (print_actions): CPP out useless code.
17720 (print_core): Don't output the last `\n' in labels.
17721 Use `quote'.
17722 * src/files.c (output_files): Output the VCG file.
17723 * src/main.c (main): Invoke print_graph ();
3e3da797 17724
957d4dbf 177252001-08-06 Marc Autret <autret_m@epita.fr>
22c2cbc0
AD
17726
17727 Automaton VCG graph output.
17728 Using option ``-g'' or long option ``--graph'', you can generate
17729 a gram_filename.vcg file containing a VCG description of the LALR (1)
17730 automaton of your grammar.
17731
17732 * src/main.c: Call to print_graph() function.
17733 * src/getargs.h: Update.
17734 * src/getargs.c (options): Update to catch `-g' and `--graph' options.
17735 (graph_flag): New flag.
17736 (longopts): Update.
17737 (getargs): Add case `g'.
17738 * src/files.c (graph_obstack): New obstack struct.
17739 (open_files): Initialize new obstack.
17740 (output_files): Saves graph_obstack if required.
17741 * src/files.h (graph_obstack): New extern declaration.
17742 * src/Makefile.am: Add new source files.
17743
927c1557 177442001-08-06 Marc Autret <autret_m@epita.fr>
ce4d5ce0
AD
17745
17746 * src/print_graph.c, src/print_graph.h (graph): New.
17747 * src/vcg.h: New file.
17748 * src/vcg.c: New file, VCG graph handling.
17749
7333d403
AD
177502001-08-06 Marc Autret <autret_m@epita.fr>
17751
17752 Add of %source_extension and %header_extension which specify
17753 the source or/and the header output file extension.
17754
17755 * src/files.c (compute_base_names): Remove initialisation of
17756 src_extension and header_extension.
17757 (compute_exts_from_gf): Update.
17758 (compute_exts_from_src): Update.
17759 (output_files): Update.
17760 * src/reader.c (parse_header_extension_decl): New.
17761 (parse_source_extension_decl): New.
17762 (read_declarations): New case statements for the new tokens.
17763 * src/lex.c (percent_table): Add entries for %source_extension
17764 and %header_extension.
17765 * src/lex.h (token_e): New tokens tok_hdrext and tok_srcext.
17766
84163231
AD
177672001-08-06 Marc Autret <autret_m@epita.fr>
17768
17769 * configure.in: Bump to 1.28c.
17770 * doc/bison.texinfo: Texinfo thingies.
17771
8303fc42
AD
177722001-08-04 Pascal Bart <pascal.bart@epita.fr>
17773
17774 * tests/atconfig.in (CPPFLAGS): Add.
17775 * tests/calc.at (AT_CHECK): Use CPPFLAGS.
17776
70a84437
AD
177772001-08-03 Akim Demaille <akim@epita.fr>
17778
17779 Version 1.28b.
17780
2ce10144
AD
177812001-08-03 Akim Demaille <akim@epita.fr>
17782
17783 * tests/Makefile.am (check-local): Ship testsuite.
17784 * tests/calc.at (_AT_DATA_CALC_Y): Prototype all the functions.
17785 Include `string.h'.
17786
1e3e4bc1
AD
177872001-08-03 Akim Demaille <akim@epita.fr>
17788
17789 * configure.in: Try using -Wformat when compiling.
17790
42b45b7f
AD
177912001-08-03 Akim Demaille <akim@epita.fr>
17792
17793 * configure.in: Bump to 1.28b.
17794
8f13fe33
AD
177952001-08-03 Akim Demaille <akim@epita.fr>
17796
17797 * src/complain.c: Adjust strerror_r portability issues.
17798
b37ba92c
AD
177992001-08-03 Akim Demaille <akim@epita.fr>
17800
17801 Version 1.28a.
17802
b0ce6046
AD
178032001-08-03 Akim Demaille <akim@epita.fr>
17804
17805 * src/getargs.c, src/getarg.h (skeleton)): Constify.
17806 * src/lex.c (literalchar): Avoid name clashes on `buf'.
17807 * src/getargs.c: Include complain.h.
17808 * src/files.c, src/files.h (skeleton_find): Avoid name clashes.
17809 * lib/quotearg.c, lib/quotearg.h: Update from fileutils 4.1.
17810
d01c415b
AD
178112001-08-03 Akim Demaille <akim@epita.fr>
17812
17813 * src/reader.c (readgram): Display hidden chars in error messages.
17814
459dd1a6
AD
178152001-08-03 Akim Demaille <akim@epita.fr>
17816
17817 Update to gettext 0.10.39.
17818
53b74c0c
AD
178192001-08-03 Akim Demaille <akim@epita.fr>
17820
17821 * lib/strspn.c: New.
17822
234a3be3
AD
178232001-08-01 Marc Autret <autret_m@epita.fr>
17824
17825 * doc/bison.texinfo: Update.
17826 * doc/bison.1 (mandoc): Update.
17827 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove .c and .h.
17828 * src/files.c: Support output files extensions computing.
17829 (src_extension): New static variable.
17830 (header_extension): New static variable.
17831 (tr): New function.
17832 (get_extension_index): New function, gets the index of an extension
17833 filename in a string.
17834 (compute_exts_from_gf): New function, computes extensions from the
17835 grammar file extension.
17836 (compute_exts_from_src): New functions, computes extensions from the
17837 C source file extension, file given by ``-o'' option.
17838 (compute_base_names): Update.
17839 (output_files): Update.
17840
847bf1f5
AD
178412001-08-01 Robert Anisko <anisko_r@epita.fr>
17842
d995fee7 17843 * doc/bison.texi: Document @$.
847bf1f5
AD
17844 (Locations): New section.
17845
d074a105
AD
178462001-07-18 Akim Demaille <akim@epita.fr>
17847
17848 * Makefile.maint, GNUmakefile: New, from Autoconf 2.52.
17849 * config/prev-version.txt, config/move-if-change: New.
17850 * Makefile.am: Adjust.
17851
3419715d
AD
178522001-07-08 Pascal Bart <pascal.bart@epita.fr>
17853
17854 * src/bison.simple (yyparse): Suppress warning `comparaison
17855 between signed and unsigned'.
17856
62ab6972
AD
178572001-07-05 Pascal Bart <pascal.bart@epita.fr>
17858
17859 * src/getargs.h (raw_flag): Remove.
17860 * src/getargs.c: Die on `-r'/`--raw'.
17861 * src/lex.c (parse_percent_token): Die on `%raw'.
17862 * src/reader.c (output_token_defines): Suppress call to `raw_flag'.
17863 * tests/calc.at: Suppress test with option `--raw'.
17864
1e24cc5b
AD
178652001-07-14 Akim Demaille <akim@epita.fr>
17866
17867 * config/: New.
17868 * configure.in: Require Autoconf 2.50.
17869 Update to gettext 0.10.38.
17870
32dfccf8
AD
178712001-03-16 Akim Demaille <akim@epita.fr>
17872
17873 * doc/bison.texinfo: ANSIfy the examples.
17874
cd5bd6ac
AD
178752001-03-16 Akim Demaille <akim@epita.fr>
17876
17877 * getargs.c (skeleton): New variable.
17878 (longopts): --skeleton is a new option.
17879 (shortopts, getargs): -S is a new option.
17880 * getargs.h: Declare skeleton.
17881 * output.c (output_parser): Use it.
17882
5141b016
AD
178832001-03-16 Akim Demaille <akim@epita.fr>
17884
17885 * m4/strerror_r.m4: New.
17886 * m4/error.m4: Run AC_FUNC_STRERROR_R.
17887 * lib/error.h, lib/error.c: Update.
17888
447992b9
AD
178892001-03-16 Akim Demaille <akim@epita.fr>
17890
17891 * src/getargs.c (longopts): Clean up.
17892
274d42ce
AD
178932001-02-21 Akim Demaille <akim@epita.fr>
17894
17895 * src/reader.c (gensym): `gensym_count' is your own.
17896 Use a static buf to create the symbol name, as token_buffer is no
17897 longer a buffer.
17898
22c821f3
AD
178992001-02-08 Akim Demaille <akim@epita.fr>
17900
17901 * src/conflicts.c (conflict_report): Be sure not to append to res
17902 between two calls, which could happen if both first sprintf were
17903 skipped, but not the first cp += strlen.
17904
18569462
AD
179052001-02-08 Akim Demaille <akim@epita.fr>
17906
17907 * lib/memchr.c, lib/stpcpy.c, lib/strndup.c, lib/strnlen.c:
17908 New, from fileutils 4.0.37.
17909 * configure.in: Require Autoconf 2.49c. I took some time before
17910 making this decision. This is the only way out for portability
17911 issues in Bison, it would mean way too much duplicate effort to
17912 import in Bison features implemented in 2.49c since 2.13.
17913 AC_REPLACE_FUNCS and AC_CHECK_DECLS the functions above.
17914
0d8f3c8a
AD
179152001-02-02 Akim Demaille <akim@epita.fr>
17916
17917 * lib/malloc.c, lib/realloc.c: New, from the fileutils 4.0.37.
66075dcf 17918 * lib/xalloc.h, lib/xmalloc.c: Update.
0d8f3c8a 17919
f17bcd1f
AD
179202001-01-19 Akim Demaille <akim@epita.fr>
17921
17922 Get rid of the ad hoc handling of token_buffer in the scanner: use
17923 the obstacks.
17924
17925 * src/lex.c (token_obstack): New.
17926 (init_lex): Initialize it. No longer call...
17927 (grow_token_buffer): this. Remove it.
17928 Adjust all the places which used it to use the obstack.
17929
511e79b3
AD
179302001-01-19 Akim Demaille <akim@epita.fr>
17931
17932 * src/lex.h: Rename all the tokens:
17933 s/\bENDFILE\b/tok_eof/g;
17934 s/\bIDENTIFIER\b/tok_identifier/g;
17935 etc.
17936 Let them be enums, not #define, to ease debugging.
17937 Adjust all the code.
17938
0d6508ef
AD
179392001-01-18 Akim Demaille <akim@epita.fr>
17940
17941 * src/lex.h (MAXTOKEN, maxtoken, grow_token_buffer): Remove, private.
17942 * src/lex.c (maxtoken, grow_token_buffer): Static.
17943
6deb4447
AD
179442001-01-18 Akim Demaille <akim@epita.fr>
17945
17946 Since we now use obstacks, more % directives can be enabled.
17947
17948 * src/lex.c (percent_table): Also accept `%yacc',
17949 `%fixed_output_files', `%defines', `%no_parser', `%verbose', and
17950 `%debug'.
17951 Handle the actions for `%semantic_parser' and `%pure_parser' here,
17952 instead of returning a token.
17953 * src/lex.h (SEMANTIC_PARSER, PURE_PARSER): Remove, unused.
17954 * src/reader.c (read_declarations): Adjust.
17955 * src/files.c (open_files): Don't call `compute_base_names', don't
17956 compute `attrsfile' since they depend upon data which might be
17957 *in* the input file now.
17958 (output_files): Do it here.
17959 * src/output.c (output_headers): Document the fact that this patch
17960 introduces a guaranteed SEGV for semantic parsers.
17961 * doc/bison.texinfo: Document them.
17962 * tests/suite.at: Exercise these %options.
17963
ff4423cc
AD
179642000-12-20 Akim Demaille <akim@epita.fr>
17965
17966 Also handle the output file (--verbose) with obstacks.
17967
17968 * files.c (foutput): Remove.
17969 (output_obstack): New.
17970 Adjust all dependencies.
17971 * src/conflicts.c: Return a string.
17972 * src/system.h (obstack_grow_string): Rename as...
17973 (obstack_sgrow): this. Be ready to work with non literals.
17974 (obstack_fgrow4): New.
17975
956dba3a
AD
179762000-12-20 Akim Demaille <akim@epita.fr>
17977
17978 * src/files.c (open_files): Fix the computation of short_base_name
17979 in the case of `-o foo.tab.c'.
17980
337bab46
AD
179812000-12-20 Akim Demaille <akim@epita.fr>
17982
17983 * src/reader.c (copy_string, copy_comment, copy_comment2, copy_at)
17984 (copy_dollar): Now that everything uses obstacks, get rid of the
17985 FILE * parameters.
17986
5d3214b8
AD
179872000-12-20 Akim Demaille <akim@epita.fr>
17988
17989 * src/files.c (open_files): Actually the `.output' file is based
17990 on the short_base_name, not base_name.
17991 * tests/suite.at (Checking output file names): Adjust.
17992
29092a57
AD
179932000-12-20 Akim Demaille <akim@epita.fr>
17994
17995 * src/bison.s1: Remove, we now use directly...
17996 * src/bison.simple: this.
17997 * src/Makefile.am: Use pkgdata instead of data.
17998
ea5607fd
AD
179992000-12-20 Akim Demaille <akim@epita.fr>
18000
18001 * src/files.c (guard_obstack): New.
18002 (open_files): Initialize it.
18003 (output_files): Dump it...
18004 * src/files.h: Export it.
18005 * src/reader.c (copy_guard): Use it.
18006
27110317
AD
180072000-12-19 Akim Demaille <akim@epita.fr>
18008
18009 * src/files.c (outfile, defsfile, actfile): Removed as global
18010 vars.
18011 (open_files): Don't compute them.
18012 (output_files): Adjust.
18013 (base_name, short_base_name): Be global.
18014 Adjust dependencies.
18015
19c50364
AD
180162000-12-19 Akim Demaille <akim@epita.fr>
18017
18018 * src/files.c (strsuffix): New.
18019 (stringappend): Be just like strcat but allocate.
18020 (base_names): Eve out from open_files.
18021 Try to simplify the rather hairy computation of base_name and
18022 short_base_name.
18023 (open_files): Use it.
18024 * tests/suite.at (Checking output file names): New test.
18025
573c1d9f
AD
180262000-12-19 Akim Demaille <akim@epita.fr>
18027
18028 * src/system.h (obstack_grow_literal_string): Rename as...
18029 (obstack_grow_string): this.
18030 * src/output.c (output_parser): Recognize `%% actions' instead of
18031 `$'.
18032 * src/bison.s1: s/$/%% actions/.
18033 * src/bison.hairy: Likewise.
18034
ef7ddedd
AD
180352000-12-19 Akim Demaille <akim@epita.fr>
18036
18037 * src/output.c (output_parser): Compute the `#line' lines when
18038 there are.
18039 * src/Makefile.am (bison.simple): Be a simple copy of bison.s1.
18040 Suggested by Hans Aberg.
18041
ff61dabd
AD
180422000-12-19 Akim Demaille <akim@epita.fr>
18043
18044 Let the handling of the skeleton files be local to the procedures
18045 that use it.
18046
18047 * src/files.c (xfopen, xfclose, skeleton_find, guardfile): No
18048 longer static.
18049 (fparser, open_extra_files): Remove.
18050 (open_files, output_files): Don't take care of fparser.
18051 * src/files.h: Adjust.
18052 * src/output.c (output_parser): Open and close the file to the
18053 skeleton.
18054 * src/reader.c (read_declarations): When %semantic_parser, open
18055 fguard.
18056
55b96341
AD
180572000-12-19 Akim Demaille <akim@epita.fr>
18058
18059 * src/file.h (BISON_SIMPLE, BISON_HAIRY): Move from here...
18060 * src/system.h (BISON_SIMPLE, BISON_HAIRY): ... to here.
18061
358c15b7
AD
180622000-12-19 Akim Demaille <akim@epita.fr>
18063
18064 * src/files.c (open_files): Yipee! We no longer need all the code
18065 looking for `/tmp' since we have no tmp file.
18066
7de3329e
AD
180672000-12-19 Akim Demaille <akim@epita.fr>
18068
18069 * src/system.h (EXT_TAB, EXT_OUTPUT, EXT_STYPE_H, EXT_GUARD_C):
18070 New macros.
18071 * src/files.c (open_files): Less dependency on MSDOS etc.
18072
3abcd459
AD
180732000-12-14 Akim Demaille <akim@epita.fr>
18074
18075 * src/bison.s1 (YYLLOC_DEFAULT): New macro.
18076 Provide a default definition.
18077 Use it when executing the default @ action.
18078 * src/reader.c (reader_output_yylsp): No longer include
18079 `timestamp' and `text' in the default YYLTYPE.
18080
2a91a95e
AD
180812000-12-12 Akim Demaille <akim@epita.fr>
18082
18083 * src/reader.c (copy_definition, parse_union_decl, copy_action)
18084 (copy_guard): Quote the file names.
18085 Reported by Laurent Mascherpa.
18086
14d3eb9b
AD
180872000-12-12 Akim Demaille <akim@epita.fr>
18088
18089 * src/output.c (output_headers, output_program, output): Be sure
18090 to escape special characters when outputting filenames.
18091 (ACTSTR_PROLOGUE, ACTSTR_EPILOGUE): Remove.
18092 (output_headers): Don't depend on them, Use ACTSTR.
18093
d7045ec6
AD
180942000-11-17 Akim Demaille <akim@epita.fr>
18095
18096 * lib/obstack.h: Formatting changes.
18097 (obstack_grow, obstack_grow0): Don't cast WHERE at all: it
18098 prevents type checking.
18099 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
18100 cast the value to (void *): assigning a `foo *' to a `void *'
18101 variable is valid.
18102 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
18103 * src/reader.c (parse_union_decl): Typo: use obstack_1grow to
18104 append characters.
18105
6fd54b73
AD
181062000-11-17 Akim Demaille <akim@epita.fr>
18107
18108 * tests/Makefile.am (suite.m4, regression.m4, calc.m4): Rename
18109 as...
18110 (suite.m4, regression.m4, calc.m4): these.
18111 * tests/atgeneral.m4: Update from CVS Autoconf.
18112
4c50eae6
AD
181132000-11-17 Akim Demaille <akim@epita.fr>
18114
18115 * tests/regression.m4 (%union and --defines): New test,
18116 demonstrating a current bug in the obstack implementation.
18117
a35f64ea
AD
181182000-11-17 Akim Demaille <akim@epita.fr>
18119
18120 * src/bison.s1 (_YY_DECL_VARIABLES, YY_DECL_VARIABLES): New
18121 macros.
18122 Use them to declare the variables which are global or local to
18123 `yyparse'.
18124
7de23534
AD
181252000-11-17 Akim Demaille <akim@epita.fr>
18126
18127 * acconfig.h: Remove, no longer used.
18128
aa7815f5
AD
181292000-11-07 Akim Demaille <akim@epita.fr>
18130
18131 * src: s/Copyright (C)/Copyright/g.
18132
5af1f549
AD
181332000-11-07 Akim Demaille <akim@epita.fr>
18134
18135 * src/reader.c (reader): #define YYLSP_NEEDED to 1 instead of just
18136 defining.
18137 * src/bison.s1: s/#ifdef YYLSP_NEEDED/#if YYLSP_NEEDED/.
18138
553e2b22
AD
181392000-11-07 Akim Demaille <akim@epita.fr>
18140
18141 * src/bison.s1 (YYLEX): Use #if instead of #ifdef.
18142 Merge in a single CPP if/else.
18143
8a4f41d6
AD
181442000-11-07 Akim Demaille <akim@epita.fr>
18145
18146 * src/output.c (output): Remove useless variables.
18147 * lib/obstack.c (obstack_grow, obstack_grow0): Rename the second
18148 argument `data' for consistency with the prototypes.
18149 Qualify it `const'.
18150 (obstack_copy, obstack_copy0): Rename the second argument as
18151 `address' for consistency. Qualify it `const'.
18152 * lib/obstack.h (obstack_copy, obstack_copy0, obstack_grow)
18153 (obstack_grow0, obstack_ptr_grow, obstack_ptr_grow_fast): Qualify
18154 `const' their input argument (`data' or `address').
18155 Adjust the corresponding macros to include `const' in casts.
18156
095a3fb5
AD
181572000-11-03 Akim Demaille <akim@epita.fr>
18158
18159 * src/Makefile.am (INCLUDES): s/PFILE/BISON_SIMPLE/.
18160 s/PFILE1/BISON_HAIRY/.
18161 Adjust dependencies.
18162
d1cdce7c
AD
181632000-11-03 Akim Demaille <akim@epita.fr>
18164
090c5ebf 18165 For some reason, this was not applied.
d1cdce7c
AD
18166
18167 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
18168 `unlink': it's no longer used.
18169
9311529b
AD
181702000-11-03 Akim Demaille <akim@epita.fr>
18171
18172 * src/files.c (skeleton_find): New function, eved out of...
18173 (open_files, open_extra_files): here.
18174
d8880f69
AD
181752000-11-03 Akim Demaille <akim@epita.fr>
18176
18177 Don't use `atexit'.
18178
18179 * src/files.c (obstack_save): New function.
18180 (done): Rename as...
18181 (output_files): this.
18182 Use `obstack_save'.
18183 * src/main.c (main): Don't use `atexit' to register `done', since
18184 it no longer has to remove tmp files, just call `output_files'
18185 when there are no errors.
18186
0dbb648e
AD
181872000-11-02 Akim Demaille <akim@epita.fr>
18188
18189 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
18190 `unlink': it's no longer used.
18191 * src/files.h: Formatting changes.
18192
896fe5c1
AD
181932000-11-02 Akim Demaille <akim@epita.fr>
18194
18195 Remove the last uses of mktemp and unlink/delete.
18196
18197 * src/files.c (fdefines, ftable): Removed.
18198 (defines_ostack, table_obstack): New.
18199 Adjust dependencies of the former into uses of the latter.
18200 * src/output.c (output_short_or_char_table, output_short_table):
18201 Convert to using obstacks.
18202 * src/reader.c (copy_comment2): Accept one FILE * and two
18203 obstacks.
18204 (output_token_defines, reader_output_yylsp): Use obstacks.
18205 * src/system.h (obstack_fgrow3): New.
1f65350a 18206 * po/POTFILES.in: Adjust.
896fe5c1 18207
dd60faec
AD
182082000-11-01 Akim Demaille <akim@epita.fr>
18209
18210 Change each use of `fattrs' into a use of `attrs_obstack'.
18211
18212 * src/reader.c (copy_at): Typo: s/yylloc/yyloc/.
18213 * src/files.c (fattrs): Remove.
18214 (attrs_obstack): New.
18215 Adjust all dependencies.
18216 (done): If SEMANTIC_PARSER, dump attrs_obstack into attrsfile.
18217
8c7ebe49
AD
182182000-11-01 Akim Demaille <akim@epita.fr>
18219
18220 Introduce obstacks.
18221 Change each use of `faction' into a use of `action_obstack'.
18222
18223 * lib/obstack.h, lib/obstack.c: New files.
18224 * src/files.c (faction): Remove.
18225 (action_obstack): New.
18226 Adjust all dependencies.
18227
77aee789
AD
182282000-10-20 Akim Demaille <akim@epita.fr>
18229
18230 * lib/quote.h (PARAMS): New macro. Use it.
18231
43591cec
AD
182322000-10-16 Akim Demaille <akim@epita.fr>
18233
18234 * src/output.c (output_short_or_char_table): New function.
18235 (output_short_table, output_token_translations): Use it.
18236 (goto_actions): Use output_short_table.
18237
1e9798d5
AD
182382000-10-16 Akim Demaille <akim@epita.fr>
18239
18240 * src/symtab.c (bucket_new): New function.
18241 (getsym): Use it.
18242
18243 * src/output.c (output_short_table): New argument to display the
18244 comment associated with the table.
18245 Adjust dependencies.
18246 (output_gram): Use it.
18247 (output_rule_data): Nicer output layout for YYTNAME.
18248
f282676b
AD
182492000-10-16 Akim Demaille <akim@epita.fr>
18250
18251 * src/lex.c (read_typename): New function.
18252 (lex): Use it.
18253 * src/reader.c (copy_dollar): Likewise.
18254
550a72a3
AD
182552000-10-16 Akim Demaille <akim@epita.fr>
18256
18257 * src/reader.c (copy_comment2): Expect the input stream to be on
18258 the `/' which is suspected to open a comment, instead of being
18259 called after `//' or `/*' was read.
18260 (copy_comment, copy_definition, parse_union_decl, copy_action)
18261 (copy_guard): Adjust.
18262
131e2fef
AD
182632000-10-16 Akim Demaille <akim@epita.fr>
18264
18265 * src/reader.c (parse_expect_decl): Use `skip_white_space' and
18266 `read_signed_integer'.
18267
79282c5a
AD
182682000-10-16 Akim Demaille <akim@epita.fr>
18269
18270 * src/reader.c (copy_dollar): New function.
18271 (copy_guard, copy_action): Use it.
18272
ff4a34be
AD
182732000-10-16 Akim Demaille <akim@epita.fr>
18274
18275 * lib/quote.h, lib/quote.c, lib/quotearg.h, lib/quotearg.c:
18276 * m4/prereq.m4, m4/c-bs-a.m4, m4/mbstate.m4:
18277 New files, from Fileutils 4.0.27.
18278 * src/main.c (printable_version): Remove.
18279 * src/lex.c, src/reader.c: Use `quote'.
18280
182812000-10-04 Akim Demaille <akim@epita.fr>
18282
18283 * lib/error.c, lib/error.h: New files, needed by xmalloc.c.
18284
14ded682
AD
182852000-10-04 Akim Demaille <akim@epita.fr>
18286
18287 * doc/bison.texinfo: Various typos spotted by Neil Booth.
18288
8e03724b
AD
182892000-10-04 Akim Demaille <akim@epita.fr>
18290
18291 When a literal string is used to define two different tokens,
18292 `bison -v' segfaults.
18293 Reported by Piotr Gackiewicz, and fixed by Neil Booth.
18294
18295 * tests/regression.m4: New file.
18296 Include the core of the sample provided by Piotr Gackiewicz.
18297 * src/reader.c (parse_token_decl): Diagnose bad cases, and proceed
18298 properly.
18299
a9e64249
AD
183002000-10-04 Akim Demaille <akim@epita.fr>
18301
18302 * src/reader.c (parse_expect_decl): Keep `count' within the size
18303 of `buffer'.
18304 From Neil Booth.
18305
da9abf43
AD
183062000-10-02 Paul Eggert <eggert@twinsun.com>
18307
18308 * bison.s1 (yyparse): Assign the default value
18309 unconditionally, to avoid a GCC warning and make the parser a
18310 tad smaller.
18311
c33638bb
AD
183122000-10-02 Akim Demaille <akim@epita.fr>
18313
18314 * src/getargs.c (getargs): Don't dump `--help' on unrecognized
18315 options.
18316
444c570a
AD
183172000-10-02 Akim Demaille <akim@epita.fr>
18318
18319 * src/derives.c, src/print.c, src/reduce.c: To ease the
18320 translation, move some `\n' out of the translated strings.
18321
89cab50d
AD
183222000-10-02 Akim Demaille <akim@epita.fr>
18323
18324 The location tracking mechanism is precious for parse error
18325 messages. Nevertheless, it is enabled only when `@n' is used in
18326 the grammar, which is a different issue (you can use it in error
18327 message, but not in the grammar per se). Therefore, there should
18328 be another means to enable it.
18329
18330 * src/getargs.c (getargs): Support `--locations'.
18331 (usage): Report it.
18332 * src/getargs.h (locationsflag): Export it.
18333 * src/lex.c (percent_table): Support `%locations'.
18334 * src/reader.c (yylsp_needed): Remove this variable, now replaced
18335 with `locationsflag'.
18336 * doc/bison.texinfo: Document `--locations' and `%locations'.
18337 Sort the options.
18338 * tests/calc.m4: Test it.
18339
18340 For regularity of the names, replace each
18341 (nolineflag, toknumflag, rawtokenumflag, noparserflag): with...
18342 (no_lineflag, token_tableflag, rawflag, no_parserflag): this.
18343 In addition replace each `flag' with `_flag'.
18344
d6c2cba0
AD
183452000-10-02 Akim Demaille <akim@epita.fr>
18346
18347 Also test parse error messages, including with YYERROR_VERBOSE.
18348
18349 * tests/calc.m4 (calc.y): Add support for `exp = exp' (non
18350 associative).
18351 Use it to check the computations.
18352 Use it to check `nonassoc' is honored.
18353 (AT_DATA_CALC_Y): Equip `calc.y' with YYERROR_VERBOSE when passed
18354 `--yyerror-verbose'.
18355 (_AT_CHECK_CALC): Adjust to this option.
18356 (_AT_CHECK_CALC_ERROR): New macro to check parse error messages.
18357
5a35a6cb
AD
183582000-10-02 Akim Demaille <akim@epita.fr>
18359
18360 Test also `--verbose', `--defines' and `--name-prefix'. Testing
18361 the latter demonstrates a flaw in the handling of non debugging
18362 parsers introduced by myself on 2000-03-16: `#define yydebug 0'
18363 was used in order to simplify:
18364
18365 #if YYDEBUG
18366 if (yydebug)
18367 {
18368 ...
18369 }
18370 #endif
18371
18372 into
18373
18374 if (yydebug)
18375 {
18376 ...
18377 }
18378
18379 unfortunately this leads to a CPP conflict when
18380 `--name-prefix=foo' is used since it produces `#define yydebug
18381 foodebug'.
18382
18383 * src/bison.s1 [!YYDEBUG]: Do not define yydebug.
18384 (YYDPRINTF): New macro.
18385 Spread its use.
18386 * tests/calc.m4 (AT_CHECK_CALC): Do require a title, build it from
18387 the bison options.
18388 Also test `--verbose', `--defines' and `--name-prefix'.
18389
71da9eea
AD
183902000-10-02 Akim Demaille <akim@epita.fr>
18391
18392 Improve the readability of the produced parsers.
18393
18394 * src/bison.s1: Formatting changes.
18395 Improve the comment related to the `$' mark.
18396 (yydefault): Don't fall through to `yyresume': `goto' there.
18397 * src/output.c (output_parser): When the `$' is met, skip the end
18398 of its line.
18399 New variable, `number_of_dollar_signs', to check there's exactly
18400 one `$' in the parser skeleton.
18401
95e36146
AD
184022000-10-02 Akim Demaille <akim@epita.fr>
18403
18404 * lib/xstrdup.c: New file, from the fileutils.
18405 * src/reader.c (parse_token_decl, get_type_name, parse_type_decl)
18406 (parse_assoc_decl, parse_thong_decl, get_type): Use `xstrdup'
18407 instead of strlen + xmalloc + strcpy.
18408 * src/symtab.c (copys): Remove, use xstrdup instead.
18409
d7020c20
AD
184102000-10-02 Akim Demaille <akim@epita.fr>
18411
18412 * src/gram.h (associativity): New enum type which replaces the
18413 former CPP macros `RIGHT_ASSOC', `LEFT_ASSOC' and `NON_ASSOC' with
18414 `right_assoc', `left_assoc' and `non_assoc'.
18415 Adjust all dependencies.
18416 * src/reader.c: Formatting changes.
18417 (LTYPESTR): Don't define it, use it as a literal in
18418 `reader_output_yylsp'.
18419 * src/symtab.h (symbol_class): New enum type which replaces the
18420 former CPP macros `SUNKNOWN', `STOKEN and `SNTERM' with
18421 `sunknown', `stoken and `snterm'.
18422
1916f98e
AD
184232000-10-02 Akim Demaille <akim@epita.fr>
18424
18425 * src/getargs.c (fixed_outfiles): Rename as...
18426 (yaccflag): for consistency and accuracy.
18427 Adjust dependencies.
18428
d7913476
AD
184292000-10-02 Akim Demaille <akim@epita.fr>
18430
18431 Use the more standard files `xalloc.h' and `xmalloc.c' instead of
18432 Bison's `allocate.c' and `alloc.h'. This patch was surprisingly
18433 difficult and introduced a lot of core dump. It turns out that
18434 Bison used an implementation of `xmalloc' based on `calloc', and
18435 at various places it does depend upon the initialization to 0. I
18436 have not tried to isolate the pertinent places, and all the former
18437 calls to Bison's `xmalloc' are now using `XCALLOC'. Someday,
18438 someone should address this issue.
18439
18440 * src/allocate.c, src/alloc.h, m4/bison-decl.m4: Remove.
18441 * lib/xmalloc.c, lib/xalloc.h, m4/malloc.m4, m4/realloc.m4: New
18442 files.
18443 Adjust dependencies.
18444 * src/warshall.h: New file.
18445 Propagate.
18446
340ef489
AD
184472000-10-02 Akim Demaille <akim@epita.fr>
18448
18449 Various anti-`extern in *.c' changes.
18450
18451 * src/system.h: Include `assert.h'.
18452
b2ca4022
AD
184532000-10-02 Akim Demaille <akim@epita.fr>
18454
18455 * src/state.h (nstates, final_state, first_state, first_shift)
18456 (first_reduction): Move their exportation from here...
18457 * src/LR0.h: to here.
18458 Adjust dependencies.
18459 * src/getargs.c (statisticsflag): New variable.
18460 Add support for `--statistics'.
18461 Adjust dependencies.
18462
18463 Remove a lot of now useless `extern' statements in most files.
18464
403b315b
AD
184652000-10-02 Akim Demaille <akim@epita.fr>
18466
18467 * src/LR0.h: New file.
18468 Propagate its use.
18469
07a58c13
AD
184702000-10-02 Akim Demaille <akim@epita.fr>
18471
18472 * src/print.h: New file.
18473 Propagate its use.
18474 * src/print.c: Formatting and ordering changes.
18475 (verbose, terse): Replace with...
18476 (print_results): this new function.
18477 Adjust dependencies.
18478
0619caf0
AD
184792000-10-02 Akim Demaille <akim@epita.fr>
18480
18481 * src/conflicts.c (conflict_report): New function.
18482 (conflict_log, verbose_conflict_log): Replace with...
18483 (print_conflicts): this function.
18484 Adjust dependencies.
18485 * src/conflicts.h: New file.
18486 Propagate its inclusion.
18487
3519ec76
AD
184882000-10-02 Akim Demaille <akim@epita.fr>
18489
18490 * src/nullable.h: New file.
18491 Propagate its inclusion.
18492 * src/nullable.c: Formatting changes.
18493
015acc48
AD
184942000-10-02 Akim Demaille <akim@epita.fr>
18495
18496 * src/reduce.h: New file.
18497 Propagate its inclusion.
18498 * src/reduce.c: Topological sort and other formatting changes.
18499 (bool, TRUE, FALSE): Move their definition to...
18500 * src/system.h: here.
18501
8963a27b
AD
185022000-10-02 Akim Demaille <akim@epita.fr>
18503
18504 * src/files.c: Formatting changes.
18505 (tryopen, tryclose, openfiles): Rename as...
18506 (xfopen, xfclose, open_files): this.
18507 (stringappend): static.
18508 * src/files.h: Complete the list of exported symbols.
18509 Propagate its use.
18510
a70083a3
AD
185112000-10-02 Akim Demaille <akim@epita.fr>
18512
18513 * src/reader.h: New file.
18514 Propagate its use instead of tedious list of `extern' and
18515 prototypes.
18516 * src/reader.c: Formatting changes, topological sort,
18517 s/register//.
18518
abadc117
AD
185192000-10-02 Akim Demaille <akim@epita.fr>
18520
18521 * src/lex.h: Prototype `lex.c' exported functions.
18522 * src/reader.c: Adjust.
18523 * src/lex.c: Formatting changes.
18524 (safegetc): Rename as...
18525 (xgetc): this.
18526
720d742f
AD
185272000-10-02 Akim Demaille <akim@epita.fr>
18528
18529 * src/lalr.h: New file.
18530 Propagate its inclusion instead of prototypes and `extern'.
18531 * src/lalr.c: Formatting changes, topological sorting etc.
18532
f2acea59
AD
185332000-10-02 Akim Demaille <akim@epita.fr>
18534
18535 * src/output.c (token_actions): Introduce a temporary array,
18536 YYDEFACT, that makes it possible for this function to use
18537 output_short_table.
18538
d019d655
AD
185392000-10-02 Akim Demaille <akim@epita.fr>
18540
18541 `user_toknums' is output as a `short[]' in `output.c', while it is
18542 defined as a `int[]' in `reader.c'. For consistency with the
18543 other output tables, `user_toknums' is now defined as a table of
18544 shorts.
18545
18546 * src/reader.c (user_toknums): Be a short table instead of an int
18547 table.
18548 Adjust dependencies.
18549
18550 Factor the short table outputs.
18551
18552 * src/output.c (output_short_table): New function.
18553 * src/output.c (output_gram, output_stos, output_rule_data)
18554 (output_base, output_table, output_check): Use it.
18555
6c89f1c1
AD
185562000-10-02 Akim Demaille <akim@epita.fr>
18557
18558 * src/output.c (output): Topological sort of the functions, in
18559 order to get rid of the `static' prototypes.
18560 No longer use `register'.
18561 * src/output.h: New file.
18562 Propagate its inclusion in files explicitly prototyping functions
18563 from output.c.
18564
d9efd181
AD
185652000-09-21 Akim Demaille <akim@epita.fr>
18566
18567 * src/atgeneral.m4: Update from Autoconf.
18568
c29240e7 185692000-09-21 Akim Demaille <akim@epita.fr>
2fa6973e
AD
18570
18571 * src/closure.h: New file.
18572 * src/closure.c: Formatting changes, topological sort over the
18573 functions, use of closure.h.
18574 (initialize_closure, finalize_closure): Rename as...
18575 (new_closure, free_closure): these. Adjust dependencies.
18576 * src/LR0.c: Formatting changes, topological sort, use of
18577 cloture.h.
18578 (initialize_states): Rename as...
18579 (new_states): this.
18580 * src/Makefile.am (noinst_HEADERS): Adjust.
18581
499daa50
AD
185822000-09-20 Akim Demaille <akim@epita.fr>
18583
18584 * src/acconfig.h: Don't protect config.h against multiple
18585 inclusion.
18586 Don't define PARAMS.
18587 * src/system.h: Define PARAMS.
18588 Remove some of the ad-hoc CPP magic for DOS, VMS etc.: this is the
18589 purpose of config.h. system.h must not try to fix wrong
18590 definitions in config.h.
18591
cc84fd5d
AD
185922000-09-20 Akim Demaille <akim@epita.fr>
18593
18594 * src/derives.h: New file.
18595 * src/main.c, src/derives.h: Use it.
18596 Formatting changes.
18597 * src/Makefile.am (noinst_HEADERS): Adjust.
18598
db5b3a89
AD
185992000-09-20 Akim Demaille <akim@epita.fr>
18600
18601 * tests/atgeneral.m4: Update from Autoconf.
18602 * tests/calc.m4 (_AT_DATA_CALC_Y, AT_DATA_CALC_Y, _AT_CHECK_CALC)
18603 (AT_CHECK_CALC): New macros.
18604 Use these macros to test bison with options `', `--raw',
18605 `--debug', `--yacc', `--yacc --debug'.
18606
ceed8467
AD
186072000-09-19 Akim Demaille <akim@epita.fr>
18608
18609 * src/output.c: Formatting changes.
18610 * src/machine.h: Remove, leaving its contents in...
18611 * src/system.h: here.
18612 Include stdio.h.
18613 Adjust all dependencies on stdio.h and machine.h.
18614 * src/getargs.h: New file.
18615 Let all `extern' declarations about getargs.c be replaced with
18616 inclusion of `getargs.h'.
18617 * src/Makefile.am (noinst_HEADERS): Adjust.
18618
18619 * tests/calc.m4 (yyin): Be initialized in main, not on the global
18620 scope.
18621 (yyerror): Returns void, not int.
18622 * doc/bison.texinfo: Formatting changes.
18623
05a1d24b
AD
186242000-09-19 Akim Demaille <akim@epita.fr>
18625
18626 * tests/calc.m4 (calc.y): Do not assign to stdin, as it's not
18627 portable.
18628
cbd25751
AD
186292000-09-18 Akim Demaille <akim@epita.fr>
18630
18631 * configure.in: Append WARNING_CFLAGS to CFLAGS.
18632 * src/Makefile.am (INCLUDES): Don't.
18633 Be ready to fetch headers in lib/.
18634
13863333
AD
186352000-09-18 Akim Demaille <akim@epita.fr>
18636
18637 * doc/bison.texinfo: Update the copyright.
18638 ANSIfy and GNUify the examples.
18639 Remove the old menu.
18640
0d533154
AD
186412000-09-18 Akim Demaille <akim@epita.fr>
18642
18643 First set of tests: use the `calc' example from the documentation.
18644
18645 * src/bison.s1 (yyparse): Condition the code using `yytname' which
18646 is defined only when YYDEBUG is.
18647 * m4/atconfig.m4 (AT_CONFIG): Adjust to Autoconf 2.13.
18648 * src/files.c (tryopen, tryclose): Formatting changes.
18649 Move to the top and be static.
18650 * src/reader.c (read_signed_integer): Likewise.
18651 * tests/calc.m4: New file.
18652 * Makefile.am, suite.m4: Adjust.
18653 * m4/atconfig.m4: Set BISON_SIMPLE and BISON_HAIRY.
18654
e79137ac
AD
186552000-09-18 Akim Demaille <akim@epita.fr>
18656
18657 Add support for an Autotest test suite for Bison.
18658
18659 * m4/m4.m4, m4/atconfig.m4: New files.
18660 * m4/Makefile.am (EXTRA_DIST): Adjust.
18661 * tests/suite.m4, tests/Makefile.am, tests/atgeneral.m4: New
18662 files.
18663 * src/getargs.c: Display a more standard --version message.
18664 * src/reader.c (reader): Formatting changes.
18665 No longer depend upon VERSION_STRING.
18666 * configure.in: No longer use `dnl'.
18667 Set up the test suite and the new directory `tests/.
18668 (VERSION_STRING): Remove.
18669
27821bff
AD
186702000-04-14 Akim Demaille <akim@epita.fr>
18671
18672 * src/reader.c (copy_comment2): New function, same as former
18673 `copy_comment', but outputs into two FILE *.
18674 (copy_comment): Use it.
18675 (parse_union_decl): Use it.
18676 (get_type, parse_start_decl): Use the same `invalid' message.
18677 (parse_start_decl, parse_union_decl): Use the same `multiple'
18678 message.
18679 (parse_union_decl, copy_guard, copy_action): Use the same
18680 `unmatched' message.
18681 * m4/Makefile.am (EXTRA_DIST): Add `warning.m4'.
18682
cfe5fbc0
AD
186832000-03-31 Akim Demaille <akim@epita.fr>
18684
18685 * src/files.c (tryopen, tryclose): Move to the top.
18686 Be static.
18687
cb7db13e
AD
186882000-03-31 Akim Demaille <akim@epita.fr>
18689
18690 * src/main.c (main): Don't call `done', exit does it.
18691
a0f6b076
AD
186922000-03-31 Akim Demaille <akim@epita.fr>
18693
36281465
AD
18694 * allocate.c: s/return (foo)/return foo/.
18695 * lalr.c: Likewise.
18696 * LR0.c: Likewise.
18697 * output.c: Likewise.
18698 * reader.c: Likewise.
18699 * symtab.c: Likewise.
18700 * vmsgetargs.c: Likewise.
18701
187022000-03-31 Akim Demaille <akim@epita.fr>
18703
18704 Clean up the error reporting functions.
a0f6b076
AD
18705
18706 * src/report.c: New file.
18707 * src/report.h: Likewise.
18708 * src/Makefile.am: Adjust.
18709 * m4/error.m4: New file.
18710 * m4/Makefile.am: Adjust.
18711 * configure.in (jm_PREREQ_ERROR): Call it.
18712 * src/main.c (int_to_string, banner, fatal_banner, warn_banner):
18713 Remove.
18714 (fatal, fatals): Remove. All callers use complain.c::fatal.
18715 (warn, warni, warns, warnss, warnss): Remove. All callers use
18716 complain.c::complain.
18717 (toomany): Remove, use fatal instead.
18718 * src/files.c (done): No argument, use complain_message_count.
18719 * src/main.c (main): Register `done' to `atexit'.
18720
18721 * src/getargs.c (usage): More `fputs', less `fprintf'.
18722
18539825
AD
187232000-03-28 Akim Demaille <akim@epita.fr>
18724
18725 * lib/: New directory.
18726 * Makefile.am (SUBDIRS): Adjust.
18727 * configure.in: Adjust.
18728 (LIBOBJS): Although not used yet, AC_SUBST it, otherwise it's
18729 useless.
18730 * src/alloca.c: Moved to lib/.
18731 * src/getopt.c: Likewise.
18732 * src/getopt1.c: Likewise.
18733 * src/getopt.h: Likewise.
18734 * src/ansi2knr.c: Likewise.
18735 * src/ansi2knr.1: Likewise.
18736 * src/Makefile.am: Adjust.
18737 * lib/Makefile.am: New file.
18738
9f306f2a
AD
187392000-03-28 Akim Demaille <akim@epita.fr>
18740
18741 * src/getargs.c (usage): Refresh the help message.
18742
0ba347b6
AD
187432000-03-17 Akim Demaille <akim@epita.fr>
18744
18745 * src/getopt1.c: Updated from textutils 2.0e
18746 * src/getopt.c: Likewise.
18747 * src/getopt.h: Likewise.
18748
dbe7f271
AD
187492000-03-17 Akim Demaille <akim@epita.fr>
18750
18751 * src/Makefile.am (bison.simple): Fix the awk program: quote only
18752 the file name, not the whole `#line LINE FILE'.
18753
75bbe78d
AD
187542000-03-17 Akim Demaille <akim@epita.fr>
18755
18756 On syntax errors, report the token on which we choked.
18757
aa5fd0ee
AD
18758 * src/bison.s1 (yyparse): In the label yyerrlab, when
18759 YYERROR_VERBOSE, add yychar in msg.
75bbe78d 18760
7b306f52
AD
187612000-03-17 Akim Demaille <akim@epita.fr>
18762
aa5fd0ee 18763 * src/reader.c (copy_at): New function.
7b306f52
AD
18764 (copy_guard): Use it.
18765 (copy_action): Use it.
18766
e87b5700
AD
187672000-03-17 Akim Demaille <akim@epita.fr>
18768
18769 Be kind to translators, save some useless translations.
18770
aa5fd0ee 18771 * src/main.c (banner): New function.
e87b5700
AD
18772 (fatal_banner): Use it.
18773 (warn_banner): Use it.
18774
ae3c3164
AD
187752000-03-17 Akim Demaille <akim@epita.fr>
18776
aa5fd0ee
AD
18777 * src/reader.c (copy_definition): Use copy_string and
18778 copy_comment. Removed now unused `match', `ended',
18779 `cplus_comment'.
ae3c3164
AD
18780 (copy_comment, copy_string): Moved, to be visible from
18781 copy_definition.
18782
4dc58e7c
AD
187832000-03-17 Akim Demaille <akim@epita.fr>
18784
aa5fd0ee
AD
18785 * src/reader.c (copy_string): Declare `static inline'. No
18786 problems with inline, since it is checked by configure.
4dc58e7c
AD
18787 (copy_comment): Likewise.
18788
0a6384c4
AD
187892000-03-17 Akim Demaille <akim@epita.fr>
18790
aa5fd0ee 18791 * src/reader.c (packsymbols): Formatting changes.
0a6384c4 18792
3cef001a
AD
187932000-03-17 Akim Demaille <akim@epita.fr>
18794
aa5fd0ee 18795 * src/reader.c (copy_comment): New function, factored out from:
3cef001a
AD
18796 (copy_action): Use it. Removed now unused `match', `ended',
18797 `cplus_comment'.
18798 (copy_guard): Likewise.
18799
ca36d2ef
AD
188002000-03-17 Akim Demaille <akim@epita.fr>
18801
aa5fd0ee 18802 * src/reader.c (copy_string): New function, factored out from:
ca36d2ef
AD
18803 (copy_action): Use it.
18804 (copy_guard): Likewise.
18805
6666f98f
AD
188062000-03-17 Akim Demaille <akim@epita.fr>
18807
18808 Change the handling of @s so that they behave exactly like $s.
18809 There is now a pseudo variable @$ (readble and writable), location
18810 of the lhs of the rule (by default ranging from the location of
18811 the first symbol of the rhs, to the location of the last symbol,
18812 or, if the rhs is empty, YYLLOC).
18813
18814 * src/bison.s1 [YYLSP_NEEDED] (yyloc): New variable, twin of
18815 yyval.
18816 (yyparse): When providing a default semantic action, provide a
18817 default location action.
18818 (after the $): No longer change `*YYLSP', just stack YYLOC the
18819 same way you stack YYVAL.
18820 * src/reader.c (read_declarations): Use warns.
18821 (copy_guard, case '@'): Also recognize `@$', expanded as `YYLOC'.
18822 (copy_action, case '@'): Likewise.
18823 Use a standard error message, to save useless work from
18824 translators.
18825
41aca2e0
AD
188262000-03-17 Akim Demaille <akim@epita.fr>
18827
aa5fd0ee
AD
18828 * src/bison.s1: Formatting and cosmetics changes.
18829 * src/reader.c: Likewise.
41aca2e0
AD
18830 Update the Copyright notice.
18831
dc08c1d5
AD
188322000-03-17 Akim Demaille <akim@epita.fr>
18833
aa5fd0ee
AD
18834 * src/bison.s1 (#line): All set to `#line' only, since the
18835 Makefile now handles them.
dc08c1d5 18836
9ee3c97b
AD
188372000-03-16 Akim Demaille <akim@epita.fr>
18838
18839 * src/output.c (output_rule_data): Output the documentation of
18840 some of the tables.
18841 (Copyright notice): Update.
18842 Formatting changes.
18843
0de741ca
AD
188442000-03-16 Akim Demaille <akim@epita.fr>
18845
18846 * src/bison.s1 [!YYDEBUG]: Define yydebug to 0. This allows to
18847 remove most `#if YYDEBUG != 0', since `if (yydebug)' is enough.
18848 One `#if YYDEBUG' remains, since it uses variables which are
18849 defined only if `YYDEBUG != 0'.
18850
bb10be54
AD
188512000-03-16 Akim Demaille <akim@epita.fr>
18852
18853 * src/bison.s1 (yyparse): Reorganize the definitions of the stacks
18854 and related variables so that the similarities are highlighted.
18855
b07b484a
AD
188562000-03-16 Akim Demaille <akim@epita.fr>
18857
18858 * src/bison.s1: Properly indent CPP directives.
18859
361f60b3
AD
188602000-03-16 Akim Demaille <akim@epita.fr>
18861
18862 * src/bison.s1: Properly indent the `alloca' CPP section.
18863
8c44d3ec
AD
188642000-03-16 Akim Demaille <akim@epita.fr>
18865
18866 Do not hard code values of directories in `configure.in'.
18867 Update the `configure' tool chain.
18868
18869 * configure.in (XPFILE, XPFILE1, LOCALEDIR): Remove, handled by
18870 src/makefile.am.
18871 (VERSION_STRING): Use the third arg of AC_DEFINE_UNQUOTED.
18872 (AC_OUTPUT): Add m4/Makefile.
18873 Bump to bison 1.28a, 1.29 has never been released.
18874 * acconfig.h (XPFILE, XPFILE1, LOCALEDIR): Remove, since they are
18875 handled via src/Makefile.am.
18876 (VERSION_STRING, PROTOTYPES, ENABLE_NLS, HAVE_CATGETS,
18877 HAVE_GETTEXT, HAVE_LC_MESSAGES, HAVE_STPCPY): Remove, handled by
18878 autoheader.
18879 * Makefile.am (SUBDIRS): Add m4.
18880 (ACLOCAL_AM_FLAGS): New variable.
18881 (AUTOMAKE_OPTIONS): Add check-news.
18882 * src/Makefile.am (bison.simple): Use awk to replace #line lines with
18883 the proper line number and file name.
18884 (DEFS): Propagate the location of bison library files and of the
18885 locale files.
18886 (INCLUDES): Added `-I ..' so that one can compile with srcdir !=
18887 builddir.
18888 * acinclude.m4: Remove, replaced by the directory m4.
18889 * m4/Makefile.am (EXTRA_DIST): New variable.
18890 * m4/gettext.m4: New file, from the fileutils.
18891 * m4/lcmessage.m4: Likewise
18892 * m4/progtest.m4: Likewise.
18893 * m4/bison-decl.m4: New file, extracted from former acinclude.m4.
18894
f95997e7
AD
188952000-03-10 Akim Demaille <akim@epita.fr>
18896
18897 * src/closure.c:
18898 Formatting changes of various comments.
18899 Respect the GNU coding standards at various places.
18900 Don't use `_()' when no translation is needed.
18901
189021999-12-13 Jesse Thilo <jthilo@gnu.org>
18903
18904 * src/files.c:
18905 OS/2 honors TMPDIR environment variable.
18906
189071999-12-13 Jesse Thilo <jthilo@gnu.org>
18908
18909 * doc/bison.texinfo: Tweaked spelling and grammar.
18910 Updated ISBN.
18911 Removed reference to price of printed copy.
18912 Mention BISON_SIMPLE and BISON_HAIRY.
18913
189141999-12-13 Jesse Thilo <jthilo@gnu.org>
18915
18916 * configure.in, NEWS:
18917 Bison 1.29 released.
18918
189191999-10-27 Jesse Thilo <jthilo@gnu.org>
18920
18921 * doc/.cvsignore, doc/Makefile.am, doc/refcard.tex:
18922 Added reference card.
18923
189241999-07-26 Jesse Thilo <jthilo@gnu.org>
18925
18926 * po/ru.po: Added Russian translation.
18927
189281999-07-26 Jesse Thilo <jthilo@gnu.org>
18929
18930 * configure.in: Added Russian translation.
18931
189321999-07-06 Jesse Thilo <jthilo@gnu.org>
18933
18934 * configure.in, NEWS, README:
18935 Released version 1.28.
18936
189371999-06-14 Jesse Thilo <jthilo@gnu.org>
18938
18939 * src/system.h:
18940 Squashed redefinition warning on some systems.
18941
18942 * src/getargs.c, src/Makefile.am, src/reader.c, src/version.c:
18943 Have configure build version string instead of relying on ANSI string
18944 concatentation.
18945
189461999-06-14 Jesse Thilo <jthilo@gnu.org>
18947
18948 * po/POTFILES.in: Got rid of version.c.
18949
189501999-06-14 Jesse Thilo <jthilo@gnu.org>
18951
18952 * acconfig.h, configure.in:
18953 Have configure build version string instead of relying on ANSI string
18954 concatentation.
18955
189561999-06-08 Jesse Thilo <jthilo@gnu.org>
18957
18958 * doc/bison.1:
18959 Dropped mention of `+' for long-named options.
18960
189611999-05-30 Jesse Thilo <jthilo@gnu.org>
18962
18963 * src/files.c: Added <unistd.h> for unlink().
18964
18965 * src/Makefile.am, src/system.h:
18966 I18n fixes.
18967
189681999-05-30 Jesse Thilo <jthilo@gnu.org>
18969
18970 * README: Added a FAQ list.
18971
18972 * configure.in, acconfig.h:
18973 I18n fixes.
18974
189751999-05-30 Jesse Thilo <jthilo@gnu.org>
18976
18977 * doc/FAQ, doc/Makefile.am:
18978 Added a FAQ list.
18979
189801999-05-19 Jesse Thilo <jthilo@gnu.org>
18981
18982 * src/alloc.h, src/symtab.h, src/version.c:
18983 Protected inclusion of "config.h" with HAVE_CONFIG_H.
18984
189851999-04-18 Jesse Thilo <jthilo@gnu.org>
18986
18987 * src/.cvsignore, src/Makefile.am:
18988 Reorganized: sources in `src', documentation in `doc'.
18989
18990 * src/lex.c (literalchar):
18991 fixed the code for escaping double quotes (thanks
18992 Jonathan Czisny.)
18993
189941999-04-18 Jesse Thilo <jthilo@gnu.org>
18995
18996 * po/de.po, po/es.po, po/fr.po, po/nl.po, po/POTFILES.in:
18997 Adjusted paths to reflect directory reorganization.
18998
189991999-04-18 Jesse Thilo <jthilo@gnu.org>
19000
19001 * doc/.cvsignore, doc/Makefile.am:
19002 Reorganized: sources in `src', documentation in `doc'.
19003
190041999-04-18 Jesse Thilo <jthilo@gnu.org>
19005
19006 * configure.in:
19007 Updated AC_INIT file to reflect directory reorganization.
19008
19009 * configure.in, .cvsignore, Makefile.am, POTFILES.in:
19010 Reorganized: sources in `src', documentation in `doc'.
19011
190121999-04-13 Jesse Thilo <jthilo@gnu.org>
19013
19014 * src/allocate.c:
19015 Don't declare calloc() and realloc() if not necessary.
19016
190171999-04-13 Jesse Thilo <jthilo@gnu.org>
19018
19019 * configure.in, acconfig.h, acinclude.m4:
19020 Don't declare calloc() and realloc() if not necessary.
19021
190221999-03-23 Jesse Thilo <jthilo@gnu.org>
19023
19024 * po/.cvsignore: Added i18n support.
19025
190261999-03-23 Jesse Thilo <jthilo@gnu.org>
19027
19028 * acconfig.h, configure.in, Makefile.am:
19029 Added i18n support.
19030
190311999-03-22 Jesse Thilo <jthilo@gnu.org>
19032
19033 * src/bison.s1: Fixed #line numbers.
19034
190351999-03-15 Jesse Thilo <jthilo@gnu.org>
19036
19037 * po/es.po, po/fr.po, po/nl.po, po/de.po:
19038 Added PO files from Translation Project.
19039
190401999-03-03 Jesse Thilo <jthilo@gnu.org>
19041
19042 * Makefile.am:
19043 Added support for non-ANSI compilers (ansi2knr).
19044
190451999-02-16 Jesse Thilo <jthilo@gnu.org>
19046
19047 * configure.in: Bumped version number to 1.27.
19048
19049 * Makefile.am:
19050 Added `bison.simple' to list of files removed by `make distclean'.
19051
190521999-02-12 Jesse Thilo <jthilo@gnu.org>
19053
19054 * src/files.c, src/files.h:
19055 Defined locations of parser files in config.h instead of Makefile.
19056
190571999-02-12 Jesse Thilo <jthilo@gnu.org>
19058
19059 * acconfig.h, acinclude.m4, configure.in, Makefile.am:
19060 Defined locations of parser files in config.h instead of Makefile.
19061
190621999-02-09 Jesse Thilo <jthilo@gnu.org>
19063
19064 * Makefile.am:
19065 Removed inappropriate use of $< macro.
19066
190671999-02-05 Jesse Thilo <jthilo@gnu.org>
19068
19069 * po/Makefile.in.in, po/POTFILES.in:
19070 Add `po' directory skeleton.
19071
190721999-01-27 Jesse Thilo <jthilo@gnu.org>
19073
19074 * README: Document help-bison list.
19075
19076 * configure.in: Add check for mkstemp().
19077
190781999-01-20 Jesse Thilo <jthilo@gnu.org>
19079
19080 * src/conflicts.c, src/LR0.c, src/output.c, src/reader.c:
19081 Hush a few compiler warnings.
19082
19083 * src/files.c:
19084 Add tryclose(), which verifies that fclose was successful.
19085 Hush a couple of compiler warnings.
19086
190871999-01-20 Jesse Thilo <jthilo@gnu.org>
19088
19089 * Makefile.am, OChangeLog:
19090 ChangeLog is now automatically generated. Include the old version as
19091 OChangeLog.
19092
190931999-01-14 Jesse Thilo <jthilo@gnu.org>
19094
19095 * 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:
19096 Update FSF address.
19097
190981999-01-14 Jesse Thilo <jthilo@gnu.org>
19099
19100 * doc/bison.texinfo: Fix formatting glitch.
19101
19102 * doc/bison.texinfo: Update FSF address.
19103
191041999-01-14 Jesse Thilo <jthilo@gnu.org>
19105
19106 * acconfig.h: Update FSF address.
19107
191081999-01-08 Jesse Thilo <jthilo@gnu.org>
19109
19110 * src/system.h:
19111 Don't define PACKAGE here, since config.h defines it.
19112
191131998-12-30 Jesse Thilo <jthilo@gnu.org>
19114
19115 * src/reader.c: Update copyright date.
19116
19117 * src/main.c:
19118 Ditch sprintf to statically-sized buffers in fatal/warn functions in
19119 favor of output directly to stderr (avoids buffer overruns).
19120
19121 * src/reader.c: Some checks for premature EOF.
19122
19123 * 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:
19124 Use prototypes if the compiler understands them.
19125
19126 * src/files.c: Honor TMPDIR on Unix hosts.
19127 Use prototypes if the compiler understands them.
19128
19129 * src/reader.c:
19130 Fix a couple of buffer overrun bugs.
19131 Use prototypes if the compiler understands them.
19132
19133 * src/system.h: Include unistd.h and ctype.h.
19134 Use #ifdef instead of #if for NLS symbols.
19135
191361998-12-30 Jesse Thilo <jthilo@gnu.org>
19137
19138 * doc/bison.texinfo:
19139 Delete comment "consider using @set for edition number, etc..." since
19140 we now are doing so.
19141
191421998-12-30 Jesse Thilo <jthilo@gnu.org>
19143
19144 * configure.in:
19145 Use prototypes if the compiler understands them.
19146
19147 * NEWS: Document 1.26 highlights.
19148
19149 * Makefile.am: Require Automake 1.3 or later.
19150
19151 * acconfig.h:
19152 Use prototypes if the compiler understands them.
19153
191541998-12-29 Jesse Thilo <jthilo@gnu.org>
19155
19156 * src/version.c:
19157 Use VERSION symbol from automake for version number.
19158
191591998-12-29 Jesse Thilo <jthilo@gnu.org>
19160
19161 * acconfig.h, configure.in, version.cin:
19162 Use VERSION symbol from automake for version number.
19163
191641998-11-28 Jesse Thilo <jthilo@gnu.org>
19165
19166 * Makefile.am:
19167 Distribute original version of simple parser (bison.s1), not built
19168 version (bison.simple).
19169
191701998-11-28 Jesse Thilo <jthilo@gnu.org>
19171
19172 * doc/bison.texinfo: Add info dir entry.
19173
19174 * doc/bison.texinfo:
19175 Let automake put version number into documentation.
19176
191771998-11-26 Jesse Thilo <jthilo@gnu.org>
19178
19179 * src/bison.cld, src/build.com, src/vmshlp.mar:
19180 Add non-RCS files from /gd/gnu/bison.
19181
191821998-11-26 Jesse Thilo <jthilo@gnu.org>
19183
19184 * doc/bison.1:
19185 Document the BISON_HAIRY and BISON_SIMPLE variables.
19186
191871998-11-25 Jesse Thilo <jthilo@gnu.org>
19188
19189 * src/version.c: Build version.c automatically.
19190
19191 * src/reader.c:
19192 Fix token numbering (used to start at 258, not 257).
19193
19194 * src/system.h: Include config.h.
19195
19196 * src/getargs.c: Update bug report address.
19197
19198 * src/alloca.c, src/getopt1.c, src/getopt.c, src/getopt.h:
19199 Get latest copies of alloca.c, getopt.c, getopt.h, getopt1.c from gnu.org.
19200
192011998-11-25 Jesse Thilo <jthilo@gnu.org>
19202
19203 * Makefile.am:
19204 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
19205
19206 * configure.in, version.cin:
19207 Build version.c automatically.
19208
19209 * AUTHORS: Add AUTHORS file.
19210
19211 * README: Update bug report address.
19212
19213 * bison.simple:
19214 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
19215
19216 * configure.in, Makefile.am, Makefile.in, stamp-h.in:
19217 Add automake stuff.
19218
192191998-11-25 Jesse Thilo <jthilo@gnu.org>
19220
19221 * doc/bison.texinfo: Clean up some formatting.
19222
192231998-05-05 Richard Stallman <rms@gnu.org>
19224
19225 * doc/bison.texinfo:
19226 Explain better why to make a pure parser.
19227
192281998-01-05 Richard Stallman <rms@gnu.org>
19229
19230 * src/files.c (openfiles):
19231 [_WIN32 && !__CYGWIN32__] Use TEMP or Temp to
19232 find a temporary directory, if possible. Do not unlink files while
19233 they are open.
19234
192351997-08-25 Richard Stallman <rms@gnu.org>
19236
19237 * src/reader.c (stack_offset;):
19238 Change some warni to warns.
19239
19240 * src/lex.c (literalchar): Use warns, not warni.
19241
192421997-06-28 Richard Stallman <rms@gnu.org>
19243
19244 * src/bison.s1: Add a Bison version comment.
19245
19246 * src/main.c (fatal, warn, berror):
19247 Use program_name.
19248
192491997-06-28 Richard Stallman <rms@gnu.org>
19250
19251 * Makefile.in (bison_version): New variable.
19252 (dist): Use that variable.
19253 (bison.s1): Substitute the Bison version into bison.simple.
19254
19255 * bison.simple: Add a Bison version comment.
19256
192571997-06-18 Richard Stallman <rms@gnu.org>
19258
19259 * src/main.c (fatal, warn, berror):
19260 Make error messages standard.
19261 (toomany): Improve error message text.
19262
19263 * 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:
19264 new.h renamed to alloc.h.
19265
192661997-06-18 Richard Stallman <rms@gnu.org>
19267
19268 * Makefile.in: new.h renamed to alloc.h.
19269
192701997-05-24 Richard Stallman <rms@gnu.org>
19271
19272 * src/lex.c (literalchar):
19273 Fix the code for escaping \, " and '.
19274
19275 (lex): Avoid trouble when there are many chars
19276 to discard in a char literal with just several chars in it.
19277
192781997-05-17 Richard Stallman <rms@gnu.org>
19279
19280 * src/bison.s1:
19281 Use malloc, if using alloca is troublesome.
19282 (YYSTACK_USE_ALLOCA): New flag macro.
19283 Define it for some systems and compilers.
19284 (YYSTACK_ALLOC): New macro.
19285 (yyparse): Use YYSTACK_ALLOC to allocate stack.
19286 If it was malloc'd, free it.
19287
192881997-05-17 Richard Stallman <rms@gnu.org>
19289
19290 * bison.simple:
19291 Use malloc, if using alloca is troublesome.
19292 (YYSTACK_USE_ALLOCA): New flag macro.
19293 Define it for some systems and compilers.
19294 (YYSTACK_ALLOC): New macro.
19295 (yyparse): Use YYSTACK_ALLOC to allocate stack.
19296 If it was malloc'd, free it.
19297
192981997-04-23 Richard Stallman <rms@gnu.org>
19299
19300 * src/bison.s1:
19301 (alloca) [__hpux]: Always define as __builtin_alloca.
19302
193031997-04-23 Richard Stallman <rms@gnu.org>
19304
19305 * bison.simple:
19306 (alloca) [__hpux]: Always define as __builtin_alloca.
19307
193081997-04-22 Richard Stallman <rms@gnu.org>
19309
19310 * src/bison.s1:
19311 [__hpux]: Include alloca.h (right for HPUX 10)
19312 instead of declaring alloca (right for HPUX 9).
19313
19314 * src/bison.s1 (__yy_memcpy):
19315 Declare arg `count' as unsigned int.
19316 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
19317
193181997-04-22 Richard Stallman <rms@gnu.org>
19319
19320 * bison.simple:
19321 [__hpux]: Include alloca.h (right for HPUX 10)
19322 instead of declaring alloca (right for HPUX 9).
19323
19324 * bison.simple (__yy_memcpy):
19325 Declare arg `count' as unsigned int.
19326 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
19327
193281997-01-03 Richard Stallman <rms@gnu.org>
19329
19330 * src/allocate.c: [__STDC__ or _MSC_VER]:
19331 Declare calloc and realloc to return void *.
19332
193331997-01-02 Richard Stallman <rms@gnu.org>
19334
19335 * src/system.h:
19336 [_MSC_VER]: Include stdlib.h and process.h.
19337 [_MSC_VER] (getpid): Define as macro--translate it to _getpid.
19338
19339 * src/main.c (main): Return FAILURE as a value.
19340 (printable_version): Declare arg as int, not char.
19341
193421997-01-02 Richard Stallman <rms@gnu.org>
19343
19344 * Makefile.in (dist):
19345 Explicitly check for symlinks, and copy them.
19346
193471996-12-19 Richard Stallman <rms@gnu.org>
19348
19349 * src/files.c:
19350 [_MSC_VER] (XPFILE, XPFILE1): Define, if not already defined.
19351
193521996-12-18 Paul Eggert <eggert@gnu.org>
19353
19354 * src/bison.s1 (yyparse):
19355 If __GNUC__ and YYPARSE_PARAM are both defined,
19356 declare yyparse to have a void * argument.
19357
193581996-12-18 Paul Eggert <eggert@gnu.org>
19359
19360 * bison.simple (yyparse):
19361 If __GNUC__ and YYPARSE_PARAM are both defined,
19362 declare yyparse to have a void * argument.
19363
193641996-12-17 Richard Stallman <rms@gnu.org>
19365
19366 * src/reduce.c (nbits): Add some casts.
19367
193681996-08-12 Richard Stallman <rms@gnu.org>
19369
19370 * src/bison.s1: Test _MSDOS as well as _MSDOS_.
19371
193721996-08-12 Richard Stallman <rms@gnu.org>
19373
19374 * bison.simple: Test _MSDOS as well as _MSDOS_.
19375
193761996-07-31 Richard Stallman <rms@gnu.org>
19377
19378 * src/bison.s1:
19379 [__sun && __i386]: Include alloca.h.
19380
193811996-07-31 Richard Stallman <rms@gnu.org>
19382
19383 * bison.simple:
19384 [__sun && __i386]: Include alloca.h.
19385
193861996-07-30 Richard Stallman <rms@gnu.org>
19387
19388 * src/bison.s1: Comment change.
19389
19390 * src/bison.s1: Test _MSDOS_, not MSDOS.
19391
193921996-07-30 Richard Stallman <rms@gnu.org>
19393
19394 * bison.simple: Comment change.
19395
19396 * bison.simple: Test _MSDOS_, not MSDOS.
19397
193981996-06-01 Richard Stallman <rms@gnu.org>
19399
19400 * 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:
19401 Insert `_' macro around many string constants.
19402
19403 * src/main.c:
19404 Insert `_' macro around many string constants.
19405
19406 (main): Call setlocale, bindtextdomain and textdomain.
19407
19408 * src/system.h: [HAVE_LOCALE_H]: Include locale.h.
19409 [! HAVE_LOCALE_H] (setlocale): Define as no-op.
19410 [ENABLE_NLS]: Include libintl.h.
19411 [ENABLE_NLS] (gettext): Define.
19412 [! ENABLE_NLS] (bintextdomain, textdomain, _): Consolation definitions.
19413 (N_, PACKAGE, LOCALEDIR): New macros.
19414
194151996-06-01 Richard Stallman <rms@gnu.org>
19416
19417 * POTFILES.in: New file.
19418
19419 * Makefile.in (allocate.o):
19420 Define target explicitly.
19421
19422 * Makefile.in (CFLAGS): Set to @CFLAGS@.
19423 (LDFLAGS): Set to @LDFLAGS@.
19424 (configure): Run autoconf only if preceding `cd' succeeds.
19425 (bison.s1): Redirect output to temporary file then move the
19426 temporary to the target, rather than redirecting directly to bison.s1.
19427 (clean): Remove config.status and config.log.
19428 (distclean): Don't remove config.status here.
19429
194301996-05-12 Richard Stallman <rms@gnu.org>
19431
19432 * src/bison.s1:
19433 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
19434
194351996-05-12 Richard Stallman <rms@gnu.org>
19436
19437 * bison.simple:
19438 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
19439
194401996-05-11 Richard Stallman <rms@gnu.org>
19441
19442 * src/bison.s1 (__yy_memcpy):
19443 Really reorder the args, as was supposedly done on Feb 14 1995.
19444 (yyparse): Calls changed accordingly.
19445
194461996-05-11 Richard Stallman <rms@gnu.org>
19447
19448 * Makefile.in (dist): Don't use $(srcdir).
19449
19450 * bison.simple (__yy_memcpy):
19451 Really reorder the args, as was supposedly done on Feb 14 1995.
19452 (yyparse): Calls changed accordingly.
19453
194541996-01-27 Richard Stallman <rms@gnu.org>
19455
19456 * src/output.c (output_rule_data):
19457 Test YYERROR_VERBOSE in the conditional
19458 around the definition of ttyname.
19459
194601995-12-29 Richard Stallman <rms@gnu.org>
19461
19462 * src/bison.s1:
19463 Fix line numbers in #line commands.
19464
194651995-12-29 Richard Stallman <rms@gnu.org>
19466
19467 * bison.simple:
19468 Fix line numbers in #line commands.
19469
194701995-12-27 Richard Stallman <rms@gnu.org>
19471
19472 * src/bison.s1 (YYPARSE_PARAM_DECL):
19473 In C++, make it always null.
19474 (YYPARSE_PARAM_ARG): New macro.
19475 (yyparse): Use YYPARSE_PARAM_ARG.
19476
194771995-12-27 Richard Stallman <rms@gnu.org>
19478
19479 * bison.simple (YYPARSE_PARAM_DECL):
19480 In C++, make it always null.
19481 (YYPARSE_PARAM_ARG): New macro.
19482 (yyparse): Use YYPARSE_PARAM_ARG.
19483
194841995-11-29 Richard Stallman <rms@gnu.org>
19485
19486 * doc/bison.texinfo:
19487 Describe literal string tokens, %raw, %no_lines, %token_table.
19488
194891995-11-29 Daniel Hagerty <hag@gnu.org>
19490
19491 * doc/bison.texinfo: Fixed update date
19492
194931995-10-16 Richard Stallman <rms@gnu.org>
19494
19495 * src/version.c: Version 1.25.
19496
194971995-10-16 Richard Stallman <rms@gnu.org>
19498
19499 * NEWS: *** empty log message ***
19500
195011995-10-16 Richard Stallman <rms@gnu.org>
19502
19503 * doc/bison.1, doc/bison.rnh:
19504 Add new options.
19505
195061995-10-15 Richard Stallman <rms@gnu.org>
19507
19508 * src/vmsgetargs.c, src/getargs.c:
19509 Added -n, -k, and -raw switches.
19510 (noparserflag, toknumflag, rawtoknumflag): New variables.
19511
19512 * src/symtab.h (SALIAS):
19513 New #define for adding aliases to %token.
19514 (struct bucket): Added `alias' field.
19515
19516 * src/reduce.c (reduce_grammar):
19517 Revise error message.
19518 (print_notices): Remove final `.' from error message.
19519
19520 * src/reader.c (reader_output_yylsp):
19521 New function.
19522 (readgram): Use `#if 0' around code that accepted %command
19523 inside grammar rules: The documentation doesn't allow it,
19524 and it will fail since the %command processors scan for the next %.
19525 (parse_token_decl): Extended the %token
19526 declaration to allow a multi-character symbol as an alias.
19527 (parse_thong_decl): New function.
19528 (read_declarations): Added %thong declarations.
19529 (read_declarations): Handle NOOP to deal with allowing
19530 % declarations as another means to specify the flags.
19531 (readgram): Allow %prec prior to semantics embedded in a rule.
19532 (skip_to_char, read_declarations, copy_definition)
19533 (parse_token_decl, parse_start_decl, parse_type_decl)
19534 (parse_assoc_decl, parse_union_decl, parse_expect_decl)
19535 (get_type_name, copy_guard, copy_action, readgram)
19536 (get_type, packsymbols): Revised most error messages.
19537 Changed `fatal' to `warnxxx' to avoid aborting for error.
19538 Revised and use multiple warnxxx functions to avoid using VARARGS1.
19539 (read_declarations): Improve the error message for
19540 an invalid character. Do not abort.
19541 (read_declarations, copy_guard, copy_action): Use
19542 printable_version to avoid unprintable characters in printed output.
19543 (parse_expect_decl): Error if argument to %expect exceeds 10 digits.
19544 (parse_token_decl, parse_assoc_decl, parse_type_decl, get_type):
19545 Allow the type of a non-terminal can be given
19546 more than once, as long as all specifications give the same type.
19547
19548 * src/output.c:
19549 (output_headers, output_trailers, output, output_gram)
19550 (output_rule_data): Implement noparserflag variable.
19551 Implement toknumflag variable.
19552 (output): Call reader_output_yylsp to output LTYPESTR.
19553
19554 * src/main.c (main):
19555 If reader sees an error, don't process the grammar.
19556 (fatals): Updated to not use VARARGS1.
19557 (printable_version, int_to_string, warn, warni, warns, warnss)
19558 (warnsss): New error reporting functions. Avoid abort for error.
19559
19560 * src/lex.h:
19561 Added THONG and NOOP for alias processing.
19562 Added SETOPT for the new code that allows setting options with %flags.
19563
19564 * src/lex.c:
19565 Include getopt.h. Add some extern decls.
19566 (safegetc): New function to deal with EOF gracefully.
19567 (literalchar); new function to deal with reading \ escapes.
19568 (lex): Use literalchar.
19569 (lex): Implemented "..." tokens.
19570 (literalchar, lex, parse_percent_token): Made tokenbuffer
19571 always contain the token. This includes growing the token
19572 buffer while reading an integer.
19573 (parse_percent_token): Replaced if-else statement with percent_table.
19574 (parse_percent_token): Added % declarations as another
19575 way to specify the flags -n, -l, and -r. Also added hooks for
19576 -d, -k, -y, -v, -t, -p, -b, -o, but implementation requires
19577 major changes to files.c.
19578 (lex) Retain in the incoming stream a character following
19579 an incorrect '/'.
19580 (skip_white_space, lex): Revised most error messages
19581 and changed fatal to warn to avoid aborting.
19582 (percent_table): Added %thong declarations.
19583
19584 * src/gram.h: Comment changes.
19585
19586 * src/files.c (openfiles, open_extra_files, done):
19587 Add faction flag
19588 and actfile file. Handle noparserflag. Both for -n switch.
19589
19590 * src/conflicts.c (resolve_sr_conflict):
19591 Remove use of alloca.
19592
195931995-06-01 Jim Meyering <meyering@gnu.org>
19594
19595 * doc/bison.texinfo: *** empty log message ***
19596
195971995-05-06 Richard Stallman <rms@gnu.org>
19598
19599 * src/bison.s1: Comment change.
19600
196011995-05-06 Richard Stallman <rms@gnu.org>
19602
19603 * bison.simple: Comment change.
19604
196051995-05-03 Richard Stallman <rms@gnu.org>
19606
19607 * src/version.c: Version now 1.24.
19608
19609 * src/bison.s1: Change distribution terms.
19610
19611 * src/version.c: Version now 1.23.
19612
196131995-05-03 Richard Stallman <rms@gnu.org>
19614
19615 * doc/bison.texinfo:
19616 Rewrite "Conditions for Using Bison".
19617 Update version to 1.24.
19618
196191995-05-03 Richard Stallman <rms@gnu.org>
19620
19621 * bison.simple: Change distribution terms.
19622
196231995-02-23 Richard Stallman <rms@gnu.org>
19624
19625 * src/files.c: Test __VMS_POSIX as well as VMS.
19626
196271995-02-14 Jim Meyering <meyering@gnu.org>
19628
19629 * src/bison.s1 (__yy_memcpy):
19630 Renamed from __yy_bcopy to avoid
19631 confusion. Reverse FROM and TO arguments to be consistent with
19632 those of memcpy.
19633
196341995-02-14 Jim Meyering <meyering@gnu.org>
19635
19636 * bison.simple (__yy_memcpy):
19637 Renamed from __yy_bcopy to avoid
19638 confusion. Reverse FROM and TO arguments to be consistent with
19639 those of memcpy.
19640
196411994-11-10 David J. MacKenzie <djm@gnu.org>
19642
19643 * NEWS: reformat
19644
19645 * NEWS: New file.
19646
19647 * Makefile.in (DISTFILES): Include NEWS.
19648
19649 * Makefile.in (DISTFILES):
19650 Include install-sh, not install.sh.
19651
19652 * configure.in: Update to Autoconf v2 macro names.
19653
196541994-10-05 David J. MacKenzie <djm@gnu.org>
19655
19656 * Makefile.in: fix typo
19657
19658 * Makefile.in (prefix, exec_prefix):
19659 Let configure set them.
19660
196611994-09-28 David J. MacKenzie <djm@gnu.org>
19662
19663 * Makefile.in: Set datadir to $(prefix)/share.
19664
196651994-09-15 Richard Stallman <rms@gnu.org>
19666
19667 * src/bison.s1:
19668 Update copyright notice and GPL version.
19669
196701994-09-15 Richard Stallman <rms@gnu.org>
19671
19672 * bison.simple:
19673 Update copyright notice and GPL version.
19674
196751994-07-12 Richard Stallman <rms@gnu.org>
19676
19677 * src/reduce.c, src/reader.c:
19678 entered into RCS
19679
196801994-05-05 David J. MacKenzie <djm@gnu.org>
19681
19682 * Makefile.in: entered into RCS
19683
196841994-03-26 Richard Stallman <rms@gnu.org>
19685
19686 * src/bison.s1: entered into RCS
19687
196881994-03-26 Richard Stallman <rms@gnu.org>
19689
19690 * bison.simple: entered into RCS
19691
196921994-03-25 Richard Stallman <rms@gnu.org>
19693
19694 * src/main.c: entered into RCS
19695
196961994-03-24 Richard Stallman <rms@gnu.org>
19697
19698 * src/conflicts.c: entered into RCS
19699
197001994-01-02 Richard Stallman <rms@gnu.org>
19701
19702 * Makefile.in: *** empty log message ***
19703
197041993-11-21 Richard Stallman <rms@gnu.org>
19705
19706 * src/bison.s1: *** empty log message ***
19707
197081993-11-21 Richard Stallman <rms@gnu.org>
19709
19710 * doc/bison.texinfo: entered into RCS
19711
19712 * doc/bison.texinfo: *** empty log message ***
19713
197141993-11-21 Richard Stallman <rms@gnu.org>
19715
19716 * bison.simple: *** empty log message ***
19717
197181993-10-25 David J. MacKenzie <djm@gnu.org>
19719
19720 * doc/bison.texinfo: *** empty log message ***
19721
197221993-10-19 Richard Stallman <rms@gnu.org>
19723
19724 * src/bison.s1: *** empty log message ***
19725
197261993-10-19 Richard Stallman <rms@gnu.org>
19727
19728 * bison.simple: *** empty log message ***
19729
197301993-10-14 Richard Stallman <rms@gnu.org>
19731
19732 * src/bison.s1: *** empty log message ***
19733
197341993-10-14 Richard Stallman <rms@gnu.org>
19735
19736 * bison.simple: *** empty log message ***
19737
197381993-09-14 David J. MacKenzie <djm@gnu.org>
19739
19740 * doc/bison.texinfo: *** empty log message ***
19741
197421993-09-13 Noah Friedman <friedman@gnu.org>
19743
19744 * Makefile.in: *** empty log message ***
19745
197461993-09-10 Richard Stallman <rms@gnu.org>
19747
19748 * src/conflicts.c: *** empty log message ***
19749
19750 * src/system.h: entered into RCS
19751
197521993-09-10 Richard Stallman <rms@gnu.org>
19753
19754 * doc/bison.1: entered into RCS
19755
197561993-09-06 Noah Friedman <friedman@gnu.org>
19757
19758 * src/version.c: entered into RCS
19759
197601993-09-06 Noah Friedman <friedman@gnu.org>
19761
19762 * Makefile.in: *** empty log message ***
19763
197641993-07-30 David J. MacKenzie <djm@gnu.org>
19765
19766 * Makefile.in: *** empty log message ***
19767
197681993-07-24 Richard Stallman <rms@gnu.org>
19769
19770 * src/bison.s1: *** empty log message ***
19771
197721993-07-24 Richard Stallman <rms@gnu.org>
19773
19774 * bison.simple: *** empty log message ***
19775
197761993-07-08 David J. MacKenzie <djm@gnu.org>
19777
19778 * Makefile.in: *** empty log message ***
19779
197801993-07-04 Richard Stallman <rms@gnu.org>
19781
19782 * src/bison.s1: *** empty log message ***
19783
197841993-07-04 Richard Stallman <rms@gnu.org>
19785
19786 * bison.simple: *** empty log message ***
19787
197881993-06-26 David J. MacKenzie <djm@gnu.org>
19789
19790 * src/getargs.c: entered into RCS
19791
197921993-06-26 David J. MacKenzie <djm@gnu.org>
19793
19794 * doc/bison.texinfo: *** empty log message ***
19795
19796 * doc/bison.1: New file.
19797
197981993-06-25 Richard Stallman <rms@gnu.org>
19799
19800 * src/getargs.c: New file.
19801
198021993-06-16 Richard Stallman <rms@gnu.org>
19803
19804 * src/bison.s1: *** empty log message ***
19805
198061993-06-16 Richard Stallman <rms@gnu.org>
19807
19808 * bison.simple: *** empty log message ***
19809
198101993-06-03 Richard Stallman <rms@gnu.org>
19811
19812 * src/bison.s1: New file.
19813
198141993-06-03 Richard Stallman <rms@gnu.org>
19815
19816 * doc/bison.texinfo: *** empty log message ***
19817
198181993-06-03 Richard Stallman <rms@gnu.org>
19819
19820 * bison.simple: New file.
19821
198221993-05-19 Richard Stallman <rms@gnu.org>
19823
19824 * doc/bison.texinfo: New file.
19825
198261993-05-07 Noah Friedman <friedman@gnu.org>
19827
19828 * Makefile.in: *** empty log message ***
19829
198301993-04-28 Noah Friedman <friedman@gnu.org>
19831
19832 * src/reader.c: *** empty log message ***
19833
198341993-04-23 Noah Friedman <friedman@gnu.org>
19835
19836 * src/alloc.h: entered into RCS
19837
198381993-04-20 David J. MacKenzie <djm@gnu.org>
19839
19840 * src/version.c: *** empty log message ***
19841
19842 * src/files.c, src/allocate.c:
19843 entered into RCS
19844
19845 * src/reader.c: *** empty log message ***
19846
19847 * src/lex.c: entered into RCS
19848
19849 * src/conflicts.c: New file.
19850
19851 * src/symtab.c: entered into RCS
19852
19853 * src/alloc.h: New file.
19854
19855 * src/LR0.c: entered into RCS
19856
198571993-04-18 Noah Friedman <friedman@gnu.org>
19858
19859 * src/reader.c: New file.
19860
19861 * src/version.c: *** empty log message ***
19862
198631993-04-18 Noah Friedman <friedman@gnu.org>
19864
19865 * Makefile.in: *** empty log message ***
19866
198671993-04-17 Noah Friedman <friedman@gnu.org>
19868
19869 * Makefile.in: *** empty log message ***
19870
198711993-04-15 Richard Stallman <rms@gnu.org>
19872
19873 * src/main.c, src/files.c:
19874 New file.
19875
198761993-04-15 Noah Friedman <friedman@gnu.org>
19877
19878 * configure.in: entered into RCS
19879
19880 * configure.in: *** empty log message ***
19881
19882 * configure.in: New file.
19883
198841993-04-14 Richard Stallman <rms@gnu.org>
19885
19886 * Makefile.in: New file.
19887
198881993-04-13 Richard Stallman <rms@gnu.org>
19889
19890 * src/version.c: New file.
19891
198921993-03-25 Richard Stallman <rms@gnu.org>
19893
19894 * src/output.c: entered into RCS
19895
198961992-09-25 Richard Stallman <rms@gnu.org>
19897
19898 * configure.bat: entered into RCS
19899
199001992-06-22 Richard Stallman <rms@gnu.org>
19901
19902 * src/vmsgetargs.c: entered into RCS
19903
199041992-06-22 Richard Stallman <rms@gnu.org>
19905
19906 * doc/bison.rnh: entered into RCS
19907
199081992-04-20 David J. MacKenzie <djm@gnu.org>
19909
19910 * README: entered into RCS
19911
199121992-01-22 Richard Stallman <rms@gnu.org>
19913
19914 * src/machine.h: entered into RCS
19915
199161991-12-21 Richard Stallman <rms@gnu.org>
19917
19918 * src/lalr.c, src/closure.c:
19919 entered into RCS
19920
199211991-12-20 Richard Stallman <rms@gnu.org>
19922
19923 * src/state.h: entered into RCS
19924
199251991-12-18 Richard Stallman <rms@gnu.org>
19926
19927 * src/print.c, src/nullable.c, src/derives.c:
19928 entered into RCS
19929
199301991-11-03 David J. MacKenzie <djm@gnu.org>
19931
19932 * src/warshall.c, src/types.h, src/symtab.h, src/lex.h, src/gram.c, src/gram.h, src/files.h:
19933 entered into RCS
19934
199351988-09-09 Richard Stallman <rms@gnu.org>
19936
19937 * src/bison.hairy: entered into RCS
19938
199391987-12-16 Richard Stallman <rms@gnu.org>
19940
19941 * REFERENCES: entered into RCS
dc546b0f 19942
f294a2c2 19943
04098407 19944 -----
f294a2c2 19945
04098407 19946 Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996,
95021767
JD
19947 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
19948 Free Software Foundation, Inc.
f294a2c2 19949
04098407
PE
19950 Copying and distribution of this file, with or without
19951 modification, are permitted provided the copyright notice and this
19952 notice are preserved.
e9071366
AD
19953
19954$Id$