1 2008-01-09 Paul Eggert <eggert@cs.ucla.edu>
3 * data/yacc.c (yyparse): Correct the comment when locations aren't used.
4 Problem reported by Claudio Saavedra in
5 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00003.html>.
7 2008-01-05 Wojciech Polak <polak@gnu.org>
9 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Precede an XHTML
10 document's title with the input grammar file name.
12 2007-12-22 Joel E. Denny <jdenny@ces.clemson.edu>
14 Automate regression testing of the XML/XSLT implementation. Discussed
16 <http://lists.gnu.org/archive/html/bison-patches/2007-11/msg00021.html>.
17 * configure.ac (XSLTPROC): New substitution.
18 * Makefile.am (maintainer-xml-check): New phony target invoking...
19 * tests/Makefile.am (maintainer-xml-check): ... this new phony target
20 invoking make maintainer-check with BISON_TEST_XML=1.
21 * tests/atlocal.in (XSLTPROC): New.
22 * tests/local.at (AT_BISON_CHECK): New macro to (1) instruct Valgrind
23 not to report reachable memory when Bison is expected to have a
24 non-zero exit status and (2) to compare XML/XSLT output with --graph
25 and --report=all output for every working grammar when
27 (AT_BISON_CHECK_NO_XML): Likewise, but skip XML checks.
28 (AT_BISON_CHECK_XML): New.
29 (AT_QUELL_VALGRIND): New.
30 * tests/testsuite.at (ORIGINAL_AT_CHECK): Remove this and...
31 (AT_CHECK): ... don't redefine this since this was the old way to
33 * tests/actions.at: Rewrite all AT_CHECK invocations for bison as
34 AT_BISON_CHECK invocations.
35 * tests/c++.at: Likewise.
36 * tests/calc.at: Likewise.
37 * tests/conflicts.at: Likewise.
38 * tests/cxx-type.at: Likewise.
39 * tests/existing.at: Likewise.
40 * tests/glr-regression.at: Likewise.
41 * tests/headers.at: Likewise.
42 * tests/input.at: Likewise.
43 * tests/java.at: Likewise.
44 * tests/output.at: Likewise.
45 * tests/push.at: Likewise.
46 * tests/reduce.at: Likewise.
47 * tests/regression.at: Likewise.
48 * tests/sets.at: Likewise.
49 * tests/skeletons.at: Likewise.
50 * tests/synclines.at: Likewise.
51 * tests/torture.at: Likewise.
52 (Big triangle): Use AT_BISON_CHECK_NO_XML instead since this grammar
53 tends to hang xsltproc.
54 (Big horizontal): Likewise.
56 2007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
58 In XML output, remove redundant class attribute on symbol element.
59 * data/xslt/bison.xsl (xsl:key name="bison:symbolByName"): New.
60 * data/xslt/xml2xhtml.xsl (xsl:template match="symbol"): Use it to
61 look up a symbol to determine whether it's a nonterminal or terminal.
62 * src/gram.c (rule_rhs_print_xml): Remove class attribute.
63 * src/state.c (state_rule_lookahead_tokens_print_xml): Likewise.
65 Add prec/assoc information to XML output.
66 * src/gram.c (grammar_rules_print_xml): For each rule that has a
67 %prec, add a percent_prec attribute.
68 * src/print-xml.c (print_grammar): For each terminal that has a
69 precedence or associativity, add a prec or assoc attribute.
71 (xml_puts): Use xml_indent.
72 (xml_printf): Use xml_indent.
73 * src/print-xml.h (xml_indent): Prototype.
75 * tests/existing.at (GNU pic Grammar): Fix a rule miscopied from
76 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
78 2007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
80 * data/xslt/bison.xsl (bison:ruleNumber): Rename to...
81 (bison:ruleByNumber): ... this for clarity.
82 * data/xslt/xml2dot.xsl (xsl:template match="item"): Update.
83 * data/xslt/xml2text.xsl (xsl:template match="item"): Update.
84 (xsl:template match="reduction"): Update.
85 (xsl:template match="item"): Update.
86 (xsl:template match="reduction"): Update.
88 In the XML output, don't print the list of rules where symbols appear.
89 Compute it in XSLT instead. Discussed at
90 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00024.html>.
91 * data/xslt/bison.xsl (bison:ruleByLhs): New.
92 (bison:ruleByRhs): New.
93 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Use
95 (xsl:template match="terminal/rule"): Remove.
96 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
98 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
100 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Use
101 bison:ruleByRhs and mode="number-link" for rule template.
102 (xsl:template match="terminal/rule"): Remove.
103 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
104 bison:ruleByRhs and mode="number-link" for rule template.
105 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
107 (xsl:template match="rule" mode="number-link"): ... this.
108 * src/print-xml.c (print_grammar): Don't print the list of rules.
110 2007-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
112 Don't let --report affect XML output; always print all information.
114 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00020.html>.
115 * src/conflicts.c (log_resolution): Implement.
116 * src/print-xml.c (print_core): Implement.
117 (print_state): Implement.
118 (print_xml): Implement.
120 * NEWS (2.3a+): Fix quotes.
121 * src/parse-gram.y (prologue_declaration): For consistency with -v,
122 don't let %verbose clear the list specified by --report.
124 2007-11-26 Akim Demaille <akim@epita.fr>
126 * data/Makefile.am (dist_pkgdata_DATA): Ship and install bison.xsl.
128 2007-11-24 Joel E. Denny <jdenny@ces.clemson.edu>
130 In the XML output, list useless and unused symbols and rules with the
131 useful ones and add a "usefulness" attribute. Discussed starting at
132 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00017.html>.
133 * src/gram.c (grammar_rules_partial_print_xml): Remove.
134 (grammar_rules_print_xml): Print all rules instead of just those
135 useful in the grammar, and add a "usefulness" attribute.
136 * src/gram.h (grammar_rules_partial_print_xml): Remove prototype.
137 * src/print-xml.c (print_rules_useless_in_parser): Remove.
138 (print_grammar): Print all nonterminals instead of just useful ones,
139 and add a "usefulness" attribute to nonterminals and terminals.
140 (print_xml): Don't print a separate "reductions" or
141 "rules-useless-in-parser" element.
142 * src/reduce.c (reduce_output): Use reduce_token_unused_in_grammar.
143 (reduce_xml): Remove.
144 (reduce_token_unused_in_grammar): New.
145 (reduce_nonterminal_useless_in_grammar): New.
146 * src/reduce.h (reduce_xml): Remove prototype.
147 (reduce_token_unused_in_grammar): Add prototype.
148 (reduce_nonterminal_useless_in_grammar): Add prototype.
149 * data/xslt/xml2text.xsl: Update for XML changes.
150 * data/xslt/xml2xhtml.xsl: Update for XML changes.
151 * tests/reduce.at (Useless Terminals): Update output.
152 (Useless Rules): Update output.
153 (Reduced Automaton): Update output.
155 Say "Terminals unused in grammar" instead of "Unused terminals".
156 * NEWS (2.3a+): Update.
157 * doc/bison.texinfo (Understanding): Update example output.
158 * src/reduce.c (reduce_output): Implement.
159 * data/xslt/xml2text.xsl: Implement.
160 * data/xslt/xml2xhtml.xsl: Implement.
162 2007-11-18 Joel E. Denny <jdenny@ces.clemson.edu>
164 Accept --report-file=FILE to override the default `.output' filename.
165 * NEWS (2.3a+): Mention.
166 * doc/bison.texinfo (Bison Options): Add an entry.
167 * src/files.c (compute_output_file_names): Don't override
168 spec_verbose_file if already set.
169 * src/getargs.c (usage): Document --report-file.
170 (REPORT_FILE_OPTION): New anonymous enum member.
171 (long_options): Add entry for it.
172 (getargs): Add case for it setting spec_verbose_file.
174 * build-aux/cross-options.pl: Don't record a short option just because
176 * doc/.cvsignore: Add yacc.1.
178 2007-11-14 Akim Demaille <akim@epita.fr>
180 * doc/yacc.1.in: New.
181 * configure.ac, doc/Makefile.am: Adjust.
182 * configure.ac (PACKAGE_COPYRIGHT_YEAR): New substitution, and new
184 Use AC_SUBST for assignments too.
185 * src/getargs.c (version): Use PACKAGE_COPYRIGHT_YEAR.
187 2007-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
189 * src/gram.c: Remove comments that duplicate comments in gram.h.
191 When reporting useless rules and nonterminals, say "useless in grammar"
192 instead of "useless", and say "useless in parser" instead of "never
193 reduced". Discussed starting at
194 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00033.html>.
195 * NEWS (2.3a+): Mention this change.
196 * data/xslt/xml2text.xsl: Update output text and expected input XML
197 element names to match changes below.
198 * data/xslt/xml2xhtml.xsl: Likewise.
199 (xsl:template match="bison-xml-report"): Add missing entry in Table of
200 Contents: "Rules useless in parser due to conflicts".
201 * doc/bison.texinfo (Decl Summary): Reword a little.
202 (Understanding): Update example output for changes below.
203 * src/gram.c: (rule_useful_p): Rename to...
204 (rule_useful_in_grammar_p): ... this.
205 (rule_useless_p): Rename to...
206 (rule_useless_in_grammar_p): ... this.
207 (rule_never_reduced_p): Rename to...
208 (rule_useless_in_parser_p): ... this.
209 (grammar_rules_print): Update for renames.
210 (grammar_rules_print_xml): Update for renames.
211 (grammar_rules_never_reduced_report): Rename to...
212 (grammar_rules_useless_report): ... this since it is used for either
213 kind of useless rule.
214 * src/gram.h: Reword comments and update function names in prototypes.
215 * src/main.c (main): Say "rule useless in parser due to conflicts".
216 * src/print-xml.c (print_rules_never_reduced): Rename to...
217 (print_rules_useless_in_parser): ... this, and rename output XML
218 element "rules-never-reduced" to "rules-useless-in-parser".
219 (print_xml): Update for rename.
220 * src/print.c (print_results): Say "Rules useless in parser due to
222 * src/reduce.c (reduce_grammar_tables): Say "rule useless in grammar".
223 (nonterminals_reduce): Say "nonterminal useless in grammar".
224 (reduce_output): Say "Nonterminals useless in grammar".
225 Say "Rules useless in grammar".
226 (reduce_xml): Rename output XML element "useless" to
227 "useless-in-grammar".
228 (reduce_print): Don't report the count of grammatically useless rules
229 as "rules never reduced" just because %yacc is specified.
230 In the correct report of this count, say nonterminal(s) and rule(s)
231 "useless in grammar".
232 * tests/conflicts.at (S/R in initial): Update expected output.
233 (Defaulted Conflicted Reduction): Likewise.
234 (Unreachable States After Conflict Resolution): Likewise.
235 * tests/existing.at (GNU pic Grammar): Likewise.
236 * tests/reduce.at (Useless Nonterminals): Likewise.
237 (Useless Rules): Likewise.
238 (Reduced Automaton): Likewise.
239 (Underivable Rules): Likewise.
240 (Empty Language): Likewise.
242 2007-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
244 * data/bison.m4 (b4_cat): Put a newline after the end delimiter of the
245 here document and before the EOF so that BSD's implementation of Bourne
246 shell doesn't parse the delimiter as part of the here document.
247 * doc/.cvsignore: Add cross-options.texi.
248 * src/getargs.c (usage): Add a blank line after the warning categories.
250 2007-11-08 Paolo Bonzini <bonzini@gnu.org>
252 * data/lalr1.java (Lexer): Remove usage of b4_pure_if.
254 2007-11-05 Akim Demaille <akim@epita.fr>
256 Remove Id: from bison.1.
257 * doc/Makefile.am (remove_time_stamp): Include the sed invocation.
258 (perl -0777 -pi -e 's/\.PP\nId): New.
259 (.x.1): Use it to ignore the version control revision.
261 2007-11-05 Akim Demaille <demaille@gostai.com>
263 * build-aux/Makefile.am: Ship cross-options.pl.
264 * doc/Makefile.am: Always refer to cross-options.texi with
266 (MAINTAINERCLEANFILES): Add it.
268 2007-11-04 Akim Demaille <demaille@gostai.com>
270 Generate the long/short option cross-table.
271 * build-aux/cross-options.pl: New.
272 * doc/Makefile.am (cross-options.texi): New.
273 * doc/bison.texinfo: Use it.
275 2007-11-04 Akim Demaille <demaille@gostai.com>
277 Generate bison.1 using help2man.
278 * doc/common.x, doc/bison.x: New.
279 * doc/Makefile.am (bison.1, .x.1): New.
280 The code is taken from autoconf-2.61/man/Makefile.am.
281 * configure.ac: Look for help2man.
283 2007-11-04 Akim Demaille <demaille@gostai.com>
286 * src/getargs.c (usage): Document -W, make it clear that -d,
287 -g and -x have optional arguments.
289 2007-11-04 Akim Demaille <demaille@gostai.com>
291 Find sha1sum when named gsha1sum.
292 * bootstrap (find_tool): New.
295 2007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
297 Deprecate %pure-parser and add `%define api.pure'. Discussed starting
299 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00006.html>.
300 * NEWS (2.3a+): Mention.
301 * data/bison.m4 (b4_pure_if): Don't define it here.
302 * data/c.m4 (b4_identification): Depend on individual skeletons to
303 define b4_pure_flag, b4_push_flag, or b4_pull_flag if they use the
304 values of the %define variables api.pure or api.push_pull. Define
305 YYPURE, YYPUSH, and YYPULL accordingly.
306 * data/glr.c: Define b4_pure_if based on `%define api.pure' unless
307 glr.cc has already defined b4_pure_flag.
308 * data/push.c: Define b4_pure_if based on `%define api.pure'.
309 Remove YYPUSH and YYPULL since they're back in b4_identification again.
310 * data/yacc.c Define b4_pure_if based on `%define api.pure'.
311 * doc/bison.texinfo (Pure Decl): Update.
313 (Decl Summary): Add api.pure to %define entry.
314 In %pure-parser entry, say it's deprecated and reference %define.
315 (Pure Calling): Update.
316 (Error Reporting): Update.
317 (C++ Scanner Interface): Update.
318 (How Can I Reset the Parser): Update.
319 (Table of Symbols): In %pure-parser entry, say it's deprecated and
321 * src/getargs.c (pure_parser): Remove global variable.
322 * src/getargs.h (pure_parser): Remove extern.
323 * src/output.c (prepare): Don't define pure_flag muscle.
324 * src/parse-gram.y (prologue_declaration): Implement %pure-parser as a
325 wrapper around `%define api.pure'.
326 * tests/calc.at (Simple LALR Calculator): Update.
327 (Simple GLR Calculator): Update.
328 * tests/cxx-type.at (GLR: Resolve ambiguity, pure, no locations):
330 (GLR: Resolve ambiguity, pure, locations): Update.
331 (GLR: Merge conflicting parses, pure, no locations): Update.
332 (GLR: Merge conflicting parses, pure, locations): Update.
333 * tests/glr-regression.at (Uninitialized location when reporting
335 * tests/input.at (Unused %define api.pure): New test case.
336 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Update definition for
337 AT_PURE_IF and AT_PURE_AND_LOC_IF.
338 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
340 2007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
342 %define push_pull -> %define api.push_pull. Discussed starting at
343 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00005.html>.
344 * data/push.c: Expect the new name.
345 * data/yacc.c: Likewise.
346 * doc/bison.texinfo (Push Decl): Update.
347 (Decl Summary): Update %define entry.
348 (Push Parser Function): Update.
349 (Pull Parser Function): Update.
350 (Parser Create Function): Update.
351 (Parser Delete Function): Update.
352 * tests/calc.at (Simple LALR Calculator): Update.
353 * tests/input.at (%define enum variables): Update.
354 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
355 (Push Parsing: Multiple impure instances): Update.
356 (Push Parsing: Unsupported Skeletons): Update.
357 * tests/torture.at (Exploding the Stack Size with Alloca): Update.
358 (Exploding the Stack Size with Malloc): Update.
360 * NEWS (2.3a+): Add an entry for the push parser, and clean up the
363 2007-10-27 Joel E. Denny <jdenny@ces.clemson.edu>
365 For the XML output's terminal element, rename @number to @token-number,
366 and add @symbol-number. In the nonterminal element, rename @number to
367 @symbol-number. Discussed starting at
368 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00040.html>.
369 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Update for
371 (xsl:template match="nonterminal"): Likewise.
372 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Likewise.
373 (xsl:template match="nonterminal"): Likewise.
374 * src/print-xml.c (print_grammar): Implement.
376 2007-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
378 * data/xslt/xml2dot.xsl (xsl:template match="automaton/state"): After
379 2007-10-11 change, the child elements here are items not rules.
380 (xsl:template match="item"): New.
381 (xsl:template match="rule"): Update for new reduced itemset.
382 (xsl:template match="point"): Remove.
383 (xsl:template match="empty"): For consistency with --graph, don't
384 output "/* empty */".
385 * data/xslt/xml2text.xsl (xsl:template match="terminal"): When invoking
386 line-wrap, don't pass a negative value as first-line-length since this
387 won't work with the following changes.
388 (xsl:template name="line-wrap"): Simplify slightly.
389 (xsl:template name="ws-search"): Eliminate recursion.
390 * src/print_graph.c (print_core): Don't print a reduction's lookahead
391 set next to an item whose dot is not at the end of the RHS even if it
392 happens to be associated with the same rule.
394 2007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
396 Add %define lr.keep_unreachable_states.
397 * NEWS (2.3a+): Mention it in the entry for unreachable state removal.
398 * doc/bison.texinfo (Decl Summary): Mention it in the %define entry.
399 * src/main.c (main): Implement it.
400 * tests/conflicts.at (Unreachable States After Conflict Resolution):
401 Extend to test it, and fix a typo.
403 2007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
405 * NEWS (2.3a+): Add entry for recent .output file lookahead set fix.
406 * doc/bison.texinfo (Understanding): Remove a bogus lookahead set in
407 the example .output text.
408 * tests/regression.at (Extra lookahead sets in report): Improve wording
411 2007-10-17 Wojciech Polak <polak@gnu.org>
413 * src/print-xml.c (print_grammar): Renamed
414 <terminal> and <nonterminal> attributes:
415 "type" to "number" and "symbol" to "name".
416 * data/xslt/xml2text.xsl (xsl:template match="terminal"):
417 Use new attribute names.
418 (xsl:template match="nonterminal"): Likewise.
419 * data/xslt/xml2xhtml.xsl: Likewise.
421 2007-10-17 Joel E. Denny <jdenny@ces.clemson.edu>
423 * doc/bison.texinfo (Bison Options): Add entry for --print-datadir.
424 (Option Cross Key): Likewise.
426 * src/print-xml.c (print_core): Don't print a reduction's lookahead set
427 next to an item whose dot is not at the end of the RHS even if it
428 happens to be associated with the same rule.
429 * src/print.c (print_core): Likewise.
430 * tests/conflicts.at (Unresolved SR Conflicts): Update output.
431 (Resolved SR Conflicts): Update output.
432 * tests/regression.at (Extra lookahead sets in report): New test case.
434 2007-10-11 Wojciech Polak <polak@gnu.org>
436 * src/print-xml.c (print_core): Remove item set
438 * data/xslt/bison.xsl (bison:ruleNumber): New key.
439 Improve processing time. Suggested by Joel E. Denny.
440 * data/xslt/xml2dot.xsl (xsl:template name="escape"):
441 Write xsl:param "required" attribute as comment.
442 * data/xslt/xml2text.xsl (xsl:template match="item"): New.
443 (xsl:template match="rule"): Support new reduced itemset.
444 (xsl:template match="point"): Remove.
445 * data/xslt/xml2xhtml.xsl: Likewise.
447 2007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
449 * src/getargs.c (version): Update copyright year.
451 2007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
453 Make xml2dot.xsl and --graph produce the same output.
454 * data/xslt/xml2dot.xsl (xsl:template match="rule"): Use a ` '
455 instead of a `\n'. That is, don't add escapes yet or they'll be doubly
457 (xsl:template name="output-node"): Use the new escape template instead
458 of the string-replace template directly.
459 (xsl:template name="output-edge"): Likewise.
460 (xsl:template name="escape"): New, escapes backslashes and newlines in
461 addition to quotation marks.
462 * src/graphviz.c (start_graph, output_node, output_edge): Add
463 whitespace to output for legibility.
465 Make xml2text.xsl and --report produce the same output, and remove the
466 XML "conflicts" element since a conflict summary is easily extracted
468 * data/xslt/bison.xsl: New.
469 (xsl:template match="state" mode="bison:count-conflicts): New.
470 * data/xslt/xml2text.xsl: Import bison.xsl.
471 (xsl:template match="bison-xml-report"): Instead of styling the
472 "conflicts" element, style the "automaton" element with mode
473 "conflicts". Unlike the former, the latter lists S/R and R/R
474 conflicts for a state on the same line.
475 (xsl:template match="conflicts"): Remove.
476 (xsl:template match="conflict"): Remove.
477 (xsl:template match="terminal"): Line-wrap the list of rules in which
478 the terminal is used.
479 (xsl:template match="nonterminal"): Likewise for nonterminals.
480 (xsl:template match="automaton" mode="conflicts"): New.
481 (xsl:template match="state" mode="conflicts"): New.
482 (xsl:template name="line-wrap"): New.
483 (xsl:template name="ws-search"): New.
484 * data/xslt/xml2xhtml.xsl: Import bison.xsl.
485 (xsl:template match="bison-xml-report"): Instead of styling the
486 "conflicts" element, style the "automaton" element with mode
488 (xsl:template match="conflicts"): Remove.
489 (xsl:template match="conflict"): Remove.
490 (xsl:template match="automaton" mode="conflicts"): New.
491 (xsl:template match="state" mode="conflicts): New.
492 * src/conflicts.c (conflicts_output_xml): Remove.
493 * src/conflicts.h (conflicts_output_xml): Remove prototype.
494 * src/print-xml.c (print_xml): Don't invoke conflicts_output_xml.
495 * src/print.c (print_grammar): Consistently wrap at the 66th column so
496 the corresponding XSLT is easier. Also, never wrap between a word and
497 the comma that follows it.
499 2007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
501 Improve C++ namespace support. Discussed starting at
502 <http://lists.gnu.org/archive/html/help-bison/2007-09/msg00016.html>.
503 * data/c++.m4: (b4_namespace_ref, b4_namespace_open,
504 b4_namespace_close): New macros that interpret the %define variable
505 "namespace" so its value can contain "::" to indicate nested
507 * data/glr.cc (b4_namespace): Don't define, and replace all uses with
509 * data/lalr1.cc (b4_namespace): Likewise.
510 * data/location.cc (b4_namespace): Likewise.
511 * doc/bison.texinfo (Decl Summary): Move `%define push_pull' entry
512 inside a new table in the general %define entry. Document `%define
513 namespace' there as well. Point the %name-prefix entry to it since it
514 explains it more completely in the case of C++.
515 (C++ Bison Interface): Mention `%define namespace' instead of
517 (Table of Symbols): Remove the `%define push_pull' entry. The %define
519 * tests/c++.at (Relative namespace references): New test case.
520 (Absolute namespace references): New test case.
521 (Syntactically invalid namespace references): New test case.
522 * tests/input.at (C++ namespace reference errors): New test case.
524 2007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
526 Add syncline support and location accessor to internal %define
528 * data/bison.m4 (b4_percent_define_get_loc): New.
529 (b4_percent_define_get_syncline): New.
530 (b4_percent_define_flag_if): Use b4_percent_define_get_loc.
531 (b4_percent_define_default): Record defining location as line 1 rather
532 than 0 for the sake of synchronizing #line's, and define
533 b4_percent_define_syncline(VARIABLE).
534 (b4_percent_define_check_values): Use b4_percent_define_get_loc.
535 * src/muscle_tab.c (muscle_syncline_grow): New.
536 (muscle_code_grow): Use muscle_syncline_grow.
537 (muscle_percent_define_insert): Use muscle_percent_define_get_loc, and
538 define b4_percent_define_syncline(VARIABLE).
539 (muscle_percent_define_get_loc): New.
540 (muscle_percent_define_get_syncline): New.
541 (muscle_percent_define_flag_if): Use muscle_percent_define_get_loc, and
542 remove some unused variables.
543 (muscle_percent_define_default): Record defining location as line 1
544 rather than 0 for the sake of synchronizing #line's, and define
545 b4_percent_define_syncline(VARIABLE).
546 (muscle_percent_define_check_values): Use
547 muscle_percent_define_get_loc.
548 * src/muscle_tab.h (muscle_percent_define_get_loc): Prototype.
549 (muscle_percent_define_get_syncline): Prototype.
550 * tests/skeletons.at (%define Boolean variables: invalid skeleton
551 defaults): Update output for location change.
552 (Complaining during macro argument expansion): Extend to test
553 b4_percent_define_get_loc and b4_percent_define_get_syncline errors.
555 2007-10-07 Joel E. Denny <jdenny@ces.clemson.edu>
557 Fix some error-reporting macro bugs.
558 * data/bison.m4 (b4_cat): New.
559 (b4_error, b4_error_at): Use b4_cat to send error directives directly
560 to stdout so they don't become arguments to other macros. Update
561 comments and add examples.
562 (b4_warn, b4_warn_at, b4_complain, b4_complain_at): Update comments and
564 (b4_fatal, b4_fatal_at): Likewise, and invoke m4_exit(1) immediately
565 after printing the error directive so that M4 doesn't report subsequent
566 problems that are induced by this problem.
567 * src/scan-skel.l: Recognize @` digraph outside of directive arguments
568 instead of just in them. Recognize @\n in both places. Both expand to
569 the empty string. Needed by b4_cat.
570 * tests/skeletons.at (Complaining during macro argument expansion):
572 (Fatal errors make M4 exit immediately): New test case.
574 2007-10-04 Joel E. Denny <jdenny@ces.clemson.edu>
576 Implement --print-datadir.
577 * src/getargs.c (usage): Mention.
578 (PRINT_DATADIR_OPTION): New anonymous enum member.
579 (long_options): Add entry for it.
580 (getargs): Add case for it calling compute_pkgdatadir.
581 * src/output.c (output_skeleton): Encapsulate data directory
582 computation from here...
583 (prepare): ... and from here...
584 (compute_pkgdatadir): ... into this new function.
585 * src/output.h (compute_pkgdatadir): Prototype.
587 2007-09-29 Joel E. Denny <jdenny@ces.clemson.edu>
589 * src/print-xml.c (escape_bufs): New static global variable
591 (xml_escape_n): ... the static local variable buf here.
592 (print_xml): Free memory for escape_bufs.
593 * src/reduce.c (reduce_xml): XML-escape terminal symbol tags.
595 2007-09-25 Joel E. Denny <jdenny@ces.clemson.edu>
597 Replace `%push-parser' and `%push-pull-parser' with
598 `%define push_pull "push"' and `%define push_pull "both"'.
599 `%define push_pull "pull"' is the default.
600 * doc/bison.texinfo (Push Decl, Push Parser Function,
601 Pull Parser Function, Parser Create Function, Parser Delete Function):
603 (Decl Summary, Table of Symbols): Replace %push-parser and
604 %push-pull-parser entries with a %define push_pull entry.
605 * data/bison.m4 (b4_percent_define_check_values): New macro.
606 (b4_pull_if, b4_push_if, b4_use_push_for_pull_if): Move these
608 * data/c.m4 (b4_identification): ... and the YYPUSH and YYPULL cpp
610 * data/push.c: ... to here and compute them from the value of the
611 %define variable push_pull.
612 * data/c-skel.m4: Instead of choosing the push.c skeleton for push
613 parsing requests here...
614 * data/yacc.c: ... hack this to switch to push.c any time
615 b4_use_push_pull_flag or the %define variable push_pull is set. This
616 will go away when we mv push.c yacc.c.
617 * data/c++-skel.m4, data/glr.c, data/java-skel.m4: Don't report that
618 push parsing is not supported since unused %define variables are
620 * src/getargs.c, src/getargs.h (pull_parser, push_parser): Remove.
621 * src/muscle_tab.h (muscle_percent_define_check_values): Update
622 comments for consistency with b4_percent_define_check_values.
623 * src/output.c (prepare): Don't insert b4_pull_flag and b4_push_flag
625 * src/parse-gram.y (PERCENT_PUSH_PARSER, PERCENT_PUSH_PULL_PARSER):
627 (prologue_declaration): Remove %push-parser and %push-pull-parser
629 * src/scan-gram.l (%push-parser, %push-pull-parser): Remove rules.
630 * tests/calc.at: Update declarations.
631 * tests/input.at (%define enum variables): New test case.
632 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update
634 (Push Parsing: Multiple impure instances): Update declaration.
635 (Push Parsing: Unsupported Skeletons): New test case.
636 * tests/torture.at (Exploding the Stack Size with Alloca): Update
638 (Exploding the Stack Size with Malloc): Update declaration.
640 2007-09-24 Wojciech Polak <polak@gnu.org>
642 Add XSLT transformations.
644 * data/xslt/xml2dot.xsl: Transform XML into DOT.
645 * data/xslt/xml2text.xsl: Transform XML into plain text.
646 * data/xslt/xml2xhtml.xsl: Transform XML into XHTML.
647 * data/Makefile.am (xsltdir): New variable.
648 (dist_xslt_DATA): Add xslt/*.xsl files.
650 2007-09-23 Paul Eggert <eggert@cs.ucla.edu>
652 * src/conflicts.c (log_resolution): Fix indenting bugs I introduced.
653 Problem reported by Wojciech Polak.
654 * src/print-xml.c (xml_puts): Work even if LEVEL exceeds INT_MAX/2.
655 (xml_printf): Undo change I made on 21 September; that is,
656 indent 2 spaces, not 1.
658 2007-09-23 Joel E. Denny <jdenny@ces.clemson.edu>
660 Pacify ./configure --enable-gcc-warnings.
661 * src/print-xml.c, src/print-xml.h (xml_puts): Make third argument
662 `char const *' instead of `char *'.
663 * src/state.c (state_rule_lookahead_tokens_print_xml): Remove unused
664 local variable `sep'.
666 2007-09-21 Paul Eggert <eggert@cs.ucla.edu>
668 * src/gram.c (rule_rhs_print_xml): Now static, since it isn't used
670 * src/print-xml.c: Prefer "const" after types; that's more consistent.
671 (xml_printf): Indent just 1 space for level.
672 (e_char, xlate_char): Remove.
673 (xml_escape_string): Rewrite to avoid undefined behavior (used
674 storage that was freed from the stack).
675 (xml_escape_n): Don't bother checking for subscript error.
677 2007-09-21 Wojciech Polak <polak@gnu.org>
679 Add Bison XML Automaton Report.
681 Add support for an -x option to generate an XML report.
682 It is not documented yet.
683 * src/print-xml.c: New file.
684 * src/print-xml.h: Likewise.
685 * lib/timevar.def (TV_XML): New var.
686 * src/Makefile.am (bison_SOURCES): Add print-xml.c, print-xml.h.
687 * src/conflicts.c: Include print-xml.h.
688 (solved_conflicts_xml_obstack): New var.
689 (log_resolution, conflicts_solve, conflicts_free):
690 Add support for XML report.
691 (conflicts_output_val): New function.
692 * src/conflicts.h (conflicts_output_val): New decl.
693 * src/files.c (spec_xml_file): New var.
694 (compute_output_file_names, output_file_names_free): Add XML support.
695 * src/files.h (spec_xml_file): New decl.
696 * src/getargs.c (xml_flag): New var.
697 (usage, short_options, long_options, getargs): Add XML support.
698 * src/getargs.h (xml_flag): New decl.
699 * src/gram.c: Include print-xml.h.
700 (rule_lhs_print_xml, rule_rhs_print_xml):
701 (grammar_rules_partial_print_xml, grammar_rules_print_xml):
703 * src/gram.h: Declare external ones.
704 * src/main.c: Include print-xml.h.
705 (main): Add XML support.
706 * src/reduce.c: Include print-xml.h.
707 (reduce_xml): New function.
708 * src/reduce.h: Declare it.
709 * src/state.c: Include print-xml.h.
710 (state_new): Add XML support.
711 (state_rule_lookahead_tokens_print_xml): New function.
712 * src/state.h: Declare it.
713 (struct state): New member solved_conflicts_xml.
714 * src/symtab.c (symbol_class_get_string): New function.
715 * src/symtab.h: Declare it.
717 2007-09-21 Paul Eggert <eggert@cs.ucla.edu>
719 * GNUmakefile: Switch to coreutils's version.
720 * bootstrap: Likewise.
721 * Makefile.cfg: Adjust to new GNUmakefile.
722 * README-hacking: Likewise.
726 2006-08-18 Paul Eggert <eggert@cs.ucla.edu>
727 Bruno Haible <bruno@clisp.org>
729 * m4/bison-i18n.m4 (BISON_I18N): Also handle the case where yacc exists
730 and is a script that invokes bison. Tighten the code. Add comments.
732 2007-08-28 Joel E. Denny <jdenny@ces.clemson.edu>
734 Spell "boolean" as "Boolean". Reported by Akim Demaille.
735 * data/bison.m4 (b4_percent_define_flag_if): Fix complaint.
736 * doc/bison.texinfo (Decl Summary): Fix.
737 * src/muscle_tab.c (muscle_percent_define_flag_if): Fix complaint.
738 * tests/input.at (Boolean %define variables): Update output.
739 * tests/skeletons.at (%define boolean variables: invalid skeleton
740 defaults): Rename to...
741 (%define Boolean variables: invalid skeleton defaults): ... this and
744 2007-08-17 Joel E. Denny <jdenny@ces.clemson.edu>
746 In impure push mode, don't allow more than one yypstate to be allocated
747 since multiple impure parsers would corrupt yynerrs.
748 * data/push.c (yypstate_allocated): New static global variable
750 (yypull_parse): If yypstate_new returns 0, don't report it as memory
751 exhaustion if yypstate_allocated is 1, but still return 2.
752 (yypstate_new): Invoke yyerror and return 0 if yypstate_allocated is
753 already 1. Otherwise, set it to 1.
754 (yypstate_delete): Set it to 0.
755 * tests/push.at (Push Parsing: Multiple impure instances): New test
758 2007-08-17 Bob Rossi <bob@brasko.net>
760 * doc/bison.texinfo (Push Decl): Document the push parser.
761 (Table of Symbols): Ditto.
763 (Decl Summary): Ditto.
764 (Multiple Parsers, Push Parser Function, Pull Parser Function,
765 Parser Create Function, Parser Delete Function):
766 Add new push parser symbols.
767 (Table of Symbols): Document push-parser, push-pull-parser,
768 yypush_parse, yypull_parse, yypstate_new and yypstate_delete.
770 2007-08-15 Paul Eggert <eggert@cs.ucla.edu>
773 * doc/gpl-3.0.texi: New file.
774 * doc/gpl.texi: Remove.
775 * COPYING, GNUmakefile, HACKING, Makefile.am, Makefile.cfg:
776 * Makefile.maint, NEWS, PACKAGING, README, README-alpha:
777 * README-hacking, TODO, bootstrap, bootstrap.conf:
778 * configure.ac, data/Makefile.am, data/README, data/bison.m4:
779 * data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4:
780 * data/glr.c, data/glr.cc, data/java-skel.m4, data/java.m4:
781 * data/lalr1.cc, data/lalr1.java, data/location.cc:
782 * data/push.c, data/yacc.c, data/m4sugar/m4sugar.m4:
783 * djgpp/Makefile.maint, djgpp/README.in, djgpp/config.bat:
784 * djgpp/config.sed, djgpp/config.site, djgpp/config_h.sed:
785 * djgpp/djunpack.bat, djgpp/subpipe.c, djgpp/subpipe.h:
786 * djgpp/testsuite.sed, doc/Makefile.am, doc/bison.texinfo:
787 * doc/fdl.texi, doc/refcard.tex, etc/Makefile.am, etc/README:
788 * etc/bench.pl.in, examples/Makefile.am, examples/extexi:
789 * examples/calc++/Makefile.am, lib/Makefile.am, lib/abitset.c:
790 * lib/abitset.h, lib/bbitset.h, lib/bitset.c, lib/bitset.h:
791 * lib/bitset_stats.c, lib/bitset_stats.h, lib/bitsetv-print.c:
792 * lib/bitsetv-print.h, lib/bitsetv.c, lib/bitsetv.h:
793 * lib/ebitset.c, lib/ebitset.h, lib/get-errno.c:
794 * lib/get-errno.h, lib/lbitset.c, lib/lbitset.h:
795 * lib/libiberty.h, lib/main.c, lib/subpipe.c, lib/subpipe.h:
796 * lib/timevar.c, lib/timevar.def, lib/timevar.h:
797 * lib/vbitset.c, lib/vbitset.h, lib/yyerror.c:
798 * m4/c-working.m4, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4:
799 * m4/timevar.m4, src/LR0.c, src/LR0.h, src/Makefile.am:
800 * src/assoc.c, src/assoc.h, src/closure.c, src/closure.h:
801 * src/complain.c, src/complain.h, src/conflicts.c:
802 * src/conflicts.h, src/derives.c, src/derives.h, src/files.c:
803 * src/files.h, src/flex-scanner.h, src/getargs.c:
804 * src/getargs.h, src/gram.c, src/gram.h, src/graphviz.c:
805 * src/lalr.c, src/lalr.h, src/location.c, src/location.h:
806 * src/main.c, src/muscle_tab.c, src/muscle_tab.h:
807 * src/nullable.c, src/nullable.h, src/output.c, src/output.h:
808 * src/parse-gram.c, src/parse-gram.h, src/parse-gram.y:
809 * src/print.c, src/print.h, src/print_graph.c:
810 * src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c:
811 * src/reduce.h, src/relation.c, src/relation.h:
812 * src/revision.h, src/scan-code.h, src/scan-code.l:
813 * src/scan-gram.h, src/scan-gram.l, src/scan-skel.h:
814 * src/scan-skel.l, src/state.c, src/state.h, src/symlist.c:
815 * src/symlist.h, src/symtab.c, src/symtab.h, src/system.h:
816 * src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h:
817 * tests/Makefile.am, tests/actions.at, tests/c++.at:
818 * tests/calc.at, tests/conflicts.at, tests/cxx-type.at:
819 * tests/existing.at, tests/glr-regression.at:
820 * tests/headers.at, tests/input.at, tests/java.at:
821 * tests/local.at, tests/output.at, tests/push.at:
822 * tests/reduce.at, tests/regression.at, tests/sets.at:
823 * tests/skeletons.at, tests/synclines.at, tests/testsuite.at:
827 2007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
829 Get rid of broken %no-parser, -n, and --no-parser implementation and
831 * TODO: Don't mention them.
832 * doc/bison.1: Likewise.
833 * doc/bison.texinfo (Decl Summary): Likewise.
834 (Bison Options): Likewise.
835 (Option Cross Key): Likewise.
836 * src/getargs.c (no_parser_flag): Remove global variable.
837 (usage): Don't print description of -n and --no-parser.
838 (long_options): Remove --no-parser entry here.
839 (getargs): Remove -n case in the switch here.
840 * src/getargs.h (no_parser_flag): Remove extern.
841 * tests/regression.at (Web2c Actions): Remove comment that mentions
844 2007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
846 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Do not
847 name user variables starting with `yy'. Just pass NULL instead of a
848 dummy local &yylval to yypush_parse.
849 * tests/torture.at (AT_DATA_STACK_TORTURE): Do not name user variables
852 2007-08-03 Joel E. Denny <jdenny@ces.clemson.edu>
854 * data/yacc.c (yyexhaustedlab): Define it when YYERROR_VERBOSE is
855 true since it's then always used regardless of whether yyoverflow is
856 defined. Reported by Christian Burger at
857 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00031.html>.
858 * THANKS: Add Christian Burger.
860 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
861 node names: say "Decl Summary" not "Bison Declaration Summary".
863 2007-07-28 Joel E. Denny <jdenny@ces.clemson.edu>
865 * src/muscle_tab.c (muscle_percent_define_flag_if): In order to
866 determine whether this function has already complained about an invalid
867 value for a %define boolean variable, don't check whether Bison has
868 ever examined the value. As written, the check was a tautology.
869 Instead, record and check for this complaint using a separate muscle.
871 2007-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
873 Fix push parsing memory leak reported by Brandon Lucia at
874 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00032.html>.
875 * THANKS: Add Brandon Lucia.
876 * data/push.c (yypstate_delete): Free the stack if it was reallocated
877 but the parse never completed and thus freed it.
878 * tests/Makefile.am (TESTSUITE_AT): Add push.at.
879 * tests/testsuite.at: Include push.at.
881 (Push Parsing: Memory Leak for Early Deletion): New test case.
883 2007-07-17 Joel E. Denny <jdenny@ces.clemson.edu>
885 Improve handling of multiple S/R conflicts in the same state and of S/R
886 conflicts involving multiple reductions.
887 * src/conflicts.c (resolve_sr_conflict): Don't assign the error action
888 set for a state here or Bison will abort if it is reassigned on a
889 later conflicted reduction in the same state.
890 Similarly, don't finalize and assign the solved conflicts report here
891 or it will be lost if it is reassigned on a later conflicted reduction
893 (set_conflicts): Instead, assign them both here after all S/R conflicts
894 in the state have been fully examined.
895 * src/print.c (shift_set): Rename to...
896 (no_reduce_set): ... this.
897 (print_reductions): Update for rename, and add %nonassoc error action
898 tokens to no_reduce_set so that, when printing the first remaining
899 reduction on an error action token, the reduction is enclosed in
901 (print_results): Update for rename.
902 * tests/conflicts.at (Solved conflicts report for multiple reductions
903 in a state): New test case.
904 (%nonassoc error actions for multiple reductions in a state): New test
907 * src/main.c (main): Don't depend on C99 features.
909 2007-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
911 * build-aux/.cvsignore: Add compile.
912 * lib/.cvsignore: Add charset.alias, ref-add.sed, ref-del.sed, and
915 2007-07-10 Joel E. Denny <jdenny@ces.clemson.edu>
917 * bootstrap (slurp): Create target directories that don't exist.
918 Specifically, we need lib/uniwidth/ because of recent Gnulib changes.
920 2007-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
922 * LR0.c (new_itemsets): Fix wording in comments: say item index rather
924 * closure.c (closure): Likewise.
925 * state.h (reductions): Comment sorting of rules.
926 (state): Comment sorting of items.
928 2007-07-02 Joel E. Denny <jdenny@ces.clemson.edu>
930 Fix C++ test cases after recent Gnulib changes. Discussed starting at
931 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00000.html>.
932 * examples/calc++/Makefile.am (DEFAULT_INCLUDES): Override Automake's
933 definition in order to avoid Gnulib headers since we don't use config.h
935 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Use AT_DATA_GRAMMAR
936 rather than AT_DATA so that config.h is included.
938 2007-07-01 Joel E. Denny <jdenny@ces.clemson.edu>
940 * data/glr.c (yy_yypstack, yypstates, yypdumpstack): Use YYFPRINTF
941 instead of fprintf. Guard these functions with #if YYDEBUG instead of
942 #ifdef YYDEBUG for consistency with all other uses of YYDEBUG in Bison
943 and so that YYFPRINTF is guaranteed to be defined here.
945 2007-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
947 * src/muscle_tab.c (muscle_percent_define_invalid_value): Replace
949 (muscle_percent_define_check_values): ... this more helpful function.
950 Again, it's not used yet, but it will be.
951 * src/muscle_tab.h: Likewise.
953 Improve some comments in parser table construction.
954 * src/LR0.c (new_itemsets): Explain sorting of itemset and kernel_base.
955 (generate_states): Don't mention ruleset, which is internal to closure.
956 * src/closure.c (closure): Explain sorting of core and itemset, which
957 is required for this function to behave correctly.
958 * src/closure.h (closure): Mention sorting.
960 2007-05-28 Joel E. Denny <jdenny@ces.clemson.edu>
962 * src/lalr.c (state_lookahead_tokens_count): For code readability,
963 move the check for disabled transitions to an aver since conflict
964 resolution hasn't happened yet.
966 * src/lalr.c (state_lookahead_tokens_count): Remove the check that
967 labels a state as inconsistent just because it has error transitions.
968 The original form of this check appeared in revision 1.1 of lalr.c,
969 which was committed on 1991-12-21. Now (at least), changing the
970 consistency label on such a state appears to have no useful effect in
971 any of the places it is examined, which I enumerate below. The key
972 point to understanding each item in this enumeration is that a state
973 with an error transition is labelled consistent in the first place only
974 if it has no rules, so the check cannot matter for states that have
975 rules. (1) Labelling a state as inconsistent will cause set_conflicts
976 to try to identify its conflicts, and a state must have *rules* to have
977 conflicts. (2) Labelling a state as inconsistent will affect how
978 action_row sets the default *rule* for the state. (3) Labelling a
979 state as inconsistent will cause build_relations to add lookback edges
980 to *rules* in that state.
981 * src/state.h (struct state): Word the comment for member consistent
984 2007-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
986 Don't depend on C99 features.
987 * src/conflicts.c (conflicts_update_state_numbers): Fix for-loop.
988 * src/lalr.c (lalr_update_state_numbers): Fix for-loop.
989 * src/reader.c (check_and_convert_grammar): Fix for-loop.
990 * src/state.c (state_mark_reachable_states): Fix for-loop.
991 (state_remove_unreachable_states): Fix for-loop.
993 Don't widen struct state with member reachable just to temporarily
994 record reachability. Instead, use a local bitset.
995 * src/state.h (struct state): Remove member.
996 * src/state.c (state_new): Don't initialize it.
997 (state_mark_reachable_states): Rename to...
998 (state_record_reachable_states): ... this, and use bitset.
999 (state_remove_unreachable_states): Use bitset.
1001 2007-05-26 Joel E. Denny <jdenny@ces.clemson.edu>
1003 * src/Makefile.am (yacc): Quote target action commands properly so
1004 that the yacc script isn't corrupt. Reported by Hans Aberg at
1005 <http://lists.gnu.org/archive/html/bug-bison/2007-05/msg00003.html>.
1007 * data/glr.c (yylval): As in yacc.c, don't extern in the header for
1008 the case of pure parsers. Reported by Frans Englich at
1009 <http://lists.gnu.org/archive/html/help-bison/2007-05/msg00018.html>.
1010 * THANKS: Add Frans Englich.
1012 * NEWS (2.3a+): In the %code entry, reference section `Bison
1013 Declaration Summary' from the manual now since the %code summary has
1015 * doc/bison.texinfo (Prologue Alternatives): Mention that directives
1016 in the rules section must be terminated by semicolons.
1018 2007-05-20 Joel E. Denny <jdenny@ces.clemson.edu>
1020 Extend the front-end API for %define variables to more completely
1021 mirror the back-end. This will be useful in the future.
1022 * data/bison.m4 (b4_percent_define_get, b4_percent_define_ifdef):
1023 Update comments to mention the new front-end counterparts of these
1025 * src/muscle_tab.c (MUSCLE_COMMON_DECODE): New macro with common code
1026 for muscle_string_decode and muscle_location_decode.
1027 (muscle_string_decode): New static function.
1028 (muscle_location_decode): Use MUSCLE_COMMON_DECODE.
1029 (muscle_percent_define_get, muscle_percent_define_ifdef): New
1031 (muscle_percent_define_flag_if): Use muscle_percent_define_ifdef and
1032 muscle_percent_define_get to mimic the b4_percent_define_flag_if
1033 implementation more closely.
1034 (muscle_percent_define_invalid_value): New function.
1035 * src/muscle_tab.h (muscle_percent_define_get,
1036 muscle_percent_define_ifdef, muscle_percent_define_invalid_value):
1039 2007-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
1041 * NEWS (2.3a+): Mention yesterday's state-removal change.
1042 (2.3a): Remove the %language entry, which was added after 2.3a.
1043 * src/LR0.c, src/closure.c, src/closure.h, src/conflicts.c,
1044 src/conflicts.h, src/lalr.c, src/lalr.h, src/print.c,
1045 src/print_graph.c, src/state.c, src/state.h, tests/conflicts.at,
1046 tests/existing.at: Update copyright date.
1048 2007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
1050 If conflict resolution makes states unreachable, remove those states,
1051 report rules that are then unused, and don't report conflicts in those
1053 * src/conflicts.c, src/conflicts.h (conflicts_update_state_numbers):
1054 New global function.
1055 * src/lalr.c, src/lalr.h (lalr_update_state_numbers): New global
1057 * src/main.c (main): After conflict resolution, remove the unreachable
1058 states and update all data structures that reference states by number.
1059 * src/state.c (state_new): Initialize each state's reachable member to
1061 (state_mark_reachable_states): New static function.
1062 (state_remove_unreachable_states): New global function.
1063 * src/state.h (struct state): Add member bool reachable.
1064 (state_remove_unreachable_states): Prototype.
1065 * tests/conflicts.at (Unreachable States After Conflict Resolution):
1067 * tests/existing.at (GNU pic Grammar): Update test case output now that
1068 an unused rule is discovered.
1070 2007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
1072 Minor code cleanup in parser table construction.
1073 * src/LR0.c (new_itemsets): Use item_number_is_symbol_number.
1074 (new_itemsets, save_reductions): Update for rename to nitemset.
1075 * src/closure.c (nritemset): Rename to...
1076 (nitemset): ... this since the "r" appears to meaningless and isn't
1077 used in the comments.
1078 (closure): Update for rename.
1079 * src/closure.h (nritemset): Update extern to...
1080 (nitemset): ... this.
1081 * src/lalr.c (LA): Fix a typo in comments.
1082 * src/print.c (print_core): Update for rename to nitemset.
1083 * src/print_graph.c (print_graph): Likewise.
1084 * src/state.h: Fix some typos in header comments.
1086 2007-04-04 Paul Eggert <eggert@cs.ucla.edu>
1088 * THANKS: Use ASCII for Sebastien Fricker's name. Bison source
1089 still sticks to ASCII. Sorry!
1091 * README-hacking: New file, taken mostly from coreutils, with changes
1092 for Bison. Contains much of the contents of:
1093 * README-cvs: Remove.
1094 * bootstrap: Sync from gnulib.
1095 * build-aux/.cvsignore: Remove *.t, mkinstalldirs.
1096 * lib/.cvsignore: Add wchar.h, wctype.h. Remove exit.h.
1098 2007-03-10 Joel E. Denny <jdenny@ces.clemson.edu>
1100 * doc/bison.texinfo (Destructor Decl): Fix typo reported by Sebastian
1102 (Java Differences): Fix some typos.
1103 * THANKS: Add Sebastian Setzer.
1105 2007-03-07 Paolo Bonzini <bonzini@gnu.org>
1107 * data/java.m4 (b4_single_class_if): Remove.
1108 (b4_abstract_if): Look at "%define abstract".
1110 (b4_union_name): Rename...
1111 (b4_yystype): ... to this. Map to "%define stype".
1112 (b4_rhs_value, b4_parse_param_decl, b4_lex_param_decl,
1113 b4_maybe_throws): Fix quoting.
1114 (b4_lex_param_call): Move below to keep b4_*_param_decl close.
1115 * data/lalr1.java (Lexer interface): Always define.
1116 (Lexer interface within parser class): Remove.
1117 (YYLexer class): New, used when "%code lexer" is present.
1118 (constructor): When "%code lexer" is used, pass %lex-param
1119 to the lexer constructor.
1120 (yylex, yyparse): Remove %lex-param from method invocations
1121 (YYStack, yyaction, yyparse): Rename b4_union_name to b4_yystype.
1123 * doc/bison.texinfo (Java Bison Interface): Mention "%define
1124 abstract". Rename "%define union_name" to "%define stype".
1125 Rename method names according to previous patch.
1126 (Java Scanner Interface): Describe "%code lexer" instead of
1127 "%pure-parser" and "%define single_class".
1128 (Java Differences): Mention "%code lexer".
1130 * tests/java.at (_AT_DATA_JAVA_CALC_Y): Remove final argument.
1131 Include scanner here, using macros from tests/local.at.
1132 (AT_DATA_CALC_Y): Remove final argument.
1133 (_AT_CHECK_JAVA_CALC): Likewise.
1134 (AT_CHECK_JAVA_CALC): Likewise. Test all four combinations
1135 of %locations and %error-verbose.
1136 (main): Test with and without %lex-param.
1137 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_LEXPARAM_IF.
1138 (AT_BISON_OPTION_POPDEFS): Pop it.
1140 2007-03-07 Juan Manuel Guerrero <juan.guerrero@gmx.de>
1142 DJGPP spefic issue. Inhibit the use of disallowed characters for
1143 file name genertion on Win98, WinXP, etc. These are |<>":?*\
1144 and concern testsuite case 46.
1145 * Makefile.am: djgpp/testsuite.sed added to EXTRA_DIST
1146 * djgpp/testsuite.sed: Inhibit the use of disallowed characters.
1147 * djgpp/config.bat: Inhibit the use of disallowed characters.
1149 2007-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
1151 Miscellaneous %define and %code cleanup.
1152 * data/bison.m4 (b4_percent_define_flag_if): Correct comments on how
1153 values are interpreted.
1154 * doc/bison.texinfo (Decl Summary): Clean up and extend %define
1155 documentation a little more.
1156 * src/muscle_tab.c (MUSCLE_USER_NAME_CONVERT,
1157 muscle_percent_define_insert, muscle_percent_code_grow): New
1159 * src/muscle_tab.h (muscle_percent_define_insert,
1160 muscle_percent_code_grow): Prototype.
1161 * src/parse-gram.y (prologue_declaration): Use
1162 muscle_percent_define_insert and muscle_percent_code_grow when parsing
1163 %define and %code directives.
1165 Make it easy to share %define boolean variables between the front-end
1166 and back-end. Though not used yet, this will be useful in the future.
1167 * data/bison.m4 (b4_check_user_names): Rewrite comments to talk about
1168 Bison uses of names rather than just skeleton uses of names.
1169 (b4_percent_define_get, b4_percent_define_ifdef): Rename
1170 b4_percent_define_skeleton_variables(VARIABLE) to
1171 b4_percent_define_bison_variables(VARIABLE).
1172 (b4_percent_code_get, b4_percent_code_ifdef): Rename
1173 b4_percent_code_skeleton_qualifiers(QUALIFIER) to
1174 b4_percent_code_bison_qualifiers(QUALIFIER).
1175 (b4_check_user_names_wrap): Update for renames.
1176 * src/muscle_tab.c, src/muscle_tab.h (muscle_percent_define_flag_if,
1177 muscle_percent_define_default): New functions mimicking
1178 b4_percent_define_flag_if and b4_percent_define_default.
1180 For %define variables, report locations for invalid values and
1182 * data/bison.m4 (b4_percent_define_flag_if): Read
1183 b4_percent_define_loc(VARIABLE) to report the location of an invalid
1185 (b4_percent_define_default): Save a special location in
1186 b4_percent_define_loc(VARIABLE) in case the default value for VARIABLE
1187 must later be reported as invalid.
1188 * src/muscle_tab.c (muscle_location_grow, muscle_location_decode): New
1190 (muscle_percent_define_insert): Record the location of VARIABLE in
1191 muscle percent_define_loc(VARIABLE), and use it to report the previous
1192 location for a redefinition.
1193 (muscle_percent_define_flag_if): Update like b4_percent_define_flag_if.
1194 (muscle_percent_define_default): Update like b4_percent_define_default.
1195 (muscle_grow_user_name_list): Rename to...
1196 (muscle_user_name_list_grow): ... this for consistency and use
1197 muscle_location_grow.
1198 * src/muscle_tab.h (muscle_location_grow): Prototype.
1199 * tests/input.at (%define errors): Update expected output.
1200 * tests/skeletons.at (%define boolean variables: invalid skeleton
1201 defaults): New test case.
1203 2007-02-28 Joel E. Denny <jdenny@ces.clemson.edu>
1205 * src/print.c (lookahead_set, state_default_rule): Remove.
1206 (print_reductions): Replace state_default_rule invocation with
1207 equivalent use of yydefact, which was computed in token_actions in
1209 (print_results): Don't allocate lookahead_set.
1211 2007-02-27 Paolo Bonzini <bonzini@gnu.org>
1213 * data/lalr1.java: Prefix all private members with yy.
1215 2007-02-24 Joel E. Denny <jdenny@ces.clemson.edu>
1217 Use YYFPRINTF instead of fprintf where appropriate. Reported by
1218 Sebastien Fricker at
1219 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00035.html>.
1220 * THANKS: Add Sebastien Fricker.
1221 * data/glr.c, data/push.c, data/yacc.c (yy_reduce_print): Implement.
1222 * doc/bison.texinfo (Tracing): Make it clearer that YYFPRINTF must
1223 accept a variable number of arguments.
1225 2007-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
1227 * bootstrap: Remove occurrences of .#bootmp from lib/Makefile.
1229 2007-02-13 Juan Manuel Guerrero <juan.guerrero@gmx.de>
1231 * djgpp/config.bat: Adjustments concerning the use of autoconf 2.61.
1232 * djgpp/config.sed: Adjustments concerning the use of autoconf 2.61.
1233 * djgpp/config.site: Adjustments concerning the use of autoconf 2.61.
1235 2007-02-11 Paul Eggert <eggert@cs.ucla.edu>
1237 Undo my 2007-02-07 change, switching back to the c-strcase module
1238 introduced in the 2007-02-03 change. Bruno Haible reported that
1239 the 2007-02-07 change would be dangerous in Turkish if we add a
1240 language whose name contains "i", since "i" is not lowercase "I"
1242 * bootstrap.conf (gnulib_modules): Add c-strcase. Remove strcase.
1243 * lib/.cvsignore: Add c-ctype.c, c-ctype.h, c-strcase.h,
1244 c-strcasecomp.c, c-strncasecmp.c. Remove strcasecmp.c, strncasecmp.c.
1245 * m4/.cvsignore: Remove strcase.m4.
1246 * src/getargs.c: Revert 2007-02-07 change, as follows.
1247 Include c-strcase.h.
1248 (language_argmatch): Use c_strcasecmp rather than strcasecmp.
1250 2007-02-11 Bruno Haible <bruno@clisp.org>
1252 Enable the Java related testsuite tests when the only Java compiler
1253 found is a gcj < 4.3. Discussed at
1254 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00016.html>.
1255 * configure.ac (gt_JAVACOMP): Don't specify a target_version.
1257 2007-02-11 Joel E. Denny <jdenny@ces.clemson.edu>
1259 * data/Makefile.am: Update copyright date.
1260 * data/push.c (yypull_parse): Report memory exhaustion and return 2 if
1261 yypstate_new returns NULL.
1262 (yypstate_new): Return NULL if malloc does.
1263 * src/reader.c (packgram): Move translation of rule actions from the
1264 beginning of packgram to...
1265 (check_and_convert_grammar): ... here right before packgram is invoked
1266 so it's easier to write more complete comments, and remove redundant
1269 2007-02-10 Joel E. Denny <jdenny@ces.clemson.edu>
1271 As in semantic actions, make @$ in %initial-action, %destructor, and
1272 %printer imply %locations.
1273 * src/scan-code.l (SC_SYMBOL_ACTION): Set locations_flag = true when
1275 * tests/actions.at (AT_CHECK_ACTION_LOCATIONS): New macro supporting...
1276 (@$ in %initial-action implies %locations,
1277 @$ in %destructor implies %locations,
1278 @$ in %printer implies %locations): ... these new test cases.
1280 2007-02-07 Paul Eggert <eggert@cs.ucla.edu>
1282 Undo most of the 2007-02-03 change, switching to the strcase module
1283 now that gnulib strcase has been fixed.
1284 * bootstrap.conf (gnulib_modules): Remove c-strcase. Add strcase.
1285 * lib/.cvsignore: Remove c-ctype.c, c-ctype.h, c-strcase.h,
1286 c-strcasecomp.c, c-strncasecmp.c. Add strcasecmp.c, strncasecmp.c
1287 * m4/.cvsignore: Add strcase.m4.
1288 * src/getargs.c: Revert 2007-02-03 change, as follows.
1289 Don't include c-strcase.h.
1290 (language_argmatch): Use strcasecmp rather than c_strcasecmp.
1291 strcasecmp has "unspecified behavior" outside the POSIX locale,
1292 but it works fine in practice if at least one argument is ASCII,
1293 as is the case in Bison.
1295 2007-02-07 Paolo Bonzini <bonzini@gnu.org>
1297 * tests/java.at: Skip tests if only one of javac/java is present.
1298 Reported by Joel E. Denny.
1299 * tests/atlocal.in: Adjust copyright years.
1301 2007-02-05 Paolo Bonzini <bonzini@gnu.org>
1303 * data/lalr1.java (Stack): Work around old verifiers that disallow
1304 access to the private fields of an inner class, from the outer class.
1305 We can make Stack's fields public because user code doesn't have access
1306 to the instance of Stack used by parse(). Reported by Paul Eggert.
1308 2007-02-03 Paul Eggert <eggert@cs.ucla.edu>
1310 * .cvsignore: Add javacomp.sh, javaexec.sh. Is this really
1311 the right spot for these files?
1312 * bootstrap.conf (gnulib_modules): Add c-strcase.
1313 * lib/.cvsignore: Add c-ctype.c c-ctype.h, c-strcasecomp.c,
1315 * src/getargs.c: Include c-strcase.h.
1316 (language_argmatch): Use c_strcasecmp rather than strcasecmp,
1317 to avoid unspecified behavior.
1319 2007-02-01 Joel E. Denny <jdenny@ces.clemson.edu>
1321 * doc/bison.texinfo (Decl Summary): Correct typo.
1323 2007-01-30 Paolo Bonzini <bonzini@gnu.org>
1325 * data/bison.m4 (b4_percent_define_flag_if): Don't treat 0 as false.
1326 Complain if the value does not match empty, "true" or "false".
1327 * data/c++.m4: Adjust default definitions of %define variables.
1328 * data/java.m4: Adjust default definitions of %define variables.
1329 * doc/bison.texinfo (Decl Summary): Adjust the %define entry according
1331 * tests/input.at (Boolean %define variables): Test new behavior.
1333 2007-01-29 Paolo Bonzini <bonzini@gnu.org>
1335 * NEWS: Mention java.
1336 * TODO: Remove things that are done.
1337 * bootstrap.conf: Add javacomp-script and javaexec-script.
1338 * configure.ac: Invoke gt_JAVACOMP and gt_JAVAEXEC.
1340 * data/Makefile.am: Add new files.
1341 * data/java-skel.m4: New.
1342 * data/java.m4: New.
1343 * data/lalr1.java: New.
1345 * doc/bison.texinfo: Put "A Complete C++ Example" under
1346 C++ Parsers. Add Java Parsers. Put C++ Parsers and Java Parsers
1347 under Other Languages.
1349 * src/getargs.c (valid_languages): Add Java.
1350 * src/getargs.h (struct bison_language): Update size of string fields.
1352 * tests/Makefile.am: Add java.at.
1353 * tests/atlocal.in: Add CONF_JAVA and CONF_JAVAC.
1354 * tests/java.at: New.
1355 * tests/testsuite.at: Include it.
1357 2007-01-28 Joel E. Denny <jdenny@ces.clemson.edu>
1360 * src/scan-skel.l (at_directive_perform): Add at_directive_argc and
1361 at_directive_argv arguments so these no longer have to be global
1362 variables. Also, update the implementation for the following changes.
1363 (fail_for_at_directive_too_many_args,
1364 fail_for_at_directive_too_few_args): Add at_directive_name argument.
1365 (at_directive_name): Remove as at_directive_argv[0] will be used for
1367 (AT_DIRECTIVE_ARGC_MAX): Increment to make space in at_directive_argv
1368 for the directive name.
1369 (at_directive_argc, at_directive_argv): Make these local within
1370 skel_lex instead of global.
1371 (INITIAL): Update directive start action for above changes.
1372 (SC_AT_DIRECTIVE_ARG): Rename to...
1373 (SC_AT_DIRECTIVE_ARGS): ... this, and update for above changes.
1374 (SC_AT_DIRECTIVE_SKIP_WS): Update.
1375 (scan_skel): Move yylex_destroy to...
1376 (skel_scanner_free): ... here.
1377 * tests/skeletons.at (installed skeleton file name): Rename to...
1378 (installed skeleton file names): ... this.
1380 2007-01-27 Joel E. Denny <jdenny@ces.clemson.edu>
1382 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
1383 node names: say "Table of Symbols" not "Bison Symbols", and say "Decl
1384 Summary" not "Directives".
1385 * doc/bison.texinfo (Decl Summary, Calc++ Parser): Cross-reference the
1386 %code entry in "Decl Summary" rather than the one in "Table of Symbols"
1387 since the former is now the more complete one.
1388 (Prologue Alternatives): Likewise and do the same for %defines.
1389 (Table of Symbols): Add summary of %code, add summary of %define, and
1390 move full %code documentation to...
1391 (Decl Summary): ... here for consistency with other entries in these
1393 Move %define entry in order to keep this list alphabetized.
1394 Reword %define entry a little to put less emphasis on the skeleton
1395 concept, which most users shouldn't have to think about.
1397 2007-01-26 Paul Eggert <eggert@cs.ucla.edu>
1399 Adjust to recent gnulib changes.
1400 * lib/.cvsignore: Remove stpcpy.h, strndup.h, strnlen.h.
1401 Add string.h, string_.h, unistd_.h, wchar_.h.
1402 * m4/.cvsignore: Add gnulib-common.m4, string_h.m4, wchar.m4.
1403 * src/system.h: Don't include <stpcpy.h>; this is now done by
1406 2007-01-23 Paolo Bonzini <bonzini@gnu.org>
1408 Simplify implementation of unqualified %code, implement macros for
1409 uniform treatment of boolean %define flags. Document %define.
1410 * data/bison.m4 (b4_percent_define_ifdef, b4_percent_define_flag_if,
1411 b4_percent_code_ifdef): New.
1412 (b4_percent_code_get): Map unqualified %code to b4_percent_code().
1413 * data/c++.m4: Define default value for global_tokens_and_yystype.
1414 * data/glr.cc: Likewise.
1415 * data/location.cc: Use b4_percent_define_flag_if.
1417 * doc/bison.texinfo (Decl Summary): Document %define.
1419 * src/parse-gram.y (Unqualified %code): Change muscle name to
1421 (content.opt): Default to empty.
1423 2007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
1425 Implement support for relative and absolute skeleton file names.
1426 Discussed starting at
1427 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00071.html>.
1428 * doc/bison.texinfo (Decl Summary): Document in %skeleton entry.
1429 (Bison Options): Document in --skeleton entry.
1430 * src/output.c (output_skeleton): Use strncpy rather than strcpy since
1431 full_skeleton can't necessarily hold all of pkgdatadir.
1432 If the specified skeleton file name contains a `/', don't prepend
1434 * src/parse-gram.y (prologue_declaration): If the specified skeleton
1435 file name contains a `/', prepend the grammar file directory.
1436 * tests/Makefile.am (TESTSUITE_AT): Add skeletons.at.
1437 * skeletons.at: New file.
1438 (relative skeleton file names): New test case.
1439 (installed skeleton file names): New test case.
1440 * tests/testsuite.at: Include skeletons.at.
1442 * bootstrap: Update copyright to 2007.
1444 2007-01-17 Paolo Bonzini <bonzini@gnu.org>
1446 * bootstrap: Remove occurrences of .#bootmp from the files.
1448 2007-01-17 Akim Demaille <akim@epita.fr>
1450 * doc/bison.texinfo (Calc++ Parser): Don't try to alias
1452 Use per-type %printer.
1454 2007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
1456 * NEWS, data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4,
1457 data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
1458 djgpp/config.site, src/files.c, src/files.h, src/main.c,
1459 src/muscle_tab.c, src/muscle_tab.h, src/parse-gram.y, src/reader.h,
1460 src/scan-skel.h, src/scan-skel.l, tests/actions.at, tests/calc.at,
1461 tests/glr-regression.at, tests/input.at, tests/local.at,
1462 tests/output.at, tests/torture.at: Update copyright to 2007.
1464 2007-01-16 Akim Demaille <akim@epita.fr>
1466 * doc/bison.texinfo (Calc++ Parsing Driver): Let "parse" return an
1468 (Calc++ Scanner): Exit with failure if we can't open the input
1470 Accept "-" standing for stdin.
1471 (Calc++ Top Level): Print the result only if the parsing was
1474 2007-01-16 Akim Demaille <akim@epita.fr>
1476 * data/lalr1.cc (yy_reduce_print_): Add a missing end-of-line.
1478 2007-01-15 Paolo Bonzini <bonzini@gnu.org>
1479 and Joel E. Denny <jdenny@ces.clemson.edu>
1481 Clean up %define and %code implementation in M4 some. Most
1482 importantly, rename all related macros to be in the b4_percent_define
1483 and b4_percent_code namespaces. Also, complete support for `.' in
1484 %define variable names and %code qualifiers.
1485 * data/bison.m4 (b4_check_user_names): Check for special
1486 "SKELETON-NAMESPACE(name)" macros instead of using two nested
1488 (b4_get_percent_define, b4_get_percent_code): Rename to...
1489 (b4_percent_define_get, b4_percent_code_get): ... these.
1490 Extend documentation with examples.
1491 For SKELETON-NAMESPACE (as documented for b4_check_user_names), use
1492 b4_percent_define_skeleton_variables and
1493 b4_percent_code_skeleton_qualifiers.
1494 Expect any value for the %define variable `foo' to be stored in the
1495 macro named `b4_percent_define(foo)'; expect any %code blocks for the
1496 qualifier `foo' to be stored in a macro named `b4_percent_code(foo)';
1497 expect any unqualified %code blocks to be stored in a macro named
1498 `b4_percent_code_unqualified'.
1499 Use m4_indir so that %define variable names and %code qualifiers can
1500 contain `.', which is allowed by the grammar parser.
1501 (b4_percent_define_default): New macro to set a default value for a
1503 (m4_wrap): Update wrapped code, and fix some underquoting.
1504 (b4_check_user_names_wrap): Update and define outside the m4_wrap.
1505 Expect grammar uses of %define variables and %code qualifiers to be
1506 defined in b4_percent_define_user_variables and
1507 b4_percent_code_user_qualifiers.
1508 * data/c++.m4: Use b4_percent_define_default rather than
1509 m4_define_default. Fix some underquoting. Skeleton usage of %define
1510 variable define_location_comparison now implies skeleton usage of
1511 %define variable filename_type.
1512 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
1513 data/push.c, data/yacc.c: Update macro names.
1514 * src/parse-gram.y (prologue_declaration, grammar_declaration): Update
1517 2007-01-14 Juan Manuel Guerrero <juan.guerrero@gmx.de>
1519 DJGPP specific issues.
1521 * djgpp/config.site: Set ac_cv_path_mkdir to a sane DJGPP specific
1522 default. Set gl_cv_absolute_wctype_h to a sane DJGPP specific default.
1524 2007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
1526 * tests/glr-regression.at: Use AT_PARSER_CHECK rather than AT_CHECK to
1527 run parsers in all tests so that Valgrind is invoked during
1528 maintainer-check-valgrind.
1529 (Duplicate representation of merged trees): Free all semantic values.
1530 (Duplicated user destructor for lookahead): Likewise.
1532 2007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
1534 * tests/local.at (AT_PARSER_CHECK): Add a PRE argument to specify a
1535 command-line prefix.
1536 * tests/torture.at (Exploding the Stack Size with Alloca): Stderr is
1537 ignored, so use that PRE to set --log-fd=1 in VALGRIND_OPTS so we don't
1538 miss Valgrind messages.
1539 (Exploding the Stack Size with Malloc): Likewise.
1541 2007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
1543 Ignore YYSTACK_USE_ALLOCA for push parsers since the stacks can't be
1544 locals. Reported by Juan Manuel Guerrero at
1545 <http://lists.gnu.org/archive/html/bug-bison/2007-01/msg00000.html>.
1546 * data/push.c: Enclose the #ifdef YYSTACK_USE_ALLOCA in b4_push_if.
1547 Fix some indentation also.
1548 * tests/torture.at (Exploding the Stack Size with Alloca): Add comment
1549 explaining this issue.
1551 2007-01-09 Paolo Bonzini <bonzini@gnu.org>
1552 and Joel E. Denny <jdenny@ces.clemson.edu>
1554 Simplify union and prologue handling, and escape union and lex/parse
1555 params with digraphs.
1556 * data/bison.m4 (b4_pre_prologue, b4_post_prologue): Set their default
1557 values to the empty string since these are no longer guaranteed
1558 initialized by the front-end.
1559 * data/glr.c, data/glr.cc, data/lalr1.cc, data/push.c, data/yacc.c: Add
1560 braces around b4_user_stype since this is no longer done by the
1562 * src/files.c, src/files.h (pre_prologue_obstack,
1563 post_prologue_obstack): Remove.
1564 * src/muscle_tab.c (muscle_pair_list_grow): Don't duplicate header
1565 comments here. Use MUSCLE_OBSTACK_SGROW so that values are escaped
1566 with digraphs. This fixes lex params and parse params.
1567 * src/muscle_tab.h (muscle_pair_list_grow): Update comments.
1568 * src/output.c (prepare): Remove muscle insertion of the prologues.
1569 (output): Remove freeing of pre_prologue_obstack and
1570 post_prologue_obstack.
1571 * src/parse-gram.y (prologue_declaration): Use muscle_code_grow rather
1572 than prologue_augment for prologue parsing so you don't need prologue
1574 (grammar_declaration): For %union RHS, use `braceless' instead of
1575 "{...}" so that braces are already stripped and code is escaped with
1577 * src/reader.c (prologue_augment): Remove.
1578 (reader): Remove initialization of pre_prologue_obstack and
1579 post_prologue_obstack.
1580 * src/reader.h (prologue_augment): Remove.
1582 * data/c.m4: Remove stray parenthesis.
1584 2007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
1586 Remove quotes from variables names in %define directives and from
1587 qualifiers in %code directives, and restrict the characters that are
1588 allowed in them to M4-friendly ones. For %define, continue to support
1589 the quoted form as a deprecated feature. Discussed starting at
1590 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00023.html>.
1591 * NEWS (2.3a+): Add entry for the change to %define. Update entry for
1593 * doc/bison.texinfo (Prologue Alternatives): Update.
1594 (Decl Summary): In %defines entry, update mention of `%code requires'
1595 and `%code provides'.
1596 (C++ Location Values): Update %define uses.
1597 (Calc++ Parser Interface): Likewise.
1598 (Calc++ Parser): Likewise, and update `%code requires' uses.
1599 (Table of Symbols): Update %code documentation.
1600 * src/parse-gram.y (prologue_declaration): For %define variables, use
1601 `variable' instead of `STRING'.
1602 (grammar_declaration): For %code qualifiers, use `ID' instead of
1604 (variable): New nonterminal that takes an `ID' or a `STRING'.
1605 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update %code
1607 * tests/calc.at (_AT_DATA_CALC_Y): Update %define use.
1608 * tests/input.at (Reject unused %code qualifiers): Update %code uses.
1609 (%define errors): Update %define uses.
1611 2007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
1613 * src/parse-gram.y (prologue_declaration): Use MUSCLE_INSERT_STRING
1614 instead of muscle_insert for %define values so that M4-special
1615 characters are replaced with digraphs.
1616 * tests/input.at (%define errors): Extend to check weird values.
1618 2007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
1620 Instead of having skeletons declare all valid %define variables and
1621 %code qualifiers, provide macros that retrieve the associated values
1622 and build these lists automatically. Thus Bison will now warn when a
1623 variable or qualifier is not used by the skeleton in the current
1624 invocation regardless of whether it might sometimes be used by that
1625 skeleton in other invocations. Also, move all %define value macros to
1626 the b4_percent_define_ namespace, and remove the %define "NAME" {CODE}
1627 form, which is replaced by %code.
1628 * data/bison.m4 (b4_check_for_unrecognized_names): Rename to...
1629 (b4_check_user_names): ... this, and change the series of valid name
1630 arguments to a single list argument for names used in the skeleton
1631 similar to the existing list argument for names used in the grammar.
1632 Warn instead of complaining.
1633 (b4_get_percent_define, b4_get_percent_code): New to retrieve %define
1634 values and %code code, to format %code code properly, and to build
1635 lists of all %define variables and %code qualifiers used in the
1636 skeleton: b4_skeleton_percent_define_variables and
1637 b4_skeleton_percent_code_qualifiers.
1638 (b4_check_percent_define_variables, b4_check_percent_code_qualifiers):
1640 (m4_wrap): ... m4_wrap b4_check_user_names invocations instead so that
1641 the skeleton names lists can finish building first. In place of
1642 b4_used_percent_define_variables and b4_used_percent_code_qualifiers,
1643 expect the lists b4_user_percent_define_variables and
1644 b4_user_percent_code_qualifiers.
1645 * data/c++.m4: Where setting default values for b4_parser_class_name,
1646 b4_location_type, b4_filename_type, b4_namespace, and
1647 b4_define_location_comparison, update their names to the
1648 b4_percent_define_ namespace.
1649 * data/glr.c: Don't use b4_check_percent_define_variables and
1650 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
1651 * data/glr.cc, data/lalr1.cc: Likewise, and use b4_get_percent_define.
1652 (b4_parser_class_name, b4_namespace): Define these using
1653 b4_get_percent_define for parser_class_name and namespace.
1654 * data/location.cc: Use b4_get_percent_define.
1655 * data/push.c: Don't use b4_check_percent_define_variables and
1656 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
1657 * data/yacc.c: Likewise, and don't call m4_exit in
1658 b4_use_push_for_pull_if or m4_wrap code will never execute.
1659 * src/muscle_tab.c, src/muscle_tab.h (muscle_grow_used_name_list):
1661 (muscle_grow_user_name_list): ... this for consistency with the
1662 terminology used in bison.m4.
1663 * src/parse-gram.y (prologue_declaration): Prepend "percent_define_" to
1664 %define variable names, and rename muscle used_percent_define_variables
1665 to user_percent_define_variables.
1666 (grammar_declaration): Rename muscle used_percent_code_qualifiers to
1667 user_percent_code_qualifiers.
1669 (content.opt): Replace content RHS with STRING RHS so %define "NAME"
1670 {CODE} form is no longer accepted.
1671 * tests/input.at (Reject bad %code qualifiers): Rename to...
1672 (Reject unused %code qualifiers): ... this, and update test output.
1673 (%define error): Update test output.
1675 2007-01-07 Joel E. Denny <jdenny@ces.clemson.edu>
1677 Check for unrecognized %define variables similar to checking for
1678 unrecognized %code qualifiers. Check for redefined %define variables.
1679 * data/bison.m4 (b4_check_for_unrecognized_names): New macro that
1681 (b4_check_percent_code_qualifiers): ... this, which now wraps it.
1682 (b4_check_percent_define_variables): New, also wraps it.
1683 * data/glr.c: Unless glr.cc is wrapping glr.c, declare no valid %define
1684 variables using b4_check_percent_define_variables.
1685 * data/glr.cc, data/lalr1.cc: Declare the valid %define variables as
1686 all those exercised in the test suite and all those listed in the
1687 `Default values' section of c++.m4. Are there others?
1688 * data/push.c, data/yacc.c: Declare no valid %define variables.
1689 * src/muscle_tab.c, src/muscle_tab.h (muscle_find_const): New function,
1690 similar to muscle_find, but it works even when the muscle stores a
1692 (muscle_grow_used_name_list): New function for constructing the used
1693 name list muscles that b4_check_for_unrecognized_names requires.
1694 * src/parse-gram.y (prologue_declaration): Warn if a variable is
1695 %define'd more than once. Define the b4_used_percent_define_variables
1696 muscle with muscle_grow_used_name_list.
1697 (grammar_declaration): Abbreviate %code code with
1698 muscle_grow_used_name_list.
1699 * tests/input.at (%define errors): New.
1701 2007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
1703 Provide warn_at, complain_at, and fatal_at function callbacks to the
1704 skeletons, and use this for %code qualifier complaints.
1705 * data/bison.m4 (b4_error_at): New, invoked by...
1706 (b4_warn_at, b4_complain_at, b4_fatal_at): ... these new macros to wrap
1707 the skeleton scanner's new @warn_at(...@), @complain_at(...@), and
1708 @fatal_at(...@) directives.
1709 (b4_check_percent_code_qualifiers): Rewrite to expect locations for
1710 qualifiers in b4_used_percent_code_qualifiers and to use
1712 * src/location.c, src/location.h (boundary_set_from_string): New global
1714 * src/muscle_tab.c, src/muscle_tab.h (muscle_boundary_grow): New global
1716 * src/parse-gram.y (grammar_declaration): Add locations for qualifiers
1717 to b4_used_percent_code_qualifiers.
1718 * src/scan-skel.l (fail_for_at_directive_too_few_args): New static
1720 (AT_DIRECTIVE_ARGC_MAX): Increase for boundary arguments.
1721 (lineno): Rename to...
1722 (out_lineno): ... this so I don't misunderstand it again.
1723 (SC_AT_DIRECTIVE_SKIP_WS): Don't increment out_lineno for newlines
1724 here; these newlines are in the input but not the output file.
1725 (SC_AT_DIRECTIVE_ARG): Likewise. Extract directive execution to...
1726 (at_directive_perform): ... this new static function, and add handling
1727 of new @warn_at(...@), @complain_at(...@), and @fatal_at(...@)
1729 * tests/input.at (Reject bad %code qualifiers): Update test output with
1730 locations and extend.
1732 * tests/output.at (Output file name: [, Output file name: ]): Remove
1733 bogus comment about these tests failing.
1735 2007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
1737 Clean up b4_check_percent_code_qualifiers a little.
1738 * data/bison.m4 (b4_check_percent_code_qualifiers): Expect qualifiers
1739 in b4_used_percent_code_qualifiers to be double-M4-quoted. Rewrite
1740 documentation and add examples.
1741 * src/parse-gram.y (grammar_declaration): Double-M4-quote those
1744 2007-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
1746 Don't use m4_divert since it makes m4_divert_push and m4_divert_pop
1747 unreliable -- especially when they're hidden inside another macro.
1748 * data/bison.m4, data/c++-skel.m4, data/c++.m4, data/c-skel.m4,
1749 data/c.m4: Remove m4_divert(-1).
1750 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
1751 data/push.c, data/yacc.c: Likewise, and replace m4_divert(0) with
1752 m4_divert_push(0) and m4_divert_pop(0).
1753 * src/output.c (output_skeleton): Don't add an m4_divert_push(0) and
1754 an m4_wrap([m4_divert_pop(0)]) to the M4. Diversion -1, which is
1755 pushed and popped by m4sugar, should be first on the stack.
1757 Provide warn, complain, and fatal function callbacks to the skeletons.
1758 This provides more flexibility than m4_fatal, improves the error
1759 message format, and captures messages for translation. Discussed
1761 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00063.html>.
1762 * data/bison.m4 (b4_error): New, invoked by...
1763 (b4_warn, b4_complain, b4_fatal): ... these new macros to wrap the
1764 skeleton scanner's new @warn(...@), @complain(...@), and @fatal(...@)
1765 directives. Because these M4 macros might be called when the current
1766 diversion is -1 or 0, m4_divert_push and m4_divert_pop is used; thus
1767 the previous removal of uses of m4_divert, which caused trouble.
1768 (b4_check_percent_code_qualifiers): Use b4_complain instead of
1769 m4_fatal to report unrecognized %code qualifiers.
1770 * data/c++-skel.m4: Use b4_complain instead of m4_fatal to report C++
1771 push parser requests.
1772 * data/glr.c: Use b4_complain instead of m4_fatal to report
1773 non-deterministic push parser requests.
1774 Update @output usage to @output(...@) form.
1775 * data/glr.cc, data/lalr1.cc: Use b4_fatal instead of m4_fatal to
1776 report missing %defines. Update @output usage to @output(...@) form.
1777 * data/location.cc, data/push.c, data/yacc.c: Update @output usage to
1779 * src/main.c (main): Invoke skel_scanner_free.
1780 * src/scan-skel.h (skel_scanner_free): Prototype new function.
1781 * src/scan-skel.l (FLEX_NO_OBSTACK): Don't define; we now need the
1782 obstack_for_string from flex-scanner.h.
1783 (YY_DECL): Use to declare skel_lex static.
1784 (decode_at_digraphs): Remove; now handled in the new
1785 SC_AT_DIRECTIVE_ARG start condition.
1786 (fail_for_at_directive_too_many_args, fail_for_invalid_at): New static
1788 (at_directive_name, AT_DIRECTIVE_ARGC_MAX, at_directive_argc,
1789 at_directive_argv): New static globals.
1790 (INITIAL): Use fail_for_invalid_at.
1791 Don't parse `@output file_name\n' or `@basename(...@)'. Instead,
1792 recognize the start of a generalized `@directive(...@)' form and
1794 (SC_AT_DIRECTIVE_ARG): ... this new start condition to parse the
1795 directive args (using the new obstack_for_string), to decode the
1796 contained @ diagraphs, and to perform the directive. It recognizes
1797 @basename(...@), @warn(...@), @complain(...@), @fatal(...@), and
1799 (SC_AT_DIRECTIVE_SKIP_WS): New start condition started by
1800 SC_AT_DIRECTIVE_ARG to skip whitespace after the argument delimiter,
1802 (scan_skel): Initialize obstack_for_string on the first call.
1803 (skel_scanner_free): New function to free obstack_for_string.
1804 * tests/input.at (Reject bad %code qualifiers): Update test output.
1806 2007-01-04 Joel E. Denny <jdenny@ces.clemson.edu>
1808 Consolidate the 4 prologue alternative directives (%code, %requires,
1809 %provides, and %code-top) into a single %code directive with an
1810 optional qualifier field. Discussed at
1811 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00012.html>.
1812 * NEWS (2.3a+): Rewrite the existing entry for the prologue
1814 * doc/bison.texinfo (Prologue Alternatives): Update.
1815 (Decl Summary): Update to %code "requires" and %code "provides".
1816 (Calc++ Parser): Update to %code "requires".
1817 (Table of Symbols): Remove entries for %requires, %provides, and
1818 %code-top. Rewrite %code entry, and add a %code "QUALIFIER" entry.
1819 * data/bison.m4 (b4_user_provides, b4_user_requires): Remove as these
1820 are replaced by b4_percent_code_provides and b4_percent_code_requires,
1821 which are skeleton-specific.
1822 (b4_check_percent_code_qualifiers): New. A skeleton can use this to
1823 declare what %code qualifiers it supports and to complain if any other
1824 qualifiers were used in the grammar.
1825 * data/glr.cc: Update to use b4_user_code([b4_percent_code_requires])
1826 and b4_user_code([b4_percent_code_provides]) in place of
1827 b4_user_requires and b4_user_provides.
1828 * data/glr.c, data/lalr1.cc, data/push.c, data/yacc.c: Likewise.
1829 Add b4_user_code([b4_percent_code_top]) and
1830 b4_user_code([b4_percent_code]).
1831 Invoke b4_check_percent_code_qualifiers.
1832 * src/parse-gram.y (PERCENT_CODE_TOP, PERCENT_PROVIDES,
1833 PERCENT_REQUIRES): Remove.
1834 (grammar_declaration): Remove RHS's for %code-top, %provides, and
1835 %requires. Rewrite the %code RHS as the unqualified form defining the
1836 muscle b4_percent_code. Add another RHS for the qualified %code form,
1837 which defines muscles of the form b4_percent_code_QUALIFIER and the
1838 b4_used_percent_code_qualifiers muscle.
1839 * src/scan-gram.l (PERCENT_CODE_TOP, PERCENT_PROVIDES,
1840 PERCENT_REQUIRES): Remove.
1841 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update to use
1842 %code "requires" and %code "provides".
1843 * tests/input.at (Reject bad %code qualifiers): New.
1845 2007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
1847 Use the new code_props interface for destructors and printers.
1848 * src/symtab.h (symbol, semantic_type): Remove destructor_location and
1849 printer_location members, and change the type of the destructor and
1850 printer members to code_props.
1851 (symbol_destructor_set, symbol_destructor_get, symbol_printer_set,
1852 symbol_printer_get, semantic_type_destructor_set,
1853 semantic_type_printer_set, default_tagged_destructor_set,
1854 default_tagless_destructor_set, default_tagged_printer_set,
1855 default_tagless_printer_set): Use code_props in arguments and return
1856 types in place of char const * and location.
1857 (symbol_destructor_location_get, symbol_printer_location_get): Remove
1858 since the locations are now contained in the return of
1859 symbol_destructor_get and symbol_printer_get.
1860 * src/output.c (symbol_destructors_output, symbol_printers_output):
1862 (symbol_code_props_output): ... this to eliminate duplicate code.
1863 (output_skeleton): Update to use symbol_code_props_output.
1864 * src/reader.c (symbol_should_be_used): Update use of
1865 symbol_destructor_get.
1866 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
1867 Update uses of the various _destructor_set and _printer_set functions.
1868 * src/symtab.c: (default_tagged_destructor_location,
1869 default_tagless_destructor_location, default_tagged_printer_location,
1870 default_tagless_printer_location): Remove since we...
1871 (default_tagged_destructor, default_tagless_destructor,
1872 default_tagged_printer, default_tagless_printer): ... change the type
1873 of these to code_props.
1874 (symbol_new, semantic_type_new, symbol_destructor_set,
1875 semantic_type_destructor_set, symbol_destructor_get,
1876 symbol_printer_set, semantic_type_printer_set, symbol_printer_get,
1877 symbol_check_alias_consistency, default_tagged_destructor_set,
1878 default_tagless_destructor_set, default_tagged_printer_set,
1879 default_tagless_printer_set): Update.
1880 (symbol_destructor_location_get, symbol_printer_location_get): Remove.
1881 (SYMBOL_CODE_PRINT): New similar to SYMBOL_ATTR_PRINT but for
1883 (symbol_print): Use SYMBOL_CODE_PRINT.
1885 2007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
1887 Use the new code_props interface for rule actions.
1888 * src/symlist.h (symbol_list): Replace action, action_location, and
1889 used members with a code_props action_props member.
1890 * src/reader.c (symbol_should_be_used, grammar_rule_check,
1891 grammar_midrule_action, grammar_current_rule_merge_set,
1892 grammar_current_rule_symbol_append, packgram): Update.
1893 * src/scan-code.h (translate_rule_action): Remove, no longer used.
1894 * src/scan-code.l (handle_action_dollar): Update.
1895 (translate_rule_action): Remove, no longer used.
1896 * src/symlist.c (symbol_list_sym_new, symbol_list_syms_print): Update.
1898 2007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
1900 Use the new code_props interface in parse-gram.y.
1901 * src/parse-gram.y (prologue_declaration, braceless, epilogue.opt):
1902 Update all uses of translate_* functions to use the new code_props
1903 interface and to use gram_scanner_last_string_free and
1904 code_scanner_last_string_free where possible.
1905 (grammar_declaration): symbol_list_destructor_set and
1906 symbol_list_printer_set now perform the translation, so don't do it
1907 here. Use gram_scanner_last_string_free where possible.
1908 * src/scan-code.h, src/scan-code.l (translate_symbol_action,
1909 translate_code): Remove, no longer used.
1910 * src/symlist.h, src/symlist.c (symbol_list_destructor_set,
1911 symbol_list_printer_set): Perform code translation here rather than
1912 depending on the caller to do so.
1914 * src/symlist.h (struct symbol_list): Correct some documentation typos.
1915 * src/scan-gram.h (gram_last_string): Remove declaration.
1916 * src/scan-gram.l (last_string): Declare it static.
1918 2007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
1920 Encapsulate code properties and related functionality for the various
1921 destructors, printers, and actions into a code_props structure and
1922 interface. This patch merely implements code_props in scan-code.h and
1923 scan-code.l. Future patches will rewrite other modules to use it.
1924 Discussed starting at
1925 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00020.html>.
1926 * src/location.h (EMPTY_LOCATION_INIT): Define so that it's easier to
1927 consistently initialize const structs that have an empty location
1929 * src/location.c (empty_location): Initialize with EMPTY_LOCATION_INIT
1930 to ensure consistency.
1931 * src/scan-code.h (code_props): New structure.
1932 (code_props_none_init, CODE_PROPS_NONE_INIT, code_props_none): New
1933 function, macro, and const global variable for initializing a
1934 code_props with no code.
1935 (code_props_plain_init, code_props_symbol_action_init,
1936 code_props_rule_action_init, code_props_translate_code): The rest of
1937 the new code_props functional interface. Among other things, the init
1938 functions set the code_props kind field so that
1939 code_props_translate_code will know whether to behave like
1940 translate_symbol_action, translate_rule_action, or translate_code.
1941 These old translate functions must remain until all other modules are
1942 updated to use the new code_props interface.
1943 (code_scanner_last_string_free): New function similar to
1944 gram_scanner_last_string_free.
1945 (code_scanner_free): Add documentation.
1946 * src/scan-code.l: Implement the new interface.
1947 (code_lex): Make it static, add a code_props* argument, and remove the
1949 (last_string): New static global similar to the one in scan-gram.l.
1950 (SC_RULE_ACTION): Update to use the code_props* argument to code_lex
1952 (SC_SYMBOL_ACTION): For $$, set the is_value_used member of the
1953 code_props since Bison may one day use this information for destructors
1955 (<*><<EOF>>): Use STRING_FINISH so that last_string is set.
1956 (handle_action_dollar): Use symbol_list_n_get and set used flag
1957 directly since symbol_list_n_used_set is removed.
1958 (translate_action): Add a code_props* argument and remove the rule,
1959 action, and location arguments. Pass the code_props* on to code_lex.
1960 (translate_rule_action, translate_symbol_action, translate_code):
1961 Rewrite as wrappers around the new code_props interface.
1962 * src/symlist.h, src/symlist.c (symbol_list_n_used_set): Remove since
1963 it would eventually need to break the encapsulation of code_props.
1965 2007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
1967 * etc/.cvsignore: New.
1969 2007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
1971 Add maintainer-push-check to run maintainer-check using push parsing in
1972 place of pull parsing where available.
1973 * Makefile.am (maintainer-push-check): New.
1974 * data/bison.m4 (b4_use_push_for_pull_if): New.
1975 * data/push.c: Redefine b4_push_if and b4_use_push_for_pull_if
1976 appropriately based on their existing values.
1977 (yypush_parse): Don't print push-parser-specific diagnostics if push
1978 parsing is being used in place of pull parsing.
1979 * data/yacc.c: If push parsing should replace pull parsing, redirect to
1981 * src/output.c (prepare): Check BISON_USE_PUSH_FOR_PULL environment
1982 variable, and insert b4_use_push_for_pull_flag into muscles.
1983 * tests/Makefile.am (maintainer-push-check): New.
1985 2006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
1987 * data/push.c (yypush_parse): Set yynew = 1 at the end of a parse
1988 (whether successful or failed) so that yypush_parse can be invoked
1989 again to start a new parse using the same yypstate.
1990 * tests/torture.at (AT_DATA_STACK_TORTURE): For push mode, extend to
1991 check multiple yypull_parse invocations on the same yypstate. For pull
1992 mode, extend to check multiple yyparse invocations.
1993 (Exploding the Stack Size with Alloca): Extend to try with
1995 (Exploding the Stack Size with Malloc): Likewise.
1997 * tests/calc.at (Simple LALR Calculator): Don't specify
1998 %skeleton "push.c" since %push-pull-parser implies that now.
1999 * tests/headers.at (export YYLTYPE): Don't check for the push
2000 declarations. Otherwise, this test case can't be used to see if push
2001 mode can truly emulate pull mode.
2002 * tests/input.at (Torturing the Scanner): Likewise.
2003 * tests/local.at (AT_YACC_OR_PUSH_IF, AT_PUSH_IF): Remove.
2004 (AT_YYERROR_SEES_LOC_IF): Rather than AT_YACC_OR_PUSH_IF, use
2005 AT_YACC_IF, which now includes the case of push mode since %skeleton
2006 need not be used for push mode. This will be more intuitive once
2007 push.c is renamed to yacc.c.
2009 2006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
2011 For push mode, convert yyparse from a macro to a function, invoke yylex
2012 instead of passing a yylexp argument to yypull_parse, and don't
2013 generate yypull_parse or yyparse unless %push-pull-parser is declared.
2014 Discussed starting at
2015 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00163.html>.
2016 * data/bison.m4 (b4_pull_if): New.
2017 * data/c.m4 (b4_identification): Define YYPULL similar to YYPUSH.
2018 * data/push.c: Improve M4 quoting a little.
2019 (b4_generate_macro_args, b4_parenthesize): Remove.
2020 (yyparse): If there's a b4_prefix, #define this to b4_prefix[parse]
2021 any time a pull parser is requested.
2022 Don't #define this as a wrapper around yypull_parse. Instead, when
2023 both push and pull are requested, make it a function that does that
2025 (yypull_parse): If there's a b4_prefix, #define this to
2026 b4_prefix[pull_parse] when both push and pull are requested.
2027 Don't define this as a function unless both push and pull are
2029 Remove the yylexp argument and hard-code yylex invocation instead.
2030 * etc/bench.pl.in (bench_grammar): Use %push-pull-parser instead of
2032 * src/getargs.c (pull_parser): New global initialized to true.
2033 * getargs.h (pull_parser): extern it.
2034 * src/output.c (prepare): Insert pull_flag muscle.
2035 * src/parse-gram.y (PERCENT_PUSH_PULL_PARSER): New token.
2036 (prologue_declaration): Set both push_parser and pull_parser = true for
2037 %push-pull-parser. Set push_parser = true and pull_parser = false for
2039 * src/scan-gram.l: Don't accept %push_parser as an alternative to
2040 %push-parser since there's no backward-compatibility concern here.
2041 Scan %push-pull-parser.
2042 * tests/calc.at (Simple LALR(1) Calculator): Use %push-pull-parser
2043 instead of %push-parser.
2044 * tests/headers.at (export YYLTYPE): Make yylex static, and don't
2045 prototype it in the module that calls yyparse.
2046 * tests/input.at (Torturing the Scanner): Likewise.
2047 * tests/local.at (AT_PUSH_IF): Check for %push-pull-parser as well.
2049 2006-12-26 Joel E. Denny <jdenny@ces.clemson.edu>
2051 Update etc/bench.pl. Optimize push mode a little (the yyn change
2052 deserves most of the credit).
2053 * Makefile.am (SUBDIRS): Add etc subdirectory.
2054 * configure.ac (AC_CONFIG_FILES): Add etc/bench.pl and etc/Makefile.
2055 * data/push.c (b4_declare_parser_state_variables): Move yyn, yyresult,
2056 yytoken, yyval, and yyloc declarations to...
2057 (yyparse or yypush_parse): ... here to improve performance. For
2058 yypush_parse invocations after the first, be sure to assign yyn its old
2060 (yypstate_new): Don't bother initializing the yyresult field since the
2061 initial value isn't used.
2062 (yyn, yyresult, yytoken, yyval, yyloc): For each NAME in this list,
2063 remove the #define that, in push mode, set it to yyps->NAME.
2064 * etc/Makefile.am: New.
2065 * etc/bench.pl: Remove and build it instead from...
2066 * etc/bench.pl.in: ... this new file. Use @abs_top_builddir@ to invoke
2067 "tests/bison" from the build directory by default rather than just
2068 invoking "bison" from $PATH.
2069 (calc_grammar): Update push parser code: don't declare yylval globally,
2070 don't define yyparse_wrapper, and don't #define yyparse.
2071 (bench_grammar): Update to check all working combinations of yacc.c,
2072 push.c, impure, pure, pull, and push.
2074 2006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
2076 For push mode, add pull wrappers around yypush_parse.
2077 * data/push.c: (b4_generate_macro_args, b4_parenthesize): New macros.
2078 (yypull_parse): New function wrapping yypush_parse.
2079 (yyparse): New #define wrapping yypull_parse.
2080 * tests/calc.at (_AT_DATA_CALC_Y): Call yyparse even when %push-parser
2082 * tests/headers.at (export YYLTYPE): Make yylex global. For push mode,
2083 prototype yylex in the module that calls yyparse, and don't prototype
2084 yyparse there. Otherwise, the yyparse expansion won't compile.
2085 * tests/input.at (Torturing the Scanner): Likewise.
2087 2006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
2089 Enable push parsers to operate in impure mode. Thus, %push-parser no
2090 longer implies %pure-parser. The point of this change is to move
2091 towards being able to test the push parser code by running the entire
2092 test suite as if %push-parser had been declared.
2093 * data/push.c (yypush_parse): For impure mode, remove the
2094 yypushed_char, yypushed_val, and yypushed_loc arguments.
2095 Instead, declare these as local variables initialized to the global
2096 yychar, yylval, and yylloc.
2097 For the first yypush_parse invocation only, restore the initial values
2098 of these global variables when it's time to read a token since they
2099 have been overwritten.
2100 * src/parse-gram.y (prologue_declaration): Don't set pure_parser for
2102 * tests/calc.at (Simple LALR(1) Calculator): Always declare
2103 %pure-parser along with %push-parser since this test case was designed
2104 for pure push parsers.
2105 * tests/local.at (AT_PURE_OR_PUSH_IF): Remove unused.
2106 (AT_YACC_OR_PUSH_IF): New.
2107 (AT_YYERROR_SEES_LOC_IF): Fix enough that the test suite passes, but
2108 add a note that it's still wrong for some cases (as it has been for a
2110 (AT_PURE_LEX_IF): Use AT_PURE_IF instead of AT_PURE_OR_PUSH_IF since
2111 %push-parser no longer implies %pure-parser.
2113 2006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
2115 Remove some unnecessary differences between the pull parser code and
2116 the push parser code. This patch enables yynerrs in push mode.
2117 * data/push.c: Reformat M4 a little.
2118 (b4_yyerror_range): Remove and convert all uses to just yyerror_range.
2119 (b4_declare_scanner_communication_variables): Don't omit yynerrs just
2120 because push mode is on. Instead, if pure mode is on, move yynerrs
2122 (b4_declare_parser_state_variables): ... here.
2123 (yynerrs, yyerror_range): For push mode, #define each NAME in this list
2124 to yyps->NAME so it can be used in yypush_parse.
2125 (yypush_parse): Don't omit uses of yynerrs in push mode.
2127 2006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
2129 Fix bug such that the first pushed token's value and location are
2130 sometimes overwritten (sometimes by %initial-action) before being used.
2131 * data/push.c (yypush_parse): Rename arguments yynchar, yynlval, and
2132 yynlloc to yypushed_char, yypushed_val, and yypushed_loc for clarity.
2133 For the first yypush_parse invocation, initialize yychar to YYEMPTY to
2134 more closely mimic the pull parser logic.
2135 Don't copy the pushed token to yychar, yylval, and yylloc until it's
2136 time to read a token, which is after any initialization of yylval and
2138 (gottoken): Rename label to...
2139 (yyread_pushed_token): ... for clarity and to avoid infringing on the
2142 2006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
2144 Rearrange initialization of the parser state variables so that the
2145 skeleton doesn't have to have a copy for pull mode and another for push
2146 mode. This patch also fixes at least a bug such that yylloc was not
2147 initialized (with b4_location_initial_line and
2148 b4_location_initial_column) upon calling yypush_parse. However, that
2149 initialization now overwrites the first token's location;
2150 %initial-action assigning @$ already did the same thing, and both bugs
2151 will be fixed in a later patch.
2152 * data/push.c (b4_yyssa): Remove and convert all uses to just yyssa.
2153 (b4_declare_parser_state_variables): Remove initialization of yytoken,
2154 yyss, yyvs, yyls, and yystacksize.
2155 (yypstate_new): Remove initialization of some yypstate fields: yystate,
2156 yyerrstatus, yytoken, yyss, yyvs, yyls, yystacksize, yyssp, yyvsp, and
2158 (yyssa, yyvsa, yylsa): For push mode, #define each NAME in this list to
2159 yyps->NAME so it can be used in yypush_parse.
2160 (yyparse or yypush_parse): For yypush_parse, don't print the
2161 "Starting parse" diagnostic for invocations after the first.
2162 Add initialization of yytoken, yyss, yyvs, yyls, and yystacksize; for
2163 yypush_parse, only do it for the first invocation.
2164 Allow yystate, yyerrstatus, yyssp, yyvsp, yylsp, and yylloc
2165 initialization to occur in yypush_parse but only on the first
2168 2006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
2170 * data/push.c: Add CPP guards around push parser declarations in both
2171 the header and the code file.
2172 In the code file, move the push parser declarations to the same place
2173 they appear in the header file.
2174 Clean up the M4 some, especially the inconsistent underquoting in
2175 some b4_c_function_def and b4_c_function_decl uses.
2177 2006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
2179 Encapsulate the push parser state variables into an M4 macro so the
2180 push skeleton doesn't have to list them again for pull mode's yyparse.
2181 For push mode, remove yypush_parse's local equivalents of these
2182 variables to eliminate unnecessary copying between the two sets at
2183 run-time. This patch also fixes at least a bug related to multiple
2184 %initial-action invocations in push mode.
2185 * data/push.c (b4_declare_parser_variables): Rename to...
2186 (b4_declare_scanner_communication_variables): ... this for clarity and
2188 (b4_declare_yyparse_variables): Remove and move its contents to the one
2189 spot where it was invoked.
2190 (b4_declare_parser_state_variables): New macro containing the parser
2191 state variables required by push mode.
2192 (struct yypstate): Replace all fields but yynew with
2193 b4_declare_parser_state_variables.
2194 (yystate, yyn, yyresult, yyerrstatus, yytoken, yyss, yyssp, yyvs,
2195 yyvsp, yyls, yylsp, yystacksize, yyval, yyloc): For push mode, #define
2196 each NAME in this list to yyps->NAME so it can be used in yypush_parse.
2197 (yyparse or yypush_parse): For yyparse in pull mode, replace local
2198 parser state variable declarations with
2199 b4_declare_parser_state_variables.
2200 Don't initialize parser state variables when calling yypush_parse since
2201 yypstate_new already does that.
2202 Invoke the user's initial action only upon the first yypush_parse
2204 Remove all code that copies between the local parser state variables
2207 2006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
2209 * data/push.c (union yyalloc): Rename yyss, yyvs, and yyls fields to
2210 prevent a name collision in a future patch where these names will
2211 sometimes be #define'd.
2212 (YYSTACK_RELOCATE): Add an argument to select a union yyalloc field
2213 since it no longer has the same name as the existing argument.
2214 (yyparse or yypush_parse): Update all uses of YYSTACK_RELOCATE.
2216 2006-12-19 Paolo Bonzini <bonzini@gnu.org>
2217 and Joel E. Denny <jdenny@ces.clemson.edu>
2219 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
2220 that the argument is case-insensitive, and there's no `=' here.
2221 For the %skeleton entry, mention that %language is better.
2222 (Bison Options): Likewise for --language and --skeleton. Move the
2223 --skeleton entry so that the `Tuning the parser' section is sorted
2224 alphabetically on long options.
2225 (C++ Bison Interface): Don't use the word skeleton. Don't explain the
2226 %language directive in detail here; cross-reference the %language
2227 documentation instead.
2228 (Calc++ Parser): Use `%require "@value{VERSION}"' rather than
2229 `%require "2.3b"' so that the example is always up-to-date.
2230 (Table of Symbols): Add entries for %language and %skeleton.
2231 * examples/extexi (normalize): Instead of replacing every %require
2232 argument with the current Bison version, just substitute for
2233 `@value{VERSION}'. This guarantees that we're testing what actually
2234 appears in the documentation.
2235 * examples/calc++/Makefile.am ($(calc_extracted)): Use `$(VERSION)'
2236 rather than `@VERSION@'.
2238 2006-12-18 Paul Eggert <eggert@cs.ucla.edu>
2240 * NEWS: Reword the %language news a bit, and put it earlier.
2242 * src/getargs.c (skeleton_arg): Last arg is now location const *.
2243 Rewrite to simplify the logic.
2244 (language_argmatch): Likewise.
2245 (program_name): We now own this var.
2246 * src/getargs.h (struct bison_language): Use char[] rather than
2249 * doc/bison.texinfo (Decl Summary, Bison Options): Don't claim
2251 * src/complain.c (program_name): Remove decl; no longer needed.
2252 * src/main.c (program_name): Remove; now belongs to getargs.
2254 2006-12-18 Paolo Bonzini <bonzini@gnu.org>
2256 * NEWS: Document %language.
2258 * data/Makefile.am (dist_pkgdata_DATA): Add c-skel.m4, c++-skel.m4.
2260 * data/c-skel.m4, data/c++-skel.m4: New files.
2261 * data/glr.c: Complain on push parsers.
2263 * doc/bison.texinfo (C++ Parser Interface): Prefer %language
2265 (Decl Summary): Document %language and %skeleton.
2266 (Command line): Document -L.
2268 * examples/extexi: Rewrite %require directive.
2269 * examples/calc++/Makefile.am: Pass VERSION to extexi.
2271 * src/files.c (compute_exts_from_gc): Look in language structure
2273 (compute_file_name_parts): Check whether .tab should be added.
2274 * src/getargs.c (valid_languages, skeleton_prio, language_prio):
2275 (language, skeleton_arg, language_argmatch): New.
2276 (long_options): Add --language.
2277 (getargs): Use skeleton_arg, add -L/--language.
2278 * src/getargs.h: Include location.h.
2279 (struct bison_language, language, skeleton_arg, language_argmatch): New.
2280 * src/output.c (prepare): Pick default skeleton from struct language.
2281 Don't dispatch C skeletons here.
2282 * src/parse-gram.y (PERCENT_LANGUAGE): New.
2283 (prologue_declaration): Add "%language" rule, use skeleton_arg.
2284 * src/scan-gram.l ("%language"): New rule.
2286 * tests/calc.at: Test %skeleton and %language.
2287 * tests/local.at (AT_SKEL_CC_IF): Look for %language.
2288 (AT_GLR_IF): Look for %skeleton "glr.cc".
2289 (AT_LALR1_CC_IF, AT_GLR_CC_IF): Rewrite.
2290 (AT_YACC_IF): Reject %language.
2292 2006-12-18 Paul Eggert <eggert@cs.ucla.edu>
2294 * src/symtab.h (struct semantic_type): Remove the tag 'semantic_type',
2295 since it wasn't used; only the typedef name 'semantic_type' is needed.
2296 Also, omit trailing white space.
2298 * bootstrap: Sync from coreutils.
2299 (gnulib_extra_files): Add build-aux/announce.gen.
2300 (slurp): Adjust .gitignore files like .cvsignore files.
2301 * build-aux/announce-gen: Remove from CVS, since bootstrap
2304 2006-12-16 Joel E. Denny <jdenny@ces.clemson.edu>
2306 Make %push-parser imply %pure-parser. This fixes several bugs; see
2307 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00148.html>.
2308 * src/parse-gram.y (prologue_declaration): For %push-parser, also set
2310 * data/push.c: Don't bother testing b4_push_if when deciding whether
2311 to expand b4_declare_parser_variables globally.
2312 (yypush_parse): Likewise in here.
2314 * data/push.c (yypush_parse): Add b4_parse_param to arguments.
2315 (yy_reduce_print): Reformat M4 for readability.
2317 2006-12-15 Bob Rossi <bob@brasko.net>
2318 and Joel Denny <jdenny@ces.clemson.edu>
2320 * data/push.c (yypstate): Add typedef, and update all uses of
2321 struct yypstate to just yypstate.
2322 * tests/calc.at (_AT_DATA_CALC_Y): Update here as well.
2324 2006-12-14 Bob Rossi <bob@brasko.net>
2326 * data/push.c (yypush_parse): Declare prototype regardless of
2329 2006-12-14 Bob Rossi <bob@brasko.net>
2331 * data/push.c (yyparse): Remove the prototype and the #define when in
2334 2006-12-13 Bob Rossi <bob@brasko.net>
2336 * data/push.c (yypstate_init): Rename to...
2337 (yypstate_new): ... this and use b4_c_function_def.
2338 (yypstate_delete): New.
2339 (yypush_parse): Change parameters yynval and yynlloc to be const.
2340 * tests/calc.at (_AT_DATA_CALC_Y): Use new yypstate_new and
2341 yypstate_delete functions.
2343 2006-12-13 Joel E. Denny <jdenny@ces.clemson.edu>
2345 * configure.ac (AC_PREREQ): Require Autoconf 2.61 because of our
2346 strange test case titles. Reported by Bob Rossi.
2348 2006-12-13 Paul Eggert <eggert@cs.ucla.edu>
2350 * TODO: Add pointer to Sylvain Schmitz's work on static detection
2351 of potential ambiguities in GLR grammers.
2353 2006-12-12 Joel E. Denny <jdenny@ces.clemson.edu>
2355 * tests/testsuite.at (AT_CHECK): When checking if $1 starts with
2356 `bison ', use m4_index instead of m4_substr since chopping up a string
2357 containing M4-special characters causes problems here.
2359 Fix a couple of bugs related to special characters in user-specified
2360 file names, and make it easier for skeletons to compute output file
2361 names with the same file name prefix as Bison-computed output file
2363 * data/glr.cc, data/push.c, data/yacc.c: In @output, use
2364 b4_parser_file_name and b4_spec_defines_file instead of
2365 @output_parser_name@ and @output_header_name@, which are now redundant.
2366 * data/glr.c, data/lalr1.cc: Likewise. Also, in header #include's, use
2367 b4_parser_file_name, b4_spec_defines_file, and the new
2368 @basename(FILENAME@) instead of @output_parser_name@ and
2369 @output_header_name@, which inappropriately escaped the file names as
2371 * src/files.c (all_but_ext): Remove static qualifier.
2372 (compute_output_file_names): Move `free (all_but_ext)' to...
2373 (output_file_names_free): ... here since all_but_ext is needed later.
2374 * src/files.h (all_but_ext): Extern.
2375 * src/muscle_tab.h (MUSCLE_INSERT_STRING_RAW): New macro that does
2376 exactly what MUSCLE_INSERT_STRING used to do.
2377 (MUSCLE_INSERT_STRING): Use MUSCLE_OBSTACK_SGROW so that M4-special
2378 characters are escaped properly.
2379 * src/output.c (prepare): Define muscle file_name_all_but_ext as
2381 For pkgdatadir muscle, maintain previous functionality by using
2382 MUSCLE_INSERT_STRING_RAW instead of MUSCLE_INSERT_STRING. The problem
2383 is that b4_pkgdatadir is used inside m4_include in the skeletons, so
2384 digraphs would never be expanded. Hopefully no one has M4-special
2385 characters in his Bison installation path.
2386 * src/scan-skel.l: Don't parse @output_header_name@ and
2387 @output_parser_name@ anymore since they're now redundant.
2388 In @output, use decode_at_digraphs.
2389 Parse a new @basename command that invokes last_component.
2390 (decode_at_digraphs): New.
2391 (BASE_QPUTS): Remove unused.
2392 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): New macro.
2393 (Output file name): New tests.
2395 2006-12-09 Joel E. Denny <jdenny@ces.clemson.edu>
2397 Warn about output files that are generated by the skeletons and that
2398 conflict with other output files.
2399 * data/glr.c: Don't generate the header file here when glr.cc does.
2400 * src/files.c (file_names, file_names_count): New static globals.
2401 (compute_output_file_names): Invoke output_file_name_check for files
2402 not generated by the skeletons and remove existing checks.
2403 (output_file_name_check): New function that warns about conflicting
2405 (output_file_names_free): Free file_names.
2406 * src/files.h (output_file_name_check): Declare.
2407 * src/scan-skel.l: Invoke output_file_name_check for files generated by
2409 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): New.
2410 (Conflicting output files): New tests.
2412 2006-12-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2414 * doc/bison.texinfo: Fix a couple of typos.
2416 2006-12-08 Bob Rossi <bob@brasko.net>
2418 * data/push.c: (yypvarsinit, yypvars, struct yypvars, yypushparse):
2420 (yypstate_init, yypstate, struct yypstate, yypush_parse): ... these and
2422 (b4_yyssa, b4_yyerror_range, yypstate_init): Rename pv to yyps.
2423 (yypush_parse): Rename yypvars argument to yyps and remove redundant
2425 (yypstate_init, yypush_parse): Declare in Bison-generated header file.
2426 * tests/calc.at (_AT_DATA_CALC_Y): Use newly named functions.
2428 2006-12-07 Bob Rossi <bob@brasko.net>
2429 and Joel Denny <jdenny@ces.clemson.edu>
2431 * data/push.c (yypvarsinit): Change return type from void* to struct
2432 yypvars*. No longer cast to void* on return.
2433 (struct yypvars): Remove yylen since it need not be remembered between
2434 yypushparse invocations.
2435 (yypushparse): Don't copy between yylen and pv->yylen.
2437 2006-12-05 Bob Rossi <bob@brasko.net>
2439 * data/push.c (yychar_set, yylval_set, yylloc_set): Delete.
2440 (yypushparse): Add yynchar, yynlval, yynlloc parameters.
2441 (b4_declare_parser_variables): Do not declare yynerrs for push mode.
2442 (struct yypvars): Remove b4_declare_parser_variables.
2443 (yypvarsinit): Remove init code for removed variables.
2444 (global scope): Do not declare b4_declare_parser_variables if
2446 (yypushparse): Add b4_declare_parser_variables.
2447 Init new local variables, and remove init code for removed
2450 * tests/calc.at (_AT_DATA_CALC_Y): Call yypushparse for push mode
2451 and yyparse for other modes.
2452 (AT_CHECK_CALC_LALR): Added '%skeleton "push.c"' for push tests.
2453 * tests/local.at (AT_PUSH_IF, AT_PURE_OR_PUSH_IF): Added.
2454 (AT_YYERROR_SEES_LOC_IF): push-parser makes this false.
2455 (AT_PURE_LEX_IF): True if pure or push parser.
2457 2006-12-05 Joel E. Denny <jdenny@ces.clemson.edu>
2459 Document Yacc prologue alternatives and default %destructor's and
2460 %printer's as experimental. Don't mention Java yet. Discussed at
2461 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00002.html>.
2462 * NEWS (2.3a+): Say they're experimental. Remove any mention of Java.
2463 (2.3a): Annotate this entry to say the old forms of these features were
2465 * doc/bison.texinfo (Prologue Alternatives, Freeing Discarded Symbols,
2466 Table of Symbols): Say they're experimental. Comment out any mention
2467 of Java (we'll want this back eventually).
2469 2006-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
2471 Support a file name argument to %defines. Deprecate `=' in
2472 %file-prefix, %name-prefix, and %output. Discussed at
2473 <http://lists.gnu.org/archive/html/help-bison/2006-09/msg00001.html>.
2474 * NEWS (2.3a+): Mention.
2475 * doc/bison.texinfo (Decl Summary, Table of Symbols): Add entry for new
2476 form of %defines, and remove `=' from entries for %file-prefix,
2477 %name-prefix, and %output.
2478 * src/parse-gram.y (prologue_declaration): Implement.
2479 * tests/calc.at (Simple LALR Calculator, Simple GLR Calculator, Simple
2480 LALR1 C++ Calculator, Simple GLR C++ Calculator): Remove the `=' from
2481 all but one occurrence of %name-prefix.
2482 * tests/headers.at (export YYLTYPE): Remove the `=' from %name-prefix.
2483 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Likewise.
2484 * tests/output.at (AT_CHECK_OUTPUT): Remove the `=' from all but one
2485 occurrence of each of %file-prefix and %output. Add check for %defines
2487 * tests/reduce.at (Useless Terminals, Useless Nonterminals,
2488 Useless Rules, Reduced Automaton, Underivable Rules, Empty Language):
2489 Remove the `=' from %output.
2491 2006-11-21 Joel E. Denny <jdenny@ces.clemson.edu>
2493 Don't escape $ in test case titles since Autoconf 2.61 now does that
2495 * tests/actions.at (Default %printer and %destructor are not for error
2496 or $undefined): Here.
2497 (Default %printer and %destructor are not for $accept): Here.
2498 * tests/input.at (Invalid $n and @n): Here.
2500 2006-11-20 Joel E. Denny <jdenny@ces.clemson.edu>
2502 Rename <!> to <>. Discussed starting at
2503 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00039.html>.
2504 * NEWS (2.3a+): Update.
2505 * doc/bison.texinfo (Freeing Discarded Symbols, Table of Symbols):
2507 * src/parse-gram.y (TYPE_TAG_NONE, generic_symlist_item): Implement.
2508 * src/scan-gram.l (INITIAL): Implement.
2509 * src/symlist.c (symbol_list_default_tagless_new): Update comment.
2510 * src/symlist.h (symbol_list, symbol_list_default_tagless_new): Update
2512 * tests/actions.at (Default tagless %printer and %destructor,
2513 Default tagged and per-type %printer and %destructor,
2514 Default %printer and %destructor are not for error or $undefined,
2515 Default %printer and %destructor are not for $accept,
2516 Default %printer and %destructor for mid-rule values): Update.
2517 * tests/input.at (Default %printer and %destructor redeclared,
2518 Unused values with default %destructor): Update.
2520 2006-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
2522 Don't let %prec take a nonterminal.
2523 * src/reader.c (grammar_current_rule_prec_set): Make the %prec symbol a
2525 * tests/input.at (%prec takes a token): New test checking that %prec
2526 won't take a nonterminal.
2528 2006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
2530 * tests/testsuite.at (AT_CHECK): Don't miss an exit value of 0 because
2531 it was double-quoted.
2532 * src/Makefile.am (YACC): Use --warnings=all,error so that Bison's own
2533 grammar is maintained with Bison's highest standards.
2534 * src/getargs.c: Fix some typos in Doxygen comments.
2536 2006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
2538 Fix memory leaks in scanners generated by at least Flex 2.5.9 and
2539 later. Reported by Paul Eggert in
2540 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00014.html>.
2541 * src/flex-scanner.h (yylex_destroy): Define for Flex before 2.5.9.
2542 * src/scan-code.l (translate_action): Don't bother invoking
2543 yy_delete_buffer (YY_CURRENT_BUFFER) before creating the first buffer.
2544 (code_scanner_free): Instead of invoking
2545 yy_delete_buffer (YY_CURRENT_BUFFER) directly, invoke yylex_destroy,
2547 * src/scan-gram.l (gram_scanner_free): Likewise.
2548 * src/scan-skel.l (scan_skel): Likewise.
2550 2006-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
2552 * src/files.c (tr): Change return type to void.
2553 * src/muscle_tab.c (muscle_insert): Free storage in case muscle_grow
2554 has been called previously for the same key.
2555 (muscle_find): Return storage instead of value so that
2556 --enable-gcc-warnings doesn't produce warnings that the return discards
2557 const. aver that the value and storage are the same since storage
2558 could potentially be NULL when value is not.
2559 * tests/testsuite.at (AT_CHECK): Treat an unspecified exit value the
2562 2006-11-08 Paul Eggert <eggert@cs.ucla.edu>
2564 * bootstrap.conf (excluded_files): Exclude m4/codeset.m4 (undoing
2565 the earlier change today), m4/intl.m4, m4/intldir.m4. This gives
2566 us a slightly cleaner distribution, and also works.
2567 * m4/.cvsignore: Add inline.m4, wint_t.m4 to accommodate recent
2570 2006-11-08 Joel E. Denny <jdenny@ces.clemson.edu>
2571 and Paul Eggert <eggert@cs.ucla.edu>
2573 Don't let Bison leak memory except when it complains.
2574 * src/files.h (parser_file_name, spec_verbose_file, spec_graph_file):
2575 (spec_defines_file, dir_prefix): Now char *, not const char *,
2576 since they are freed.
2577 * src/files.c: Likewise.
2578 (all_but_ext, all_but_tab_ext, src_extension, header_extension):
2580 (tr): Now operates in-place. All uses changed.
2581 (compute_exts_from_gf, compute_exts_from_src): Don't leak temporary
2583 (compute_file_name_parts, compute_output_file_names): Don't store
2584 read-only data in variables that will be freed.
2585 (compute_output_file_names): Free all_but_ext, all_but_tab_ext,
2586 src_extension, and header_extension.
2587 (output_file_names_free): New public function to free
2588 spec_verbose_file, spec_graph_file, spec_defines_file,
2589 parser_file_name, and dir_prefix.
2590 * src/getargs.c (getargs): Don't store read-only data in variables that
2592 * src/main.c (main): Invoke output_file_names_free, code_scanner_free
2593 (which previously existed but was unused), and quotearg_free.
2594 * src/muscle_tab.h (muscle_insert): value arg is now a `char const *'.
2595 * src/muscle_tab.c: Likewise.
2596 (muscle_entry): Make the value char const *,
2597 and add a new storage member that is char * and can be freed.
2598 (muscle_entry_free): New private function.
2599 (muscle_init): Use it instead of free.
2600 (muscle_insert, muscle_grow): Update and use new storage member.
2601 (muscle_code_grow): Free the string passed to muscle_grow
2602 since it's not needed anymore.
2603 * src/parse-gram.y (%union): Make `chars' member a `char const *', and
2604 add a new `char *code' member.
2605 ("{...}"): Declare semantic type as code.
2606 * src/scan-code.h (translate_rule_action):
2607 (translate_symbol_action, translate_code, translate_action): Return
2608 `char const *' rather than `char *' since external code should not free
2610 * src/scan-code.l: Likewise.
2611 * src/scan-gram.l (<SC_BRACED_CODE>): Use val->code for BRACED_CODE,
2612 which is "{...}" in the parser.
2613 * tests/Makefile.am (maintainer-check-valgrind): Set
2614 VALGRIND_OPTS='--leak-check=full --show-reacheable=yes' before invoking
2616 * tests/calc.at (_AT_DATA_CALC_Y): fclose the FILE* so Valgrind doesn't
2618 * tests/testsuite.at (AT_CHECK): Redefine so that running Bison and
2619 expecting a non-zero exit status sets --leak-check=summary and
2620 --show-reachable=no for Valgrind. Bison unabashedly leaks memory in
2621 this case, and we don't want to hear about it.
2623 2006-11-08 Paul Eggert <eggert@cs.ucla.edu>
2625 * bootstrap (runtime-po/Makevars): Derive from po/Makevars
2626 instead of from the template, to simplify configuration a bit.
2627 * bootstrap.conf (excluded_files): Don't exclude m4/codeset.m4
2628 and m4/wint_t.m4, as they are needed with the latest gnulib.
2630 2006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
2632 Disable unset/unused mid-rule value warnings by default, and recognize
2633 --warnings=midrule-values to enable them. Discussed starting at
2634 <http://lists.gnu.org/archive/html/help-bison/2006-10/msg00030.html>.
2635 * NEWS (2.3a+): Mention.
2636 * src/getargs.c, src/getargs.h (warnings_args, warnings_types, enum
2637 warnings): Add entry for midrule-values subargument.
2638 * src/reader.c (symbol_should_be_used): Don't return true just because
2639 the value is a set/used mid-rule value unless
2640 --warnings=midrule-values was specified.
2641 * tests/input.at (Unused values, Unused values before symbol
2642 declarations): Run tests with and without --warnings=midrule-values.
2644 * src/reader.c (check_and_convert_grammar): Use symbol_list_free rather
2645 than LIST_FREE directly.
2647 2006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
2649 Finish implementing --warnings=error, which should not be implied by
2650 --warnings=all (or by its synonyms -W and --warnings without
2652 * src/complain.c (set_warning_issued): New function to report that
2653 warnings are being treated as errors and to record an error if so.
2655 (warn_at, warn): ... here.
2656 * src/getargs.c (warnings_args, warnings_types): Reorder so that
2657 "error - warnings are errors" does not appear above "all - all of the
2659 (getargs): For -W and --warnings without subarguments, don't let
2660 FLAGS_ARGMATCH set warnings_error in warnings_flag.
2661 * src/getargs.h (enum warnings): Unset warnings_error in warnings_all.
2663 2006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
2665 * src/getargs.c (flags_argmatch): Don't cause segmentation fault for
2666 empty subargument list. For example: `bison --warnings= parser.y'.
2668 2006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
2670 * data/push.c, data/yacc.c: Make sure there's a newline at the end of
2671 the parser header file so that gcc doesn't warn.
2673 2006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
2675 Split the default %destructor/%printer into two kinds: <*> and <!>.
2676 Discussed starting at
2677 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00060.html>.
2678 * NEWS (2.3a+): Mention.
2679 * doc/bison.texinfo (Freeing Discarded Symbols): Document this and the
2680 previous change today related to mid-rules.
2681 (Table of Symbols): Remove %symbol-default and add <*> and <!>.
2682 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): Remove.
2683 (TYPE_TAG_ANY): Add as <*>.
2684 (TYPE_TAG_NONE): Add as <!>.
2685 (generic_symlist_item): Remove RHS for %symbol-default and add RHS's
2687 * src/scan-gram.l (PERCENT_SYMBOL_DEFAULT): Remove.
2688 (TYPE_TAG_ANY, TYPE_TAG_NONE): Add.
2689 * src/symlist.c (symbol_list_default_new): Split into tagged and
2691 (symbol_list_destructor_set, symbol_list_printer_set): Split
2692 SYMLIST_DEFAULT case into SYMLIST_DEFAULT_TAGGED and
2693 SYMLIST_DEFAULT_TAGLESS.
2694 * src/symlist.h: Update symbol_list_default*_new prototypes.
2695 (symbol_list.content_type): Split enum value SYMLIST_DEFAULT into
2696 SYMLIST_DEFAULT_TAGGED and SYMLIST_DEFAULT_TAGLESS.
2697 * src/symtab.c (default_destructor, default_destructor_location,
2698 default_printer, default_printer_location): Split each into tagged and
2700 (symbol_destructor_get, symbol_destructor_location_get,
2701 symbol_printer_get, symbol_printer_location_get): Implement tagged
2702 default and tagless default cases.
2703 (default_destructor_set, default_printer_set): Split each into tagged
2704 and tagless versions.
2705 * src/symtab.h: Update prototypes.
2706 * tests/actions.at (Default %printer and %destructor): Rename to...
2707 (Default tagless %printer and %destructor): ... this, and extend.
2708 (Per-type %printer and %destructor): Rename to...
2709 (Default tagged and per-type %printer and %destructor): ... this, and
2711 (Default %printer and %destructor for user-defined end token): Extend.
2712 (Default %printer and %destructor are not for error or $undefined):
2714 (Default %printer and %destructor are not for $accept): Update.
2715 (Default %printer and %destructor for mid-rule values): Extend.
2716 * tests/input.at (Default %printer and %destructor redeclared): Extend.
2717 (Unused values with default %destructor): Extend.
2719 2006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
2721 Don't apply the default %destructor/%printer to an unreferenced midrule
2723 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00104.html>.
2724 * src/symtab.c (dummy_symbol_get): Name all dummy symbols initially
2725 like $@n instead of just @n so that the default %destructor/%printer
2726 logic doesn't see them as user-defined symbols.
2727 (symbol_is_dummy): Check for both forms of the name.
2728 * src/reader.c (packgram): Remove the `$' from each midrule symbol
2729 name for which the midrule value is referenced in any action.
2730 * tests/actions.at (Default %printer and %destructor for mid-rule
2732 * tests/regression.at (Rule Line Numbers, Web2c Report): Update output
2733 for change to dummy symbol names.
2735 2006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
2737 Warn about unset midrule $$ if the corresponding $n is used.
2738 * src/reader.c (symbol_should_be_used): Check midrule parent rule for
2740 (packgram): Before invoking grammar_rule_check on any rule, make sure
2741 all actions have already been scanned in order to set `used' flags.
2742 Otherwise, checking that a midrule's $$ is set will not always work
2743 properly because the midrule check must forward-reference the midrule's
2745 * tests/input.at (AT_CHECK_UNUSED_VALUES): Extend to check the new
2748 2006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
2750 More improvements to the documentation of the prologue alternatives:
2751 * NEWS (2.3a+): Mention the new `Prologue Alternatives' section in the
2753 * doc/bison.texinfo (Prologue Alternatives): Correct some errors. Add
2754 some text to clarify the relative importance of the new directives and
2755 to show how these directives may be viewed as code labels.
2757 2006-10-16 Joel E. Denny <jdenny@ces.clemson.edu>
2759 Similar to the recently removed %before-header, add %code-top as the
2760 alternative to the pre-prologue. Mentioned at
2761 <http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00063.html>.
2762 Also, let the prologue alternatives appear in the grammar section.
2763 * src/parse-gram.y (PERCENT_CODE_TOP): New token.
2764 (prologue_declaration): Move the existing prologue alternatives to...
2765 (grammar_declaration): ... here and add %code-top.
2766 * src/scan-gram.l (PERCENT_CODE_TOP): New token.
2768 Clean up and extend documentation for the prologue alternatives.
2769 * NEWS (2.3a+): Describe prologue alternatives.
2770 * doc/bison.texinfo (Prologue): Move discussion of prologue
2772 (Prologue Alternatives): ... this new section, and extend it to discuss
2773 all 4 directives in detail.
2774 (Table of Symbols): Clean up discussion of prologue alternatives and
2777 2006-10-16 Juan Manuel Guerrero <juan.guerrero@gmx.de>
2779 DJGPP specific issues.
2781 * djgpp/config.bat: config.hin has been moved to lib. Adjust
2782 config.bat accordingly.
2783 * djgpp/config.sed: Adjust config.sed for the use of autoconf 2.60.
2784 * djgpp/config.site: Likewise.
2786 2006-10-16 Paolo Bonzini <bonzini@gnu.org>
2788 Replace %*-header with %provides, %requires, %code. See discussion at
2789 http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00002.html
2791 * data/bison.m4 (b4_user_requires, b4_user_provides): New.
2792 (b4_user_start_header): Remove.
2793 * data/glr.c: Use new macros instead of b4_*start_header
2795 * data/glr.cc: Likewise.
2796 * data/lalr1.cc: Likewise.
2797 * data/push.c: Likewise.
2798 * data/yacc.c: Likewise.
2800 * doc/bison.texinfo: Remove %before-header, rename
2801 %{start,end,after}-header to %requires, %provides, %code.
2803 * src/parse-gram.y: Likewise (also rename token names accordingly).
2804 * src/scan-gram.l: Likewise.
2805 * tests/actions.at: Likewise.
2807 2006-10-14 Paul Eggert <eggert@cs.ucla.edu>
2809 * lib/Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS).
2810 Problem reported by Joel E. Denny.
2812 2006-10-14 Jim Meyering <jim@meyering.net>
2814 (Sync from coreutils.)
2815 Work also when the working directory (with e.g. coreutils sources)
2816 is version controlled with git, rather than CVS.
2817 * bootstrap (CVS_only_file): Test for the existence of README-cvs,
2819 In messages and comments, say e.g., "checked-out sources",
2820 rather than "CVS sources".
2821 (version_controlled_file): New function. Work for git as well as
2822 for CVS. Don't use grep's -q option.
2823 (slurp): Call it here, in place of CVS-specific code.
2825 2006-10-14 Joel E. Denny <jdenny@ces.clemson.edu>
2827 Fix testsuite for ./configure --enable-gcc-warnings:
2828 * configure.ac (gcc-warnings): Move -Wall before -Wno-sign-compare.
2829 Otherwise, gcc 4.1.0 (at least) warns about sign comparisons in
2830 __AT_CHECK_PRINTER_AND_DESTRUCTOR in tests/actions.at.
2831 * test/input.at (Torturing the Scanner): #include <stdlib.h> for abort.
2832 * test/regression.at (Diagnostic that expects two alternatives):
2835 2006-10-12 Paul Eggert <eggert@cs.ucla.edu>
2837 * bootstrap.conf (gnulib_modules): Add config-h.
2838 * djgpp/subpipe.c: Include <config.h> unconditionally; don't
2839 worry about HAVE_CONFIG_H.
2840 * lib/abitset.c: Likewise.
2841 * lib/bitset.c: Likewise.
2842 * lib/bitset_stats.c: Likewise.
2843 * lib/bitsetv-print.c: Likewise.
2844 * lib/bitsetv.c: Likewise.
2845 * lib/ebitset.c: Likewise.
2846 * lib/get-errno.c: Likewise.
2847 * lib/lbitset.c: Likewise.
2848 * lib/subpipe.c: Likewise.
2849 * lib/timevar.c: Likewise.
2850 * lib/vbitset.c: Likewise.
2851 * lib/bitset.c: Include "bitset.h" first, to test interface.
2852 * lib/bitset_stats.c: Include "bitset_stats.h" first.
2853 * lib/bitsetv-print.c: Include "bitsetv-print.h" first.
2854 * lib/bitsetv.c: Include "bitsetv.h" first.
2855 * lib/get-errno.c: Include "get-errno.h" first.
2856 * m4/.cvsignore: Add config-h.m4.
2857 * tests/actions.at (Default %printer and %destructor for ...):
2858 Adjust expected line numbers in output to reflect removal of #if
2859 HAVE_CONFIG_H lines.
2860 * tests/glr-regression.at (Missed %merge type warnings when ...):
2862 * tests/regression.at (Braced code in declaration in rules section):
2864 * tests/atlocal.in (CPPFLAGS): Don't define HAVE_CONFIG_H.
2865 * tests/local.at (AT_DATA_GRAMMAR_PROLOGUE):
2866 Include <config.h> unconditionally.
2868 * bootstrap: Sync from coreutils, as follows:
2870 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
2872 * bootstrap (symlink_to_gnulib): Fix bug: the dot_dots shell
2873 variable was sometimes used without being initialized. This
2874 messed up the installation of the INSTALL file in some cases.
2876 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
2878 * bootstrap (usage, main program, symlink_to_gnulib): Add option
2879 --copy. Inspired by a suggestion from Bruno Haible.
2881 2006-10-03 Jim Meyering <jim@meyering.net>
2883 * bootstrap: Undo last change to this file, since now gnulib-tool
2884 sticks with the automake default in generating dependencies.
2886 2006-10-12 Paul Eggert <eggert@cs.ucla.edu>
2888 * configure.ac: Use AC_PROG_CC_STDC; this is more modern than
2889 the old AC_PROG_CC / AM_PROG_CC_STDC combination.
2891 * doc/bison.1: Add copyright notice.
2893 * data/glr.c: Don't include <stdarg.h>; not used.
2895 * NEWS: The -g and --graph options now output graphs in Graphviz
2896 DOT format, not VCG format.
2897 * doc/bison.1: Likewise.
2898 * doc/bison.texinfo (Understanding, Bison Options): Likewise.
2899 * THANKS: Add Satya Kiran Popuri, who proposed the initial version
2901 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00158.html>.
2902 * TODO: Remove Graphviz entry.
2903 * src/Makefile.am (bison_SOURCES): Add graphviz.c and graphviz.h;
2904 remove vcg.c, vcg.h, vcg_defaults.h.
2905 * src/vcg.c, src/vcg.h, src/vcg_defaults.h: Remove.
2906 * src/graphviz.c, src/graphviz.h: New files.
2907 * src/files.c (compute_output_file_names): Output .dot, not .vcg.
2908 * src/files.h: Make comment more generic.
2909 * src/main.c (main): Likewise.
2910 * src/print_graph.h: Likewise.
2911 * src/getargs.c (usage): Make usage description more generic.
2912 * src/print_graph.c: Include graphviz.h rather than vcg.h.
2913 (static_graph, fgraph): Remove. All uses changed to pass
2914 arguments instead of sharing a static var.
2915 (print_core, print_actions, print_state, print_graph):
2916 Output graphviz format rather than VCG format.
2917 * tests/.cvsignore: Remove *.vcg; add *.dot.
2918 * tests/output.at: Expect *.dot files, not *.vcg files.
2920 * data/Makefile.am (dist_pkgdata_DATA): Add bison.m4; this
2921 accommodates the 2006-10-08 change.
2923 2006-10-11 Bob Rossi <bob@brasko.net>
2925 * data/push.c (yypushparse, yypvarsinit, yypvars): Wrap in b4_push_if.
2926 (b4_yyssa, b4_yyerror_range): New macros.
2927 (struct yypvars): Remove yyssa_ptr and yyerror_range_ptr fields.
2928 (yypvarsinit): Remove init of removed fields.
2929 (yypushparse): Remove use of removed fields; use new macros instead.
2931 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
2933 * data/push.c (yypushparse): Fix memory leak if yymsg is malloced
2934 in a push parser. Reindent slightly to match yacc.c better.
2936 2006-10-11 Bob Rossi <bob@brasko.net>
2938 * data/push.c (struct yypvars): Remove yymsgbuf, yymsgbuf_ptr, yymsg,
2940 (yypvarsinit, yypushparse): Remove init of removed fields.
2941 (yypushparse): Use yymsgbuf instead of yymsgbuf_ptr.
2943 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
2945 * THANKS: Add Paolo Bonzini and Bob Rossi.
2947 2006-10-08 Paolo Bonzini <bonzini@gnu.org>
2949 * data/c.m4 (b4_copyright, b4_epilogue, b4_location_initial_column,
2950 b4_location_initial_line, p4_parse_param, b4_ints_in, b4_flag_if,
2951 b4_define_flag_if and uses, b4_basename, b4_syncline, b4_user_code,
2952 b4_define_user_cde and uses): Remove.
2953 (b4_comment, b4_prefix, b4_sync_start): New.
2954 * data/bison.m4: New file, with most of the content removed from c.m4.
2955 * src/muscle_tab.h: Use "do {...} while(0)" throughout.
2956 * src/output.c (output_skeleton): Pass bison.m4.
2957 (prepare): Pass glr_flag and nondeterministic_flag. Pass prefix
2960 2006-10-05 Paul Eggert <eggert@cs.ucla.edu>
2962 Fix test failure reported by Tom Lane in
2963 <http://lists.gnu.org/archive/html/bug-bison/2006-10/msg00000.html>
2964 and try to make such failures easier to catch in the future.
2965 * data/glr.c (YYTRANSLATE): Don't check for nonpositive arg;
2966 that's now the caller's responsibility.
2967 (yyprocessOneStack, yyrecoverSyntaxError, yyparse):
2968 Set yychar = YYEOF if it's negative.
2969 * tests/actions.at (yylex): Abort if asked to read past EOF.
2970 * tests/conflicts.at (yylex): Likewise.
2971 * tests/cxx-type.at (yylex): Likewise.
2972 * tests/glr-regression.at (yylex): Likewise.
2973 * tests/input.at (yylex): Likewise.
2974 * tests/regression.at (yylex): Likewise.
2975 * tests/torture.at (yylex): Likewise.
2977 2006-10-01 Paul Eggert <eggert@cs.ucla.edu>
2979 Fix problems with translating English-language diagnostics.
2980 * bootstrap: Fix bug introduced in recent bootstrap changes, with
2981 respect to bison-runtime pot generation. The YY_ stuff
2982 wasn't being captured.
2983 * bootstrap.conf (XGETTEXT_OPTIONS_RUNTIME): New var.
2984 * po/POTFILES.in: Add src/location.c, src/scan-code.l.
2985 * runtime-po/POTFILES.in: Add data/push.c.
2987 2006-09-29 Paul Eggert <eggert@cs.ucla.edu>
2989 Merge bootstrap changes from coreutils.
2991 2006-09-28 Jim Meyering <jim@meyering.net>
2993 Automatically generated dependencies are important even
2994 when all of the sources in a directory come from gnulib.
2995 * bootstrap (gnulib_tool): Remove the "no-dependencies" automake
2996 option that gnulib-tool adds to what becomes our lib/gnulib.mk.
2998 2006-09-23 Jim Meyering <jim@meyering.net>
3000 * bootstrap (gnulib_tool_options): Add "--local-dir gl".
3002 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
3004 * bootstrap: Add support for --force.
3005 (usage): New function. Describe usage less tersely.
3006 (CVS_only_file): New var.
3008 2006-09-21 Paul Eggert <eggert@cs.ucla.edu>
3010 * data/push.c (YYPUSH_MORE): Make it an enum instead.
3011 (yypushparse): Use YYPUSH_MORE instead of the mystery constant.
3012 Adjust white space and comments to match GNU style better.
3014 2006-09-20 Bob Rossi <bob@brasko.net>
3016 * data/push.c (yyresult_get): Remove function.
3017 (YYPUSH_MORE): Add #define.
3018 (yypushparse): Modify return value.
3020 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
3022 * stamp-h.in: Remove; no longer needed.
3023 * .cvsignore: Replace autom4te.cache and config.cache with *.cache.
3024 Remove config.h, config.hin, intl (no longer created).
3025 * lib/.cvsignore: Add config.h, config.hin, configmake.h, inttypes.h,
3028 Sync bootstrap from coreutils, as follows:
3030 2006-09-18 Paul Eggert <eggert@cs.ucla.edu>
3032 * bootstrap (symlink_to_gnulib): New function.
3033 (cp_mark_as_generated): Use it, to prefer symlinks-to-gnulib
3034 to copies-of-gnulib.
3035 (cp_mark_as_generated, slurp, gnulib_files):
3036 Avoid making a copy if it's the same as the old version.
3037 (gnulib_files): Add support for this variable (used by Bison).
3039 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
3041 * src/getargs.c (usage): Rework to use conventions similar to
3042 coreutils, to make translation a bit easier and the code a bit
3043 smaller. Problem reported by Tim Van Holder.
3045 2006-09-15 Paul Eggert <eggert@cs.ucla.edu>
3047 Use some of gnulib's new modules, taken from coreutils.
3049 * bootstrap: Sync from coreutils, except add support for gnulib_files.
3050 * bootstrap.conf: New file.
3051 (gnulib_modules): Add configmake, inttypes, unistd.
3052 (XGETTEXT_OPTIONS): Add complain, complain_at,
3053 fatal, fatal_at, warn, warn_at, unexpected_end.
3054 * configure.ac (AC_CONFIG_HEADERS): config.h is now in lib, not here.
3055 (gl_USE_SYSTEM_EXTENSIONS): Remove; gl_EARLY now does this.
3057 (AM_STDBOOL_H): Remove; gl_INIT now dows this.
3059 (GNULIB_AUTOCONF_SNIPPET): Remove.
3060 (AM_GNU_GETTEXT): Add; require formatstring macros since that's
3062 * lib/.cvsignore: Add inttypes_.h.
3063 * lib/Makefile.am: Include gnulib.mk first so we can append to it.
3064 (AM_CFLAGS): Add WERROR_CFLAGS, to be more like coreutils.
3065 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES): Remove
3066 no-longer-necessary initializations.
3067 (lib_SOURCES): Remove, replacing by libbison_a_SOURCES.
3068 * lib/subpipe.c: Include <unistd.h> unconditionally, now that we
3069 use the unistd module.
3070 * src/system.h: Likewise.
3071 * m4/.cvsignore: Remove *_gl.m4, gnulib.m4, inttypes_h.m4, uintmax_t.m4,
3072 ulonglong.m4. Add gettext.m4, gnulib-cache.m4, gnulib-comp.m4,
3073 gnulib-tool.m4, inttypes-h.m4, inttypes-pri.m4, inttypes.m4.
3074 * src/Makefile.am (DEFS): Remove, since configmake does this for us.
3075 (AM_CPPFLAGS): Remove -I../lib, since Automake does that for us.
3076 * src/system.h: Include inttypes.h unconditionally, now that we
3077 use the inttypes module. Don't bother to include stdint.h, since
3078 inttypes.h now does that for us.
3079 (LOCALEDIR): Remove, now that we use the configmake module.
3080 * src/getargs.c: Include configmake.h.
3081 * src/main.c: Likewise.
3082 * src/output.c: Likewise.
3083 * tests/atlocal.in (CPPFLAGS): Include from $abs_top_builddir/lib,
3084 not from $abs_top_builddir, since config.h moved.
3087 Port to GCC 2.95. First two problems reported by Michael Deutschmann in
3088 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00018.html>.
3090 * src/parse-gram.y (symbol_declaration): Don't put statements
3091 before declarations; it's not portable to C89.
3092 * src/scan-code.l (handle_action_at): Likewise.
3094 * src/scan-code.l: Always initialize braces_level; the old code
3095 left it uninitialized and therefore had undefined behavior.
3097 Don't attempt to redefine 'assert', since it runs afoul of
3098 systems where standard headers (mistakenly) include <assert.h>.
3099 Instead, define and use our own alternative, called 'aver'.
3100 * src/reader.c: Don't include assert.h, since we no longer
3102 * src/scan-code.l: Likewise.
3103 * src/system.h (assert): Remove, replacing with....
3104 (aver): New function, taking a bool arg. All uses changed.
3105 * src/tables.c (pack_vector): Ensure that aver arg is bool,
3106 not merely an integer.
3108 2006-09-15 Bob Rossi <bob@brasko.net>
3110 * data/Makefile.am (dist_pkgdata_DATA): Add push.c.
3111 * data/c.m4 (YYPUSH): New.
3112 (b4_push_if): New macro. Use it instead of #ifdef YYPUSH.
3113 * src/getargs.c (push_parser): New var.
3114 * src/getargs.h (push_parser): New declaration.
3115 * src/output.c (prepare): Add macro insertion of `push_flag'.
3116 * src/parse-gram.y (PERCENT_PUSH_PARSER): New token.
3117 (prologue_declaration): Parse %push-parser.
3118 * src/scan-gram.l: Scan new PERCENT_PUSH_PARSER token.
3119 * tests/calc.at (_AT_CHECK_CALC_ERROR): Add "Return" and "Now" to
3120 list of removed lines from the traces observed.
3121 (AT_CHECK_CALC_LALR): Added push parser tests.
3123 2006-09-13 Paul Eggert <eggert@cs.ucla.edu>
3125 * NEWS: Version 2.3a.
3126 * configure.ac (AC_INIT): Likewise.
3128 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Remove
3129 "#define YYSTYPE int" that caused "make maintainer-check" to fail
3130 due to header ordering dependencies. I don't know why the #define
3133 Fix glr.cc and lalr1.cc's use of YYDEBUG so that there's zero
3134 runtime cost when YYDEBUG is not defined, and so that some tests
3135 that used to fail now work. Problem and initial suggestion by
3137 * data/c++.m4 (b4_parse_param_cons): Omit leading ','.
3138 * data/glr.cc (b4_parser_class_name):
3139 Initialize yycdebug_ only if YYDEBUG. Also, initialize yydebug_.
3140 (debug_level, set_debug_level): Affect yydebug_, not ::yydebug.
3141 (yydebug_) [YYDEBUG]: New member.
3142 (yycdebug_): Now defined only if YYDEBUG.
3143 * data/lalr1.cc (yydebug_, yycdebug_): Now defined only if YYDEBUG.
3144 (YYCDEBUG) [!YYDEBUG]: Don't use yydebug_ and yycdebug_.
3145 (b4_parser_class_name): Initialize yydebug_ and yycdebug_ only
3147 (debug_stream, set_debug_stream, debug_level, set_debug_level):
3148 Define only if YYDEBUG.
3149 * tests/calc.at (_AT_DATA_CALC_Y) [!YYDEBUG]: Omit call to
3151 * tests/regression.at (_AT_DATA_DANCER_Y) [!YYDEBUG]: Likewise.
3152 * tests/calc.at (AT_CHECK_CALC_GLR_CC): Uncomment calls to
3153 AT_CHECK_CALC_GLR_CC that are working now.
3155 2006-09-12 Paul Eggert <eggert@cs.ucla.edu>
3157 * data/glr.cc (YYERROR_VERBOSE, YYTOKEN_TABLE): Remove.
3158 We don't need them in glr.cc, and glr.c defines them.
3159 Defining YYERROR_VERBOSE to 0 here breaks glr.c, since glr.c
3160 assumes that defining it to anything is the same as defining
3161 it to 1. Problem reported by Paolo Bonzini.
3163 2006-09-12 Paolo Bonzini <bonzini@gnu.org> (tiny change)
3165 * data/c.m4 (b4_null, b4_case): Define.
3166 * src/output.c (prepare_symbols): Use b4_null.
3167 (user_actions_output): Use b4_case.
3169 2006-09-11 Paul Eggert <eggert@cs.ucla.edu>
3171 * data/glr.c (b4_shared_declarations): Put start-header first,
3172 before any #includes that we generate, so that feature-test
3173 macros work. Problem reported by Michael Deutschmann in
3174 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00004.html>.
3175 * data/lalr1.cc: Likewise.
3176 * doc/bison.texinfo (Prologue): Document that feature-test macros
3177 should be defined before any Bison declarations.
3178 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Put defns
3179 that depend on location.hh after, not before, Bison decls, since
3180 we now include location.hh after the first user prologue.
3182 * doc/bison.texinfo (Calc++ Parser): Fix memory leak reported by
3183 Sander Brandenburg in
3184 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00002.html>.
3185 Also, fix minor white space and comment issues.
3186 (Prologue): Mention that it's better to define feature-test macros
3187 before Bison declarations. Problem reported by Michael Deutschmann.
3189 * README-cvs: Fix typo: "&" should be "&&". Problem reported
3191 * m4/.cvsignore: Add argmatch.m4. Remove obstack.m4, strerror_r.m4.
3192 This adjusts to recent gnulib changes.
3194 2006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
3196 Finish implementation of per-type %destructor/%printer. Discussed
3198 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>
3200 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>.
3201 * NEWS (2.3+): Add a description of this feature to the default
3202 %destructor/%printer description.
3203 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise.
3204 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
3205 Invoke semantic_type_destructor_set or semantic_type_printer_set when a
3206 list node contains a semantic type.
3207 * src/symtab.c, src/symtab.h: Extend with a table that associates
3208 semantic types with their %destructor's and %printer's.
3209 (semantic_type_from_uniqstr, semantic_type_get,
3210 semantic_type_destructor_set, semantic_type_printer_set): New functions
3211 composing the public interface of that table.
3212 (symbol_destructor_get, symbol_destructor_location_get,
3213 symbol_printer_get, symbol_printer_location_get): If there's no
3214 per-symbol %destructor/%printer, look up the per-type before trying
3216 * tests/actions.at (Per-type %printer and %destructor): New test case.
3217 * tests/input.at (Default %printer and %destructor redeclared):
3218 Extend to check that multiple occurrences of %symbol-default in a
3219 single %destructor/%printer declaration is an error.
3220 (Per-type %printer and %destructor redeclared, Unused values with
3221 per-type %destructor): New test cases.
3223 2006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
3225 Require default %destructor/%printer to be declared using
3226 %symbol-default instead of an empty symbol list, and start working on
3227 new per-type %destructor/%printer. Discussed at
3228 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00007.html>.
3229 * NEWS (2.3+): Add %symbol-default to example.
3230 * bison.texinfo (Freeing Discarded Symbols): Likewise.
3231 (Table of Symbols): Add entry for %symbol-default.
3232 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): New token.
3233 (generic_symlist, generic_symlist_item): New nonterminals for creating
3234 a list in which each item is a symbol, semantic type, or
3236 (grammar_declaration): Use generic_symlist in %destructor and %printer
3237 declarations instead of symbols.1 or an empty list.
3238 (symbol_declaration, precedence_declaration, symbols.1): Update actions
3239 for changes to symbol_list.
3240 * src/reader.c: Update for changes to symbol_list.
3241 * src/scan-code.l: Likewise.
3242 * src/scan-gram.l: Scan new PERCENT_SYMBOL_DEFAULT token.
3243 * src/symlist.c, src/symlist.h: Extend such that a list node may
3244 represent a semantic type or a %symbol-default in addition to just an
3245 ordinary symbol. Add switched functions for setting %destructor's and
3247 * tests/actions.at, tests/input.at: Add %symbol-default to all default
3248 %destructor/%printer declarations.
3250 2006-08-23 Joel E. Denny <jdenny@ces.clemson.edu>
3252 Whether the default %destructor/%printer applies to a particular symbol
3253 isn't a question of whether the user *declares* that symbol (in %token,
3254 for example). It's a question of whether the user by any means
3255 *defines* the symbol at all (by simply using a char token, for
3256 example). $end is defined by Bison whereas any other token with token
3257 number 0 is defined by the user. The error token is always defined by
3258 Bison regardless of whether the user declares it with %token, but we
3259 may one day let the user define error as a nonterminal instead.
3260 * NEWS (2.3+): Say "user-defined" instead of "user-declared".
3261 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise, and document
3262 the meaning of "user-defined".
3263 * tests/actions.at (Default %printer and %destructor for user-declared
3264 end token): Rename to...
3265 (Default %printer and %destructor for user-defined end token): ...
3268 * src/symtab.c (symbol_destructor_get, symbol_printer_get): In the
3269 computation of whether to apply the default, don't maintain a list of
3270 every Bison-defined symbol. Instead, just check for a first character
3271 of '$', which a user symbol cannot have, and check for the error token.
3273 2006-08-21 Joel E. Denny <jdenny@ces.clemson.edu>
3275 Don't apply the default %destructor or %printer to the error token,
3276 $undefined, or $accept. This change fits the general rule that the
3277 default %destructor and %printer are only for user-declared symbols,
3278 and it solves several difficulties that are described in the new test
3280 * src/symtab.c (symbol_destructor_get, symbol_printer_get): Implement.
3281 * tests/actions.at (Default %printer and %destructor are not for error
3282 or $undefined, Default %printer and %destructor are not for $accept):
3285 2006-08-19 Joel E. Denny <jdenny@ces.clemson.edu>
3287 Allow %start after the first rule.
3288 * src/reader.c (grammar_current_rule_begin): Don't set the start symbol
3289 when parsing the first rule.
3290 (check_and_convert_grammar): Search for it here after all grammar
3291 declarations have been parsed. Skip midrules, which have dummy LHS
3293 * src/symtab.c (symbol_is_dummy): New function.
3294 * src/symtab.h (symbol_is_dummy): Declare it.
3295 * tests/input.at (%start after first rule): New test.
3297 2006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
3299 Redo some of the previous commit: add back the ability to use
3300 non-aliased/undeclared string literals since it might be useful to
3301 those declaring %token-table.
3302 * src/reader.c (check_and_convert_grammar): Undo changes in previous
3303 commit: don't worry about complaints from symbols_pack.
3304 * src/symtab.c (symbol_new, symbol_class_set,
3305 symbol_check_alias_consistency): Undo changes in previous commit: count
3306 each string literal as a new symbol and token, assign it a symbol
3307 number, and don't complain about non-aliased string literals.
3308 (symbols_pack): Since symbol_make_alias still does not decrement symbol
3309 and token counts but does still set aliased tokens to the same number,
3310 symbol_pack_processor now leaves empty slots in the symbols array.
3312 * tests/regression.at (Undeclared string literal): Remove test case
3313 added in previous commit since non-aliased string literals are allowed
3315 (Characters Escapes, Web2c Actions): Undo changes in previous commit:
3316 remove unnecessary string literal declarations.
3317 * tests/sets.at (Firsts): Likewise.
3319 2006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
3321 Don't allow an undeclared string literal, but allow a string literal to
3322 be used before its declaration.
3323 * src/reader.c (check_and_convert_grammar): Don't invoke packgram if
3324 symbols_pack complained.
3325 * src/symtab.c (symbol_new): Don't count a string literal as a new
3327 (symbol_class_set): Don't count a string literal as a new token, and
3328 don't assign it a symbol number since symbol_make_alias does that.
3329 (symbol_make_alias): It's not necessary to decrement the symbol and
3330 token counts anymore. Don't assume that an alias declaration occurs
3331 before any uses of the identifier or string, and thus don't assert that
3332 one of them has the highest symbol number so far.
3333 (symbol_check_alias_consistency): Complain if there's a string literal
3334 that wasn't declared as an alias.
3335 (symbols_pack): Bail if symbol_check_alias_consistency failed since
3336 symbol_pack asserts that every token has been assigned a symbol number
3337 although undeclared string literals have not.
3338 * tests/regression.at (String alias declared after use, Undeclared
3339 string literal): New test cases.
3340 (Characters Escapes, Web2c Actions): Declare string literals as
3342 * tests/sets.at (Firsts): Likewise.
3344 2006-08-14 Joel E. Denny <jdenny@ces.clemson.edu>
3346 In the grammar scanner, STRING_FINISH unclosed constructs and return
3347 them to the parser in order to improve error messages.
3348 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER,
3349 SC_BRACED_CODE, SC_PROLOGUE): Implement.
3350 * tests/input.at (Unclosed constructs): New test case.
3351 * tests/regression.at (Invalid inputs): Update now that unclosed %{ is
3354 * src/scan-gram.h, src/scan-gram.l (gram_last_braced_code_loc): Remove
3357 2006-08-13 Joel E. Denny <jdenny@ces.clemson.edu>
3359 Handle string aliases for character tokens correctly.
3360 * src/symtab.c (symbol_user_token_number_set): If the token has an
3361 alias, check and set its alias's user token number instead of its own,
3362 which is set to indicate the alias. Previously, every occurrence of
3363 the character token in the grammar overwrote that alias indicator with
3365 * tests/input.at (String aliases for character tokens): New test.
3367 2006-08-12 Joel E. Denny <jdenny@ces.clemson.edu>
3369 * src/parse-gram.y: Add `%expect 0' so we don't overlook conflicts.
3371 2006-08-11 Paul Eggert <eggert@cs.ucla.edu>
3373 * bootstrap: Put in need-ngettext argument to AM_GNU_GETTEXT,
3374 to prevent failures when building on older platforms.
3375 Check for autopoint failure.
3376 Set XGETTEXT_OPTIONS to values that check for C format strings,
3377 so that translators are warned about them (this also helps
3378 prevent core dumps).
3380 * lib/subpipe.c (create_subpipe): Use new gnulib pipe_safer
3381 function, since it simplifies our code a bit.
3383 * configure.ac (AC_ARG_ENABLE): Use -Wextra -Wno-sign-compare
3384 rather than -W, so we don't get bogus warnings about sign comparisons.
3385 Add -Wpointer-arith, since that warning is useful (it reports code
3386 that does not conform to C89 and that some compilers reject).
3387 * data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c: Undo latest change,
3388 since it's no longer needed.
3390 2006-08-10 Joel E. Denny <jdenny@ces.clemson.edu>
3392 Clean up scanners a bit.
3393 * src/flex-scanner.h (FLEX_NO_OBSTACK): New macro that blocks obstack
3394 definitions so gcc won't warn when obstack_for_string is unused.
3395 * src/scan-code.l: config.h and system.h are already #include'd by
3396 scan-code-c.c, so get rid of them here.
3397 * src/scan-gram.l: Likewise.
3398 * src/scan-skel.l: Likewise, and use flex-scanner.h without obstack
3399 definitions rather than duplicating the rest of it.
3400 * src/scan-gram-c.c, scan-skel-c.c: #include "system.h".
3402 2006-08-09 Joel E. Denny <jdenny@ces.clemson.edu>
3404 Suppress signed/unsigned comparison warnings for yycheck.
3405 * data/c.m4 (b4_safest_int_type): New macro.
3406 * data/glr.c, data/lalr1.cc: Wherever you compare yycheck[i] against
3407 a signed int type, cast it to b4_safest_int_type first.
3408 * data/yacc.c: Likewise.
3409 (b4_safest_int_type): Overwrite the one from c.m4 since b4_int_type is
3412 2006-08-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
3414 * doc/bison.texinfo: Fix some typos.
3416 2006-08-02 Paul Eggert <eggert@cs.ucla.edu>
3418 * m4/.cvsignore: Add inttypes_h.m4,lib-ld.m4, lib-prefix.m4,
3419 po.m4, stdint_h.m4, uintmax_t.m4, ulonglong.m4, warning.m4.
3421 * bootstrap (gnulib_tool): Stop using --assume-autoconf;
3422 the latest gnulib does this a different way.
3423 (get_translations): Sharuzzaman Ahmat Raslan reported that the ms
3424 translation was patched, so stop omitting it.
3426 2006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
3428 Enable declaration of default %printer/%destructor. Make the parser
3429 use these for all user-declared grammar symbols for which the user does
3430 not declare a specific %printer/%destructor. Thus, the parser uses it
3431 for token 0 if the user declares it but not if Bison generates it as
3432 $end. Discussed starting at
3433 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>,
3434 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>,
3436 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>.
3437 * NEWS (2.3+): Mention.
3438 * doc/bison.texinfo (Actions in Mid-Rule): It's no longer impossible to
3439 declare a %destructor for a mid-rule's semantic value. It's just
3440 impossible to declare one specific to it.
3441 (Freeing Discarded Symbols): Mention that @$ can be used in %destructor
3442 code. Describe default %destructor form.
3443 * src/parse-gram.y (grammar_declaration): Parse default
3444 %printer/%destructor declarations.
3445 * src/output.c (symbol_destructors_output): Use symbol_destructor_get
3446 and symbol_destructor_location_get rather than accessing the destructor
3447 and destructor_location members of struct symbol.
3448 (symbol_printers_output): Likewise but for %printer's.
3449 * src/reader.c (symbol_should_be_used): Likewise but for %destructor's
3451 * src/symtab.c (default_destructor, default_destructor_location,
3452 default_printer, default_printer_location): New static global
3453 variables to record the default %destructor and %printer.
3454 (symbol_destructor_get, symbol_destructor_location_get,
3455 symbol_printer_get, symbol_printer_location_get): New functions to
3456 compute the appropriate %destructor and %printer for a symbol.
3457 (default_destructor_set, default_printer_set): New functions to set the
3458 default %destructor and %printer.
3459 * src/symtab.h: Prototype all those new functions.
3460 * tests/actions.at (Default %printer and %destructor): New test to
3461 check that the right %printer and %destructor are called, that they're
3462 not called for $end, and that $$ and @$ work correctly.
3463 (Default %printer and %destructor for user-declared end token): New
3464 test to check that the default %printer and %destructor are called for
3465 a user-declared end token.
3466 * tests/input.at (Default %printer and %destructor redeclared, Unused
3467 values with default %destructor): New tests to check related grammar
3468 warnings and errors.
3470 2006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
3472 Clean up handling of %destructor for the end token (token 0).
3473 Discussed starting at
3474 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>
3476 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00013.html>.
3478 Make the skeletons consistent in how they pop the end token and invoke
3480 * data/glr.c (yyrecoverSyntaxError, yyparse): Don't pop the start
3481 state, which has token number 0, since this would invoke the
3482 %destructor for the end token.
3483 * data/lalr1.cc (yy::parser::parse): Don't check for the final state
3484 until after shifting the end token, or else it won't be popped.
3485 * data/yacc.c (yyparse): Likewise.
3487 * data/glr.c (yyparse): Clear the lookahead after shifting it even when
3488 it's the end token. Upon termination, destroy an unshifted lookahead
3489 even when it's the end token.
3490 * data/lalr1.cc (yy::parser::parse): Likewise.
3491 * data/yacc.c (yyparse): Likewise.
3493 * src/reader.c (packgram): Don't check rule 0. This suppresses unused
3494 value warnings for the end token when the user gives the end token a
3497 * tests/actions.at (Printers and Destructors): Test all the above.
3499 2006-07-24 Paul Eggert <eggert@cs.ucla.edu>
3501 Update to latest gnulib and gettext versions.
3502 * bootstrap (gnulib-modules): Remove hard-locale, stdio-safer.
3504 (gnulib_files): Add m4/warning.m4. Don't worry about files
3505 overwritten by autopoint.
3506 Replace gt_INTL_SUBDIR_CORE with an empty body in m4/gettext_gl.m4.
3507 Suppress "id", "ms", "tr" translations for now, since gettext 0.15
3509 Don't use autoreconf; instead, invoke autopoint etc. by hand,
3510 so that we can remove the intl files at a better time.
3511 (intl_files_to_remove): Remove aclocal.m4, since it gets
3512 rebuilt anyway. Remove m4/inttypes_h.m4, m4/inttypes.m4,
3513 m4/isc-posix.m4, m4/lib-ld.m4, m4/lib-prefix.m4, m4/po.m4,
3514 m4/stdint_h.m4, m4/uintmax_t.m4, m4/ulonglong.m4.
3515 Add m4/inttypes-h.m4, m4/lock.m4, m4/visibility.m4.
3516 Remove datarootdir hack; no longer needed.
3517 * configure.ac: Use gl_WARNING_CFLAGS rather than BISON_WARNING.
3518 (AM_GNU_GETTEXT_VERSION): Bump from 0.12 to 0.15.
3519 * lib/.cvsignore: Remove hard-locale.c, hard-locale.h, strdup.c,
3521 * m4/.cvsignore: Remove hard-locale.m4, strdup.m4.
3522 * m4/warning.m4: Remove from CVS, since we now use gnulib's version.
3524 2006-07-20 Paul Eggert <eggert@cs.ucla.edu>
3526 * bootstrap: Adjust to today's change to gnulib-tool by invoking
3527 it with --assume-autoconf='latest-stable'.
3529 2006-07-13 Joel E. Denny <jdenny@ces.clemson.edu>
3531 * src/parse-gram.y (grammar_declaration): Don't confuse Doxygen (at
3532 least 1.4.7 and 1.4.4) by putting a #line between `typedef union
3534 * src/muscle_tab.h (muscle_grow): Replace the header comments with
3535 those from muscle_tab.c since the old ones are misleading.
3537 2006-07-13 Akim Demaille <akim@epita.fr>
3539 Support %define "KEY" {VALUE}.
3540 * src/scan-code.h, src/scan-code.l (translate_action)
3541 (translate_rule_action, translate_symbol_action, translate_code):
3542 Return char *, not const char *.
3543 * src/parse-gram.y (declaration): Rename as...
3544 (prologue_declaration): this.
3545 (string_content): Remove this nonterminal, use STRING.
3546 (braceless, content, content.opt): New nonterminal.
3548 (%define): Now accept content.opt, i.e., accept also BRACED_CODE
3550 * src/scan-gram.l (getargs.h): Don't include it.
3552 2006-07-12 Paul Eggert <eggert@cs.ucla.edu>
3554 * data/lalr1.cc (YYCDEBUG): Use 'if (yydebug_) (*yycdebug_)'
3555 rather than a for-loop that declares a local bool variable. This
3556 should work around a compatibility problem with a Cray x1e C++
3557 compiler reported by Hung Nguyen in
3558 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00022.html>.
3559 The for-loop was introduced in the 2004-11-17 change but I don't
3560 know why it was needed.
3562 2006-07-12 Akim Demaille <akim@epita.fr>
3564 * data/c.m4: Comment changes.
3566 2006-07-10 Akim Demaille <akim@lrde.epita.fr>
3568 * src/complain.c (error_message, ERROR_MESSAGE): New.
3570 (fatal_at, fatal, warn_at, warn, complain_at, complain): these.
3571 * src/complain.h, src/complain.c (warning_issued): Remove, unused.
3573 2006-07-09 Paul Eggert <eggert@cs.ucla.edu>
3575 * NEWS: Instead of %union, you can define and use your own union type
3576 YYSTYPE if your grammar contains at least one <type> tag.
3577 Your YYSTYPE need not be a macro; it can be a typedef.
3578 * doc/bison.texinfo (Value Type, Multiple Types, Location Type):
3579 (Union Decl, Decl Summary): Document this.
3580 * data/glr.c (YYSTYPE): Implement this.
3581 * data/glr.cc (YYSTYPE): Likewise.
3582 * data/lalr1.cc (YYSTYPE): Likewise.
3583 * data/yacc.c (YYSTYPE): Likewise.
3584 * src/output.c (prepare): Output tag_seen_flag.
3585 * src/parse-gram.y (declaration, grammar_declaration):
3586 Use 'union_seen' rather than 'typed' to determine whether
3587 %union has been seen, since grammars can now be typed without
3589 (symbol_declaration, type.opt, symbol_def):
3590 Keep track of whether a tag has been seen.
3591 * src/reader.c (union_seen, tag_seen): New vars.
3593 * src/reader.h (union_seen, tag_seen, typed): Likewise.
3594 * src/scan-code.l (untyped_var_seen): New variable.
3595 (handle_action_dollar): Adjust to above changes.
3596 (handle_action_dollar, handle_action_at):
3597 Improve overflow checking for outlandish numbers.
3598 * tests/input.at (AT_CHECK_UNUSED_VALUES): Redo test to
3599 avoid new diagnostics generated by above changes.
3600 * tests/regression.at (YYSTYPE typedef): Add test to check
3601 for type tags without %union.
3603 * src/symlist.c (symbol_list_length): Return int, not unsigned
3604 int, since callers expect int. This may need to get revisited
3605 once we have proper integer overflow checking.
3607 * src/scan-gram.h (gram_scanner_cursor): Remove decl, since this
3608 object is now static.
3610 * src/getargs.c (flags_argmatch): Return void, not int,
3611 to pacify ./configure --enable-gcc-warnings.
3613 * src/flex-scanner.h (STRING_FREE): Don't use FLEX_PREFIX (last_string)
3614 since last_string is already defined to FLEX_PREFIX (last_string).
3616 2006-07-09 Akim Demaille <akim@lrde.epita.fr>
3618 Implement --warnings/-W.
3619 * src/getargs.c (report_argmatch, trace_argmatch): Remove,
3621 (flags_argmatch, FLAGS_ARGMATCH): this new function and macro.
3623 * src/getargs.h, src/getargs.c (warnings, warnings_flags)
3624 (warnings_args, warnings_types): New.
3625 (getargs, short_options, long_options): Accept -W/--warnings.
3626 Sort the options by alphabetical order, upper case letter right
3627 before its lower case.
3629 2006-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
3631 Change %merge result type clash warnings to errors. Discussed at
3632 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00026.html>.
3633 * src/reader.c (record_merge_function_type): Use complain_at.
3634 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
3635 declared later): Update test case results.
3637 2006-07-09 Akim Demaille <akim@lrde.epita.fr>
3639 * src/getargs.h, src/getargs.c: Swap --report and --trace handling
3640 to be in alphabetical order.
3641 (trace_args): Spelling fixes.
3643 2006-07-09 Paul Eggert <eggert@cs.ucla.edu>
3645 * data/yacc.c (YYID, yy_stack_print): Prefix local vars with "yy"
3646 so they don't collide with user-defined macros.
3647 (yy_stack_print): Don't assume that yytype_int16 promotes to int;
3648 this was never guaranteed, and now that we're using gnulib stdint,
3649 which defines int_fast16_t to long int, the problem is exposed.
3651 2006-07-08 Paul Eggert <eggert@cs.ucla.edu>
3653 * data/c.m4 (b4_basename): Simplify a bit, since we don't
3654 need the full POSIX semantics (and weren't implementing them
3657 Adjust to Autoconf 2.60 and today's gnulib.
3658 * bootstrap (gnulib_modules): Add stdint.
3659 Remove special case for m4/onceonly_2_57.m4, since gnulib-tool
3660 no longer copies it.
3661 (intl_files_to_remove): Remove m4/longlong.m4 and m4/wchar_t.m4,
3662 since stdint needs the former and wcwidth (which is now required
3663 by mbswidth) needs the latter.
3664 Append 'datarootdir = @datarootdir@' to po/Makefile.in.in, to
3665 work around a compatibility glitch between gettext 0.14.6 and
3667 * configure.ac (AC_PREREQ): Require Autoconf 2.60.
3668 Do not check for uintptr_t, since new stdint module does the right
3670 * lib/.cvsignore: Remove alloca.c, alloca.h, alloca_.h.
3671 Add stdint.h, stdint_.h, wcwidth.h.
3672 * m4/.cvsignore: Remove alloca.m4, onceonly.m4.
3673 Add absolute-header.m4, double-slash-root.m4, longlong.m4,
3674 stdint.m4, wchar_t.m4, wcwidth.m4.
3675 * src/files.c: Include <dirname.h> and <stdio-safer.h> in the
3676 usual order for ../lib/*.h files.
3677 (file_name_split): Use last_component, not base_name, to adjust
3679 * src/parse-gram.h: Include <strverscmp.h> in the usual order
3680 for ../lib/*.h files.
3681 (YYTYPE_INT16, YYTYPE_INT8, YYTYPE_UINT16, YYTYPE_UINT8):
3682 Define unconditionally, since we now assume the stdint module.
3683 * src/scan-skel.l: Include <dirname.h>.
3684 (BASE_QPUTS): Use last_component, not base_name.
3685 * src/system.h: Include <unlocked-io.h> in the usual order
3686 for ../lib/*.h files. Include <stdint.h> unconditionally,
3687 since we now use the stdint module.
3688 (uintptr_t): Declare if UINTPTR_MAX is not defined, not
3689 HAVE_UINTPTR_T, since we now use the stdint module.
3690 (base_name): Remove decl, since files now include <dirname.h>
3693 2006-07-08 Akim Demaille <akim@lrde.epita.fr>
3695 * data/c.m4 (b4_location_initial_column, b4_location_initial_line):
3697 * data/yacc.c, data/glr.c, data/location.cc: Use them.
3698 * NEWS, doc/bison.texinfo: The initial column and line are 1 by
3700 * tests/calc.at: Adjust.
3702 2006-07-08 Akim Demaille <akim@lrde.epita.fr>
3704 * data/c.m4 (b4_basename): New.
3705 (b4_syncline): Also output the location of its invocation (from
3707 (b4_user_action, b4_define_user_action, b4_user_actions)
3708 (b4_user_initial_action, b4_user_post_prologue, b4_user_start_header)
3709 (b4_user_stype): New.
3710 * data/yacc.c, data/glr.c, data/lalr1.cc, data/glr.cc: Use them.
3712 2006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
3714 In the grammar file, the first column is 1 not 0 on the first line as
3715 on every other line.
3716 * src/parse-gram.y (%initial-action): Initialize @$ correctly.
3717 * tests/input.at (Torturing the Scanner): Update output.
3719 * src/scan-gram.l (scanner_cursor): Declare it static.
3721 2006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
3723 In warnings, say "previous declaration" rather than "first
3725 * src/symtab.c (redeclaration): Do that here.
3726 * src/reader.c (record_merge_function_type): In the case of a result
3727 type clash, report the previous declaration rather than the very first
3728 one in the grammar file.
3729 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
3730 declared later): Add a third declaration to check this behavior.
3731 * tests/input.at (Incompatible Aliases): Update output.
3733 2006-06-27 Akim Demaille <akim@epita.fr>
3735 * doc/Doxyfile.in: New.
3736 * doc/Makefile.am: Use it.
3737 * src/lalr.h, src/symtab.h: Initial doxygenation.
3739 2006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
3741 Don't miss %merge result type warnings just because the LHS types are
3742 declared after the %merge. This continues the effort of the previous
3744 * src/reader.c (get_merge_function): Don't set the merger type yet.
3745 (record_merge_function_type): New function for setting the merger type
3746 and checking for clashes.
3747 (grammar_current_rule_merge_set): Set the location of the %merge for
3749 (packgram): Invoke record_merge_function_type for each rule now that
3750 all symbol type declarations have been parsed.
3751 * src/reader.h (merger_list.type_declaration_location): New member
3752 storing the location of the first %merge from which the type for this
3753 merging function was derived.
3754 * src/symlist.h (symbol_list.merger_declaration_location): New member
3755 storing the location of a rule's %merge, if any.
3756 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
3757 declared later): New test to catch the error fixed by the above patch.
3759 2006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
3761 Get action warnings (grammar_rule_check) right even when symbol
3762 declarations appear after the rules. Discussed at
3763 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00108.html>
3765 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00151.html>.
3766 Don't mistake the type of $$ in a midrule to be that of its parent
3768 * src/reader.c (grammar_current_rule_end): Don't invoke
3769 grammar_rule_check yet since not all symbol declarations may have been
3771 (grammar_midrule_action): Likewise.
3772 Don't record whether the midrule's $$ has been used yet since actions
3773 haven't been translated yet.
3774 Record the midrule's parent rule and its RHS index within the parent
3776 (grammar_current_rule_action_append): Don't translate the action yet
3777 since not all symbol declarations may have been parsed yet and, thus,
3778 warnings about types for $$, $n, @$, and @n can't be reported yet.
3779 (packgram): Translate the action and invoke grammar_rule_check now that
3780 all symbol declarations have been parsed.
3781 * src/scan-code.l (handle_action_dollar): Now that this is invoked
3782 after parsing the entire grammar file, the symbol list here in the case
3783 of a midrule is actually the midrule's empty RHS, so reference its
3784 parent rule's RHS where necessary.
3785 On the other hand, now that you can already know it's a midrule, you
3786 aren't forced to think $$ has the same type as its parent rule's $$.
3787 (handle_action_at): In the case of a midrule, reference the parent rule
3789 * src/symlist.c (symbol_list_new): Initialize new midrule-related
3791 (symbol_list_length): Now that this is invoked after all rules have
3792 been parsed, a NULL symbol (rather than a NULL symbol list node)
3793 terminates a rule. symbol_list_print already does this correctly.
3794 * src/symlist.h (symbol_list.midrule_parent_rule,
3795 symbol_list.midrule_parent_rhs_index): New members so that midrules can
3796 remember their relationships with their parents.
3797 * tests/input.at (Type Clashes): Extend to catch the midrule $$ error
3798 fixed by the above patch.
3799 (_AT_UNUSED_VALUES_DECLARATIONS, AT_CHECK_UNUSED_VALUES): New m4 macros
3801 (Unused values): ... this old test case and...
3802 (Unused values before symbol declarations): ... this new test case.
3803 This one is the same as `Unused values' except that all symbol
3804 declarations appear after the rules in order to catch the rest of the
3805 errors fixed by the above patch.
3807 2006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
3810 * src/reader.c (current_rule): Declare it static since it's no longer
3811 used outside this file.
3812 (grammar_current_rule_action_append): Remove redundant arguments from
3813 translate_rule_action invocation.
3814 * src/reader.h (current_rule): Remove this unused extern.
3815 * src/scan-code.h (translate_rule_action): Remove redundant arguments.
3816 * src/scan-code.l (translate_rule_action): Likewise.
3818 2006-06-25 Joel E. Denny <jdenny@ces.clemson.edu>
3820 Clean up yesterday's patch.
3821 * parse-gram.y (rhs): Move grammar_midrule_action invocation from here
3823 * src/reader.c (grammar_current_rule_action_append): ... here for
3824 consistency with grammar_current_rule_symbol_append.
3825 * tests/regression.at (Braced code in declaration in rules section):
3826 Make yyerror and yylex static as usual.
3828 2006-06-24 Joel E. Denny <jdenny@ces.clemson.edu>
3830 Fix bug that mistakes braced code in a declaration in the rules section
3831 to be a rule action. Mentioned at
3832 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00105.html>.
3833 * src/scan-gram.l: Move midrule action detection from the start of the
3834 scanning of any braced code to...
3835 * src/parse-gram.y (rhs): ... the parsing of braced code as a rule
3836 action. For readability, use $2 and @2 rather than the equivalent
3838 * tests/regression.at (Braced code in declaration in rules section):
3839 New test to catch the error fixed by the above patch.
3841 Work on code readability some.
3842 * src/scan-code.l (current_rule): Get rid of this misleading and
3843 redundant declaration: it's actually extern'ed in reader.h.
3844 (YY_DECL, code_lex, handle_action_dollar, handle_action_at,
3845 translate_action): Add a rule argument and use it instead of the global
3847 (translate_rule_action): This already receives current_rule through an
3848 argument, so pass it on to translate_action instead of assigning
3849 current_rule to current_rule.
3850 (translate_symbol_action, translate_code): Pass rule = NULL to
3853 2006-06-23 Joel E. Denny <jdenny@ces.clemson.edu>
3855 Rename %before-definitions to %start-header and %after-definitions to
3856 %end-header. Don't use these declarations to separate pre-prologue
3857 blocks from post-prologue blocks. Add new order-independent
3858 declarations %before-header and %after-header as alternatives to the
3859 traditional Yacc pre-prologue and post-prologue blocks. Discussed at
3860 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00110.html>.
3861 * NEWS (2.3+): Update for these changes.
3862 * data/glr.c (b4_before_definitions): Update to...
3863 (b4_start_header): ... this.
3864 (b4_after_definitions): Update to...
3865 (b4_end_header): ... this.
3866 * data/glr.cc: Likewise.
3867 * data/lalr1.cc: Likewise.
3868 * data/yacc.c: Likewise.
3869 * doc/bison.texinfo (The prologue): Update names, and replace remaining
3870 prologue blocks with %*-header declarations.
3871 (Calc++ Parser): Likewise.
3872 (Decl Summary): Update names.
3873 (Table of Symbols): Update description.
3874 * src/parse-gram.y (PERCENT_AFTER_DEFINITIONS): Update to...
3875 (PERCENT_END_HEADER): ... this.
3876 (PERCENT_BEFORE_DEFINITIONS): Update to...
3877 (PERCENT_START_HEADER): ... this.
3878 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
3879 (declaration): Update token names and m4 macro names.
3880 When parsing %end-header and %start-header, invoke translate_code
3881 before muscle_code_grow, and no longer set global booleans to remember
3882 whether these declarations have been seen.
3883 Parse new %after-header and %before-header.
3884 * src/reader.c (before_definitions, after_definitions): Remove.
3885 (prologue_augment): Accept a new bool argument to specify whether to
3886 augment the pre-prologue or post-prologue.
3887 * src/reader.h (before_definitions, after_definitions): Remove these
3889 (prologue_augment): Add new bool argument.
3890 * src/scan-gram.l (PERCENT_AFTER_DEFINITIONS): Update to...
3891 (PERCENT_END_HEADER): ... this.
3892 (PERCENT_BEFORE_DEFINITIONS): Update to...
3893 (PERCENT_START_HEADER): ... this.
3894 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
3895 * tests/actions.at (Printers and Destructors): Update names.
3897 2006-06-22 Joel E. Denny <jdenny@ces.clemson.edu>
3899 Add comparison operators for C++ location classes. Discussed at
3900 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00092.html>.
3901 * data/c++.m4 (b4_define_location_comparison): New boolean %define
3902 declaration indicating whether filename_type has an operator==. If
3903 filename_type is `std::string', it defaults to `1', `0' otherwise.
3904 * data/location.cc: Iff b4_define_location_comparison is `1', add
3905 operator== and operator!= for class position and for class location.
3908 * src/scan-action.l: Remove unused file.
3909 * src/symtab.c (symbol_printer_set): Use printer_location not
3910 destructor_location.
3911 * src/symtab.h (struct symbol): Replace incorrect source comment for
3913 * tests/input.at (Incompatible Aliases): Update output with correct
3916 2006-06-20 Joel E. Denny <jdenny@ces.clemson.edu>
3918 Don't put the pre-prologue in the header file. For the yacc.c code
3919 file and the glr.c header and code files, move the pre-prologue before
3920 the token definitions. Add new %before-definitions and
3921 %after-definitions to declare code that will go in both the header file
3922 and code file. Discussed at
3923 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00000.html>,
3924 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00016.html>,
3926 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00055.html>.
3927 * NEWS (2.3+): Describe these changes.
3928 * data/glr.c (b4_pre_prologue): Move from within to before...
3929 (b4_shared_declarations): ... this.
3930 Add new b4_before_definitions before b4_token_enums.
3931 Add new b4_after_definitions at the end.
3932 * data/glr.cc (b4_pre_prologue): Replace with...
3933 (b4_before_definitions): ... this in the header file.
3934 (b4_after_definitions): New near the end of the header file.
3935 * data/lalr1.cc (b4_pre_prologue): Move from the header file to the
3936 code file right before including the header file.
3937 (b4_before_definitions): New in the previous position of
3938 b4_pre_prologue in the header file.
3939 (b4_after_definitions): New near the end of the header file.
3940 * data/yacc.c: Clean up some m4 quoting especially in the header file.
3941 (b4_token_enums_defines): In the code file, move to right before
3942 YYSTYPE for consistency with the header file.
3943 (b4_before_definitions): New right before b4_token_enums_defines in
3944 both the header and code file.
3945 (b4_after_definitions): New right after YYLTYPE and yylloc in both the
3946 header and code file.
3947 * doc/bison.texinfo (Prologue): Show use of %before-definitions instead
3948 of prologues for %union dependencies.
3949 (Decl Summary): In %defines description, mention the effect of
3950 %before-definitions and %after-definitions on the header file.
3951 (Calc++ Parser): Forward declare driver in a %before-definitions rather
3952 than in the pre-prologue so that make check succeeds.
3953 (Table of Symbols): Add entries for %before-definitions and
3955 * src/parse-gram.y (PERCENT_BEFORE_DEFINITIONS): New token for
3956 %before-definitions.
3957 (PERCENT_AFTER_DEFINITIONS): New token for %after-definitions.
3958 (declaration): Parse those declarations and append to
3959 b4_before_definitions and b4_after_definitions, respectively.
3960 * src/reader.c (before_definitions, after_definitions): New bools to
3961 track whether those declarations have been seen.
3962 (prologue_augment): Add to the post-prologue if %union,
3963 %before-definitions, or %after-definitions has been seen.
3964 * src/reader.h (before_definitions, after_definitions): New extern's.
3965 * src/scan-gram.l: Scan the new declarations.
3966 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Place the second
3967 prologue block in a %before-definitions or a %after-definitions based
3968 on whether the %union is declared.
3969 * tests/regression.at (Early token definitions with --yacc, Early token
3970 definitions without --yacc): Move tests for token definitions into the
3971 post-prologue since token names are no longer defined in the
3974 2006-06-20 Akim Demaille <akim@epita.fr>
3976 * src/symtab.h, src/symtab.c (symbol_from_uniqstr): New.
3977 (symbol_get): Use it.
3978 * src/parse-gram.y: Use it.
3980 2006-06-19 Joel E. Denny <jdenny@ces.clemson.edu>
3982 * src/scan-gram.l: Remove unused declaration of last_string_1 so the
3983 build succeeds when configured with --enable-gcc-warnings.
3985 2006-06-19 Paul Eggert <eggert@cs.ucla.edu>
3987 * src/parse-gram.y (char_name): New function.
3988 (CHAR, STRING, string_content): For %printer, properly escape.
3989 (ID): Prefer fputs to fprintf.
3990 (id): Reindent to be consistent with other rules.
3991 Properly quote char.
3993 The Translation Project changed its way of publishing translations
3994 to maintainers. I haven't received any responses to my request
3995 for supporting the old way, or for documenting the new way. I
3996 have modified 'bootstrap' to use screen scraping
3997 (in this case, HTML scraping). This is unreliable and inelegant,
3998 but I don't see any better way. Yuck.
3999 * bootstrap (TP_URL, WGET_COMMAND): New vars.
4000 (get_translations): New function, which uses HTML scraping to
4001 deduce locations of latest translations.
4002 Use this function to grab both bison and bison-runtime .po files.
4003 Don't bother priming the pump for the runtime-po domain any more,
4004 as it's now translated better than bison is.
4006 2006-06-19 Akim Demaille <akim@epita.fr>
4008 * src/scan-gram.l: No longer "parse" things after `%union' until
4009 `{'. Rather, return a single "%union" token.
4010 No longer make symbols: return strings, and leave the conversion
4011 to symbols to the parser.
4012 (SC_PRE_CODE, token_type): Remove.
4013 * src/parse-gram.y (%union): New field `character'.
4016 (ID, ID_COLON): Now that the scanner no longer makes them
4017 identifiers, adjust all uses to invoke symbol_get.
4018 (id_colon): New, wraps the conversion from string to symbol.
4019 (%union): Accept a possible union_name.
4020 (symbol): Now can be a char.
4021 * data/c.m4 (b4_union_name): Leave a default value.
4022 * data/glr.c, data/yacc.c: Use it.
4024 2006-06-11 Joel E. Denny <jdenny@ces.clemson.edu>
4026 For associating token numbers with token names for "yacc.c", don't use
4027 #define statements unless `--yacc' is specified; always use enum
4028 yytokentype. Most important discussions start at:
4029 <http://lists.gnu.org/archive/html/bison-patches/2005-09/msg00053.html>,
4030 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00052.html>,
4032 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00043.html>.
4033 * NEWS (2.3+): Mention.
4034 * data/c.m4 (b4_yacc_if): New.
4035 (b4_token_enums_defines): Use b4_yacc_if to decide whether to add the
4037 * doc/bison.texinfo (Bison Options): Describe the effect of `--yacc'
4038 on token name definitions.
4039 * src/getargs.c (usage): Capitalize `Yacc' in English.
4040 * src/output.c (prepare): Define b4_yacc_flag.
4041 * tests/regression.at (Early token definitions): Test that tokens names
4042 are defined before the pre-prologue not just before the post-prologue.
4043 Remove this test case and copy to...
4044 (Early token definitions with --yacc): ... this to test #define's.
4045 (Early token definitions without --yacc): ... and this to test enums.
4047 2006-06-11 Paul Eggert <eggert@cs.ucla.edu>
4049 * NEWS: Reword the post-2.3 change to not be so optimistic about
4050 removing the old "look-ahead" spelling.
4051 Update previous look-ahead/lookahead change reports.
4052 * REFERENCES: look-ahead -> lookahead (since that's
4053 what he actually wrote).
4054 * doc/refcard.tex: look ahead -> lookahead,
4055 look-ahead -> lookahead
4057 2006-06-09 Joel E. Denny <jdenny@ces.clemson.edu>
4059 For consistency, use `lookahead' instead of `look-ahead' or
4060 `look_ahead'. Discussed starting at
4061 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00049.html>
4063 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00017.html>.
4064 * NEWS: For the next release, note the change to `--report'.
4065 * TODO, doc/bison.1: Update English.
4066 * doc/bison.texinfo: Update English.
4067 (Understanding Your Parser, Bison Options): Document as
4068 `--report=lookahead' rather than `--report=look-ahead'.
4069 * src/conflicts.c: Update English in comments.
4070 (lookahead_set): Rename from look_ahead_set.
4071 (flush_reduce): Rename argument look_ahead_tokens to lookahead_tokens.
4072 (resolve_sr_conflict): Rename local look_ahead_tokens to
4073 lookahead_tokens, and update other uses.
4074 (flush_shift, set_conflicts, conflicts_solve, count_sr_conflicts,
4075 count_rr_conflicts, conflicts_free): Update uses.
4076 * src/getargs.c (report_args): Move "lookahead" before alternate
4078 (report_types): Update uses.
4079 (usage): For `--report' usage description, state `lookahead' spelling
4080 rather than `look-ahead'.
4081 * src/getargs.h (report.report_lookahead_tokens): Rename from
4082 report_look_ahead_tokens.
4083 * src/lalr.c: Update English in comments.
4084 (compute_lookahead_tokens): Rename from compute_look_ahead_tokens.
4085 (state_lookahead_tokens_count): Rename from
4086 state_look_ahead_tokens_count.
4087 Rename local n_look_ahead_tokens to n_lookahead_tokens.
4088 (lookahead_tokens_print): Rename from look_ahead_tokens_print.
4089 Rename local n_look_ahead_tokens to n_lookahead_tokens.
4091 Update English in output.
4092 (add_lookback_edge, initialize_LA, lalr, lalr_free): Update uses.
4093 * src/print.c: Update English in comments.
4094 (lookahead_set): Rename from look_ahead_set.
4095 (print_reduction): Rename argument lookahead_token from
4097 (print_core, state_default_rule, print_reductions, print_results):
4099 * src/print_graph.c: Update English in comments.
4100 (print_core): Update uses.
4101 * src/state.c: Update English in comments.
4102 (reductions_new): Update uses.
4103 (state_rule_lookahead_tokens_print): Rename from
4104 state_rule_look_ahead_tokens_print, and update other uses.
4105 * src/state.h: Update English in comments.
4106 (reductions.lookahead_tokens): Rename from look_ahead_tokens.
4107 (state_rule_lookahead_tokens_print): Rename from
4108 state_rule_look_ahead_tokens_print.
4109 * src/tables.c: Update English in comments.
4110 (conflict_row, action_row): Update uses.
4111 * tests/glr-regression.at
4112 (Incorrect lookahead during deterministic GLR,
4113 Incorrect lookahead during nondeterministic GLR): Rename
4114 print_look_ahead to print_lookahead.
4115 * tests/torture.at: Update English in comments.
4116 (AT_DATA_LOOKAHEAD_TOKENS_GRAMMAR): Rename from
4117 AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR.
4118 (Many lookahead tokens): Update uses.
4119 * data/glr.c: Update English in comments.
4120 * lalr1.cc: Likewise.
4122 * src/conflicts.h: Likewise.
4123 * src/lalr.h: Likewise.
4124 * src/main.c: Likewise.
4125 * src/output.c: Likewise.
4126 * src/parse-gram.c: Likewise.
4127 * src/tables.h: Likewise.
4128 * tests/calc.at: Likewise.
4130 2006-06-08 Joel E. Denny <jdenny@ces.clemson.edu>
4132 * src/flex-scanner.h (yytext): Remove stray `*/' in #define.
4134 2006-06-07 Paul Eggert <eggert@cs.ucla.edu>
4136 * TODO: Add request from Nelson H. F. Beebe to be able to install
4137 Bison without installing the yacc script.
4139 2006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
4141 * src/flex-scanner.h: For the sake of Flex 2.5.4, don't #define yyleng
4142 and yytext if they're already #define'd.
4143 * src/flex-scanner.h, src/location.h: Move #include "system.h" to...
4144 * src/scan-code-c.c: ... here.
4145 * src/scan-code.l, src/scan-gram.l: ... and here. Also #include
4148 2006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
4150 Get Bison to build again when configured with --enable-gcc-warnings.
4151 * src/location.c, src/location.h, src/main.c, src/scan-code.l: Add some
4153 * src/scan-code.l (handle_action_dollar, handle_action_at): Rename
4154 loc argument as it shadows a global.
4155 * src/scan-gram.l: Remove stray comma that prevents boundary_set
4158 * src/.cvsignore: Add scan-code.c.
4160 2006-06-07 Akim Demaille <akim@epita.fr>
4162 * src/scan-gram.l: Move the "add a trailing ; to actions" code
4164 * src/scan-code.l: here.
4165 * tests/input.at (Torturing the Scanner): Fix another location
4168 2006-06-07 Akim Demaille <akim@epita.fr>
4170 * src/Makefile.am (BUILT_SOURCES): Fix the trailing backslash.
4172 2006-06-06 Akim Demaille <akim@epita.fr>
4174 Extract the parsing of user actions from the grammar scanner.
4175 As a consequence, the relation between the grammar scanner and
4176 parser is much simpler. We can also split "composite tokens" back
4178 * src/gram.h (ITEM_NUMBER_MAX, RULE_NUMBER_MAX): New.
4179 * src/scan-gram.l (add_column_width, adjust_location): Move to and
4181 * src/location.h, src/location.c (add_column_width)
4182 (location_compute): these.
4183 Fix the column count: the initial column is 0.
4184 (location_print): Be robust to ending column being 0.
4185 * src/location.h (boundary_set): New.
4186 * src/main.c: Adjust to scanner_free being renamed as
4188 * src/output.c: Include scan-code.h.
4189 * src/parse-gram.y: Include scan-gram.h and scan-code.h.
4191 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_INITIAL_ACTION)
4192 (PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Remove the {...} part,
4193 which is now, again, a separate token.
4194 Adjust all dependencies.
4195 Whereever actions with $ and @ are used, use translate_code.
4196 (action): Remove this nonterminal which is now useless.
4197 * src/reader.c: Include assert.h, scan-gram.h and scan-code.h.
4198 (grammar_current_rule_action_append): Use translate_code.
4199 (packgram): Bound check ruleno, itemno, and rule_length.
4200 * src/reader.h (gram_in, gram__flex_debug, scanner_cursor)
4201 (last_string, last_braced_code_loc, max_left_semantic_context)
4202 (scanner_initialize, scanner_free, scanner_last_string_free)
4203 (gram_out, gram_lineno, YY_DECL_): Move to...
4204 * src/scan-gram.h: this new file.
4205 (YY_DECL): Rename as...
4207 * src/scan-code.h, src/scan-code.l, src/scan-code-c.c: New.
4208 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
4209 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
4210 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
4211 Move these declarations, and...
4212 (obstack_for_string, STRING_GROW, STRING_FINISH, STRING_FREE):
4214 * src/flex-scanner.h: this new file.
4215 * src/scan-gram.l (rule_length, rule_length_overflow)
4216 (increment_rule_length): Remove.
4217 (last_braced_code_loc): Rename as...
4218 (gram_last_braced_code_loc): this.
4219 Adjust to the changes of the parser.
4220 Move all the handling of $ and @ into...
4221 * src/scan-code.l: here.
4222 * src/scan-gram.l (handle_dollar, handle_at): Remove.
4223 (handle_action_dollar, handle_action_at): Move to...
4224 * src/scan-code.l: here.
4225 * src/Makefile.am (bison_SOURCES): Add flex-scanner.h,
4226 scan-code.h, scan-code-c.c, scan-gram.h.
4227 (EXTRA_bison_SOURCES): Add scan-code.l.
4228 (BUILT_SOURCES): Add scan-code.c.
4229 (yacc): Be robust to white spaces.
4231 * tests/conflicts.at, tests/input.at, tests/reduce.at,
4232 * tests/regression.at: Adjust the column numbers.
4233 * tests/regression.at: Adjust the error message.
4235 2006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
4237 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
4238 Use Akim's wording from
4239 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00056.html>.
4241 2006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
4243 Between Bison releases, manually append `+' to the previous Bison
4244 release number, and use that as a signal to automatically print the
4245 ChangeLog's CVS Id keyword from --version. Discussed starting at
4246 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00028.html>.
4247 * ChangeLog: Add Id header.
4248 * configure.ac (AC_INIT): Append `+' to `2.3'.
4249 * src/.cvsignore: Add revision.c.
4250 * src/Makefile.am (bison_SOURCES): Add revision.c and revision.h.
4251 (BUILT_SOURCES): Add revision.c.
4252 (revision.c): New target rule. This file defines a new global variable
4253 named revision. It initializes it with either the Id from ChangeLog
4254 or, if VERSION doesn't contain `+', with the empty string.
4255 * src/getargs.c (version): Print the value of revision.
4256 * src/revision.h: Extern revision.
4258 2006-06-05 Paul Eggert <eggert@cs.ucla.edu>
4260 * NEWS: Version 2.3.
4261 * configure.ac (AC_INIT): Likewise.
4263 2006-05-30 Paul Eggert <eggert@cs.ucla.edu>
4265 * data/glr.c (YYRECOVERING): Define to be a function-like macro
4266 with no arguments, not as an object-like macro. This is for
4267 compatibility with data/yacc.c. Problem reported by John P. Hartmann in
4268 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00059.html>.
4269 * doc/bison.texinfo (Action Features, Error Recovery, Table of Symbols):
4272 2006-05-30 Joel E. Denny <jdenny@ces.clemson.edu>
4274 * src/getargs.c (usage): Back out yesterday's modification of the
4275 --help output so that we don't have to wait for translation before
4278 2006-05-29 Paul Eggert <eggert@cs.ucla.edu>
4280 * doc/bison.texinfo (Introduction): Don't say "GLR grammar".
4281 Problem reported by Akim Demaille.
4283 2006-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
4285 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
4287 2006-05-26 Paul Eggert <eggert@cs.ucla.edu>
4289 * data/yacc.c (yy_reduce_print): Omit trailing white space in
4290 generated source code. Problem reported by Frans Englich in
4291 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00049.html>.
4293 2006-05-22 Paul Eggert <eggert@cs.ucla.edu>
4295 * Makefile.maint (gzip_rsyncable, GZIP_ENV): Compute within the
4296 shell, not within 'make', so that 'make' by an ordinary builder
4297 (using GNU make) does not worry about configuring gzip. This also
4298 works around a bug reported independently by Keith Thompson and by
4299 Georg Schwarz, whereby gzip 1.2.4 --help would output usage on
4300 stderr rather than stdout, messing up the build logs.
4302 2006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
4304 * data/yacc.c (yyparse): Wrap the final return from yyparse inside YYID
4305 to make sure that YYID will never be unused. This fixes a 'make
4306 maintainer-check' failure caused by the recent changes to the 'Trivial
4307 grammars' test case, which caused g++ 4.1.0 to complain that YYID was
4309 * data/glr.c (yyparse): Wrap yyparse's return inside YYID just in case.
4311 2006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
4313 * data/glr.c (yyresolveLocations): Remove bogus YYASSERT that the
4314 state before an empty RHS is always resolved here. Only the location
4315 of that state is guaranteed to be resolved, and that's enough. This
4316 fixes the remaining bug reported by Derek M. Jones in
4317 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
4318 * tests/glr-regression.at (Uninitialized location when reporting
4319 ambiguity): Test the above case.
4320 Also, the embedded comments in this test case claim it checks the case
4321 of an empty RHS that has inherited the initial location. However, the
4322 corresponding LHS was already resolved, so yyresolveLocations didn't
4323 actually have reason to modify it. Fix this by forcing
4324 nondeterministic operation at the beginning of the parse.
4326 2006-05-20 Paul Eggert <eggert@cs.ucla.edu>
4328 * data/c.m4 (b4_yy_symbol_print_generate):
4329 (b4_yy_symbol_print_generate): Use 'YYSTYPE const' rather than
4330 'const YYSTYPE', and similarly for YYLTYPE. This fixes one
4331 of the bugs reported today by Derek M Jones in
4332 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
4333 * doc/bison.texinfo (Value Type): Document that YYSTYPE must be
4334 defined to be a type name without parens or brackets.
4335 (Location Type): Similarly for YYLTYPE.
4336 * tests/regression.at (Trivial grammars): Put in a test for this
4337 bug that will be caught by 'make maintainer-check' (though not,
4338 alas, by 'make check' unless your compiler is picky).
4340 2006-05-19 Paul Eggert <eggert@cs.ucla.edu>
4342 * NEWS: Version 2.2.
4343 * configure.ac (AC_INIT): Likewise.
4345 2006-05-17 Joel E. Denny <jdenny@ces.clemson.edu>
4347 * data/glr.c (yyreportTree): Make room in yystates for the state
4348 preceding the RHS. This fixes the segmentation fault reported by Derek
4350 <http://lists.gnu.org/archive/html/help-bison/2006-05/msg00035.html>.
4351 (yyreportTree, yypdumpstack): Subtract 1 from yyrule before printing
4352 to the user. Reported for yyreportTree by Derek M. Jones later in the
4354 * THANKS: Add Derek M. Jones.
4355 Update my email address.
4356 Fix typo in Steve Murphy's name.
4358 2006-05-14 Paul Eggert <eggert@cs.ucla.edu>
4360 * data/glr.c (yyreportSyntaxError): Fix off-by-one error in
4361 checking against YYLAST that caused the parser to miss a potential
4362 alternative in its diagnostic.
4363 Problem reported by Maria Jose Moron Fernandez in
4364 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00024.html>.
4365 * data/lalr1.cc (yysyntax_error_): Likewise.
4366 * data/yacc.c (yysyntax_error): Likewise.
4367 * tests/regression.at (_AT_DATA_DANCER_Y): Use static array for
4368 tokens, in case we run into an older C compiler.
4369 (_AT_DATA_EXPECT2_Y, AT_CHECK_EXPECT2): New macros.
4370 Use them to check for the off-by-one error fixed above.
4372 * data/yacc.c (yytnamerr): Fix typo: local var should be of type
4373 YYSIZE_T, not size_t.
4374 * tests/regression.at (Trivial grammars): New test, to catch
4375 the error fixed by the above patch.
4377 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
4379 * doc/bison.texinfo (C++ Bison Interface): Clarify the naming
4381 Reported by Steve Murphy.
4383 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
4385 * data/glr.cc, data/lalr1.cc: Using %defines is mandatory.
4386 * data/glr.cc: b4_location_flag is now b4_locations_flag.
4388 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
4390 Implement --trace=m4.
4391 * src/getargs.c (trace_types, trace_args): Accept trace_m4.
4392 * src/output.c (output_skeleton): When set, pass -dV to m4.
4394 Factor the handling of flags in m4.
4395 * src/output.c (prepare): Rename the muscle names debug, defines,
4396 error_verbose to debug_flag, defines_flag, error_verbose_flag.
4397 * data/c.m4: Adjust.
4398 (_b4_define_flag_if, b4_define_flag_if, b4_defines_if): New.
4399 Use b4_define_flag_if to define other b4_FLAG_if macros.
4400 (b4_location_if): As a consequence, rename as...
4401 (b4_locations_if): this, for consistency.
4402 Adjust all the skeletons.
4404 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
4406 * etc/bench.pm: Shorten bench names.
4408 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
4410 * src/output.h, src/output.c (error_verbose): Move to...
4411 * src/getargs.h, src/getargs.c: here.
4413 Adjust dependencies.
4415 2006-05-13 Paul Eggert <eggert@cs.ucla.edu>
4417 * data/c.m4 (b4_copyright): Put the special exception for Bison
4418 skeletons here, so we don't have to put it in each skeleton. All
4419 uses changed. Suggested by Akim Demaille. Also, wrap the
4420 copyright notice, in case it is longer than 80 columns. Replace
4421 comma by newline after title.
4423 2006-05-11 Paul Eggert <eggert@cs.ucla.edu>
4425 * doc/bison.texinfo (Calc++ Scanner): The flex behavior is an
4426 incompatibility, not a bug. Mention that it wasn't fixed as of
4429 2006-05-11 Akim Demaille <akim@lrde.epita.fr>
4431 * examples/extexi: Enforce the precedence of concatenation over
4433 Reported by Tommy Nordgren.
4435 2006-05-11 Akim Demaille <akim@lrde.epita.fr>
4437 * data/lalr1.cc (yytranslate_): Rename token as t to avoid clashes
4438 with the member "token".
4439 Reported by Martin Nylin.
4441 2006-05-08 Paul Eggert <eggert@cs.ucla.edu>
4443 * data/glr.c: Switch to Bison 2.2 special-exception language in
4444 the copyright notice. Use more-regular format for titles and
4446 * data/glr.cc: Likewise.
4447 * data/location.cc: Likewise.
4448 * data/yacc.cc: Likewise.
4449 * doc/bison.texinfo (Conditions): Document this.
4450 * NEWS: likewise. Upgrade version to 2.2.
4452 2006-04-27 Akim Demaille <akim@lrde.epita.fr>
4454 * data/glr.cc: Remove dead code.
4456 2006-04-25 Paul Eggert <eggert@cs.ucla.edu>
4458 * bootstrap: Comment out the AM_CPPFLAGS line, since we don't use
4459 that variable and the line breaks the bootstrap. Problem reported
4460 by Juan M. Guerrero.
4462 2006-04-24 Akim Demaille <akim@lrde.epita.fr>
4464 * doc/bison.texinfo (Multiple start-symbols): New.
4466 2006-04-24 Akim Demaille <akim@lrde.epita.fr>
4468 * etc/README, etc/bench.pl: New.
4470 2006-04-03 Akim Demaille <akim@lrde.epita.fr>
4472 * src/scan-gram.l: Be robust to BRACED_CODE appearing before any
4474 Reported by Mickael Labau.
4475 * tests/input.at (Torturing the Scanner): Test it.
4477 2006-03-16 Paul Eggert <eggert@cs.ucla.edu>
4479 * doc/bison.texinfo (Decl Summary): Don't mention yylloc twice.
4480 Problem reported by Bob Rossi.
4482 2006-03-13 Paul Eggert <eggert@cs.ucla.edu>
4484 * doc/bison.texinfo: Remove @shorttitlepage stuff; it wasn't used
4485 and didn't really work.
4486 For the index, use @ifnotinfo, not @iftex.
4487 Minor cleanups of spacing and terminology.
4489 2006-03-12 Akim Demaille <akim@lrde.epita.fr>
4491 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Fix the definition
4492 of AT_NAME_PREFIX when %name-prefix is not used.
4494 2006-03-12 Akim Demaille <akim@lrde.epita.fr>
4496 Apply --prefix to C++ skeletons too: they change the namespace.
4497 The test suite already exercize these cases.
4498 * data/c++.m4 (b4_namespace): New.
4499 * data/lalr1.cc, data/glr.cc, data/location.cc: Use it instead of `yy'.
4500 * data/lalr1.cc (yytnameerr_): Move its definition into the namespace.
4501 * data/yacc.c, data/glr.c: Remove a useless `[]'.
4502 * doc/bison.texinfo: Document it.
4503 (Option Cross Key): Use @multitable in all formats. It looks
4504 nicer, even in TeX outputs.
4505 (Rules): Use the same code whatever the output type is.
4506 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS)
4507 (_AT_BISON_OPTION_POPDEFS): Support AT_NAME_PREFIX.
4508 * tests/calc.at: Use it, instead of hard coding `yy'.
4510 2006-03-10 Akim Demaille <akim@lrde.epita.fr>
4512 * TODO: Remove dead items.
4514 2006-03-10 Akim Demaille <akim@lrde.epita.fr>
4516 * doc/FAQ: Remove, merged into...
4517 * doc/bison.texinfo (FAQ): this.
4518 * doc/Makefile.am (EXTRA_DIST): Adjust.
4520 2006-03-10 Akim Demaille <akim@lrde.epita.fr>
4522 * data/c.m4 (b4_token_enum): Always define the enum of tokens,
4524 * data/lalrl1.cc, data/glr.cc (parser::token_type): New.
4525 * doc/bison.texinfo (Calc++ Scanner): Use it.
4527 2006-03-09 Paul Eggert <eggert@cs.ucla.edu>
4529 Fix two nits reported by twlevo, plus one more that I discovered.
4531 * src/assoc.h (assoc_to_string): Give a name to the arg, as
4532 this is the usual Bison style.
4533 * src/location.h (location_print): Likewise.
4535 * src/reader.h (token_name): Likewise.
4537 2006-03-08 Paul Eggert <eggert@cs.ucla.edu>
4539 Fix some nits reported by twlevo.
4540 * doc/FAQ: Remove ancient Y2K FAQ, replacing it with "secure"
4541 and "POSIX". Use more-modern syntax for URLs. Mention C++
4542 and ask for Java. Don't hardwire OS version numbers. Add
4544 * m4/.cvsignore: Add unistd_h.m4, for latest gnulib.
4545 * src/conflicts.c (solved_conflicts_obstack): Now static.
4547 2006-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
4549 * doc/bison.texinfo (Introduction): Mention GLR and C++ as on the web
4550 page. Say "you can use it" not "you may use it" as on the web page;
4551 we're describing capabilities not granting permission.
4553 2006-03-06 Paul Eggert <eggert@cs.ucla.edu>
4555 * data/glr.c (yyresolveLocations): Rename local variables to avoid
4556 shadowing warnings. Use usual patter for iterating through RHS.
4557 * tests/glr-regression.at
4558 (Uninitialized location when reporting ambiguity):
4559 Modify yylex so that it uses its argument, rather than trying
4560 to rely on ARGSUSED (which doesn't work for gcc with warnings).
4561 const char -> char const.
4563 * tests/Makefile.am ($(srcdir)/package.m4, maintainer-check-valgrind):
4564 Don't use tabs inside commands; it messes up 'ps'.
4565 Problem reported by twlevo.
4567 2006-03-06 Joel E. Denny <jdenny@ces.clemson.edu>
4569 * tests/glr-regression.at (Uninitialized location when reporting
4570 ambiguity): New test case.
4571 * data/glr.c (yyresolveLocations): New function, which uses
4573 (yyresolveValue): Invoke yyresolveLocations before reporting an
4575 * doc/bison.texinfo (Default Action for Locations): Note
4576 YYLLOC_DEFAULT's usage for ambiguity locations.
4577 (GLR Semantic Actions): Cross-reference those notes.
4579 2006-03-04 Joel E. Denny <jdenny@ces.clemson.edu>
4581 * tests/glr-regression.at (Leaked semantic values when reporting
4582 ambiguity): Remove unnecessary union and type declarations.
4583 (Leaked lookahead after nondeterministic parse syntax error): New test
4585 * data/glr.c (yyparse): Check for zero stacks remaining before
4586 attempting to shift the lookahead so that you don't lose it.
4588 2006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
4590 Avoid memory leaks by not invoking longjmp in yyreportAmbiguity.
4591 * tests/glr-regression.at (Leaked semantic values when reporting
4592 ambiguity): New test case.
4593 * data/glr.c (yyreportAmbiguity): Invoke yyyerror directly and return
4594 yyabort rather than invoking yyFail, which invokes longjmp. Remove the
4595 now unnecessary yystackp parameter.
4596 (yyresolveValue): Return yyreportAmbiguity's result. Now the necessary
4597 destructors can be called.
4599 * tests/glr-regression.at: Don't invoke bison with `-t' unnecessarily
4600 in existing testcases.
4602 2006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
4604 Don't leak semantic values for parent RHS when a user action cuts the
4605 parser, and clean up related code a bit.
4606 * tests/glr-regression.at (Leaked merged semantic value if user action
4607 cuts parse): Rename to...
4608 (Leaked semantic values if user action cuts parse): ... this. Add check
4609 for leaked parent RHS values.
4610 * data/glr.c (yydestroyGLRState): In debugging output, distinguish
4611 between an unresolved state (non-empty chain of semantic options) and
4612 an incomplete one (signaled by an empty chain).
4613 (yyresolveStates): Document the interface. Move all manipulation of a
4614 successfully or unsuccessfully resolved yyGLRState to...
4615 (yyresolveValue): ... here so that yyresolveValue always leaves a
4616 yyGLRState with consistent data and thus is easier to understand.
4617 Remove the yyvalp and yylocp parameters since they are always just
4618 taken from the yys parameter. When reporting a discarded merged value
4619 in debugging output, note that it is incompletely merged. Document the
4621 (yyresolveAction): If resolving any of the RHS states fails, destroy
4622 them all rather than leaking them. Thus, as long as user actions are
4623 written to clean up the RHS correctly, yyresolveAction always cleans up
4624 the RHS of a semantic option. Document the interface.
4626 2006-02-27 Paul Eggert <eggert@cs.ucla.edu>
4628 * data/glr.c (yyexpandGLRStack): Catch an off-by-one error that
4629 led to a segmentation fault in GNU Pascal. Problem reported
4632 2006-02-21 Joel E. Denny <jdenny@ces.clemson.edu>
4634 * doc/bison.texinfo (Mid-Rule Actions): Explain how to bury a
4635 mid-rule action inside a nonterminal symbol in order to declare a
4636 destructor for its semantic value.
4638 2006-02-16 Paul Eggert <eggert@cs.ucla.edu>
4640 * data/yacc.c [(! defined yyoverflow || YYERROR_VERBOSE) && !
4641 YYSTACK_USE_ALLOCA && ! defined YYSTACK_ALLOC && defined
4642 __cplusplus && ! defined _STDLIB_H && !
4643 ((defined YYMALLOC || defined malloc) && (defined YYFREE ||
4644 defined free))]: Include <stdlib.h> rather than rolling our own
4645 declarations of malloc and free, to avoid problems with
4646 incompatible declarations (using 'throw') C++'s stdlib.h. This
4647 should fix Debian bug 340012
4648 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=340012>,
4649 reported by Guillaume Melquiond.
4651 2006-02-13 Paul Eggert <eggert@cs.ucla.edu>
4653 * NEWS: Clarify symbols versus types in unused-value warnings.
4655 * configure.ac (AC_INIT): Bump version number.
4657 2006-02-13 Paul Eggert <eggert@cs.ucla.edu>
4659 * NEWS: Version 2.1a.
4660 * tests/headers.at (AT_TEST_CPP_GUARD_H): Declare yyerror and yylex,
4661 since C99 requires this.
4663 2006-02-11 Paul Eggert <eggert@cs.ucla.edu>
4665 * m4/c-working.m4: New file.
4666 * configure.ac (BISON_TEST_FOR_WORKING_C_COMPILER): Use it.
4668 2006-02-10 Paul Eggert <eggert@cs.ucla.edu>
4670 * Makefile.maint: Merge from coreutils.
4672 2006-02-09 Paul Eggert <eggert@cs.ucla.edu>
4674 More portability fixes for problems summarized by Nelson H. F. Beebe.
4676 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Catch a
4677 configuration screwup "./configure CC=/opt/SUNWspro/bin/c89
4678 CFLAGS="-xarch=generic64" CXX=/opt/SUNWspro/bin/CC
4679 LDFLAGS="-xarch=generic64" with Sun C 5.7 on Solaris 10; this
4680 messes up because C++ code is compiled in 32-bit mode but linked
4683 2006-02-08 Paul Eggert <eggert@cs.ucla.edu>
4685 More portability fixes for problems summarized by Nelson H. F. Beebe.
4687 * doc/bison.texinfo (Calc++ Scanner): Work around a bug in flex
4688 2.5.31. This resembles the 2005-10-10 patch to src/scan-skel.l.
4690 * examples/calc++/Makefile.am (check_PROGRAMS): Renamed from
4691 nodist_PROGRAMS, since we don't need to actually compile the
4692 example if we're just doing a plain 'make'. This avoids bothering
4693 the installer unnecessarily about problems due to weird C++
4696 2006-02-06 Paul Eggert <eggert@cs.ucla.edu>
4698 More portability fixes for problems summarized by Nelson H. F. Beebe.
4700 * tests/headers.at (AT_TEST_CPP_GUARD_H): Use #include <...> rather
4701 than #include "...", and compile with -I'.'. The old method was
4702 not portable, according to Posix and the C standard, and it does
4703 not work with Sun C 5.7, where previous #line directives affect
4704 the working directory used in later #include "..." directives.
4706 2006-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
4708 Various DJGGP specific issues in /djgpp
4710 2006-02-02 Paul Eggert <eggert@cs.ucla.edu>
4712 More portability fixes for problems summarized by Nelson H. F. Beebe.
4714 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check that
4715 '#include <map>' works and that you can apply ++ to iterators.
4717 2006-02-01 Paul Eggert <eggert@cs.ucla.edu>
4719 Work around portability problems summarized by Nelson H. F. Beebe in
4720 <http://lists.gnu.org/archive/html/bug-bison/2005-09/msg00021.html>.
4722 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
4723 that '#include <string>' works.
4725 * data/lalr1.cc (yytranslate_): No longer inline, to work around a
4726 porting problem to g++ 3.4.3 on Darwin 7.9.0, where g++ complained
4727 "warning: sorry: semantics of inline function static data `const
4728 unsigned char translate_table[262]' are wrong (you'll wind up with
4731 * lib/bbitset.h (struct bitset_vtable): Rename members not, and,
4732 or, xor to not_, and_, or_, and xor_, respectively. This works
4733 around a bug in GCC 3.4.3 on Irix 6.5, which apparently has a
4734 random system header somewhere that includes the equivalent of
4737 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that "$CC
4738 -E" works; it apparently doesn't work with PathScale EKO Compiler
4741 2006-01-30 Joel E. Denny <jdenny@ces.clemson.edu>
4743 During deterministic GLR operation, user actions should be able to
4744 influence the parse by changing yychar. To make this easier to fix and
4745 to make glr.c easier to evolve in general, don't maintain yytoken in
4746 parallel with yychar; just compute yytoken when needed.
4747 * tests/glr-regression.at (Incorrect lookahead during deterministic
4748 GLR): Check that setting yychar in a user action has the intended
4750 * data/glr.c (yyGLRStack): Remove yytokenp member.
4751 (yyclearin): Don't set *yytokenp.
4752 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Examine
4753 yychar rather than *yytokenp to determine the current lookahead.
4754 Compute yytoken locally when needed.
4755 (yyparse): Likewise. Remove the local yytoken that yytokenp used to
4758 * doc/bison.texinfo (Bison Options): Remove stray sentence fragment
4759 after `--report' documentation.
4761 2006-01-30 Paul Eggert <eggert@cs.ucla.edu>
4763 * src/parse-gram.y (grammar_declaration): Location of printer
4764 symbol is @1, not list->location. Bug reported by twlevo.
4765 * tests/input.at (Incompatible Aliases): Adjust to above change.
4767 2006-01-29 Paul Eggert <eggert@cs.ucla.edu>
4769 * tests/input.at (AT_CHECK_UNUSED_VALUES): Remove. Instead, do
4770 all the test at once. This makes the output easier to read in the
4773 Fix a longstanding bug uncovered by bro-0.9a9/src/parse.y, which I
4774 got from <http://bro-ids.org/download.html>. The bug is that
4775 when two actions appeared in succession, the second one was
4776 scanned before the first one was added to the grammar rule
4777 as a midrule action. Bison then output the incorrect warning
4778 "parse.y:905.17-906.36: warning: unused value: $3".
4779 * src/parse-gram.y (BRACED_CODE, action): These are no longer
4780 associated with a value.
4781 (rhs): Don't invoke grammar_current_rule_action_append.
4782 (action): Invoke it here instead.
4783 * src/reader.c (grammar_midrule_action): Now extern.
4784 (grammar_current_rule_action_append): Don't invoke
4785 grammar_midrule_action; that is now the scanner's job.
4786 * src/reader.h (last_string, last_braced_code_loc):
4787 (grammar_midrule_action): New decls.
4788 * src/scan-gram.l (last_string): Now extern, sigh.
4789 (last_braced_code_loc): New extern variable.
4790 (<INITIAL>"{"): Invoke grammar_midrule_action if the current
4791 rule already has an action.
4792 (<SC_BRACED_CODE>"}"): Set last_braced_code_loc before returning.
4793 * tests/input.at (AT_CHECK_UNUSED_VALUES):
4794 Add some tests to check that the above changes fixed the bug.
4796 2006-01-27 Paul Eggert <eggert@cs.ucla.edu>
4798 * src/reader.c (symbol_should_be_used): Renamed from symbol_typed_p.
4799 All used changed. Check whether the symbol has a destructor,
4800 not whether it is typed.
4801 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add a destructor, so
4802 that the values are still reported as unused. All line numbers
4805 2006-01-23 Paul Eggert <eggert@cs.ucla.edu>
4807 Work around a bug in bro 0.8, which underparenthesizes its
4808 definition of YYLLOC_DEFAULT.
4809 * data/glr.c: Change all uses of YYLLOC_DEFAULT to parenthesize
4811 * data/lalr1.cc: Likewise.
4812 * data/yacc.cc: Likewise.
4814 2006-01-22 Paul Eggert <eggert@cs.ucla.edu>
4816 Work around a bug in Pike 7.0, and give the Pike folks a
4817 better way to override the usual int widths.
4818 * data/yacc.c (b4_int_type): Use yytype_uint8, etc., so that the
4819 user can override the types.
4820 (short): #undef, to work around a bug in Pike 7.0.
4821 (yytype_uint8, yytype_int8, yytype_uint16, yytype_int16): New types.
4822 (union yyalloc.yyss): Use yytype_int16 rather than short.
4824 (yysigned_char): Remove.
4825 * src/parse-gram.y (YYTYPE_UINT8, YYTYPE_INT8, YYTYPE_UINT16):
4826 (YYTYPE_INT16): New macros, to test the new facility in yacc.c.
4827 * tests/regression.at (Web2c Actions): Adjust to above changes.
4829 * src/reader.c (check_and_convert_grammar): New function.
4830 (reader): Close the input file even if something went wrong during
4831 parsing. Minor file descriptor leak reported by twlevo.
4833 * src/assoc.c (assoc_to_string): Use a default: abort (); case
4834 to pacify gcc -Wswitch-default.
4835 * src/scan-gram.l (adjust_location): Use a default: break; case
4836 to pacify gcc -Wswitch-default.
4837 * src/scan-skel.h (skel_get_lineno, skel_get_in, skel_get_out):
4838 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
4839 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
4840 Move these decls to scan-skel.l, since they don't need to be
4842 * src/scan-skel.l: Accept the above decls.
4843 (skel_lex): New decl, to pacify GCC when unpatched flex 2.5.31
4846 2006-01-21 Paul Eggert <eggert@cs.ucla.edu>
4848 * Makefile.cfg (local-checks-to-skip): Add changelog-check,
4849 since we don't want to insist on a version number at the start
4850 of the changelog every time.
4851 * Makefile.maint: Sync from coreutils a bit better.
4852 (sc_trailing_blank): Renamed from sc_trailing_space.
4854 (sc_no_if_have_config_h, sc_require_config_h):
4855 (sc_prohibit_assert_without_use): New rules.
4856 (sc_obsolete_symbols): Don't catch Makefile.maint itself.
4857 (sc_dd_max_sym_length): Fix leading spaces in rule.
4858 (sc_system_h_headers): Prefix with @.
4859 (sc_useless_cpp_parens, m4-check): Output line numbers.
4860 (changelog-check): Allow version only in head.
4861 * data/c.m4: Use "defined FOO" instead of "defined (FOO)", to
4862 satisfy new Makefile.maint rule.
4863 * data/glr.c: Likewise.
4864 * data/glr.cc: Likewise.
4865 * data/lalr1.cc: Likewise.
4866 * data/yacc.c: Likewise.
4867 * lib/ebitsetv.c: Likewise.
4868 * lib/lbitset.c: Likewise.
4869 * lib/subpipe.c: Likewise.
4870 * lib/timevar.c: Likewise.
4871 * src/system.h: Likewise.
4872 * data/yacc.c (YYSTYPE): Don't generate trailing spaces in output.
4873 * djgpp/Makefile.maint: Add copyright notice.
4874 * djgpp/README.in: Likewise.
4875 * djgpp/config.bat: Likewise.
4876 * djgpp/config.site: Likewise.
4877 * djgpp/config_h.sed: Likewise.
4878 * djgpp/djunpack.bat: Likewise.
4879 * djgpp/config.sed: Fix copyright notice to match standard format.
4880 * djgpp/subpipe.h: Likewise.
4881 * lib/bitsetv-print.c: Likewise.
4882 * lib/bitsetv.c: Likewise.
4883 * lib/subpipe.h: Likewise.
4884 * lib/timevar.c: Likewise.
4885 * lib/timevar.h: Likewise.
4886 * djgpp/subpipe.c: Use standard recipe for config.h.
4887 * lib/abitset.c: Likewise.
4888 * lib/bitset.c: Likewise.
4889 * lib/bitset_stats.c: Likewise.
4890 * lib/bitsetv-print.c: Likewise.
4891 * lib/bitsetv.c: Likewise.
4892 * lib/ebitsetv.c: Likewise.
4893 * lib/get-errno.c: Likewise.
4894 * lib/lbitset.c: Likewise.
4895 * lib/subpipe.c: Likewise.
4896 * lib/timevar.c: Likewise.
4897 * lib/vbitset.c: Likewise.
4898 * tests/local.at: Likewise.
4899 * src/scan-gram.l: Don't include verify.h, since system.h does
4901 * .x-sc_require_config_h: New file.
4902 * .x-sc_unmarked_diagnostics: New file.
4904 2006-01-20 Paul Eggert <eggert@cs.ucla.edu>
4906 Be a bit more systematic about using 'abort'.
4907 * lib/abitset.c (abitset_test): Remove ATTRIBUTE_UNUSED; not needed.
4908 * lib/bitset.c (bitset_bytes, bitset_init, bitset_op4_cmp):
4909 Put 'default: abort ();' before some other case, to satisfy older
4911 * lib/bitset_stats.c (bitset_stats_init): Likewise.
4912 * lib/ebitset.c (ebitset_elt_find, ebitset_op3_cmp): Likewise.
4913 * lib/lbitset.c (lbitset_elt_find, lbitset_op3_cmp): Likewise.
4914 * src/conflicts.c (resolve_sr_conflict): Likewise.
4915 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str):
4916 (get_decision_str, get_orientation_str, get_node_alignment_str):
4917 (get_arrow_mode_str, get_crossing_type_str, get_view_str):
4918 (get_linestyle_str, get_arrowstyle_str): Likewise.
4919 * src/conflicts.c (resolve_sr_conflict):
4920 Use a default case rather than one for the one remaining enum
4921 value, to catch invalid enum values as well.
4922 * src/lalr.c (set_goto_map, map_goto):
4923 Prefer "assert (FOO);" to "if (!FOO) abort ();".
4924 * src/nullable.c (nullable_compute, token_definitions_output):
4926 * src/reader.c (packgram, reader): Likewise.
4927 * src/state.c (transitions_to, state_new, state_reduction_find):
4929 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias):
4930 (symbol_pack): Likewise.
4931 * src/tables.c (conflict_row, pack_vector): Likewise.
4932 * src/scan-skel.l (QPUTS): Remove unnecessary parens.
4933 (BASE_QPUTS, "@output ".*\n): Remove unnecessary asserts.
4934 * src/system.h: Don't include <assert.h>.
4935 (assert): New macro.
4937 * doc/bison.texinfo (Prologue, Rules, Actions, Union Decl, Action Decl):
4938 (Destructor Decl, Parser Function, Pure Calling):
4939 Describe rules for braces inside C code more carefully.
4941 2006-01-19 Paul Eggert <eggert@cs.ucla.edu>
4943 Fix some porting glitches found by Nelson H. F. Beebe.
4944 * lib/abitset.c (abitset_resize): Rewrite to avoid warnings from
4945 compilers that don't understand that abort () does not return.
4946 * src/state.c (transitions_to): Likewise.
4947 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
4948 that '#include <cstdlib>' works.
4949 * src/system.h (INT8_MIN, INT16_MIN, INT32_MIN, INT8_MAX):
4950 (INT16_MAX, UINT8_MAX, INT32_MAX, UINT16_MAX, UINT32_MAX):
4951 #undef if ! defined __STDC_VERSION__ || __STDC_VERSION__ < 199901,
4952 for the benefit of some pre-C99 compilers.
4954 * bootstrap: Undo changes to gnulib files that autoreconf made.
4956 Minor fixups to get 'make maintainer-check' to work.
4957 * configure.ac: Don't use -Wnested-externs, as it's incompatible
4958 with the new verify.h implementation.
4959 * data/c.m4 (b4_yy_symbol_print_generate): YYUSE (yyoutput).
4960 * data/glr.c (YYUSE): Depend on __GNUC__ as well.
4961 * data/yacc.c (YYUSE): Likewise.
4962 * data/lalr1.cc (yysyntax_error_): YYUSE (yystate).
4963 * lib/subpipe.c (end_of_output_subpipe): The args are unused.
4964 * src/parse-gram.y (declaration): Don't pass a string constant
4965 to a function that expects char *, since GCC might complain
4966 about the constant value.
4967 * src/reader.c (symbol_typed_p): Add parens to pacify GCC.
4968 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): #undef yylloc and yylval
4969 before #defining them.
4970 * tests/glr-regression.at
4971 (Incorrectly initialized location for empty right-hand side in GLR):
4972 In yyerror, use the msg arg.
4973 (Corrupted semantic options if user action cuts parse):
4974 (Incorrect lookahead during deterministic GLR):
4975 (Incorrect lookahead during nondeterministic GLR):
4976 Don't name a local var 'index'; it shadows string.h's 'index'.
4978 2006-01-19 Akim Demaille <akim@epita.fr>
4980 * tests/calc.at (_AT_DATA_CALC_Y): Initialize the whole initial
4981 location, not just parts of it.
4983 2006-01-18 Paul Eggert <eggert@cs.ucla.edu>
4985 * NEWS: Document the fact that multiple %unions are now allowed.
4986 * doc/bison.texinfo (Union Decl): Likewise.
4987 * TODO: This feature is now implemented, so remove it from
4990 * Makefile.maint: Merge with coreutils Makefile.maint.
4991 (CVS_LIST): Use build-aux version if available.
4992 (VERSION_REGEXP): New macro.
4993 (syntax-check-rules): Add sc_no_if_have_config_h,
4994 sc_prohibit_assert_without_use, sc_require_config_h,
4995 sc_useless_cpp_parens.
4996 (sc_obsolete_symbols): Check for O_NDELAY.
4997 (sc_dd_max_sym_length): Track coreutils.
4998 (sc_unmarked_diagnostics): Look in all files, not just *.c.
4999 (sc_useless_cpp_parens): New rule.
5000 (news-date-check): Look for version or today's date.
5001 (changelog-check): Don't require version number near head.
5002 (copyright-check): Use current year instead of hardwiring 2005.
5003 (my-distcheck): Depend on $(release_archive_dir)/$(prev-tgz).
5004 (announcement): Add --gpg-key-ID.
5006 * djgpp/config.sed: Add copyright notice, and replace "filesystem"
5009 Avoid undefined behavior that addressed just before the start of an
5010 array. Problem reported by twlevo.
5011 * src/reader.c (packgram): Prepend a new sentinel before ritem.
5012 * src/lalr.c (build_relations): Rely on new sentinel.
5013 * src/gram.c (gram_free): Adjust to new sentinel.
5015 2006-01-12 Joel E. Denny <jdenny@ces.clemson.edu>
5017 * data/glr.c (yyGLRStateSet): Rename yylookaheadStatuses to
5018 yylookaheadNeeds. All uses updated.
5019 (yysplitStack): Rename local yynewLookaheadStatuses to
5020 yynewLookaheadNeeds.
5021 * data/glr-regression.at (Incorrect lookahead during nondeterministic
5022 GLR): In comments, change `lookahead status' to `lookahead need'.
5024 2006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
5026 * data/glr.c (yysplitStack): A little stylistic rewrite.
5028 2006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
5030 * data/glr.c (yyaddDeferredAction): Flesh out the comment.
5032 2006-01-11 Joel E. Denny <jdenny@ces.clemson.edu>
5034 * doc/bison.texinfo: Fix some typos.
5035 (GLR Semantic Actions): New subsection discussing special
5036 considerations because GLR semantic actions might be deferred.
5037 (Actions): Mention look-ahead usage of yylval.
5038 (Actions and Locations): Mention look-ahead usage of yylloc.
5039 (Special Features for Use in Actions): Add YYEOF entry and mention it
5040 in the yychar entry.
5041 In the yychar entry, remove mention of the local yychar case (pure
5042 parser) since this is irrelevant information when writing semantic
5043 actions and since it's already discussed in `Table of Symbols' where
5044 yychar is otherwise described as an external variable.
5045 In the yychar entry, don't call it the `current' look-ahead since it
5046 isn't when semantic actions are deferred.
5047 In the yychar and yyclearin entries, add note about deferred semantic
5049 Add yylloc and yylval entries discussing look-ahead usage.
5050 (Look-Ahead Tokens): When discussing yychar, don't call it the
5051 `current' look-ahead, and do mention yylval and yylloc.
5052 (Error Recovery): Cross-reference `Action Features' when mentioning
5054 (Table of Symbols): In the yychar entry, don't call it the `current'
5056 In the yylloc and yylval entries, mention look-ahead usage.
5058 2006-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
5060 * tests/glr-regression.at: Update copyright year to 2006.
5062 2006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
5064 * data/glr.c (yyGLRStateSet): Add yybool* yylookaheadStatuses member to
5065 use during nondeterministic operation to track which stacks have
5066 actually needed the current lookahead.
5067 (yyinitStateSet, yyfreeStateSet, yyremoveDeletes, yysplitStack):
5068 Allocate, deallocate, resize, and otherwise shuffle space for
5069 yylookaheadStatuses in parallel with yystates member of yyGLRStateSet.
5070 (yysplitStack, yyprocessOneStack, yyparse): Set lookahead status
5071 appropriately during nondeterministic operation.
5072 (yySemanticOption): Add int yyrawchar, YYSTYPE yyval, and YYLTYPE yyloc
5073 members to store the current lookahead to be used by the deferred
5075 (yyaddDeferredAction): Add size_t yyk parameter specifying the stack
5076 from which the RHS is taken. Set the lookahead members of the new
5077 yySemanticOption according to the lookahead status for stack yyk.
5078 (yyglrShiftDefer, yyglrReduce): Pass yyk parameter on to
5079 yyaddDeferredAction.
5080 (yyresolveAction): Set yychar, yylval, and yylloc to the lookahead
5081 members of yySemanticOption before invoking yyuserAction, and then set
5082 them back to their current values afterward.
5083 (yyparse): Set yychar = YYEMPTY where yytoken = YYEMPTY.
5084 (yyreportAmbiguity): Add /*ARGSUSED*/ to pacify lint.
5085 * tests/glr-regression.at: Remove `.' from the ends of recent test case
5086 titles for consistency.
5087 (Leaked merged semantic value if user action cuts parse): In order to
5088 suppress lint warnings, use arguments in merge function, and assign
5089 char value < 128 in main.
5090 (Incorrect lookahead during deterministic GLR): New test case.
5091 (Incorrect lookahead during nondeterministic GLR): New test case.
5093 2006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
5095 * data/c.m4 (b4_yy_symbol_print_generate): In yy_symbol_print, accept
5096 !yyvaluep as signal that no semantic value is available to print.
5097 * data/glr.c (yydestroyGLRState): If state is not resolved, don't try
5098 to print a semantic value.
5100 2006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
5102 * tests/glr-regression.at: For consistency with my newer test cases,
5105 2006-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
5107 * data/glr.c (yyresolveValue): When merging semantic options, if at
5108 least one user action succeeds but a later one cuts the parse, then
5109 destroy the semantic value before returning rather than leaking it.
5110 (yyresolveStates): If a user action cuts the parse and thus
5111 yyresolveValue fails, ignore the (unset) semantic value rather than
5112 corrupting the yyGLRState, and empty the semantic options list since
5113 the user actions should have called all necessary destructors.
5114 Simplify code with YYCHK.
5115 * tests/glr-regression.at (Corrupted semantic options if user action
5116 cuts parse): New test case.
5117 (Undesirable destructors if user action cuts parse): New test case.
5118 Before applying any of this patch, this test case never actually failed
5119 for me... but only because the corrupted semantic options usually
5121 (Leaked merged semantic value if user action cuts parse): New test
5124 2006-01-05 Akim Demaille <akim@epita.fr>
5126 * src/reader.c, src/symlist.h, src/symlist.c: s/mid_rule/midrule/.
5128 2006-01-04 Paul Eggert <eggert@cs.ucla.edu>
5130 * data/c.m4 (b4_c_modern): New macro, with a new provision for
5131 _MSC_VER. Problem reported by Cenzato Marco.
5132 (b4_c_function_def): Use it.
5133 * data/yacc.c (YYMODERN_C): Remove. All uses replaced by
5135 (yystrlen, yystpcpy, yyparse): Use b4_c_function... macros rather
5136 than rolling our own.
5138 2006-01-04 Akim Demaille <akim@epita.fr>
5140 Also warn about non-used mid-rule values.
5141 * src/symlist.h, src/symlist.c (symbol_list): Add a mid_rule
5143 (symbol_list_new): Adjust.
5144 * src/reader.c (symbol_typed_p): New.
5145 (grammar_rule_check): Use it.
5146 (grammar_midrule_action): Bind a mid-rule LHS to its rule.
5148 * tests/input.at (AT_CHECK_UNUSED_VALUES): New.
5150 * tests/actions.at (Exotic Dollars): Adjust.
5152 2006-01-04 Akim Demaille <akim@epita.fr>
5154 * src/reader.c (grammar_midrule_action): If $$ is set in a
5155 mid-rule, move the `used' bit to its lhs.
5156 * tests/input.at (Unused values): New.
5157 * tests/actions.at (Exotic Dollars): Adjust: exp is not typed.
5159 2006-01-03 Paul Eggert <eggert@cs.ucla.edu>
5161 * doc/bison.texinfo (Bison Options): Say more accurately what
5163 * src/parse-gram.y (rules_or_grammar_declaration): Don't complain
5164 about declarations in the grammar when in Yacc mode, as POSIX does
5165 not require a diagnostic when the grammar uses extensions.
5167 * src/reduce.c (reduce_grammar): Remove unnecessary cast to bool.
5169 Warn about dubious constructions like "%token T T".
5171 * src/symtab.h (struct symbol.declared): New member.
5172 * src/symtab.c (symbol_new): Initialize it to false.
5173 (symbol_class_set): New arg DECLARING, specifying whether
5174 this is a declaration that we want to warn about, if there
5175 is more than one of them. All uses changed.
5177 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c:
5178 Allow multiple %union directives, whose contents concatenate.
5179 * src/parse-gram.y (grammar_declaration): Likewise.
5180 Use muscle_code_grow, so that we don't need stype_line any more.
5183 * src/muscle_tab.c (muscle_grow): Fix comment.
5185 * ChangeLog, data/c.m4, data/glr.c, data/glr.cc, data/location.cc:
5186 * data/yacc.c, src/getargs.c, src/output.c, tests/cxx-type.at:
5187 Update copyright year to 2006.
5189 2006-01-03 Akim Demaille <akim@epita.fr>
5191 Have glr.cc pass (some of) the calc.at tests.
5192 * data/glr.cc (b4_parse_param_orig): New.
5193 (b4_parse_param): Improve its definition, and bound it more
5194 clearly in the skeleton.
5195 (b4_epilogue): Append, instead of prepending, in order to keep
5197 Simplify the generation of auxiliary functions: locations and
5198 purity are mandated.
5199 (b4_global_tokens_and_yystype): Honor it.
5200 * data/location.cc (c++.m4): Don't include it.
5201 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Define AT_GLR_CC_IF
5203 * tests/calc.at (AT_CHECK_CALC): Rely on AT_SKEL_CC_IF instead of
5205 Be sure to initialize the first position's filename.
5206 (AT_CHECK_CALC_LALR1_CC): Add %location and %defines, they are
5208 (AT_CHECK_CALC_GLR_CC): New.
5209 Use it to exercise glr.cc as a lalr1.cc drop-in replacement.
5211 2006-01-02 Akim Demaille <akim@epita.fr>
5213 * src/output.c (output_skeleton): Don't hard wire the inclusion of
5215 * data/c++.m4, data/glr.c, data/yacc.c: Include c.m4.
5216 * data/glr.cc: Do not include stack.hh.
5218 2006-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
5220 * data/glr.c: Reformat whitespace with tabs.
5221 (b4_lpure_formals): Remove this unused m4 macro.
5222 * tests/cxx-type.at: Reformat whitespace with tabs.
5223 (_AT_TEST_GLR_CXXTYPES): In union Node, rename node_info to nodeInfo
5224 since it's a member. Rename type to isNterm for clarity.
5226 2005-12-29 Akim <akim@sulaco.local>
5228 Let glr.cc catch up with symbol_value_print.
5229 * data/glr.cc (b4_yysymprint_generate): Replace by...
5230 (b4_yy_symbol_print_generate): this.
5231 (yy_symbol_print, yy_symbol_value_print): Declare them.
5233 2005-12-28 Paul Eggert <eggert@cs.ucla.edu>
5235 * src/location.h (boundary): Note that a line or column equal
5236 to INT_MAX indicates an overflow.
5237 * src/scan-gram.l: Include verify.h. Don't include get-errno.h.
5238 (rule_length_overflow, increment_rule_length, add_column_width):
5240 (<INITIAL>{id}, <SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'"):
5241 (<SC_BRACED_CODE>"}"):
5242 Use increment_rule_length rather than incrementing it by hand.
5243 (adjust_location, handle_syncline): Diagnose overflow.
5244 (handle_action_dollar, handle_action_at):
5245 Fix bug with monstrosities like $-2147483648.
5246 Remove now-unnecessary checks.
5247 (scan_integer): Verify assumptions and remove now-unnecessary checks.
5248 (convert_ucn_to_byte): Verify assumptions.
5249 (handle_syncline): New arg LOC. All callers changed.
5250 Don't store through a value derived from char const * pointer.
5252 * src/reader.c (grammar_rule_check): Rewrite slightly to avoid
5255 2005-12-27 Paul Eggert <eggert@cs.ucla.edu>
5257 * src/reader.c (grammar_midrule_action, grammar_symbol_append):
5258 Remove unnecessary forward static decls.
5260 2005-12-27 Akim Demaille <akim@epita.fr>
5262 * src/reader.c (grammar_current_rule_check): Also check that $$
5264 Take the rule to check as argument, hence rename as...
5265 (grammar_rule_check): this.
5266 * src/reader.h, src/reader.c (grammar_rule_begin, grammar_rule_end):
5268 (grammar_rule_begin, grammar_rule_end): these, for consistency.
5269 (grammar_midrule_action, grammar_symbol_append): Now static.
5270 * tests/torture.at (input): Don't rely on the default action
5271 being always performed.
5272 * tests/calc.at: "Set" $$ even when the action is "cut" with
5274 * tests/actions.at (Exotic Dollars): Instead of using unused
5275 values, check that the warning is issued.
5277 2005-12-22 Paul Eggert <eggert@cs.ucla.edu>
5279 * NEWS: Improve wording for unused-value warnings.
5281 2005-12-22 Akim Demaille <akim@epita.fr>
5283 * data/lalr1.cc, data/yacc.c, data/glr.c, data/c.m4
5284 (b4_yysymprint_generate): Rename as...
5285 (b4_yy_symbol_print_generate): this.
5286 Generate yy_symbol_print instead of yysymprint.
5287 Generate also yy_symbol_value_print, and use it.
5289 2005-12-22 Akim Demaille <akim@epita.fr>
5291 * NEWS: Warn about unused values.
5292 * src/symlist.h, src/symlist.c (symbol_list, symbol_list_new): Add
5294 (symbol_list_n_get, symbol_list_n_used_set): New.
5295 (symbol_list_n_type_name_get): Use symbol_list_n_get.
5296 * src/scan-gram.l (handle_action_dollar): Flag used symbols.
5297 * src/reader.c (grammar_current_rule_check): Check that values are
5299 * src/symtab.c (symbol_print): Accept 0.
5300 * tests/existing.at: Remove the type information.
5302 Remove useless actions (beware of mid-rule actions: perl -000
5303 -pi -e 's/\s*\{\}(?=[\n\s]*[|;])//g').
5304 * tests/actions.at (Exotic Dollars): Use unused values.
5305 * tests/calc.at: Likewise.
5306 * tests/glr-regression.at (No users destructors if stack 0 deleted):
5309 * src/gram.c (rule_useful_p, rule_never_reduced_p): Use
5312 2005-12-21 Paul Eggert <eggert@cs.ucla.edu>
5314 Undo 2005-12-01 tentative license wording change. The wording is
5315 still being reviewed by the lawyers, and we don't want to wait for
5316 them before publishing a test release. For now, revert to the
5318 * NEWS: Undo 2005-12-01 change.
5319 * data/glr.c: Revert to previous license wording.
5320 * data/glr.cc: Likewise.
5321 * data/lalr1.cc: Likewise.
5322 * data/location.cc: Likewise.
5323 * data/yacc.c: Likewise.
5325 * NEWS: Reword %destructor vs YYABORT etc.
5326 * data/glr.c: Use American spacing, for consistency.
5327 * data/glr.cc: Likewise.
5328 * data/lalr1.cc: Likewise.
5329 * data/yacc.c: Likewise.
5330 * data/yacc.c: Reformat comments slightly.
5331 * doc/bison.texinfo: Replace "non-" with "non" when that makes sense,
5332 for consistency. Fix some spelling errors and reword recently-included
5334 * tests/cxx-type.at: Cast results of malloc, for C++.
5336 2005-12-21 Joel E. Denny <address@hidden>
5338 * tests/cxx-type.at: Construct a tree, count the parents of shared
5339 nodes, and free each node once and only once. Previously, the memory
5340 for semantic values was leaked instead.
5342 2005-12-21 Joel E. Denny <address@hidden>
5344 * data/glr.c (struct yyGLRStack): If pure, add yyval and yyloc members.
5345 (yylval, yylloc): If pure, #define to yystackp->yyval and
5346 yystackp->yyloc similar to yychar and yynerrs.
5347 (yyparse): If pure, remove local yylval and yylloc. Add local
5348 yystackp to accommodate pure definitions of yylval and yylloc.
5349 (b4_lex_param, b4_lyyerror_args, b4_lpure_args): If pure, change
5350 yylvalp and yyllocp to &yylval and &yylloc.
5351 (nerrs, char, lval, lloc): If pure, add #define's for b4_prefix[]
5352 namespace. Previously, nerrs and char were missing, but lval and lloc
5354 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Remove
5355 yylvalp and yyllocp parameters since, if pure, these are now always
5356 accessible through yystackp. If not pure, they are still accessible
5358 * data/glr.c, data/yacc.c (YYLLOC_DEFAULT): Change `if (N)' to
5359 `if (YYID (N))' to pacify lint.
5361 2005-12-21 Akim Demaille <akim@epita.fr>
5363 YYACCEPT, YYERROR, and YYABORT, as user actions, should not
5364 destroy the RHS symbols of a rule.
5365 * data/yacc.c (yylen): Initialize to 0.
5366 Keep its value to the number of items to possibly shift.
5367 In particular, a regular successful parse that ends on YYFINAL by
5368 a (internal) YYACCEPT must not have yylen != 0.
5369 (yyerrorlab, yyreturn): Pop the RHS.
5370 Reorder a bit to emphasize the `shifting' bits of code.
5371 (YYPOPSTACK): Now accept a number of items to pop.
5372 * data/lalr1.cc: Likewise.
5373 * data/glr.c: Formatting changes.
5374 Use goto instead of fall through.
5375 * doc/bison.texinfo (Destructor Decl): Complete.
5377 2005-12-20 Juan Manuel Guerrero <juan.guerrero@gmx.de>
5379 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
5380 * djgpp/Makefile.maint: Fix PACKAGE variable computation.
5381 * djgpp/config.bat: Replace every occurence of the file name
5382 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
5383 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
5384 * djgpp/config.sed: Replace every occurence of the file name
5385 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
5386 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
5387 * djgpp/djunpack.bat: DJGPP specific file.
5388 * djgpp/fnchange.lst: DJGPP specific file.
5389 * djgpp/README.in: Add new information about how to unpack the bison
5390 source on MSDOS and other systems which have 8.3 file name restrictions
5391 using djunpack.bat and fnchange.lst.
5393 2005-12-12 Paul Eggert <eggert@cs.ucla.edu>
5395 * bootstrap (build_cvs_prefix): Remove; unused.
5396 (CVS_PREFIX): Adjust to yesterday's Savannah reorganization
5397 when getting gnulib.
5399 2005-12-12 "Joel E. Denny" <jdenny@ces.clemson.edu>
5401 * data/glr.c: Reorder typedef declarations for structs to match order
5402 of struct declarations.
5403 Rename yystack everywhere to yystackp except in yyparse where it's not
5405 (yyglrShift): Change parameter YYSTYPE yysval to YYSTYPE* yyvalp for
5407 (yyis_table_ninf): Change 0 to YYID (0) to pacify lint.
5408 (yyreportSyntaxError): Add /*ARGSUSED*/ to pacify lint.
5409 (yyparse): Change while (yytrue) to while ( YYID (yytrue)) to pacify
5412 2005-12-09 Paul Eggert <eggert@cs.ucla.edu>
5414 * tests/sets.at (Accept): Fix typos in regular expression used to
5415 sed out the final state number.
5417 Work around portability problem on Solaris 10: flex-generated
5418 files include <stdio.h> before <config.h>, which messes up
5419 because the latter defines __EXTENSIONS__. Address the problem
5420 by creating two new little files that include <config.h> first,
5421 then include the flex-generated files. Rewrite everyone else
5422 to include <config.h> first, as well.
5423 * lib/timevar.c: Always include "config.h".
5424 * src/Makefile.am (bison_SOURCES): Replace scan-gram.l with
5425 scan-gram-c.c, and scan-skel.l with scan-skel-c.c.
5426 (EXTRA_bison_SOURCES): New macro.
5427 * src/scan-gram-c.c, src/scan-skel-c.c: New files.
5428 * src/system.h: Don't include config.h.
5429 * src/LR0.c: Include <config.h> first.
5430 * src/assoc.c: Likewise.
5431 * src/closure.c: Likewise.
5432 * src/complain.c: Likewise.
5433 * src/conflicts.c: Likewise.
5434 * src/derives.c: Likewise.
5435 * src/files.c: Likewise.
5436 * src/getargs.c: Likewise.
5437 * src/gram.c: Likewise.
5438 * src/lalr.c: Likewise.
5439 * src/location.c: Likewise.
5440 * src/main.c: Likewise.
5441 * src/muscle_tab.c: Likewise.
5442 * src/nullable.c: Likewise.
5443 * src/output.c: Likewise.
5444 * src/parse-gram.y: Likewise.
5445 * src/print.c: Likewise.
5446 * src/print_graph.c: Likewise.
5447 * src/reader.c: Likewise.
5448 * src/reduce.c: Likewise.
5449 * src/relation.c: Likewise.
5450 * src/state.c: Likewise.
5451 * src/symlist.c: Likewise.
5452 * src/symtab.c: Likewise.
5453 * src/tables.c: Likewise.
5454 * src/uniqstr.c: Likewise.
5455 * src/vcg.c: Likewise.
5457 * src/parse-gram.y: Fix minor problems uncovered by lint.
5458 (current_lhs, current_lhs_location): Now static.
5459 (current_assoc): Remove unused variable.
5461 Cleanups so that Bison-generated parsers have less lint.
5462 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate):
5463 Prepend /*ARGSUSED*/, for lint's sake.
5464 * data/glr.c (YYUSE): Properly parenthesize, and use an alternate
5465 definition if 'lint' is defined.
5466 (YYID): New macro (or function, if lint).
5467 All uses of /*CONSTCOND*/0 replaced by YYID(0).
5468 * data/yacc.c: Likewise.
5469 * data/glr.c (yyuserAction, yyuserMerge, yy_reduce_print):
5470 (yyrecoverSyntaxError): Prepend /*ARGSUSED*/.
5471 * data/glr.cc (YYLLOC_DEFAULT): Omit /*CONSTCOND*/ since this code
5473 * data/lalr1.cc (YYUSE): Just use a cast, since this code is C++ only.
5474 * data/yacc.c (YYSTACK_FREE) [defined YYSTACK_ALLOC]:
5475 Use YYID(0) rather than 0, for lint.
5476 (yystrlen): Rewrite to avoid lint warning about ptrdiff_t overflow.
5477 (yysyntax_error): Rewrite to avoid lint warnings about parenthesization.
5479 2005-12-07 Paul Eggert <eggert@cs.ucla.edu>
5481 * tests/glr-regression.at
5482 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
5483 Close memory leak reported by twlevo.
5485 2005-12-06 "Joel E. Denny" <jdenny@ces.clemson.edu>
5487 * data/glr.c (yyprocessOneStack, yyparse): Synchronize the shift for
5489 (yyparse): Iterate another stack in order to call user destructors.
5490 * tests/glr-regression.at (No users destructors if stack 0 deleted):
5492 (Duplicated user destructor for lookahead): This test now is expected
5495 2005-12-01 Paul Eggert <eggert@cs.ucla.edu>
5497 * NEWS: Document the following change.
5498 * data/yacc.c: Say "parser skeleton" rather than "file", since
5499 it's no longer just a file.
5500 * data/glr.c: Grant a special exception for C GLR parsers, that
5501 reads like the already-existing exception for C LALR(1) parsers.
5502 * data/glr.cc: Likewise.
5503 * data/lalr1.cc: Likewise.
5504 * data/location.cc: Likewise.
5505 * data/yacc.c: Reword the "written by" statement to clarify that
5506 it was the parser skeleton, not the entire output file.
5507 * data/glr.c: Written by Paul Hilfinger.
5508 * data/glr.cc: Written by Akim Demaille.
5509 * data/lalr1.cc: Likewise.
5511 2005-11-18 Paul Eggert <eggert@cs.ucla.edu>
5513 * data/yacc.c (yy_reduce_print, YY_REDUCE_PRINT):
5514 Fix typos in previous change that broke 'make check'.
5515 YY_REDUCE_PRINT cannot be a pseudo-varargs macro; that isn't
5517 * tests/calc.at (_AT_CHECK_CALC,_AT_CHECK_CALC_ERROR):
5518 Don't check NUM-STDERR-LINES, since the output format is fluctuating.
5519 We can revert this once things settle down.
5521 * src/conflicts.c (conflicts_print): Don't print file name twice
5522 when %expect fails because there were no conflicts.
5523 * doc/bison.texinfo (Expect Decl): Tighten up wording in previous
5525 * tests/conflicts.at (%expect not enough, %expect too much):
5526 (%expect with reduce conflicts): Adjust to new behavior.
5528 2005-11-18 Akim Demaille <akim@epita.fr>
5530 * src/conflicts.c (conflicts_print): Unsatisfied %expectation are
5532 * NEWS: Document this.
5533 * doc/bison.texinfo (Expect Decl): Likewise.
5535 2005-11-16 Akim Demaille <akim@epita.fr>
5537 Generalize the display of semantic values and locations in traces.
5538 * data/glr.c (yy_reduce_print): Fix indices (again).
5539 * data/c++.m4 (b4_rhs_value, b4_rhs_location): Don't expect
5541 * data/lalr1.cc (yyreduce_print): Rename as...
5542 (yy_reduce_print): this.
5543 Display values and locations.
5544 * data/yacc.c (yy_reduce_print): Likewise.
5545 (YY_REDUCE_PRINT): Adjust to pass the required arguments.
5546 (yysymprint): Move higher to be visible from yy_reduce_print).
5548 * tests/calc.at: Adjust the expected length of the traces.
5550 2005-11-14 Akim Demaille <akim@epita.fr>
5552 * data/glr.c (yy_reduce_print): The loop was quite wrong: type are
5553 from 1 to N, while values and location start at 0.
5554 (b4_rhs_location, b4_rhs_value): Add parens around $1 and $2.
5556 2005-11-14 Akim Demaille <akim@epita.fr>
5558 * data/glr.c (yy_reduce_print): Fix the $ number.
5560 2005-11-14 Akim Demaille <akim@epita.fr>
5562 "Use" parse parameters.
5563 * data/c.m4 (b4_parse_param_for, b4_parse_param_use): New.
5564 * data/glr.c, data/glr.cc: Use them.
5565 * data/glr.c (YYUSE): Have a C++ definition that supports
5568 2005-11-14 Akim Demaille <akim@epita.fr>
5570 * data/glr.c (yyexpandGLRStack): Declare only if defined.
5572 2005-11-14 Akim Demaille <akim@epita.fr>
5575 * data/m4sugar/m4sugar.m4 (m4_prepend): New.
5577 2005-11-12 Akim Demaille <akim@epita.fr>
5579 Let position and location be PODs.
5580 * data/location.cc (position::initialize, location::initialize): New.
5581 (position::position, location::location): Define only if
5582 b4_location_constructors is defined.
5583 * data/lalr1.cc (b4_location_constructors): Define it for backward
5585 * doc/bison.texinfo (Initial Action Decl): Use initialize.
5587 2005-11-12 Akim Demaille <akim@epita.fr>
5589 * data/lalr1.cc: Move the body of the ctor and dtor into the
5590 parser file (instead of the header).
5591 Wrap the implementations in a "namespace yy".
5593 2005-11-12 Akim Demaille <akim@epita.fr>
5595 Have glr.c include its header file when created.
5596 * data/glr.c (b4_shared_declarations): New.
5597 Output them verbatim in the parser if !%defines, otherwise
5598 output then in the header file, and include it instead.
5600 2005-11-11 Akim Demaille <akim@epita.fr>
5602 * data/glr.c: Comment changes.
5604 2005-11-11 Akim Demaille <akim@epita.fr>
5606 When yydebug, report semantic and location values for reductions.
5607 * data/glr.c (yy_reduce_print): Report the semantic values and the
5609 (YY_REDUCE_PRINT): Adjust.
5610 (yyglrReduce): Use them.
5611 (b4_rhs_value, b4_rhs_location): Remove m4_eval invocations.
5612 * data/c.m4 (b4_yysymprint_generate): Specify the const arguments.
5613 * tests/calc.at (_AT_CHECK_CALC_ERROR): Remove the reduction
5616 2005-11-10 Akim Demaille <akim@epita.fr>
5618 * data/glr.c (yynewGLRStackItem, YY_RESERVE_GLRSTACK): New.
5619 (yyaddDeferredAction, yyglrShift, yyglrShiftDefer): Use them.
5620 (yyexpandGLRStack, YYRELOC): Define only when YYSTACKEXPANDABLE.
5622 2005-11-09 Albert Chin-A-Young <china@thewrittenword.com>
5624 * m4/cxx.m4, examples/Makefile.am: Don't build
5625 examples/calc++ if no C++ compiler is available. (trivial change)
5627 2005-11-09 Akim Demaille <akim@epita.fr>
5629 * src/scan-skel.l: Use a couple of asserts.
5631 2005-11-03 Akim Demaille <akim@epita.fr>
5633 In some (weird) cases, the final state number is incorrect.
5634 Reported by Alexandre Duret-Lutz.
5635 * src/LR0.c (state_list_append): Remove the computation of
5637 (save_reductions): Do it here.
5638 (get_state): Alpha conversion.
5639 (generate_states): Use a for loop.
5640 * src/gram.h (item_number_is_rule_number)
5641 (item_number_is_symbol_number): New.
5642 * src/state.c: Use assert.
5643 * src/system.h: Include assert.h.
5644 * tests/sets.at (Accept): New.
5646 2005-10-30 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
5648 * data/glr.c (yyfill): Adjust comment.
5649 (yyresolveAction): Initialize default location properly
5650 for empty right-hand sides.
5651 (yydoAction): Ditto.
5652 Add comment explaining apparently dead code.
5653 * tests/glr-regression.at
5654 (Incorrectly initialized location for empty right-hand side in GLR):
5657 2005-10-30 Paul Eggert <eggert@cs.ucla.edu>
5659 * bootstrap (cleanup_gnulib): New function. Use it to clean up
5660 gnulib when interrupted. This fixes some race conditions and
5661 works around some portability problems (one noted by Paul
5664 2005-10-22 Akim <akim@epita.fr>
5666 * Makefile.cfg: Adjust to config -> build-aux.
5669 2005-10-21 Akim Demaille <akim@epita.fr>
5671 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Pass
5673 * data/glr.c (YY_SYMBOL_PRINT, yydestroyGLRState): Adjust.
5674 * data/yacc.c (b4_Pure_if): Rename as...
5675 (b4_yacc_pure_if): this.
5676 (YY_SYMBOL_PRINT, yyparse): Adjust.
5677 * doc/bison.texinfo: Formatting changes.
5679 2005-10-21 Akim Demaille <akim@epita.fr>
5681 Finish the transition config -> build-aux.
5682 * configure.ac, Makefile.am: Use build-aux.
5683 * config/prev-version, config/announce-gen, config/Makefile.am:
5685 * build-aux/prev-version, build-aux/announce-gen,
5686 * build-aux/Makefile.am: here.
5688 2005-10-14 Akim Demaille <akim@epita.fr>
5690 * examples/calc++/test: Use set -x only when VERBOSE.
5692 2005-10-13 Paul Eggert <eggert@cs.ucla.edu>
5694 * NEWS: Bison now warns if it finds a stray `$' or `@' in an action.
5695 * src/scan-gram.l (<SC_BRACED_CODE>[$@]): Implement this.
5697 2005-10-13 Akim Demaille <akim@epita.fr>
5699 * src/scan-skel.l: Output the base name parts of the parser and
5701 * tests/output.at (AT_CHECK_OUTPUT): Support subdirectories, and
5703 Use this to exercise C++ outputs in subdirs.
5704 Reported by Oleg Smolsky.
5706 2005-10-12 Paul Eggert <eggert@cs.ucla.edu>
5708 * data/c.m4 (b4_c_function_def): Look at __C99_FUNC__, not at
5709 __STDC_VERSION__, as IBM cc 7.0 doesn't define the latter either.
5710 Problem reported by John P. Hartmann.
5711 * data/yacc.c (YYMODERN_C): Likewise. Don't define if the user has
5714 2005-10-12 Akim Demaille <akim@epita.fr>
5716 * src/parse-gram.y (version_check): Exit 63 to please missing
5717 (stands for "version mismatch).
5718 * tests/input.at, doc/bison.texinfo: Adjust.
5720 2005-10-10 Paul Eggert <eggert@cs.ucla.edu>
5722 Work around portability problems with Visual Age C compiler
5723 (xlc and xlC_r) reported by John P. Hartmann.
5724 * data/location.cc (initial_column, initial_line): Remove.
5725 All uses replaced by 0 and 1.
5726 * src/scan-gram.l (gram_wrap): Redefine to avoid bug in flex 2.5.31
5727 that xlc complains about.
5728 * src/scan-skel.l (skel_wrap): Likewise.
5729 * data/c.m4 (b4_c_function_def): Look at __STDC_VERSION__ as well
5731 * data/yacc.c (YYMODERN_C): New macro, which also looks at
5732 __STDC_VERSION__. Use it everywhere instead of looking at
5733 __STDC__ and __cplusplus.
5735 2005-10-10 Akim Demaille <akim@epita.fr>
5737 * examples/calc++/test: Be quiet unless VERBOSE.
5739 2005-10-05 Paul Eggert <eggert@cs.ucla.edu>
5741 * data/c.m4 (yydestruct, yysymprint):
5742 Use YYUSE instead of casting to void.
5743 * data/glr.c (YYUSE): New macro.
5744 (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
5745 Use it instead of rolling our own.
5746 (YYLLOC_DEFAULT, YYCHK, YYDPRINTF, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
5748 Use /*CONSTCOND*/ to suppress lint warnings.
5749 * data/lalr1.cc (YYLLOC_DEFAULT, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
5750 (YY_STACK_PRINT): Use 'false' not '0'.
5752 (yysymprint_, yydestruct_): Use it instead of rolling our own.
5753 * data/yacc.c (YYUSE): New macro.
5754 (YYCOPY, YYSTACK_RELOCATE, YYBACKUP, YYLLOC_DEFAULT):
5755 (YYDPRINTF, YY_SYMBOL_PRINT, YY_STACK_PRINT, YY_REDUCE_PRINT):
5756 (yyerrorlab): Use /*CONSTCOND*/ to suppress lint warnings.
5759 * data/m4sugar/m4sugar.m4 (_m4_map): New macro.
5760 (m4_map, m4_map_sep): Use it. Handle the empty list correctly.
5762 2005-10-04 Paul Eggert <eggert@cs.ucla.edu>
5764 Undo the parts of the unlocked-I/O change that substituted
5765 putc or puts for printf. This might hurt performance a bit,
5766 but some people prefer the printf style.
5767 * data/c.m4 (yysymprint): Prefer printf to puts and putc.
5768 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): Remove.
5769 All uses replaced by YYFPRINTF and YYDPRINTF.
5770 * data/yacc.c: Likewise.
5771 * lib/bitset.c (bitset_print): Likewise.
5772 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer printf to
5774 * lib/lbitset.c (debug_lbitset): Likewise.
5775 * src/closure.c (print_firsts, print_fderives): Likewise.
5776 * src/gram.c (grammar_dump): Likewise.
5777 * src/lalr.c (look_ahead_tokens_print): Likewise.
5778 * src/output.c (escaped_output): Likewise.
5779 (user_actions_output): Break apart two printfs.
5780 * src/parse-gram.y (%printer): Prefer printf to putc and puts.
5781 * src/reduce.c (reduce_print): Likewise.
5782 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
5783 * src/system.h: Include unlocked-io.h rathe than stdio.h.
5785 * data/glr.c (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
5786 Use assignments rather than casts-to-void to suppress
5787 unused-variable warnings. This pacifies 'lint'.
5788 * data/lalr1.cc (yysymprint_, yydestruct_): Use a call to suppress
5789 unused-variable warnings.
5791 2005-10-03 Juan Manuel Guerrero <juan.guerrero@gmx.de>
5793 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
5795 2005-10-02 Paul Eggert <eggert@cs.ucla.edu>
5797 Use unlocked I/O for a minor performance improvement on hosts like
5798 GNU/Linux and Solaris that support unlocked I/O. The basic idea
5799 is to use the gnlib unlocked-io module, and to prefer putc and
5800 puts to printf when either will work (since the latter doesn't
5801 come in an unlocked flavor).
5802 * bootstrap (gnulib_modules): Add unlocked-io.
5803 * data/c.m4 (yysymprint): Prefer puts and putc to printf.
5804 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): New macros.
5805 Prefer them to YYFPRINTF and YYDPRINTF if either will do,
5806 and similarly for puts and putc and printf.
5807 * data/yacc.c: Likewise.
5808 * lib/bitset.c (bitset_print): Likewise.
5809 * lib/bitset.h [USE_UNLOCKED_IO]: Include unlocked-io.h.
5810 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer putc and puts
5812 * lib/lbitset.c (debug_lbitset): Likewise.
5813 * src/closure.c (print_firsts, print_fderives): Likewise.
5814 * src/gram.c (grammar_dump): Likewise.
5815 * src/lalr.c (look_ahead_tokens_print): Likewise.
5816 * src/output.c (escaped_output): Likewise.
5817 (user_actions_output): Coalesce two printfs.
5818 * src/parse-gram.y (%printer): Prefer putc and puts to printf.
5819 * src/reduce.c (reduce_print): Likewise.
5820 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
5821 * src/system.h: Include unlocked-io.h rather than stdio.h.
5823 * data/lalr1.cc: Don't put an unmatched ' in a dnl comment, as
5824 this confuses xgettext.
5826 2005-10-02 Akim Demaille <akim@epita.fr>
5828 * bootstrap (gnulib_modules): Add strverscmp.
5829 * lib/.cvsignore: Add strverscmp.c, strverscmp.h.
5830 * m4/.cvsignore: Add strverscmp.m4.
5831 * src/parse-gram.y (%require): New token, new rule.
5832 (version_check): New.
5833 * src/scan-gram.l (%require): Adjust.
5834 * tests/input.at (AT_REQUIRE): New.
5836 * doc/bison.texinfo (Require Decl): New.
5837 (Calc++ Parser): Use %require.
5839 2005-10-02 Akim Demaille <akim@epita.fr>
5841 * data/location.cc: New.
5843 2005-10-02 Paul Eggert <eggert@cs.ucla.edu>,
5844 Akim Demaille <akim@epita.fr>
5846 Make sure -odir/foo.cc creates dir/location.hh etc.
5847 * src/files.h (spec_outfile, parser_file_name, spec_name_prefix)
5848 (spec_file_prefix, spec_verbose_file, spec_graph_file)
5849 (spec_defines_file): Now const.
5851 (short_base_name): Remove.
5852 * src/files.c: Adjust.
5853 (dirname.h): Include.
5854 (base_name): Don't prototype it.
5855 (finput): Remove, duplicates gram_in.
5856 (full_base_name, short_base_name): Replace by...
5857 (all_but_ext, all_but_tab_ext): these.
5858 (compute_base_names): Rename as...
5859 (compute_file_name_parts): this.
5860 Update to compute the new variables, including dir_prefix.
5861 Adjust dependencies.
5862 * src/output.c (prepare): Output them.
5863 * src/reader.c: Adjust to use gram_in, not finput.
5864 * src/scan-skel.l (@dir_prefix@): New.
5866 2005-10-02 Juan Manuel Guerrero <juan.guerrero@gmx.de>
5868 * lib/subpipe.c: New function end_of_output_subpipe() added
5869 to allow support for non-posix systems. This is a no-op function
5872 * lib/subpipe.h: New function end_of_output_subpipe() added
5873 to allow support for non-posix systems. This is a no-op function
5876 * src/output.c (output_skeleton): Use end_of_output_subpipe() to
5877 handle the lack of pipe/fork functionality on non-posix systems.
5879 * djgpp/Makefile.maint: DJGPP specific file.
5881 * djgpp/README.in: DJGPP specific file.
5883 * djgpp/config.bat: DJGPP specific configuration file.
5885 * djgpp/config.sed: DJGPP specific configuration file.
5887 * djgpp/config.site: DJGPP specific configuration file.
5889 * djgpp/config_h.sed: DJGPP specific configuration file.
5891 * djgpp/subpipe.c: DJGPP specific replacement file for lib/subpipe.c.
5893 * djgpp/subpipe.h: DJGPP specific replacement file for lib/subpipe.h.
5895 2005-10-02 Akim Demaille <akim@epita.fr>
5897 * data/location.cc: New, extract from...
5898 * data/lalr1.cc: here.
5899 (location.hh): Include it after the user prologue, in case the
5900 filename type is defined by the user.
5901 Forward declation location and position before the pre-prologue.
5902 (yyresult_): Rename as...
5903 (yyresult): this, it's a local variable, not an attribute.
5904 * data/Makefile.am (dist_pkgdata_DATA): Adjust.
5906 2005-10-01 Akim Demaille <akim@epita.fr>
5908 * examples/extexi: Restore the #line generation.
5910 2005-09-30 Akim Demaille <akim@epita.fr>,
5911 Alexandre Duret-Lutz <adl@gnu.org>
5913 Move the token type and YYSTYPE in the parser class.
5914 * data/lalr1.cc (stack.hh, location.hh): Include earlier.
5915 (parser::token): New, from the moved free definition of tokens.
5916 (parser::semantic_value): Now a full definition instead of an
5917 indirection to YYSTYPE.
5918 (b4_post_prologue): No longer included in the header file, but
5919 in the implementation file.
5920 * doc/bison.texi (C+ Language Interface): Update.
5921 * src/parse-gram.y: Support unary %define.
5922 * tests/actions.at: Define global_tokens_and_yystype for backward
5923 compatibility until we update the tests.
5924 * tests/calc.at: Idem.
5925 (first_line, first_column, last_line, last_column): Define for lalr1.cc
5926 to simplify the code.
5928 2005-09-29 Paul Eggert <eggert@cs.ucla.edu>
5930 Port to SunOS 4.1.4, which lacks strtoul and strerror.
5931 Ah, the good old days! Problem reported by Peter Klein.
5932 * bootstrap (gnulib_modules): Add strerror, strtoul.
5933 * lib/.cvsignore: Add strerror.c, strtol.c, strtoul.c
5934 * m4/.cvsignore: Add strerror.m4, strtol.m4, strtoul.m4.
5936 2005-09-29 Akim Demaille <akim@epita.fr>
5938 * data/c.m4 (b4_error_verbose_if): New.
5939 * data/lalr1.cc: Use it.
5940 (YYERROR_VERBOSE_IF): Remove.
5941 (yyn_, yylen_, yystate_, yynerrs_, yyerrstatus_): Remove as
5942 parser members, replaced by...
5943 (yyn, yylen, yystate, yynerss, yyerrstatus): these parser::parse
5945 (yysyntax_error_): Takes the state number as argument.
5946 (yyreduce_print_): Use the argument yyrule, not the former
5949 2005-09-26 Paul Eggert <eggert@cs.ucla.edu>
5951 * bootstrap (gnulib_modules): Add verify.
5952 * lib/.cvsignore: Add verify.h.
5953 * src/getargs.c: Use ARGMATCH_VERIFY rather than verify.
5954 * src/system.h (verify): Remove.
5955 Include verify.h instead.
5956 * src/tables.c (tables_generate): Use new API for 'verify'.
5958 2005-09-21 Paul Eggert <eggert@cs.ucla.edu>
5960 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Do not use
5961 local variables whose names begin with 'yy'.
5962 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
5963 Trivial changes from Joel E. Denny.
5965 * bootstrap (gnulib_modules): Remove alloca. Bison doesn't need
5967 * src/main.c (main) [C_ALLOCA]: Don't flush alloca'ed memory; we
5968 don't use alloca any more.
5970 * data/yacc.c [YYSTACK_USE_ALLOCA && !defined __GNUC__ && ! defined
5971 __BUILTIN_VA_ARG_INCR && ! defined _AIX && ! defined _MSC_VER &&
5972 defined _ALLOCA_H]: Don't include <stdlib.h>; not needed in this case.
5973 * tests/torture.at (Exploding the Stack Size with Alloca): Adjust
5974 to match yacc.c, to test more hosts.
5976 2005-09-20 Paul Eggert <eggert@cs.ucla.edu>
5978 * data/yacc.c (YYSIZE_T): Reindent to make it clearer. This
5979 doesn't affect behavior.
5980 (YYSTACK_ALLOC) [YYSTACK_USE_ALLOCA]: Improve support for
5982 (_STDLIB_H): Renamed from YYINCLUDED_STDLIB_H. All uses changed.
5983 This works a bit better with glibc, if user code has already included
5985 * doc/bison.texinfo (Bison Parser): Document that users can't
5986 arbitrarily use malloc and free for other purposes. Document
5987 that <alloca.h> and <malloc.h> might be included.
5988 (Table of Symbols): Under YYSTACK_USE_ALLOCA, Don't claim that the
5989 user must declare alloca.
5991 * HACKING (release): Forwarn the Translation Project about
5994 2005-09-20 Akim Demaille <akim@epita.fr>
5996 * data/glr.c: Use b4_token_enums, not b4_token_enums_defines.
5998 2005-09-19 Paul Eggert <eggert@cs.ucla.edu>
6000 * data/yacc.c (YYSIZE_MAXIMUM): New macro.
6001 (YYSTACK_ALLOC_MAXIMUM): Use it.
6002 (yysyntax_error): New function.
6003 (yyparse) [YYERROR_VERBOSE]: Don't leak memory indefinitely if
6004 multiple syntax errors are reported, and alloca is being used.
6005 Instead, reallocate buffers twice as big each time, so that
6006 we waste at most half the allocated memory. Start with a small
6007 (128-byte) buffer that will suffice in most cases anyway.
6008 Use yysyntax_error to do most of the work.
6010 * doc/bison.texinfo (Error Reporting, Table of Symbols):
6011 yynerrs is the number of errors reported, not the number of
6014 * tests/glr-regression.at (Duplicated user destructor for lookahead):
6015 Mark it as expected to fail.
6016 Cast result of malloc; problem reported by twlevo@xs4all.nl.
6017 * tests/actions.at, tests/calc.at, tests/glr-regression.at:
6018 Don't start user-code symbols with "yy", to avoid name space problems.
6020 2005-09-19 Akim Demaille <akim@epita.fr>
6022 Remove the traits, failed experiment.
6023 It never proved useful, and anyway because of the current
6024 definition, it was not possible to have several specialization of
6025 this traits, making it useless.
6026 * data/lalr1.cc (yy:traits): Remove.
6027 Inline its definitions in the parser class.
6029 2005-09-19 Akim Demaille <akim@epita.fr>
6031 * tests/atlocal.in (LIBS): Pass INTLLIBS to address failures on at
6032 least Mac OSX with a /usr/local install of gettext.
6034 2005-09-19 Akim Demaille <akim@epita.fr>
6036 * data/lalr1.cc (yyparse): Rename yylooka and yyilooka as yychar
6037 and yytoken for similarity with the other skeletons.
6039 2005-09-19 Akim Demaille <akim@epita.fr>
6041 * NEWS, configure.ac: update version number to 2.1a.
6043 2005-09-16 Paul Eggert <eggert@cs.ucla.edu>
6045 * NEWS: Version 2.1.
6047 * NEWS: Remove notice of yytname change, since it was never in an
6049 * data/glr.c (yydestroyGLRState): Rename local var to avoid shadowing
6051 * src/output.c (prepare): Likewise.
6052 * data/lalr1.cc (YYERROR_VERBOSE_IF): New macro.
6053 (yysyntax_error_): Use it to avoid GCC warning when YYERROR_VERBOSE
6054 is not defined. This is an awful hack, but it's enough for now.
6055 All callers changed.
6056 * tests/glr-regression-at (make_value): Args are const pointers now,
6057 to avoid GCC warning.
6058 (Duplicated user destructor for lookahead): New test. Currently
6059 skipped. It fails on my host but I'm not sure it'll always fail.
6061 2005-09-16 Akim Demaille <akim@epita.fr>
6063 * src/symtab.h (struct symbol): Declare the printer and destructor
6064 as const, to avoid accidental calls to free.
6065 (symbol_destructor_set, symbol_printer_set): Adjust.
6066 * src/symtab.c: Adjust.
6068 2005-09-16 Akim Demaille <akim@epita.fr>
6070 * data/c.m4 (b4_token_enums): New.
6071 (b4_token_defines): Rename as...
6072 (b4_token_enums_defines): this.
6073 (b4_token_defines): New, output only the #defines.
6074 * data/yacc.c, data/glr.c: Adjust.
6075 * data/lalr1.cc: Use b4_token_enums instead of b4_token_enums_defines.
6076 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Define
6079 2005-09-16 Akim Demaille <akim@epita.fr>
6081 * data/lalr1.cc (yylex_): Remove, inline its code.
6082 (yyreport_syntax_error_): Remove, replaced by...
6083 (yysyntax_error_): this which returns a string and leaves to the
6084 caller the call to the users' error function.
6085 (yylooka_, yyilooka_, yylval, yylloc, yyerror_range_, yyval, yyloc):
6086 Move from members of the parser object...
6087 (yylooka, yyilooka, yylval, yylloc, yyerror_range, yyval, yyloc):
6088 to local variables of the parse function.
6090 2005-09-16 Akim Demaille <akim@epita.fr>
6092 * doc/bison.texinfo (Calc++ Parser): Don't promote defining YYEOF
6093 since it's in Bison's name space.
6095 2005-09-15 Paul Eggert <eggert@cs.ucla.edu>
6097 * data/glr.c (yyresolveValue): Add default case to pacify
6098 gcc -Wswitch-default. Problem reported by twlevo@xs4all.nl.
6100 * NEWS: Document when yyparse started to return 2.
6101 * doc/bison.texinfo (Parser Function): Document when yyparse
6104 * data/lalr1.cc: Revert part of previous change, as it's incompatible.
6105 (b4_filename_type): Renamed back from b4_file_name_type. All uses
6107 (class position): file_name -> filename (reverting). All uses changed.
6109 2005-09-14 Paul Eggert <eggert@cs.ucla.edu>
6111 * examples/calc++/Makefile.am ($(calc_sources_generated)): Don't
6112 do anything if $@ exists. This reverts part of the 2005-07-07
6115 2005-09-11 Paul Eggert <eggert@cs.ucla.edu>
6117 * Makefile.am (EXTRA_DIST): Do not distribute REFERENCES; it
6118 contains obsolete information and isn't worth distributing as a
6119 separate file anyway.
6120 * data/glr.c [defined YYSETJMP]: Don't include <setjmp.h>.
6121 (YYJMP_BUF, YYSETJMP, YYLONGJMP) [!defined YYSETJMP]: New macros.
6122 All uses of jmp_buf, setjmp, longjmp changed to use these instead.
6123 (yyparse): Abort if user code uses longjmp to throw an unexpected
6126 2005-09-09 Paul Eggert <eggert@cs.ucla.edu>
6128 * data/c.m4 (b4_identification): Define YYBISON_VERSION.
6129 Suggested by twlevo@xs4all.nl.
6131 * data/glr.c (YYCHK1): Do not assume YYE is in range.
6132 This avoids a diagnostic from gcc -Wswitch-enum.
6133 Problem reported by twlevo@xs4all.nl.
6135 * doc/bison.texinfo: Don't use "filename", as per GNU coding
6136 standards. Use "file name" or "file" or "name", depending on
6138 (Invocation): The output of "bison hack/foo.y" goes to foo.tab.c,
6139 not to hack/foo.tab.c.
6140 (Calc++ Top Level): 2nd arg of main is not const.
6141 * data/glr.c: b4_filename -> b4_file_name.
6142 * data/lalr1.cc: Likewise. Also, b4_filename_type -> b4_file_name_type.
6144 (class position): filename -> file_name. All uses changed.
6145 * data/yacc.c: b4_filename -> b4_file_name.
6146 * lib/bitset.h: filename -> file_name in local vars.
6147 * lib/bitset_stats.c: Likewise.
6148 * src/files.c: Likewise.
6149 * src/scan-skel.l ("@output ".*\n): Likewise.
6150 * src/files.c (file_name_split): Renamed from filename_split.
6151 * src/muscle_tab.c (muscle_init): Output b4_file_name, not b4_filename.
6153 2005-09-08 Paul Eggert <eggert@cs.ucla.edu>
6155 * lib/.cvsignore: Add pipe-safer.c, stdio--.h, unistd--.h,
6156 to accommodate latest gnulib.
6158 * tests/glr-regression.at (Duplicate representation of merged trees):
6159 Add casts to pacify g++. Problem reported by twlevo@xs4all.nl.
6161 * bootstrap: Add comment as to why the AM_LANGINFO_CODESET hack is
6164 2005-08-26 Paul Eggert <eggert@cs.ucla.edu>
6166 * data/glr.c (yydestroyGLRState): Renamed from yydestroyStackItem.
6167 All uses changed. Invoke user destructor after an error during a
6168 split parse (trivial change from Joel E. Denny).
6170 * tests/glr-regression.at
6171 (User destructor after an error during a split parse): New test case.
6172 Problem reported by Joel E. Denny in:
6173 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00029.html
6175 2005-08-25 Paul Eggert <eggert@cs.ucla.edu>
6177 * README-cvs: Give URLs for recommended tools.
6178 Mention Gzip version problem, and bootstrapping issues.
6179 Remove troubleshooting section, as it's somewhat obsolete.
6181 * bootstrap (no_cache): New var, to accommodate different wget
6182 variants. Use it instead of '-C off'. Problem reported by
6185 * data/glr.c (yydestroyStackItem): New function.
6186 (yyrecoverSyntaxError, yyreturn): Use it to improve quality of
6187 debugging information. Problem reported by Joel E. Denny.
6189 2005-08-25 Akim Demaille <akim@epita.fr>
6191 * tests/local.at (AT_COMPILE_CXX): Pass $LINKS too.
6193 2005-08-24 Paul Eggert <eggert@cs.ucla.edu>
6195 * data/glr.c (yyrecoverSyntaxError, yyreturn):
6196 Don't invoke destructor on unresolved entries.
6197 * tests/glr-regression.at
6198 (User destructor for unresolved GLR semantic value): New test case.
6199 Problem reported by Joel E. Denny in:
6200 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00016.html
6202 2005-08-21 Paul Eggert <eggert@cs.ucla.edu>
6204 * lib/.cvsignore: Remove realloc.c, strncasecmp.c, xstrdup.c.
6206 * m4/.cvsignore: Remove codeset.m4, gettext.m4, lib-ld.m4,
6207 lib-prefix.m4, po.m4.
6209 * data/glr.c (yyreturn): Use "Cleanup:" rather than "Error:"
6210 in yydestruct diagnostic, since it might not be an error.
6211 Problem reported by Joel Denny near end of
6212 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
6213 * data/lalr1.cc (yyerturn): Likewise.
6214 * data/yacc.c (yyreturn): Likewise.
6215 * tests/calc.at (_AT_CHECK_CALC_ERROR): Adjust to the above change.
6217 * src/files.c: Remove obsolete FIXME comment.
6219 * data/glr.c (YY_SYMBOL_PRINT): Append a newline, for consistency
6220 with the other templates, and to fix bogus run-on messages such
6221 as the one reported at the end of
6222 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
6223 All callers changed to avoid the newline.
6224 (yyprocessOneStack): Output two lines rather than one, to accommodate
6225 the above change. This changes the debug output format slightly.
6227 * data/glr.c (yyresolveValue): Fix redundant parse tree problem
6228 reported by Joel E. Denny in
6229 <http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00004.html>
6231 * tests/glr-regression.at (Duplicate representation of merged trees):
6232 New test, from Joel E. Denny in:
6233 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00013.html>.
6234 * THANKS: Add Joel E. Denny.
6236 * configure.ac (AC_INIT): Bump to 2.0c.
6238 2005-07-24 Paul Eggert <eggert@cs.ucla.edu>
6240 * NEWS: Version 2.0b.
6242 * Makefile.am (SUBDIRS): Put examples before tests, so that
6243 "make check" doesn't finish with "All 1 tests passed".
6245 * tests/regression.at (Token definitions): Don't rely on
6246 AT_PARSER_CHECK for data that contains backslashes. It currently
6247 uses 'echo', and 'echo' isn't portable if its argument contains
6248 backslashes. Problem found on OpenBSD 3.4. Also, do not assume
6249 that the byte '\0xff' is not printable in the C locale; it is,
6250 under OpenBSD 3.4 (!). Luckily, '\0x80' through '\0x9e' are
6251 not printable, so use '\0x81' to test.
6253 * data/glr.c (YYOPTIONAL_LOC): Define even if it's not a recent
6254 version of GCC, since the macro is used with non-GCC compilers.
6256 Fix core dump reported by Pablo De Napoli in
6257 <http://lists.gnu.org/archive/html/bug-bison/2005-07/msg00053.html>.
6258 * tests/regression.at (Invalid inputs with {}): New test.
6259 * src/parse-gram.y (token_name): Translate type before using
6262 * data/glr.c (ATTRIBUTE_UNUSED): Remove, since it infringes on
6263 the user's name space. All uses changed to __attribute__
6265 (yyFail, yyMemoryExhausted, yyreportAmbiguity):
6266 Add __attribute__ ((__noreturn__)).
6268 * etc/clcommit: Remove. We weren't using it, and it failed
6269 "make maintainer-distcheck".
6270 * Makefile.maint: Merge from coreutils.
6271 (CVS_LIST, CVS_LIST_EXCEPT): New macros.
6272 (syntax-check-rules): Change list of rules as described below.
6273 (sc_cast_of_alloca_return_value, sc_dd_max_sym_length):
6274 (sc_file_system, sc_obsolete_symbols, sc_prohibit_atoi_atof):
6275 (sc_prohibit_jm_in_m4, sc_root_tests, sc_tight_scope):
6276 (sc_trailing_space): New rules.
6277 (sc_xalloc_h_in_src): Remove.
6278 (sc_cast_of_argument_to_free, sc_cast_of_x_alloc_return_value):
6279 (sc_space_tab, sc_error_exit_success, sc_changelog):
6280 (sc_system_h_headers, sc_sun_os_names, sc_unmarked_diagnostics):
6281 (makefile-check, po-check, author_mark_check):
6282 (makefile_path_separator_check, copyright-check):
6283 Use grep -n, to make it easier to find violations.
6284 Use CVS_LIST and CVS_LIST_EXCEPT.
6285 (header_regexp, h_re): Remove.
6287 (sc_dd_max_sym_length, .re-list, news-date-check): New rules.
6288 (my-distcheck): Use more-modern GCC flags.
6289 (signatures, %.asc): Remove.
6290 (rel-files, announcement): Remove signatures.
6291 Restore old updating code, even though we don't use it, so
6292 that we're the same as coreutils.
6293 (alpha, beta, major): Depend on news-date-check.
6294 Make the upload commands.
6296 * data/c.m4, data/lalr1.cc, data/yacc.c: Normalize white space.
6297 * lib/abitset.h, lib/bbitset.h, lib/bitset.h: Likewise.
6298 * lib/bitset_stats.c, lib/ebitset.h, lib/lbitset.c: Likewise.
6299 * lib/libitset.h, lib/timevar.c, lib/vbitset.h: Likewise.
6300 * src/Makefile.am, src/gram.c, src/muscle_tab.h: Likewise.
6301 * src/parse-gram.y, src/system.h, src/tables.c, src/vcg.c: Likewise.
6302 * src/vcg_defaults.h, tests/cxx-type.at, tests/existing.at: Likewise.
6303 * tests/sets.at: Likewise.
6305 * data/m4sugar/m4sugar.m4: Sync from Autoconf, except that
6306 we comment out the Autoconf version number.
6307 * doc/bison.texinfo (Calc++ Scanner): Don't use atoi, as
6308 it's error-prone and "make maintainer-distcheck" rejects it.
6310 * lib/subpipe.c: Include <fcntl.h> without checking for HAVE_FCNTL_H.
6311 Indent calls to "error" to pacify "make maintainer-distcheck",
6312 when the calls are not intended to be translated.
6313 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't check for fcntl.h.
6315 * src/Makefile.am (DEFS): Use +=, to pacify
6316 "make maintainer-distcheck".
6317 (bison_SOURCES): Add scan-skel.h.
6318 (sc_tight_scope): New rule, from coreutils.
6320 * src/files.c (src_extension, header_extension):
6321 Now static, not extern.
6322 * src/getargs.c (short_options): Likewise.
6323 * src/muscle_tab.c (muscle_table): Likewise.
6324 * src/parse-gram.y (current_class, current_type, current_prec):
6326 * src/reader.c (grammar_end, previous_rule_end): Likewise.
6327 * src/getargs.h: Redo comments to pacify "make maintainer-distcheck".
6328 * src/main.c (main): Cast bindtextdomain and textdomain calls to
6329 void, to avoid warning when NLS is disabled.
6330 * src/output.c: Include scan-skel.h.
6331 (scan_skel): Remove decl, since scan-skel.h does this.
6333 Indent calls to "error" to pacify "make maintainer-distcheck".
6334 * src/print_graph.c: Don't include <obstack.h>, as system.h does this.
6335 * src/reader.h (gram_end, gram_lineno): New decls to pacify
6336 "make maintainer-distcheck".
6337 * src/scan-skel.l (skel_lex, skel_get_lineno, skel_get_in):
6338 (skel_get_out, skel_get_leng, skel_get_text, skel_set_lineno):
6339 (skel_set_in, skel_set_out, skel_get_debug, skel_set_debug):
6340 (skel_lex_destroy, scan_skel): Move these decls to...
6341 * src/scan-skel.h: New file.
6342 * src/uniqstr.c (uniqstr_assert):
6343 Indent calls to "error" to pacify "make maintainer-distcheck".
6345 * tests/Makefile.am ($(srcdir)/package.m4): Use $(VAR),
6348 * tests/torture.at: Revamp to avoid misuse of atoi that
6349 "make maintainer-distcheck" complained about.
6351 * examples/extexi (message): Don't print a message more than once,
6352 and omit line-number decoration that makes Emacs compile think
6353 that informative messages are worth worrying about.
6355 2005-07-22 Paul Eggert <eggert@cs.ucla.edu>
6357 * configure.ac: Update version number.
6359 * Makefile.am (SUBDIRS): Add examples; somehow this got removed
6361 * examples/calc++/calc++-parser.yy: Remove from CVS, as it's
6362 autogenerated by the maintainer.
6363 * examples/calc++/.cvsignore: Add *.yy.
6365 * lib/bitset.c (bitset_alloc): Don't cast xcalloc result.
6366 * lib/bitset_stats.c (bitset_stats_init): Likewise.
6367 * lib/bitsetv.c (bitsetv_alloc): Likewise.
6369 * po/POTFILES.in: Add lib/xalloc-die.c; remove lib/xmalloc.c.
6371 * src/relation.c (relation_transpose): Rewrite to avoid bogus complaint
6372 from maintainer-distcheck about casting the argument of 'free'.
6374 * NEWS: Mention recent yytname changes.
6375 * THANKS: Add Anthony Heading, twlevo@xs4all.nl.
6377 * bootstrap: For translations that have not yet been upgraded to
6378 the new runtime-po domain, prime the pump by extracting the
6379 relevant strings from the obsolete translations. This code can be
6380 removed once the bison-runtime domain has been translated by each
6383 * src/scan-gram.l (<SC_PRE_CODE>.): Don't double-quote token names,
6384 now that token names are already quoted.
6386 Fix problem reported by Anthony Heading.
6387 * data/glr.c (YYTOKEN_TABLE): New macro.
6388 (yytname): Define if YYTOKEN_TABLE.
6389 * data/yacc.c (YYTOKEN_TABLE, yytname): Likewise.
6390 * data/lalr1.cc (YYTOKEN_TABLE, yytname_): Likewise.
6391 (YYERROR_VERBOSE): Define the same way the other skeletons do.
6392 * src/output.c (prepare_symbols): Output token_table_flag.
6394 2005-07-21 Paul Eggert <eggert@cs.ucla.edu>
6396 * data/glr.c (yyinitGLRStack, yyreturn): Don't call malloc
6397 again if the first call fails.
6399 * data/glr.c (yytnamerr): New function.
6400 (yyreportSyntaxError): Use it to dequote most string literals.
6401 * data/lalr1.c (yytname_): Renamed from yyname_, for compatibility
6402 with other skeletons. All uses changed.
6403 (yytnameerr_): New function.
6404 (yyreport_syntax_error): Use it to dequote most string literals.
6405 * data/yacc.c (yytnamerr): New function.
6406 (yyerrlab): Use it to decode most string literals.
6407 * doc/bison.texinfo (Decl Summary, Calling Convention):
6408 Clarify quoting convention of yytname.
6409 * src/output.c (prepare_symbols): Quote all names. This undoes
6410 the 2005-04-17 change, which is now accomplished (mostly) via
6411 changes in the parsers as described above.
6412 * tests/regression.at (Token definitions, Web2c Actions):
6413 Undo most 2005-04-17 change here, too.
6415 2005-07-20 Paul Eggert <eggert@cs.ucla.edu>
6417 Fix more problems reported by twlevo@xs4all.nl.
6418 * tests/cxx-type.at: Don't pipe output of ./types through sed to
6419 remove trailing spaces. This loses the exit status of ./types,
6420 and isn't needed since ./types shouldn't be emitting trailing
6422 * data/glr.c (yyreturn): Don't pop stack if yyinitStateSet failed,
6423 as the stack isn't valid in that case.
6425 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
6426 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
6427 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
6428 Add declarations to pacify "gcc -Wmissing-prototypes" when flex 2.5.31
6430 * src/scan-skel.l (skel_get_lineno, skel_get_in, skel_get_out):
6431 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
6432 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
6435 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Work even with
6436 overly-picky compilers that reject 'char *foo = "bar";'.
6438 * src/symtab.c (SYMBOL_ATTR_PRINT, symbol_print): Direct output
6439 to FILE * parameter, not to stderr. This fixes a typo introduced
6440 in the 2005-07-12 change.
6442 * lib/subpipe.c (create_subpipe): Rewrite slightly to avoid
6443 warnings from GCC 4.
6445 * data/glr.c (yyexpandGLRStack, yyaddDeferredAction, yyexpandGLRStack):
6446 (yyglrShiftDefer, yysplitStack):
6447 Remove unused parameters b4_pure_formals. All uses changed.
6448 (yyglrShift): Remove unused parameters b4_user_formals.
6450 (yyglrReduce): Removed unused parameter yylocp. All uses changed.
6452 2005-07-18 Paul Eggert <eggert@cs.ucla.edu>
6454 Destructor cleanups and regularization among the three skeletons.
6455 * NEWS: Document the behavior changes.
6456 * data/glr.c (yyrecoverSyntaxError): Don't bother to pop the
6457 stack before failing, as the cleanup code will do it for us now.
6458 * data/lalr1.cc (yyerrlab): Likewise.
6459 * data/glr.c (yyparse): Pop everything off the stack before
6460 freeing it, so that destructors get called properly.
6461 * data/lalr1.cc (yyreturn): Likewise.
6462 * data/yacc.c (yyreturn): Pop and destroy the start symbol, too.
6463 This is more consistent.
6464 * doc/bison.texinfo (Destructor Decl): Mention more reasons
6465 why destructors might be called. 1.875 -> 2.1.
6466 (Destructor Decl, Decl Summary, Table of Symbols):
6467 Some English-language cleanups for %destructor.
6468 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
6469 Add output line for destructor of start symbol.
6470 * tests/calc.at (AT_CHECK_CALC): Add one to line counts,
6471 because of that same extra output line.
6473 * NEWS: Document minor wording changes in diagnostics of
6474 Bison-generated parsers.
6475 * data/glr.c (yyMemoryExhausted): Renamed from yyStackOverflow.
6476 Remove unused formals. All uses changed.
6477 (yyreportAmbiguity): "ambiguity detected" -> "syntax is ambiguous".
6478 (yyparse): Rename yyoverflowlab to yyexhaustedlab.
6479 * data/yacc.c (yyparse): "parser stack overflow" -> "memory exhausted".
6480 Rename yyoverflowab to yyexhaustedlab.
6481 When memory exhaustion occurs during syntax-error reporting,
6482 report it separately rather than in a single diagnostic; this
6484 * doc/bison.texinfo (Memory Management): Renamed from Stack Overflow.
6485 (Memory Exhausted): Renamed from Parser Stack Overflow.
6486 Revamp wording slightly to prefer "memory exhaustion".
6487 * tests/actions.at: "parser stack overflow" -> "memory exhausted".
6489 * data/c.m4 (b4_yysymprint_generate): Use YYFPRINTF, not fprintf.
6491 Add i18n support to the GLR skeleton. Partially fix the C++
6492 skeleton; a C++ expert needs to finish this. Remove debugging
6493 msgids; there's little point to having them translated, since they
6494 can be understood only by someone who can read the
6495 (English-language) source code.
6497 Generate runtime-po/bison-runtime.pot automatically, so that we
6498 don't have to worry about garbage getting in that file. We'll
6499 make sure after the next official release that old msgids don't
6501 <http://lists.gnu.org/archive/html/bison-patches/2005-07/msg00119.html>.
6503 * runtime-po/Makefile.in.in, runtime-po/bison-runtime.pot: Remove.
6505 * PACKAGING: Don't claim that Gawk, GCC, Perl use this method yet.
6506 Fix typos in explanations of the runtime file.
6507 * bootstrap: Change gettext keyword from YYI18N to YY_.
6508 Use standard Makefile.in.in in runtime-po, since we'll arrange
6509 for backward-compatible bison-runtime.po files in a different way.
6510 * data/glr.c (YY_): New macro, from yacc.c.
6511 (yyuserAction, yyreportAmbiguity, yyreportSyntaxError, yyparse):
6512 Translate messages intended for users.
6513 (yyreportSyntaxError): Change "virtual memory" to "memory" to match
6514 the wording in the other skeletons. We don't know that the memory
6516 * data/lalr1.cc (YY_): Renamed from _. All uses changed.
6517 Use same method that yacc.c uses.
6518 Don't translate debugging messages.
6519 (yy::yyreport_syntax_error): Put in a FIXME for the i18n stuff;
6520 it doesn't work (yet), and requires C++ expertise to fix.
6521 * data/yacc.c (YY_): Renamed from YY18N. All uses changed.
6522 Move defn to a more logical place, to be consistent with other
6524 Don't translate debugging messages.
6525 Don't assume line numbers fit in unsigned int; use unsigned long fmts.
6526 * doc/bison.texinfo: Mention <libintl.h>. Change glibc cross reference
6527 to gettext cross reference. Add indexing terms. Mention YYENABLE_NLS.
6528 * runtime-po/POTFILES.in: Add data/glr.c, data/lalr1.cc.
6530 Fix yyerror / yylex test glitches noted by twlevo@xs4all.nl.
6531 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Have yyerror return
6533 * tests/glr-regression.at (Badly Collapsed GLR States):
6535 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
6536 yylex should return 0 at EOF rather than aborting.
6538 Improve tests for stack overflow in GLR parser.
6539 Problem reported by twlevo@xs4all.nl.
6540 * data/glr.c (struct yyGLRStack): Remove yyerrflag member.
6542 (yyStackOverflow): Just longjmp, but with value 2 so that caller
6543 can handle the problem.
6544 (YYCHK1): Use goto (a la yacc.c) rather than setting a flag.
6545 (yyparse): New local variable yyresult to record the result.
6546 Use result of setjmp to set it, rather than storing itinto
6548 (yyDone): Remove label.
6549 (yyacceptlab, yyabortlab, yyoverflowlab, yyreturn): New labels,
6550 to mimic yacc.c. Do not discard lookahead if it's EOF (possible
6551 if YYABORT is used).
6552 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Exit with
6553 yyparse status; put status > 1 into diagnostic.
6554 Check that status==2 works.
6555 * tests/calc.at, tests/cxx-type.at, tests/glr-regression.at:
6556 Use exit status 3 for failure to open (which shouldn't happen).
6558 2005-07-17 Paul Eggert <eggert@cs.ucla.edu>
6560 * tests/conflicts.at (%nonassoc and eof): Don't exit with status
6561 1 on syntax error; just let yyparse do its thing.
6562 * tests/glr-regression.at (Badly Collapsed GLR States): Likewise.
6563 * tests/torture.at (AT_DATA_STACK_TORTURE): Likewise.
6564 (Exploding the Stack Size with Alloca):
6565 (Exploding the Stack Size with Malloc):
6566 Expect exit status 2, not 1, since the parser is supposed to blow
6567 its stack. Problem reported by twlevo@xs4all.nl.
6569 * data/glr.c (yyparse): Don't assume that the initial calls
6570 to YYMALLOC succeed; in that case, yyparse incorrectly returned 0.
6571 Print a stack-overflow message and fail instead.
6572 Initialize the line-number information before creating the stack,
6573 so that the stack-overflow message can report line zero safely.
6575 2005-07-14 Paul Eggert <eggert@cs.ucla.edu>
6577 Fix problems reported by twlevo@xs4all.nl.
6578 * data/glr.c (YYSTACKEXPANDABLE): Don't define if already defined.
6579 (yyuserMerge): Provide a default case if b4_mergers is empty.
6580 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Define YYSTACKEXPANDABLE.
6581 * tests/glr-regression.at
6582 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
6583 Add casts to pacify C++ compilers.
6584 * tests/glr-regression.at (Improper merging of GLR delayed action
6585 sets): Declare yylex before using it.
6586 * tests/Makefile.am (maintainer-check-g++): Fix a stray
6587 $(GXX) that escaped the renaming of GXX to CXX. Remove bogus
6588 test for valgrind; valgrind is independent of g++.
6589 (maintainer-check-posix): Add _POSIX2_VERSION=200112, to check
6590 for compatibility with POSIX 1003.1-2001 (if running coreutils).
6591 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Port to stricter C++.
6592 Use a destructor, so that we can expand the stack. Change
6593 YYSTYPE to char * so that we can free it. Cast result of malloc.
6595 2005-07-13 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
6597 * data/glr.c (yyuserAction): Fix uninitialized variable that caused
6598 a valgrind failure. Problem reported by twlevo@xs4all.nl.
6600 2005-07-13 Paul Eggert <eggert@cs.ucla.edu>
6602 * PACKAGING: New file, suggested by Bruno Haible and taken from
6603 similar wording in gettext's PACKAGING file.
6604 * NEWS: Mention PACKAGING.
6605 * Makefile.am (EXTRA_DIST): Add PACKAGING.
6607 2005-07-12 Paul Eggert <eggert@cs.ucla.edu>
6609 * NEWS: Document recent i18n improvements.
6610 * bootstrap: Get runtime translations into runtime-po.
6611 Create runtime-po files automatically, if possible.
6612 * configure.ac: Invoke BISON_I18N, so that we eat our own dog food.
6613 * data/yacc.c: Rewrite inclusion of <libintl.h> so that ENABLE_NLS
6614 does not infringe on the user's name space.
6615 (YYENABLE_NLS): Renamed from ENABLE_BISON_NLS.
6616 * doc/bison.texinfo (Internationalization): Revamp the English
6617 and Texinfo syntax a bit, to try to make it clearer.
6618 (Bison Options, Option Cross Key): Mention --print-localedir.
6619 * m4/bison-i18n.m4 (BISON_I18N): Rename ENABLE_BISON_NLS to
6620 YYENABLE_NLS. Quote a bit more.
6621 * runtime-po/.cvsignore: New file.
6622 * runtime-po/Makefile.in.in (mostlyclean): Remove *.old.pot.
6623 * runtime-po/Rules-quot: Remove; now created by bootstrap.
6624 * runtime-po/quot.sed: Likewise.
6625 * runtime-po/boldquot.sed: Likewise.
6626 * runtime-po/en@quot.header: Likewise.
6627 * runtime-po/en@boldquot.header: Likewise.
6628 * runtime-po/insert-header.sin: Likewise.
6629 * runtime-po/remove-potcdate.sin: Likewise.
6630 * runtime-po/Makevars: Likewise.
6631 * runtime-po/LINGUAS: Likewise.
6632 * runtime-po/de.po: Likewise; we will rely on the translation project
6633 to maintain this, so "bootstrap" should get it.
6634 * src/getarg.c (PRINT_LOCALEDIR_OPTION): Let the C compiler determine
6636 * src/main.c (main): Bind the bison-runtime domain, too.
6638 2005-07-12 Bruno Haible <bruno@clisp.org>
6640 * data/yacc.c: Include <libintl.h> when NLS is enabled.
6641 (YYI18N): Renamed from _. Use dgettext when NLS is enabled.
6642 * po/POTFILES.in: Remove autogenerated file src/parse-gram.c.
6643 * runtime-po: New directory.
6644 * runtime-po/Makefile.in.in: New file, copied from po/, with modified
6645 $(DOMAIN).pot-update rule, so that old messages are never dropped.
6646 * runtime-po/Rules-quot: New file, copied from po/.
6647 * runtime-po/quot.sed: Likewise.
6648 * runtime-po/boldquot.sed: Likewise.
6649 * runtime-po/en@quot.header: Likewise.
6650 * runtime-po/en@boldquot.header: Likewise.
6651 * runtime-po/insert-header.sin: Likewise.
6652 * runtime-po/remove-potcdate.sin: Likewise.
6653 * runtime-po/Makevars: New file.
6654 * runtime-po/POTFILES.in: New file.
6655 * runtime-po/LINGUAS: New file.
6656 * runtime-po/bison-runtime.pot: New file.
6657 * runtime-po/de.po: New file.
6658 * m4/bison.m4: New file.
6659 * Makefile.am (SUBDIRS): Add runtime-po.
6660 (aclocaldir, aclocal_DATA): New variables.
6661 * configure.ac: Add AC_CONFIG_FILES of runtime-po/Makefile.in.
6663 * src/getargs.c (usage): Document --print-localedir option.
6664 (PRINT_LOCALEDIR_OPTION): New enum item.
6665 (long_options): Add --print-localedir option.
6666 (getargs): Handle --print-localedir option.
6667 * doc/bison.texinfo (Bison Parser): Remove paragraph about _().
6668 (Internationalization): New section.
6670 2005-07-12 Akim Demaille <akim@epita.fr>
6672 * src/symtab.h, src/symtab.c (symbol_print): Swap the arguments,
6673 for consistency with the rest of the code.
6674 * src/symlist.h, src/symlist.c (symbol_list_print): Ditto.
6677 2005-07-12 Akim Demaille <akim@epita.fr>
6679 * src/parse-gram.y: Use %printer instead of YYPRINT.
6681 2005-07-12 Akim Demaille <akim@epita.fr>
6683 * src/symtab.h, src/symtab.c (symbol_print): New.
6684 * src/symlist.h, src/symlist.c (symbol_list_print): New.
6685 * src/symlist.c (symbol_list_n_type_name_get): Report the culprit.
6687 2005-07-12 Akim Demaille <akim@epita.fr>
6689 * data/glr.c (b4_syncline): Fix (swap) the definitions of
6690 b4_at_dollar and b4_dollar_dollar.
6692 2005-07-11 Paul Eggert <eggert@cs.ucla.edu>
6694 * doc/bison.texinfo (Mystery Conflicts): Add reference to DeRemer
6695 and Pennello's paper.
6697 2005-07-09 Paul Eggert <eggert@cs.ucla.edu>
6699 * data/yacc.c (yyparse): Undo previous patch. Instead,
6700 set yylsp[0] and yyvsp[0] only if the initial action
6701 sets yylloc and yylval, respectively.
6703 * data/yacc.c (yyparse): In the initial action, set
6704 yylsp[0] and yyvsp[0] rather than yylloc and yylval.
6705 This avoids the use of undefined variables if the initial
6706 action does not set yylloc and/or yylval.
6708 2005-07-07 Paul Eggert <eggert@cs.ucla.edu>
6710 * examples/calc++/calc++-driver.cc, examples/calc++/calc++-driver.hh:
6711 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc:
6712 Remove from CVS. These files are automatically generated.
6713 * examples/extexi: Clarify that this file is now part of Bison,
6714 not GNU M4, and that it works with any POSIX-compatible Awk.
6715 * examples/calc++/Makefile.am (run_extexi): Remove; not used.
6716 ($(calc_extracted)): Renamed from $(calc_sources_extracted),
6717 so that we also get calc++-parser.yy. Geneate it.
6718 Use $(AWK), not gawk, since any conforming Awk will do.
6719 Put comment before action, since older 'make' can't handle comment
6721 $(BUILT_SOURCES): List all built sources, not just some of them.
6722 $(MAINTAINERCLEANFILES): Remove *.stamp, and all built sources.
6723 $($(srcdir)/calc++-parser.stamp): Work even if POSIXLY_CORRECT.
6724 $($(calc_sources_generated)): Remove unnecessary test for existence
6725 of target. (This had a shell syntax error anyway; a stray "x".)
6726 (calc_extracted): List $(srcdir)/calc++-parser.yy, not
6728 * examples/.cvsignore, examples/calc++/.cvsignore: New files.
6730 * bootstrap (gnulib_modules): Add gettext, now that it's no longer
6731 implied by the other modules.
6733 2005-07-06 Akim Demaille <akim@epita.fr>
6735 Bind examples/calc++ to the package.
6736 * examples/calc++/Makefile: Remove, replaced by...
6737 * examples/calc++/Makefile.am: ... this new file.
6738 * examples/calc++/test: Remove input.
6739 * examples/calc++/compile: Remove.
6740 * examples/Makefile.am: New.
6741 * configure.ac, Makefile.am: Adjust.
6742 * doc/Makefile.am (clean-local): New, for more recent texi2dvis.
6744 2005-07-05 Paul Eggert <eggert@cs.ucla.edu>
6746 * data/glr.c (yyFail): Drastically simplify; since the format argument
6747 never had any % directives, we can simply pass it to yyerror.
6748 (yyparse): Use "t a; a=b;" rather than "t a = b;" when a will
6749 be modified later, as that is the usual style in glr.c.
6750 Problems reported by Paul Hilfinger.
6752 Rewrite GLR parser to catch more buffer overrun, storage exhaustion,
6753 and size overflow errors.
6754 * data/glr.c: Include <stdio.h> etc. after user prolog, not before,
6755 in case the user prolog sets feature-test macros like _GNU_SOURCE.
6756 (YYSIZEMAX): New macro.
6757 (yystpcpy): New function, taken from yacc.c.
6758 (struct yyGLRStack.yyspaceLeft): Now size_t, not int.
6759 (yyinitGLRStack, yyfreeGLRstack): Remove unnecessary forward decls,
6760 so that we don't have to maintain their signatures.
6761 (yyFail): Check for buffer overflow, by using vsnprintf rather
6762 than vsprintf. Allocate a bigger buffer if possible.
6763 Report an error if buffer allocation fails.
6764 (yyStackOverflow): New function.
6765 (yyinitStateSet, yyinitGLRStack): Return a boolean indicating whether
6766 the initialization was successful. It might fail if storage was
6768 (yyexpandGLRStack): Add more checks for storage allocation failure.
6769 Use yyStackOverflow to report failures.
6770 (yymarkStackDeleted, yyglrShift, yyglrShiftDefer, yydoAction):
6771 (yysplitStack, yyprocessOneStack, yyparse, yypstack):
6772 Don't assume stack number fits in int.
6773 (yysplitStack): Check for storage allocation failure.
6774 (yysplitStack, yyprocessOneStack): Add pure_formals, so that we
6775 can print diagnostics on storage allocation failure. All callers
6777 (yyresolveValue): Use yybool for boolean.
6778 (yyreportSyntaxError): Check for size-calculation overflow.
6779 This code is taken from yacc.c.
6780 (yyparse): Check for storage allocation errors when allocating
6783 2005-07-05 Akim Demaille <akim@epita.fr>
6785 Extract calc++ from the documentation.
6786 * doc/bison.texinfo (Calc++): Add the extraction marks.
6787 * examples/extexi: New, from the aborted GNU Programming 2E.
6788 Separate the different paragraph of a file with empty lines.
6789 * examples/Makefile: Use it to extract the whole calc++ example.
6791 2005-06-24 Akim Demaille <akim@epita.fr>
6793 * doc/bison.texinfo (C++ Parser Interface): Use defcv to define
6796 2005-06-22 Akim Demaille <akim@epita.fr>
6798 * doc/bison.texinfo (C++ Language Interface): First stab.
6799 (C++ Parsers): Remove.
6801 2005-06-22 Akim Demaille <akim@epita.fr>
6803 * data/lalr1.cc (yylex_): Honor %lex-param.
6805 2005-06-22 Akim Demaille <akim@epita.fr>
6807 Start a set of simple examples.
6808 * examples/calc++/Makefile, examples/calc++/calc++-driver.cc,
6809 * examples/calc++/calc++-driver.hh,
6810 * examples/calc++/calc++-parser.yy,
6811 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc,
6812 * examples/calc++/compile, examples/calc++/test: New.
6814 2005-06-09 Paul Eggert <eggert@cs.ucla.edu>
6816 * data/yacc.c (malloc, free) [defined __cplusplus]: Wrap inside
6817 extern "C" {}. This fixes a problem reported by Paul Hilfinger,
6818 which stems from the 2005-05-27 patch.
6820 2005-06-06 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
6822 * data/glr.c: Modify treatment of unused parameters to permit use
6823 of g++ (which doesn't allow __attribute__ ((unused)) for parameters).
6825 2005-05-30 Paul Eggert <eggert@cs.ucla.edu>
6827 Fix infringement on user name space reported by Janos Zoltan Szabo.
6828 * data/yacc.c (yyparse): strlen -> yystrlen.
6830 2005-05-30 Akim Demaille <akim@epita.fr>
6832 * data/lalr1.cc (_): New.
6833 Translate the various messages.
6835 2005-05-27 Paul Eggert <eggert@cs.ucla.edu>
6837 Fix infringement on user name space reported by Bruno Haible.
6838 * data/yacc.c (YYSIZE_T): Define first, so that later decls can use it.
6839 Prefer GCC's __SIZE_TYPE__ if available, so that we don't infringe on
6840 the user's name space.
6841 (alloca): Include <stdlib.h> to get it, if it's not built in.
6842 (YYMALLOC, YYFREE): Define only if needed.
6843 (malloc, free): Declare, but only if needed, as this infringes on
6844 the user name space.
6846 2005-05-25 Paul Eggert <eggert@cs.ucla.edu>
6848 Fix BeOS, FreeBSD, MacOS porting problems reported by Bruno Haible.
6849 * lib/bitset.c (bitset_print): Don't assume size_t can be printed
6851 * lib/ebitset.c (min, max): Undef before defining.
6852 * lib/vbitset.c (min, max): Likewise.
6853 * lib/subpipe.c (create_subpipe): Save local variables in case
6854 vfork clobbers them.
6856 2005-05-24 Bruno Haible <bruno@clisp.org>
6858 * tests/synclines.at (AT_SYNCLINES_COMPILE): Add support for the
6859 error message syntax used by gcc-4.0.
6861 2005-05-23 Paul Eggert <eggert@cs.ucla.edu>
6863 * README: Mention m4 1.4.3. Remove obsolete advice about
6864 Sun Forte Developer 6 update 2, VMS, and MS-DOS.
6866 * bootstrap: Remove workaround for problem I encountered with
6867 gettext 0.14.1; it seems to be fixed now.
6869 2005-05-22 Paul Eggert <eggert@cs.ucla.edu>
6871 * NEWS: Version 2.0a.
6873 * src/files.c: Include "stdio-safer.h"; this fixes a typo in
6874 the previous change.
6876 Various maintainer cleanups.
6877 * .cvsignore: Add a.exe, a.out, b.out,, conf[0-9]*, confdefs*,
6878 conftest*, for benefit of CVS commands run at the same time as
6879 "configure". Add build-aux, since "bootstrap" now creates it and
6881 * Makefile.cfg (move_if_change): Remove.
6882 * Makefile.maint: Remove the update stuff; we now use "bootstrap".
6883 (ftp-gnu, www-gnu, move_if_change, local_updates, update):
6884 (po_repo, do-po-update, po-update, wget_files, get-targets):
6885 (config.guess-url_prefix, config.sub-url_prefix):
6886 (ansi2knr.c-url_prefix, texinfo.tex-url_prefix):
6887 (standards.texi-url_prefix, make-stds.texi-url_prefix, taget, url):
6888 ($(get-targets), cvs-files, automake_repo, wget-update, cvs-update):
6890 * configure.ac (AC_CONFIG_AUX_DIR): Change from config to build-aux;
6891 this is now the recommended name.
6892 * config/.cvsignore: Remove config.guess, config.rpath, config.sub,
6893 depcomp, install-sh, mdate-sh, missing, mkinstalldirs, texinfo.tex,
6894 ylwrap. These files now go into build-aux.
6895 * config/move-if-change: Remove.
6896 * config/prev-version.txt: Bump from 1.75 to 2.0.
6898 * bootstrap: Add stdio-safer, unistd-safer modules.
6899 Remove m4/glibc2.m4 (introduced by latest gnulib, but
6901 * lib/.cvsignore: Add dup-safer.c, fd-safer.c,
6902 fopen-safer.c, stdio-safer.h, unistd-safer.h.
6903 * lib/subpipe.c: Include "unistd-safer.h".
6904 (create_subpipe): Make sure all the newly-created
6905 file descriptors are > 2, so that diagnostics don't
6906 get sent down them (which might cause Bison to hang, in theory).
6907 * m4/.cvsignore: Add stdio-safer.m4, unistd-safer.m4.
6908 * src/files.c (xfopen): Use fopen_safer, not fopen.
6910 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Port
6911 yesterday's yacc.c fix.
6913 2005-05-21 Paul Eggert <eggert@cs.ucla.edu>
6915 * data/glr.c, data/lalr1.cc: Update copyright date.
6917 Fix a destructor bug reported by Wolfgang Spraul in
6918 <http://lists.gnu.org/archive/html/bug-bison/2005-05/msg00042.html>.
6919 * data/yacc.c (yyabortlab): Don't call destructor, and
6920 don't set yychar to EMPTY.
6921 (yyoverflowlab): Don't call destructor.
6922 (yyreturn): Call destructor, if yychar is neither YYEOF nor YYEMPTY.
6923 * tests/calc.at (AT_CHECK_CALC): Expect one fewer output lines,
6924 since we no longer output the message "discarding lookahead token
6927 2005-05-20 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
6929 * data/glr.c (YY_SYMBOL_PRINT): Don't print newline at end to
6930 fix a small glitch in debugging output.
6931 (yyprocessOneStack, yyrecoverSyntaxError, yyparse): Print newline
6932 after YY_SYMBOL_PRINT where needed.
6934 (struct yyGLRState): Add some comments.
6935 (struct yySemanticOption): Add some comments.
6936 (union yyGLRStackItem): Add comment.
6938 (yymergeOptionSets): Correct this to properly perform the union,
6939 avoiding infinite reported by Michael Rosien.
6942 * tests/glr-regression.at: Add test for GLR merging error reported
6945 2005-05-13 Paul Eggert <eggert@cs.ucla.edu>
6947 * COPYING, ChangeLog, GNUmakefile, HACKING, Makefile.am,
6948 Makefile.cfg, Makefile.maint, NEWS, README, README-alpha,
6949 README-cvs, TODO, bootstrap, configure.ac, data/Makefile.am,
6950 data/README, data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c,
6951 data/m4sugar/m4sugar.m4, doc/Makefile.am, doc/bison.texinfo,
6952 doc/fdl.texi, doc/gpl.texi, doc/refcard.tex, lib/Makefile.am,
6953 lib/abitset.c, lib/abitset.h, lib/bbitset.h, lib/bitset.c,
6954 lib/bitset.h, lib/bitset_stats.c, lib/bitset_stats.h,
6955 lib/bitsetv-print.c, lib/bitsetv-print.h, lib/bitsetv.c,
6956 lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/get-errno.c,
6957 lib/get-errno.h, lib/lbitset.c, lib/lbitset.h, lib/libiberty.h,
6958 lib/main.c, lib/subpipe.c, lib/subpipe.h, lib/timevar.c,
6959 lib/timevar.def, lib/timevar.h, lib/vbitset.c, lib/vbitset.h,
6960 lib/yyerror.c, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4, m4/timevar.m4,
6961 m4/warning.m4, src/LR0.c, src/LR0.h, src/Makefile.am, src/assoc.c,
6962 src/assoc.h, src/closure.c, src/closure.h, src/complain.c,
6963 src/complain.h, src/conflicts.c, src/conflicts.h, src/derives.c,
6964 src/derives.h, src/files.c, src/files.h, src/getargs.c,
6965 src/getargs.h, src/gram.c, src/gram.h, src/lalr.c, src/lalr.h,
6966 src/location.c, src/location.h, src/main.c, src/muscle_tab.c,
6967 src/muscle_tab.h, src/nullable.c, src/nullable.h, src/output.c,
6968 src/output.h, src/parse-gram.c, src/parse-gram.h,
6969 src/parse-gram.y, src/print.c, src/print.h, src/print_graph.c,
6970 src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c,
6971 src/reduce.h, src/relation.c, src/relation.h, src/scan-gram.l,
6972 src/scan-skel.l, src/state.c, src/state.h, src/symlist.c,
6973 src/symlist.h, src/symtab.c, src/symtab.h, src/system.h,
6974 src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h,
6975 src/vcg.c, src/vcg.h, src/vcg_defaults.h, tests/Makefile.am,
6976 tests/actions.at, tests/c++.at, tests/calc.at, tests/conflicts.at,
6977 tests/cxx-type.at, tests/existing.at, tests/glr-regression.at,
6978 tests/headers.at, tests/input.at, tests/local.at, tests/output.at,
6979 tests/reduce.at, tests/regression.at, tests/sets.at,
6980 tests/synclines.at, tests/testsuite.at, tests/torture.at:
6981 Update FSF postal mail address.
6983 2005-05-11 Paul Eggert <eggert@cs.ucla.edu>
6985 * tests/local.at (AT_COMPILE_CXX): Treat LDFLAGS like AT_COMPILE does.
6986 Problem reported by Ralf Menzel.
6988 2005-05-01 Paul Eggert <eggert@cs.ucla.edu>
6990 * tests/actions.at: Test that stack overflow invokes destructors.
6991 From Marcus Holland-Moritz.
6992 * data/yacc.c (yyerrlab): Move the code that destroys the stack
6994 (yyreturn): to here. That way, destructors are called properly
6995 even if the stack overflows, or the user calls YYACCEPT or
6996 YYABORT. Stack-overflow problem reported by Marcus Holland-Moritz.
6997 (yyoverflowlab): Destroy the lookahead.
6999 2005-04-24 Paul Eggert <eggert@cs.ucla.edu>
7001 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): Add more-descriptive comment.
7003 2005-04-17 Paul Eggert <eggert@cs.ucla.edu>
7005 * NEWS: Bison-generated C parsers no longer quote literal strings
7006 associated with tokens.
7007 * src/output.c (prepare_symbols): Don't escape strings,
7008 since users don't want to see C escapes.
7009 * tests/calc.at (AT_CHECK_CALC): Adjust to lack of quotes
7011 * tests/input.at (Torturing the Scanner): Likewise.
7012 * tests/regression.at (Token definitions, Web2c Actions): Likewise.
7014 2005-04-16 Paul Eggert <eggert@cs.ucla.edu>
7016 * tests/torture.at (AT_INCREASE_DATA_SIZE): Skip the test if
7017 the data size is known to be too small and we can't increase it.
7018 This works around an HP-UX 11.00 glitch reported by Andrew Benham.
7020 2005-04-15 Paul Eggert <eggert@cs.ucla.edu>
7022 * src/parse-gram.y: Include quotearg.h.
7023 (string_as_id): Quote $1 before using it as a key, since the
7024 lexer no longer quotes it for us.
7025 (string_content): Don't strip quotes, since lexer no longer
7027 * src/scan-gram.l: Include quotearg.h.
7029 ("'"<SC_ESCAPED_CHARACTER>): Quote symbol before using it as
7030 a key, since the rest of the lexer doesn't quote it.
7031 * src/symtab.c (symbol_get): Don't quote symbol; caller does it now.
7032 * tests/regression.at (Token definitions): Check for backslashes
7035 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): New macro.
7036 (YYSIZE_T): Define to unsigned long int when using an older compiler.
7037 (yyparse): Revamp code to generate long syntax error message, to
7038 make it easier to translate, and to avoid problems with arithmetic
7039 overflow. Change "virtual memory" to "memory" in diagnostic, since
7040 we don't know whether the memory is virtual.
7042 2005-04-13 Paul Eggert <eggert@cs.ucla.edu>
7044 * NEWS: Bison-generated C parsers now use the _ macro to
7046 * data/yacc.c (_) [!defined _]: New macro.
7047 All English strings wrapped inside this macro.
7048 * doc/bison.texinfo (Bison Parser): Document _.
7049 * po/POTFILES.in: Include src/parse-gram.c, since it now
7050 includes translateable strings that parse-gram.y doesn't.
7052 2005-04-12 Paul Eggert <eggert@cs.ucla.edu>
7054 * src/symtab.c (symbol_make_alias): Call symbol_type_set,
7055 reverting the 2004-10-11 change to this function.
7056 (symbol_check_alias_consistency): Don't call symbol_type_set
7057 if the type name is already correct.
7058 * tests/input.at (Typed symbol aliases): New test, from Tim Van Holder.
7060 2005-03-25 Paul Eggert <eggert@cs.ucla.edu>
7062 * tests/regression.at (Token definitions): Don't use a token named
7063 c, as that generates a "#define c ..." that runs afoul of buggy
7064 stdlib.h that uses the identifier c as a member of struct
7065 drand48_data. Problem reported by Horst Wente.
7067 2005-03-21 Paul Eggert <eggert@cs.ucla.edu>
7069 * bootstrap: Change translation URL from
7070 http://www2.iro.umontreal.ca/~gnutra/po/maint/bison/ to
7071 http://www.iro.umontreal.ca/translation/maint/bison/ to avoid
7072 redirection glitches. Problem reported by twlevo@xs4all.nl.
7074 2005-03-20 Paul Eggert <eggert@cs.ucla.edu>
7076 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Don't put options
7077 after operands; POSIX says this isn't portable for the c99 command.
7079 2005-03-18 Paul Eggert <eggert@cs.ucla.edu>
7081 * tests/glr-regression.at (glr-regr2a.y): Try to dump core
7082 immediately if a data overrun has occurred; this may help us track
7083 down what may be a spurious failure on MacOS.
7085 2005-03-17 Paul Eggert <eggert@cs.ucla.edu>
7087 Respond to problems reported by twlevo@xs4all.nl.
7089 * bootstrap: Use "trap - 0" rather than the unportable "trap 0".
7091 * src/vcg.h: Comment fix.
7092 * src/vcg_defaults.h: Parenthesize macro bodies to make them safe.
7093 (G_CMAX): Change to -1 instead of INT_MAX.
7095 * data/yacc.c (yyparse): Omit spaces before #line.
7097 2005-03-15 Paul Eggert <eggert@cs.ucla.edu>
7099 * src/tables.c (state_number_to_vector_number): Put it inside an
7100 "#if 0", since it's not currently used. Problem reported by
7103 2005-03-06 Paul Eggert <eggert@cs.ucla.edu>
7105 * src/output.c (escaped_output): Renamed from
7106 escaped_file_name_output, since we now use it for symbol tags as
7107 well. All uses changed.
7108 (symbol_destructors_output, symbol_printers_output):
7109 Escape symbol tags too.
7110 Problem reported by Matyas Forstner in
7111 <http://lists.gnu.org/archive/html/bug-bison/2005-03/msg00009.html>.
7113 * src/muscle_tab.c (muscle_code_grow): Don't quote numbers; it's
7115 * src/output.c (user_actions_output, token_definitions_output,
7116 symbol_destructors_output, symbol_printers_output): Likewise.
7117 * src/reader.c (prologue_augment): Likewise.
7118 * src/scan-gram.l (handle_action_dollar, handle_action_at): Likewise.
7120 * src/vcg.c (output_edge): Don't quote linestyle arg.
7121 Problem reported by twlevo@xs4all.nl.
7123 2005-02-28 Paul Eggert <eggert@cs.ucla.edu>
7125 * doc/bison.texinfo (Semantic Tokens): Fix scoping problem in
7126 example, reported by Derek M Jones. Also, make the example even
7127 more outrageous, to better illustrate how bad the problem is.
7129 2005-02-24 Paul Eggert <eggert@cs.ucla.edu>
7131 * doc/bison.texinfo (Mfcalc Symtab): Correct the prototype for
7132 putsym. Typo reported by Sebastian Piping.
7134 2005-02-23 Paul Eggert <eggert@cs.ucla.edu>
7136 * doc/bison.texinfo (Language and Grammar): some -> same
7137 (Epilogue): int he -> in the
7138 Typos reported by Sebastian Piping via Justin Pence.
7140 2005-02-07 Paul Eggert <eggert@cs.ucla.edu>
7142 * tests/glr-regression.at (Improper handling of embedded actions
7143 and dollar(-N) in GLR parsers): Renamed from "Improper handling of
7144 embedded actions and $-N in GLR parsers", work around an Autoconf bug
7145 with dollar signs in test names.
7146 * tests/input.at (Invalid dollar-n): Renamed from "Invalid \$n",
7147 for a similar reason.
7149 2005-01-28 Paul Eggert <eggert@cs.ucla.edu>
7151 * src/vcg.c (output_graph): G_VIEW -> normal_view in case someone
7152 wants to redefine G_VIEW.
7154 2005-01-27 Paul Eggert <eggert@cs.ucla.edu>
7156 * src/vcg.c (get_view_str): Remove case for normal_view.
7157 Problem reported by twlevo@xs4all.nl.
7159 2005-01-24 Paul Eggert <eggert@cs.ucla.edu>
7161 * configure.ac (O0CFLAGS, O0CXXFLAGS): Fix quoting bug.
7162 Problem reported by twlevo@xs4all.nl.
7164 * doc/bison.texinfo: Change @dircategory from "GNU programming
7165 tools" to "Software development". Requested by Richard Stallman
7168 2005-01-23 Paul Eggert <eggert@cs.ucla.edu>
7170 * tests/c++.at (AT_CHECK_DOXYGEN): Don't use options after operands.
7171 Problem reported by twlevo@xs4all.nl.
7173 2005-01-21 Paul Eggert <eggert@cs.ucla.edu>
7175 * data/yacc.c (YYCOPY, yystpcpy, yyparse): Remove "register"
7176 keyword; it's not needed with modern compilers, and it doesn't
7177 affect correctness with older compilers. Suggested by
7180 2005-01-17 Paul Eggert <eggert@cs.ucla.edu>
7182 * data/glr.c (yyuserAction): Add "default: break;" case to pacify
7183 gcc -Wswitch-default.
7184 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
7185 * data/yacc.c (yyparse): Likewise.
7187 2005-01-12 Paul Eggert <eggert@cs.ucla.edu>
7189 * src/system.h (OUTPUT_EXT, TAB_EXT): Define only if not defined
7190 already. Let config.h define any nonstandard values.
7192 2005-01-10 Paul Eggert <eggert@cs.ucla.edu>
7194 * tests/calc.at (_AT_DATA_CALC_Y): Use alarm (100), not alarm (10),
7195 for the benefit of slower hosts. Problem reported by
7198 2005-01-07 Paul Eggert <eggert@cs.ucla.edu>
7200 * data/yacc.c (yyparse): Pacify non-GCC compilers about yyerrorlab
7201 being defined and not used.
7202 * data/lalr1.cc (yyparse): Likewise.
7203 Use "if (false)" rather than "if (0)".
7205 2005-01-05 Paul Eggert <eggert@cs.ucla.edu>
7207 * TODO: Mention that we should allow NUL bytes in tokens.
7209 2005-01-02 Paul Eggert <eggert@cs.ucla.edu>
7211 * src/scan-skel.l (<<EOF>>): Don't close standard output.
7212 Problem reported by Hans Aberg.
7214 2005-01-01 Paul Eggert <eggert@cs.ucla.edu>
7216 * src/getargs.c (version): Happy new year; update overall
7217 program copyright date from 2004 to 2005.
7219 * src/scan-skel.l ("@output ".*\n): Don't close standard output.
7220 Problem reported by Hans Aberg.
7221 * tests/output.at (AT_CHECK_OUTPUT): New arg SHELLIO.
7222 (Output file names.): Add a test for the case when standard output
7225 2004-12-26 Paul Eggert <eggert@cs.ucla.edu>
7227 * doc/bison.texinfo (@copying): Update FDL version number to 1.2,
7228 to fix an oversight in the Bison 2.0 manual.
7230 2004-12-25 Paul Eggert <eggert@cs.ucla.edu>
7232 * NEWS: Version 2.0. Reformat the existing news items since
7233 1.875, so that related items are grouped together.
7234 * configure.ac (AC_INIT): Bump version to 2.0.
7235 * src/parse-gram.c, src/parse-gram.h: Regenerate with 2.0.
7237 * tests/torture.at (Exploding the Stack Size with Alloca): Set
7238 YYSTACK_USE_ALLOCA to 1 if __GNUC__ or alloca are defined;
7239 otherwise, we're not testing alloca. Unfortunately there's no
7240 simple way to consult HAVE_ALLOCA here.
7242 * data/lalr1.cc (yydestruct_): Pacify unused variable warning
7245 * src/LR0.c (new_itemsets): Use memset rather than zeroing by
7246 hand. This avoids a warning about comparing int to size_t when
7247 GCC warnings are enabled.
7249 2004-12-22 Paul Eggert <eggert@cs.ucla.edu>
7251 * NEWS: Bison-generated parsers no longer default to using the
7252 alloca function (when available) to extend the parser stack, due
7253 to widespread problems in unchecked stack-overflow detection.
7254 * data/glr.c (YYMAXDEPTH): Remove undef when zero. It's the user's
7255 responsibility to set it to a positive value. This lets the user
7256 specify a value that is not a preprocessor constant.
7257 * data/yacc.c (YYMAXDEPTH): Likewise.
7258 (YYSTACK_ALLOC): Define only if YYSTACK_USE_ALLOCA is nonzero.
7259 * doc/bison.texinfo (Stack Overflow): YYMAXDEPTH no longer needs
7260 to be a compile-time constant. However, explain the constraints on it.
7261 Also, explain the constraints on YYINITDEPTH.
7262 (Table of Symbols): Explain that alloca is no longer the default.
7263 Explain the user's responsibility if they define YYSTACK_USE_ALLOCA
7266 * doc/bison.texinfo (Location Default Action): Mention that n must
7267 be zero when k is zero. Suggested by Frank Heckenbach.
7269 2004-12-22 Akim Demaille <akim@epita.fr>
7271 * data/lalr1.cc (parser::token_number_type, parser::rhs_number_type)
7272 (parser::state_type, parser::semantic_type, parser::location_type):
7273 Private, not public.
7274 (parser::parse): Return ints, not bool.
7275 Returning a bool introduces a problem: 0 corresponds to false, and
7276 it seems weird to return false on success. Returning true changes
7277 the conventions for yyparse.
7278 Alternatively we could return void and send an exception.
7279 There is no clear consensus (yet?).
7280 (state_stack, semantic_stack, location_stack): Rename as...
7281 (state_stack_type, semantic_stack_type, location_stack_type): these.
7282 Private, not public.
7283 * tests/c++.at: New.
7284 * tests/testsuite.at, tests/Makefile.am: Adjust.
7286 2004-12-21 Akim Demaille <akim@epita.fr>
7288 * data/lalr1.cc (parser::parse): Return a bool instead of an int.
7290 2004-12-21 Akim Demaille <akim@epita.fr>
7292 Don't impose std::string for filenames.
7294 * data/lalr1.cc (b4_filename_type): New.
7295 (position::filename): Use it.
7296 (parser.hh): Move the inclusion of stack.hh and location.hh below
7297 the user code, so that needed headers for the filename type can be
7299 Forward declare them before the user code.
7300 * tests/Makefile.am (check-local, installcheck-local): Pass
7301 TESTSUITEFLAGS to the TESTSUITE.
7303 2004-12-20 Akim Demaille <akim@epita.fr>
7305 Use more STL like names: my_class instead of MyClass.
7307 * data/lalr1.cc (LocationStack, LocationType, RhsNumberType)
7308 (SemanticStack, SemanticType, StateStack, StateType)
7309 (TokenNumberType, Stack, Slice, Traits, Parser::location)
7310 (Parser::value): Rename as...
7311 (location_stack, location_type, rhs_number_type, semantic_stack)
7312 (semantic_type, state_stack, state_type, token_number_type, stack)
7313 (slice, traits, parser::yylloc, parser::yylval): these.
7315 * tests/calc.at, tests/regression.at, tests/actions.at: Adjust.
7317 2004-12-19 Paul Eggert <eggert@cs.ucla.edu>
7319 * data/glr.c (YYLLOC_DEFAULT): Use GNU spacing conventions.
7320 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
7322 2004-12-17 Paul Eggert <eggert@cs.ucla.edu>
7324 Remove uses of 'short int' and 'unsigned short int'. This raises
7325 some arbitrary limits. It uses more memory but nowadays that's
7326 not much of an issue.
7328 This change does not affect the generated parsers; that's a different
7329 task, as some users will want to conserve memory there.
7331 Ideally we should use size_t to represent all object counts, and
7332 something like ptrdiff_t to represent signed differences of object
7333 counts; but that will require more code-cleanup than I have the
7334 time to do right now.
7336 * src/LR0.c (allocate_itemsets, new_itemsets, save_reductions):
7337 Use size_t, not int or short int, to count objects.
7338 * src/closure.c (nritemset, closure): Likewise.
7339 * src/closure.h (nritemset, closure): Likewise.
7340 * src/nullable.c (nullable_compute): Likewise.
7341 * src/print.c (print_core): Likewise.
7342 * src/print_graph.c (print_core): Likewise.
7343 * src/state.c (state_compare, state_hash): Likewise.
7344 * src/state.h (struct state): Likewise.
7345 * src/tables.c (default_goto, goto_actions): Likewise.
7347 * src/gram.h (rule_number, rule): Use int, not short int.
7348 * src/output.c (prepare_rules): Likewise.
7349 * src/state.h (state_number, STATE_NUMBER_MAXIMUM, transitions,
7350 errs, reductions): Likewise.
7351 * src/symtab.h (symbol_number, SYMBOL_NUMBER_MAXIMUM, struct symbol):
7353 * src/tables.c (vector_number, tally, action_number,
7354 ACTION_NUMBER_MINIMUM): Likewise.
7355 * src/output.c (muscle_insert_short_int_table): Remove.
7357 2004-12-17 Akim Demaille <akim@epita.fr>
7359 * data/lalr1.cc: Extensive Doxygenation.
7360 (error_): Rename as...
7361 (error): this, since it is visible to the user.
7363 (Parser::message): Now an automatic variable from...
7364 (Parser::yyreport_syntax_error_): here.
7365 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust to
7367 * tests/input.at: Escape $.
7369 2004-12-16 Paul Eggert <eggert@cs.ucla.edu>
7371 * data/glr.c (b4_lhs_value, b4_rhs_value, b4_rhs-location):
7372 Parenthesize rhs to avoid obscure problems with mistakes like
7373 "foo$$bar = foo$1bar;". Problem reported by twlevo at xs4all.
7374 * data/lalr1.cc (b4_lhs_value, b4_rhs_value, b4_lhs_location,
7375 b4_rhs_location): Likewise.
7376 * data/yacc.c (b4_lhs_value, b4_rhs_value, b4_lhs_location,
7377 b4_rhs_location): Likewise.
7379 2004-12-16 Akim Demaille <akim@epita.fr>
7381 * data/lalr1.cc (yyreport_syntax_error_): Catch up with glr.c and
7382 yacc.c: be sure to stay within yycheck_.
7383 * tests/actions.at: Re-enable C++ tests.
7385 2004-12-16 Akim Demaille <akim@epita.fr>
7387 * src/print_graph.c (print_graph): Remove layoutalgorithm uses for
7390 2004-12-16 Akim Demaille <akim@epita.fr>
7392 Use #define to handle the %name-prefix.
7394 * data/glr.c, data/yacc.c: Comment changes.
7395 * data/lalr1.cc (yylex): Use #define to select the name of yylex,
7396 so that one can refer to yylex in the parser file, and have it
7397 renamed, as is the case with other skeletons.
7399 2004-12-16 Akim Demaille <akim@epita.fr>
7401 Move lalr1.cc internals into yy*.
7403 * data/lalr1.cc (semantic_stack_, location_stack_, state_stack_)
7404 (semantic_stack_, location_stack_, pact_, pact_ninf_, defact_)
7405 (pgoto_, defgoto_, table_, table_ninf_, check_, stos_, r1_, r2_)
7406 (name_, rhs_, prhs_, rline_, token_number_, eof_, last_, nnts_)
7407 (empty_, final_, terror_, errcode_, ntokens_)
7408 (user_token_number_max_, undef_token_, n_, len_, state_, nerrs_)
7409 (looka_, ilooka_, error_range_, nerrs_):
7411 (yysemantic_stack_, yylocation_stack_, yystate_stack_)
7412 (yysemantic_stack_, yylocation_stack_, yypact_, yypact_ninf_)
7413 (yydefact_, yypgoto_, yydefgoto_, yytable_, yytable_ninf_)
7414 (yycheck_, yystos_, yyr1_, yyr2_, yyname_, yyrhs_, yyprhs_)
7415 (yyrline_, yytoken_number_, yyeof_, yylast_, yynnts_, yyempty_)
7416 (yyfinal_, yyterror_, yyerrcode_, yyntokens_)
7417 (yyuser_token_number_max_, yyundef_token_, yyn_, yylen_, yystate_)
7418 (yynerrs_, yylooka_, yyilooka_, yyerror_range_, yynerrs_):
7421 2004-12-15 Paul Eggert <eggert@cs.ucla.edu>
7423 Fix some problems reported by twlevo at xs4all.
7424 * src/symtab.c (symbol_new): Report an error if the input grammar
7425 contains too many symbols. This is better than calling abort() later.
7426 * src/vcg.h (enum layoutalgorithm): Remove. All uses removed.
7427 (struct node, struct graph):
7428 Rename member expand to stretch. All uses changed.
7429 (struct graph): Remove member layoutalgorithm. All uses removed.
7430 * src/vcg.c (get_layoutalgorithm_str): Remove. All uses removed.
7431 * src/vcg_defaults.h (G_STRETCH): Renamed from G_EXPAND.
7433 (N_STRETCH): Rename from N_EXPAND. All uses changed.
7435 2004-12-15 Akim Demaille <akim@epita.fr>
7437 * data/lalr1.cc: Normalize /** \brief ... */ to ///.
7438 Add more Doxygen comments.
7439 (symprint_, stack_print_, reduce_print_, destruct_, pop)
7440 (report_syntax_error_, translate_): Rename as...
7441 (yysymprint_, yystack_print_, yyreduce_print_, yydestruct_)
7442 (yypop_, yyreport_syntax_error_, yytranslate_): this.
7444 2004-12-15 Akim Demaille <akim@epita.fr>
7446 * data/lalr1.cc (lex_): Rename as...
7448 Move the trace here.
7449 Take the %name-prefix into account.
7450 Reported by Alexandre Duret-Lutz.
7452 2004-12-15 Akim Demaille <akim@epita.fr>
7454 Simplify the C++ parser constructor.
7456 * data/lalr1.cc (debug_): Rename as...
7457 (yydebug_): so that the parser's internals are always in the yy*
7460 (b4_parse_param_decl): Remove the leading comma as it is now only
7461 called as unique argument list.
7462 (Parser::Parser): Remove the constructor accepting a location and
7463 an initial debugging level.
7464 Remove from the other ctor the argument for the debugging level.
7465 (debug_level_type, debug_level, set_debug_level): New.
7467 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust
7470 2004-12-15 Akim Demaille <akim@epita.fr>
7472 Remove b4_root related material: failure experiment
7473 (which goal was to allow to derive from a class).
7475 * data/lalr1.cc (b4_root, b4_param, b4_constructor): Remove
7476 definitions and uses.
7478 2004-12-14 Paul Eggert <eggert@cs.ucla.edu>
7480 * data/glr.c (struct yyGLRStack): yyerror_range now has 3 items,
7481 not 2, since it's not portable to subtract 1 from the start of an
7482 array. The new item 0 is never set or used. All uses changed.
7484 (yyrecoverSyntaxError): Use YYLLOC_DEFAULT instead of assuming
7485 the default definition of YYLLOC_DEFAULT. Problem reported
7486 by Frank Heckenbach.
7488 2004-12-12 Paul Eggert <eggert@cs.ucla.edu>
7490 * data/glr.c (YYRHSLOC): Don't have two definitions, one for
7491 the normal case and one for the error case. Just use the
7492 first one uniformly. Problem reported by Frank Heckenbach.
7493 (YYLLOC_DEFAULT): Use the conventions of yacc.c, so we can
7494 use exactly the same macro in both places.
7495 (yyerror_range): Now of type yyGLRStackItem, not YYLTYPE,
7496 so that the normal-case YYRHSLOC works for the error case too.
7498 * data/yacc.c (YYRHSLOC): New macro, taken from glr.c.
7499 (YYLLOC_DEFAULT): Use the same macro as glr.c.
7500 * doc/bison.texinfo (Location Default Action): Don't claim that
7501 we have an array of locations. Use the same macro for both glr
7502 and lalr parsers. Mention YYRHSLOC. Mention what happens when
7505 2004-12-10 Paul Eggert <eggert@cs.ucla.edu>
7507 * HACKING: Update email addresses to send announcements to.
7509 * configure.ac (AC_INIT): Bump version to 1.875f.
7511 2004-12-10 Paul Eggert <eggert@cs.ucla.edu>
7513 * NEWS: Version 1.875e.
7514 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875e.
7516 * src/scan-skel.l: Include "complain.h", for "fatal".
7518 * src/relation.h (relation_print, relation_digraph):
7519 Relation sizes are of type relation_node, not size_t (this is
7520 merely a doc fix, since the two types are equivalent).
7521 (relation_transpose): Relation sizes are of type relation_node,
7523 * src/relation.c: Likewise.
7524 (top, infinity): Now of type relation_node, not int.
7525 (traverse, relation_transpose): Use relation_node, not int.
7527 * data/glr.c (yyuserAction, yyrecoverSyntaxError): Mark args
7528 with ATTRIBUTE_UNUSED if they're not used, to avoid GCC warning.
7529 (yyparse): Remove unused local introduced in 2004-10-25 patch.
7531 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): New arg
7532 specifying whether the test should be skipped. Use it tp
7533 specify that the [%defines %skeleton "lalr1.cc"] tests currently
7534 fail on some hosts, and should be skipped.
7536 2004-12-08 Paul Eggert <eggert@cs.ucla.edu>
7538 * src/system.h (CALLOC, MALLOC, REALLOC): Remove. All callers
7539 changed to use xcalloc, xnmalloc, xnrealloc, respectively,
7540 unless otherwise specified below.
7542 * src/LR0.c (allocate_itemsets): Use xnmalloc, not xcalloc,
7543 to allocate kernel_base, kernel_items, kernel_size, since
7544 they needn't be initialized to 0.
7545 (allocate_storgae): Likewise, for shiftset, redset, shift_symbol.
7546 * src/closure.c (new_closure): Likewise, for itemset.
7547 * src/derives.c (derives_compute): Likewise, for delts, derives, q.
7548 * src/lalr.c (set_goto_map): Likewise, for temp_map.
7549 (initialize_F): Likewise, for reads, edge, reads[i], includes[i].
7550 (build_relations): Likewise for edge, states1, includes.
7551 * src/nullable.c (nullable_compute): Likewise, for squeue, relts.
7552 * src/reader.c (packgram): Likewise, for ritem, rules.
7553 * src/reduce.c (nonterminals_reduce): Likewise for nontermmap.
7554 * src/relation.c (relation_digraph): Likewise for VERTICES.
7555 (relation_transpose): Likewise for new_R, end_R.
7556 * src/symtab.c (symbols_token_translations_init): Likewise for
7558 * src/tables.c (save_row): Likewise for froms, tos, conflict_tos.
7559 (token_actions): Likewise for yydefact, actrow, conflrow,
7561 (save_column): Likewise for froms[symno], tos[symno].
7562 (goto_actions): Likewise for state_count.
7563 (pack_table): Likewise for base, pos, check.
7564 (tables_generate): Likewise for width.
7566 * src/LR0.c (set_states): Don't reuse kernel_size and kernel_base
7567 for initial core. Just have a separate core, so we needn't worry
7568 about whether kernel_size and kernel_base are initialized.
7570 * src/LR0.c (shift_symbol, redset, shiftset, kernel_base,
7571 kernel_size, kernel_items): Remove unnecessary initialization.
7572 * src/conflicts.c (conflicts): Likewise.
7573 * src/derives.c (derives): Likewise.
7574 * src/muscle_tablc (muscle_insert): Likewise.
7575 * src/relation.c (relation_digraph): Likewise.
7576 * src/tables.c (froms, tos, conflict_tos, tally, width, actrow, order,
7577 conflrow, conflict_table, conflict_list, table, check):
7580 * src/closure.c (new_closure): Arg is of type unsigned int, not int.
7581 This is because all callers pass unsigned int.
7582 * src/closure.h (new_closure): Likewise.
7584 * src/lalr.c (initialize_F): Initialize reads[i] in all cases.
7585 (build_relations): Initialize includes[i] in all cases.
7586 * src/reader.c (packgram): Always initialize rules[ruleno].prec
7587 and rules[ruleno].precsym. Initialize members in order.
7588 * src/relation.c (relation_transpose): Always initialize new_R[i]
7590 * src/table.c (conflict_row): Initialize 0 at end of conflict_list.
7592 * src/output.c (prepare_actions): Pass 0 instead of conflict_list[0];
7593 conflict_list[0] was always 0, but now it isn't initialized.
7595 * src/table.c (table_grow): When conflict_table grew, the grown
7596 area wasn't cleared. Fix this.
7598 * lib/.cvsignore: Add strdup.c, strdup.h.
7599 * m4/.cvsignore: Add strdup.m4.
7601 2004-12-07 Paul Eggert <eggert@cs.ucla.edu>
7603 * src/lalr.h (GOTO_NUMBER_MAXIMUM): New macro.
7604 * src/lalr.c (set_goto_map): Don't allow ngotos to equal
7605 GOTO_NUMBER_MAXIMUM, since we occasionally compute
7606 ngotos + 1 without checking for overflow.
7607 (build_relations): Use END_NODE, not -1, to denote end of edges.
7608 * src/lalr.c (set_goto_map, map_goto, initialize_F, add_loopback_edge,
7609 build_relations): Use goto_number, not int, for goto numbers.
7610 * src/tables.c (save_column, default_goto): Likewise.
7612 2004-11-23 Akim Demaille <akim@epita.fr>
7614 * data/lalr1.cc (YYSTYPE): Define it as is done for C, instead
7615 of #defining from yystype.
7616 Don't typedef yystype, C++ does not need it.
7617 This lets it possible to forward declare it as union.
7619 2004-11-23 Paul Eggert <eggert@cs.ucla.edu>
7621 * bootstrap (gnulib_modules): Add extensions.
7622 Problem reported by Jim Meyering.
7624 2004-11-22 Paul Eggert <eggert@cs.ucla.edu>
7626 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c,
7627 src/lalr.c, src/nullable.c, src/relation.c, src/scan-skel.l,
7628 src/system.h, src/tables.c: XFREE -> free, to accommodate
7629 recent change to gnulib xalloc.h.
7630 Problem reported by Jim Meyering.
7632 2004-11-17 Akim Demaille <akim@epita.fr>
7634 * data/lalr1.cc (symprint_): Use cdebug_ to avoid warnings.
7636 2004-11-17 Akim Demaille <akim@epita.fr>,
7637 Alexandre Duret-Lutz <adl@gnu.org>
7639 * data/lalr1.cc (Parser::yycdebug_): New, a pointer, to allow
7642 Use it instead of cdebug_.
7643 (Parser::debug_stream, Parser::set_debug_stream): New.
7644 (Parser::symprint_): Define cdebug_ for temporary backward
7646 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use
7649 2004-11-17 Akim Demaille <akim@epita.fr>
7651 * data/lalr1.cc (Parser:print_): Remove, use %printer instead.
7652 * tests/regression.at (_AT_DATA_DANCER_Y): Adjust.
7653 * tests/calc.at (_AT_DATA_CALC_Y): Ditto.
7654 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
7656 2004-10-27 Paul Eggert <eggert@cs.ucla.edu>
7658 * data/glr.c (yyloc_default): Remove; not used.
7659 Problem reported by Frank Heckenbach.
7661 2004-10-25 Akim Demaille <akim@epita.fr>
7663 * data/glr.c (YYRHSLOC): Move its definition next to its uses.
7664 Introduce another definition to address simple location arrays.
7665 (yyGLRStack): New member: yyerror_range.
7666 (yyrecoverSyntaxError, yyparse): Update it.
7667 (yyrecoverSyntaxError): Use it when shifting the error token to
7668 have an accurate range, equivalent to the one computed by both
7669 yacc.c and lalr1.cc.
7670 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Change its yylex so
7671 that column numbers start at column 0, as per GNU Coding
7672 Standards, the others tests, and the doc.
7673 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT_WITH_LOC):
7674 Adjust to the above change (first column is 0).
7675 And adjust the location of the "<error>", now covering the whole
7678 2004-10-22 Akim Demaille <akim@epita.fr>
7679 and Paul Eggert <eggert@cs.ucla.edu>
7681 Remove some arbitrary limits on goto numbers and relations.
7682 * src/lalr.c (goto_map, ngotos, from_state, to_state): Omit
7683 initial values, since they're never used.
7684 (set_goto_map): ngotos is now unsigned, so test for overflow
7685 by seeing whether it wraps around to zero.
7686 * src/lalr.h (goto_number): Now size_t, not short int.
7687 (GOTO_NUMBER_MAXIMUM): Remove.
7688 * src/relation.c (relation_print, traverse, relation_transpose):
7689 Check for END_NODE rather than looking at sign.
7690 * src/relation.h (END_NODE): New macro.
7691 (relation_node): Now size_t, not short int.
7693 2004-10-22 Paul Eggert <eggert@cs.ucla.edu>
7695 * doc/bison.texinfo (Language and Grammar): In example, "int" is a
7696 keyword, not an identifier. Problem reported by Baron Schwartz in
7697 <http://lists.gnu.org/archive/html/bug-bison/2004-10/msg00017.html>.
7699 2004-10-11 Akim Demaille <akim@epita.fr>
7701 * src/symtab.c (symbol_check_alias_consistency): Also check
7702 type names, destructors, and printers.
7703 Reported by Alexandre Duret-Lutz.
7704 Recode the handling of associativity and precedence in terms
7705 of symbol_precedence_set.
7706 Accept no redeclaration at all, not even equal to the previous
7708 (redeclaration): New.
7709 Use it to factor redeclaration complaints.
7710 (symbol_make_alias): Don't set the type of the alias, let
7711 symbol_check_alias_consistency do it as for other features.
7712 * src/symtab.h (symbol): Add new member prec_location, and
7714 * src/symtab.c (symbol_precedence_set, symbol_type_set): Set them.
7715 * tests/input.at (Incompatible Aliases): New.
7717 2004-10-09 Paul Eggert <eggert@cs.ucla.edu>
7719 .cvsignore fixes to accommodate gnulib changes,
7720 and the practice of naming build directories "_build".
7721 * .cvsignore: Add "_*". Sort.
7722 * lib/.cvsignore: Add getopt_.h, xalloc-die.c.
7723 * m4/.cvsignore: Add "*_gl.m4".
7725 2004-10-06 Akim Demaille <akim@epita.fr>
7727 * src/parse-gram.y (add_param): Fix the truncation of trailing
7730 2004-10-05 Akim Demaille <akim@epita.fr>
7732 In Bison 1.875's yacc.c, YYLLOC_DEFAULT was called regardless
7733 whether the reducion was empty or not. This leaves room to
7734 improve the use of YYLLOC_DEFAULT in such a case.
7735 lalr1.cc is still experimental, so changing this is acceptable.
7736 And finally, there are probably not many users who changed the
7737 handling of locations in GLR, so changing is admissible too.
7739 * data/glr.c, data/lalr1.cc, data/yacc.c (YYLLOC_DEFAULT): On an
7740 empty reduction, set @$ to an empty location ending the previously
7742 Adjust uses to make sure the code is triggered on empty
7744 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust the
7745 expected output: empty reductions have empty locations.
7747 2004-09-29 Akim Demaille <akim@epita.fr>
7749 * data/lalr1.cc: Move towards a more standard C++ coding style
7750 for templates: Class < T > -> Class<T>.
7752 2004-09-29 Akim Demaille <akim@epita.fr>
7754 * data/lalr1.cc: Reinstall the former ctor, for sake of
7755 compatibility, but warn it will be removed.
7756 Move towards a more standard C++ coding style (i.e., type *var ->
7759 2004-09-27 Paul Eggert <eggert@cs.ucla.edu>
7761 * src/parse-gram.y (add_param): Rewrite to avoid strchr,
7762 since it's less likely to work if NULs are involved in the future.
7764 2004-09-27 Akim Demaille <akim@epita.fr>
7766 * data/yacc.c (YY_LOCATION_PRINT): Fix its default declaration.
7768 2004-09-27 Akim Demaille <akim@epita.fr>
7770 * data/lalr1.cc (b4_parse_param_decl_1): New.
7771 (b4_parse_param_decl): Use it to have different names between attribute
7773 (b4_cc_constructor_call): Likewise.
7775 2004-09-24 Akim Demaille <akim@epita.fr>
7777 * src/parse-gram.y (add_param): Strip the leading and trailing
7778 blanks from a formal argument declaration.
7779 (YY_LOCATION_PRINT): New.
7781 2004-09-24 Akim Demaille <akim@epita.fr>
7783 * data/c.m4 (b4_yysymprint_generate): Move the YYINPUT invocation
7786 2004-09-24 Akim Demaille <akim@epita.fr>
7788 * doc/bison.texinfo (Table of Symbols): Sort.
7790 2004-09-21 Akim Demaille <akim@epita.fr>
7792 * data/yacc.c, data/glr.c (b4_at_dollar, b4_dollar_dollar): Remove
7793 the useless parentheses.
7794 Suggested by Paul Eggert.
7796 2004-09-20 Akim Demaille <akim@epita.fr>
7798 Let the initial-action act on the look-ahead, and use it for the
7799 "initial push" (corresponding to an hypothetical beginning-of-file).
7800 And let lalr1.cc honor %initial-action.
7802 * doc/bison.texinfo (Initial Action Decl): Clarify, and add an
7804 * data/lalr1.cc (Parser::initlocation_): Remove, bad experiment.
7805 (Parser::Parser): Remove the ctor that used to initialize it.
7806 (Parser::parse): Like in the other skeletons, issue the "starting
7807 parse" message before any action.
7808 Honor %initial-action.
7809 Initialize the stacks with the lookahead.
7810 * data/yacc.c: Let $$ and @$ in %initial-action designate the
7812 Push them in the stacks.
7813 * tests/actions.at, tests/calc.at: Adjust the C++ ctor invocations.
7815 2004-09-20 Akim Demaille <akim@epita.fr>
7817 * doc/bison.texinfo (Initial Action Decl): New.
7819 2004-09-20 Akim Demaille <akim@epita.fr>
7821 * data/yacc.c (YY_LOCATION_PRINT): Use YYLTYPE_IS_TRIVIAL as a
7822 clearer criterion to define it.
7823 (parse): Initialize the initial location when YYLTYPE_IS_TRIVIAL.
7824 When reducing on an empty RHS, use the latest stacked location as
7826 yylloc is not always available.
7827 * data/glr.c: Likewise.
7828 Also, honor initial-actions.
7830 2004-09-20 Akim Demaille <akim@epita.fr>
7832 * data/yacc.c (YY_LOCATION_PRINT): New.
7833 Define when we know YYLTYPE's structure, i.e., when the default
7834 YYLLOC_DEFAULT is used.
7835 * data/c.m4 (b4_yysymprint_generate): Use it.
7836 * data/lalr1.cc (YYLLOC_DEFAULT): Stop relying on the initial
7837 value of the result.
7838 (error_start_): Replace with...
7839 (error_range_): this location array.
7840 This allows to replace code relying on the implementation of
7841 locations by portable code.
7842 * data/yacc.c (yylerrsp): Replace with...
7843 (yyerror_range): this.
7844 Every time a token is popped, update yyerror_range[0], to have an
7845 accurate location for the error token.
7846 * data/glr.c (YY_LOCATION_PRINT): New.
7847 (yyprocessOneStack): Fix an invocation of YY_SYMBOL_PRINT:
7848 deference a pointer.
7849 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): No longer
7850 report the location in %printers.
7852 * src/scan-skel.l: Instead of abort, report error messages to ease
7853 understanding skeleton scanning failures.
7855 2004-09-16 Akim Demaille <akim@epita.fr>
7857 * data/lalr1.cc (Stack::Iterator, Stack::ConstIterator): Rename as...
7858 (iterator, const_iterator): these, to be more in the C++ spirit.
7859 Also, return reverse iterators so that when displaying the stack
7860 we display its bottom first.
7861 (Parser::stack_print_, Parser::reduce_print_): Match the messages
7863 We should probably use vector here though.
7865 2004-09-16 Akim Demaille <akim@epita.fr>
7867 Have more complete shift traces.
7869 * data/yacc.c, data/lalr1.c, data/glr.c: Use YY_SYMBOL_PRINT
7870 to report Shifts instead of ad hoc YYDPRINTF invocations,
7871 including for the error token.
7872 * data/lalr1.cc (symprint_): Output the location.
7873 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): In C++, don't
7874 output the location within the %printer.
7875 Activate GLR tests, at least to make sure they compile properly.
7876 They still don't pass though.
7877 * tests/calc.at: Adjust expect verbose output, since now "Entering
7878 state..." is on a different line than the "Shifting" message.
7880 2004-09-08 Akim Demaille <akim@epita.fr>
7882 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Move the
7883 Bison directive from the Bison file to the invocation of this
7884 macro, so that these directives are passed to
7885 AT_BISON_OPTION_PUSHDEFS to get correct help macros.
7886 Use these helping macros (e.g., AT_LOC, AT_VAL and so forth).
7887 Move the AT_SETUP/AT_CLEANUP outside, to report as test title
7888 the extra Bison directives instead of the whole series.
7889 Change the grammar so that there are recoverable errors, and
7890 unrecoverable errors. Now we can have the parser give up before
7891 consuming the whole input. As a result we now can observe that
7892 the lookahead is freed when needed.
7893 Change the parser source to parse argv[1] instead of a hard coded
7895 Simplify yylex, and give a value and location to EOF.
7896 Simplify some invocations of AT_CHECK_PRINTER_AND_DESTRUCTOR that
7897 passed directives already coded in the file.
7898 Add some tests to check the location of "error".
7899 For some tests, the C++ parser is correct, and not yacc.c.
7900 For other tests, they provide different, but unsatisfying, values,
7901 so keep the C++ value so that at least one parser is "correct"
7902 according to the test suite.
7903 (Actions after errors): Remove, this is subsumed by the
7904 AT_CHECK_PRINTER_AND_DESTRUCTOR series.
7906 2004-09-06 Akim Demaille <akim@epita.fr>
7908 * data/lalr1.cc: Adjust the indentation of the labels.
7912 2004-09-06 Akim Demaille <akim@epita.fr>
7914 * data/yacc.cc, data/glr.cc (yydestruct): Accept an additional
7915 argument, an informative message.
7916 Call YY_SYMBOL_PRINT.
7917 Adjust all callers: integrate the associated YY_SYMBOL_PRINT.
7918 * data/lalr1.cc (destruct_): Likewise.
7919 In addition, no longer depend on b4_yysymprint_generate and
7920 b4_yydestruct_generate to generate these functions, do it "by
7923 2004-09-03 Akim Demaille <akim@epita.fr>
7925 * data/glr.c, data/lalr1.cc, data/yacc.c: When YYABORT was
7926 invoked, yydestruct the lookahead.
7927 * tests/calc.at (Calculator $1): Update the expected lengths of
7928 traces: there is an added line for the discarded lookahead.
7929 * doc/bison.texinfo (Destructor Decl): Some rewording.
7930 Define "discarded" symbols.
7932 2004-09-02 Akim Demaille <akim@epita.fr>
7934 * data/lalr1.cc (translate_, destruct_): No reason to be static.
7936 2004-09-02 Akim Demaille <akim@epita.fr>
7938 * data/glr.c, yacc.c (YYDSYMPRINT): Remove, not used.
7939 (YYDSYMPRINTF): Rename as...
7940 (YY_SYMBOL_PRINT): this.
7941 * data/lalr1.cc (YY_SYMBOL_PRINT): New, modeled after the previous
7943 Use it instead of direct symprint_ calls.
7944 (yybackup): Tweak the "Now at end of input" case to match yacc.c's
7947 2004-09-02 Akim Demaille <akim@epita.fr>
7949 * data/lalr1.cc (b4_yysymprint_generate): New.
7950 (symprint_): New member function, defined when YYDEBUG.
7951 Use it consistently instead of token/nterm debugging output by
7953 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust
7954 %printer calls to use cdebug_ when using lalr1.cc.
7956 2004-08-30 Florian Krohm <florian@edamail.fishkill.ibm.com>
7958 * data/glr.c: Guard the declarations of yypstack and yypdumpstack
7959 with #ifdef YYDEBUG.
7961 2004-08-26 Akim Demaille <akim@epita.fr>
7963 * doc/bison.texinfo (Implementing Loops): Rename as...
7964 (Implementing Gotos/Loops): this.
7966 2004-08-13 Paul Eggert <eggert@cs.ucla.edu>
7968 Adjust to latest gnulib.
7969 * bootstrap (gnulib_modules): Add xalloc-die.
7970 Set LC_ALL=C so that file names sort consistently.
7971 Prefer the gnulib copies of gettext.m4, glibc21.m4,
7972 inttypes_h.m4, lib-ld.m4, lib-prefix.m4, po.m4, stdint_h.m4,
7973 uintmax_t.m4, ulonglong.m4.
7974 (intl_files_to_remove): Add gettext.m4, lib-ld.m4, lib-prefix.m4,
7975 po.m4 since we are now using _gl.m4 instead.
7977 2004-08-10 Florian Krohm <florian@edamail.fishkill.ibm.com>
7979 * src/scan-action.l: Remove. Scanning of semantic actions is
7980 handled in scan-gram.l.
7982 2004-08-07 Florian Krohm <florian@edamail.fishkill.ibm.com>
7984 * src/scan-gram.l (handle_syncline): Use uniqstr_new not xstrdup.
7986 * src/location.h (struct): The file member is a uniqstr.
7987 (equal_boundaries): Use UNIQSTR_EQ for comparison.
7989 2004-07-22 Paul Eggert <eggert@cs.ucla.edu>
7991 Fix bug with non-%union parsers that have printers or destructors,
7992 which led to a Bison core dump. Reported by Peter Fales in
7993 <http://lists.gnu.org/archive/html/bug-bison/2004-07/msg00014.html>.
7995 * data/c.m4 (b4_symbol_actions): Don't assume %union was used.
7996 * data/lalr1.cc (yystype) [defined YYSTYPE]: Define to YYSTYPE,
7997 not to our own type.
7998 * src/output.c (symbol_destructors_output, symbol_printers_output):
7999 Don't assume %union.
8000 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR,
8001 AT_CHECK_PRINTER_AND_DESTRUCTOR): New argument
8002 UNION-FLAG. All callers changed.
8003 (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't assume %union.
8004 Use type char, not unsigned int, when declaring an array of char;
8005 this lets us remove a cast.
8006 (Printers and Destructors): Add non-%union test cases.
8008 2004-06-21 Paul Eggert <eggert@cs.ucla.edu>
8010 * doc/bison.texinfo: Minor editorial changes, mostly to the new
8011 GLR writeups. E.g., avoid frenchspacing and the future tense,
8012 change "lookahead" to "look-ahead", and change "wrt" to "with
8015 2004-06-21 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
8017 * doc/bison.texinfo (Merging GLR Parses, Compiler Requirements):
8018 New sections, split off from the GLR Parsers section. Put the new
8019 Simple GLR Parser near the start of the GLR section, for clarity.
8020 Rewrite connective text.
8022 2004-06-21 Frank Heckenbach <frank@g-n-u.de>
8024 * doc/bison.texinfo (Simple GLR Parsers): New section.
8026 2004-06-21 Paul Eggert <eggert@cs.ucla.edu>
8028 * NEWS, TODO, doc/bison.texinfo:
8029 Use "look-ahead" instead of "lookahead", to be consistent.
8030 * REFERENCES: Fix incorrect reference to DeRemer and Pennello,
8031 while we're fixing "look-ahead".
8032 * src/conflicts.c (shift_set): Renamed from shiftset.
8033 (look_ahead_set): Renamed from lookaheadset.
8034 * src/print.c: Likewise.
8035 * src/getargs.c (report_args): Add "look-ahead" as the new canonical
8036 name for "lookahead".
8037 (report_types, usage): Likewise.
8038 * src/getargs.h (report_look_ahead_tokens): Renamed from
8040 * src/lalr.c (compute_look_ahead_tokens): Renamed from
8042 (state_look_ahead_tokens_count): Renamed from state_lookaheads_count.
8043 (look_ahead_tokens_print): Renamed from lookaheads_print.
8044 * src/state.c (state_rule_look_ahead_tokens_print): Renamed from
8045 state_rule_lookaheads_print.
8046 * src/state.h: Likewise.
8047 (reductions.look_ahead_tokens): Renamed from lookaheads.
8048 * tests/torture.at (AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR): Renamed from
8049 AT_DATA_LOOKAHEADS_GRAMMAR.
8051 2004-06-03 Paul Eggert <eggert@cs.ucla.edu>
8053 * README: Update location of patched M4 distribution.
8055 2004-05-30 Albert Chin-A-Young <china@thewrittenword.com>
8057 Don't assume the C++ compiler takes the same arguments as the C compiler
8059 * configure.ac (O0CXXFLAGS): New var.
8060 * tests/atlocal.in (CXXFLAGS): Use it.
8062 2004-05-29 Paul Eggert <eggert@cs.ucla.edu>
8064 Fix some "make check" problems with C++ reported by
8065 Albert Chin-A-Young for Tru64 C++ in this thread:
8066 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00049.html
8068 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check for std::cerr.
8069 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
8070 Output to a .cc file for C++, not to a .c file.
8071 * tests/calc.at (AT_CHECK_CALC): Likewise.
8072 * tests/regression.at (AT_CHECK_DANCER): Likewise.
8073 * tests/local.at (AT_COMPILE_CXX): Default to OUTPUT.cc, not OUTPUT.c.
8075 2004-05-28 Albert Chin-A-Young <china@thewrittenword.com>
8077 * tests/calc.at, tests/actions.at: Workaround for SGI
8078 C++ compiler. (trivial change)
8080 2004-05-27 Paul Eggert <eggert@cs.ucla.edu>
8082 Spent a few hours checking out which prerequisite versions the
8083 current sources actually require. I went all the way back to
8084 Gettext 0.10.40, Automake 1.4, and Autoconf 2.57 and investigated
8085 a seemingly endless set of combinations of versions more recent
8086 than that. The bottom line is that the current sources require
8087 fairly recent versions of the build tools, and it'll be some work
8089 * configure.ac (AC_PREREQ): Increase from 2.58 to 2.59.
8090 (AM_INIT_AUTOMAKE): Increase from 1.7 to 1.8.
8091 (AM_GNU_GETTEXT_VERSION): Increase from 0.11.5 to 0.12.
8092 Add comments explaining why those particular versions are
8095 * src/parse-gram.y (lloc_default): Rewrite to avoid compiler bug
8096 in SGI MIPSpro 7.4.1m. Problem reported by Albert Chin-A-Young in
8097 <http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00037.html>.
8099 * configure.ac (AC_PREREQ): Bump to 2.58, since 2.57 doesn't work
8100 (it fails with a Autoconf-without-aclocal-m4 diagnostic).
8102 2004-05-26 Paul Eggert <eggert@cs.ucla.edu>
8104 * configure.ac (AM_GNU_GETTEXT_VERSION): Lower it from 0.14.1 to
8105 0.11.5. Suggested by Bruno Haible.
8106 * bootstrap: Remove gettext version checking.
8108 * doc/bison.texinfo (Decl Summary): Also mention that %union
8109 can depend on prerequisite types. Problem reported by Tim
8112 2004-05-25 Paul Eggert <eggert@cs.ucla.edu>
8114 * README: Mention GNU m4 1.4 bugs and Akim's patched version.
8115 * README-alpha: Don't tell people not to package this.
8117 * bootstrap: Don't assume $(...) works; use `...` instead.
8118 Problem reported by Paul Hilfinger. Also, diagnose non-GNU
8121 * doc/bison.texinfo (Decl Summary, Bison Options): Clarify what's
8122 put into the -d output file, and mention what to do if YYSTYPE is
8125 2004-05-24 Paul Eggert <eggert@cs.ucla.edu>
8127 Undo change made earlier today: it caused autopoint to not bring
8128 in ABOUT-NLS. Ouch. Instead, substitute our own diagnostic for
8131 * bootstrap: Check that gettext version matches what's in
8132 configure.ac. Warn users to ignore robots.txt ERROR 404.
8133 * bootstrap: Undo today's earlier change (logged below).
8134 * configure.ac (AM_GNU_GETTEXT_VERSION): Likewise.
8136 The gettext version checking is causing more trouble than it's
8137 curing; remove it. Problem reported by Paul Hilfinger.
8139 * bootstrap: Issue a warning that one can expect a message
8140 'AM_GNU_GETTEXT is used, but not AM_GNU_GETTEXT_VERSION'.
8141 * configure.ac (AM_GNU_GETTEXT_VERSION): Remove.
8143 2004-05-23 Paul Eggert <eggert@cs.ucla.edu>
8145 Ensure that the C++ compiler used for testing actually works on a
8146 simple test program; if not, skip the C++-related tests. Problem
8147 reported by Vin Shelton in:
8148 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00026.html
8150 * m4/cxx.m4: New file.
8151 * configure.ac (BISON_TEST_FOR_WORKING_CXX_COMPILER): Add.
8152 * tests/atlocal.in (BISON_CXX_WORKS): Add.
8153 * tests/local.at (AT_COMPILE_CXX): Use it.
8155 2004-05-21 Paul Eggert <eggert@cs.ucla.edu>
8157 * data/glr.c (yylloc): Output this macro even if locations are not
8158 being generated, as the GLR parser needs it even in that case.
8159 Problem reported by Troy A. Johnson
8160 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=195946>.
8162 * configure.ac (AC_INIT): Update to 1.875e.
8164 2004-05-21 Paul Eggert <eggert@cs.ucla.edu>
8166 * NEWS: Version 1.875d.
8167 * configure.ac (AC_INIT): Likewise.
8168 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875d.
8170 * configure.ac (--enable-gcc-warnings): Do not enable -Wshadow,
8171 -Wmissing-prototypes, or -Wstrict-prototypes for C++. The current
8172 lalr1.cc runs afoul of the first, and the last two are no longer
8173 supported by GCC 3.4.0.
8174 * README: Mention GNU m4 1.4 or later; mention m4 patches.
8175 * HACKING: Use ./bootstrap, not "make update" to import foreign files.
8177 2004-05-06 Paul Eggert <eggert@cs.ucla.edu>
8179 * src/muscle_tab.c (hash_muscle): Accept and return size_t, not
8180 unsigned int, for compatibility with latest gnulib hash module.
8181 * src/state.c (state_hash, state_hasher): Likewise.
8182 * src/symtab.c (hash_symbol, hash_symbol_hasher): Likewise.
8183 * src/uniqstr.c (hash_uniqstr): Likewise.
8185 2004-05-03 Paul Eggert <eggert@cs.ucla.edu>
8187 * NEWS: Unescaped newlines are no longer allowed in char & strings.
8189 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER,
8190 SC_CHARACTER,SC_STRING>): Reject unescaped newlines in
8191 character and string literals.
8192 (unexpected_end): New function.
8193 (unexpected_eof): Use it.
8194 (unexpected_newline): New function.
8195 (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>): Coalesce duplicate
8198 * NEWS: Document %expect-rr.
8200 * bootstrap (--gnulib-srcdir=*, --cvs-user=*):
8201 Fix typo by replacing $1 with $option.
8202 Remove more 'intl'-related files.
8203 Don't DEFUN AM_INTL_SUBDIR twice.
8205 * lib/.cvsignore: Add strndup.h. Remove memchr.c, memcmp.c,
8206 memrchr.c, strcasecmp.c, strchr.c, strrchr.c, strspn.c, strtol.c,
8208 * m4/.cvsignore: Add exitfail.m4, extensions.m4, gnulib.m4,
8209 hard-locale.m4, mbstate_t.m4, strerror_r.m4, strndup.m4,
8210 xstrndup.m4. Remove glibc21.m4, intdiv0.m4, inttypes-pri.m4,
8211 inttypes.m4, inttypes_h.m4, isc-posix.m4, lcmessage.m4,
8212 stdint_h.m4, uintmax_t.m4, ulonglong.m4.
8213 * src/.cvsignore: Add *.output.
8215 * src/parse-gram.y: Put copyright notice inside %{ %} so it
8216 gets copied to the output file.
8218 2004-04-28 Paul Eggert <eggert@twinsun.com>
8220 Get files from the gnulib and po repositories, instead of relying
8221 on them being in our CVS. Upgrade to latest versions of gnulib
8224 * Makefile.am (SUBDIRS): Remove m4; Automake now does m4.
8225 * bootstrap: Bootstrap from gnulib and po repositories.
8226 Much of this code was stolen from GNU diff and GNU tar's bootstrap.
8227 * README-cvs: Document these changes. Remove version numbers from
8228 mentions of build tools, since they change so often. Mention Flex.
8230 * configure.ac (AC_CONFIG_MACRO_DIR): Add, with m4 as arg.
8231 (gl_USE_SYSTEM_EXTENSIONS): Add.
8232 (AC_GNU_SOURCE, AC_AIX, AC_MINIX):
8233 Remove; no longer needed, as gl_USE_SYSTEM_EXTENSIONS
8235 (AC_ISC_POSIX): Remove; we no longer support this
8236 ancient OS, as it gets in the way of latest Autoconf & gnulib.
8237 (AC_HEADER_STDC): Remove: we now assume C89 or better.
8238 (AC_CHECK_HEADERS_ONCE): Use instead of AC_CHECK_HEADERS.
8239 Do not check for C89 headers, except for locale.h which is used
8240 by the Yacc library and must port to K&R hosts.
8241 (AC_CHECK_FUNCS_ONCE): Use instead of AC_CHECK_FUNCS.
8242 Do not check for C89 functions, except for setlocale which is
8243 used by the Yacc library.
8244 (AC_CHECK_DECLS, AC_REPLACE_FUNCS): Remove; no longer needed.
8245 (gl_DIRNAME, gl_ERROR, gl_FUNC_ALLOCA, gl_FUNC_MEMCHR,
8246 gl_FUNC_MEMRCHR, gl_FUNC_STPCPY, gl_FUNC_STRNLEN, gl_FUNC_STRTOL,
8247 gl_GETOPT, gl_HASH, gl_MBSWIDTH, gl_OBSTACK, gl_QUOTE,
8248 gl_QUOTEARG, gl_XALLOC, jm_FUNC_GLIBC_UNLOCKED_IO, jm_FUNC_MALLOC,
8249 AM_GNU_GETTEXT): Remove; now done by:
8250 (GNULIB_AUTOCONF_SNIPPET): Add. "bootstrap" builds this for us.
8251 (AC_CONFIG_FILES): Remove m4/Makefile, as Automake now does this
8254 * lib/Makefile.am: Include gnulib.mk, built for us by "bootstrap".
8255 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES):
8256 Define to empty, as gnulib.mk will do the rest for us.
8257 ($(libbison_a_OBJECTS), stdbool.h): Remove, as gnulib.mk does this
8259 (libbison_a_SOURCES): Define to $(lib_SOURCES) now.
8260 (lib_SOURCES): New symbol, containing only the non-gnulib libs.
8262 * src/files.c: Include gnulib's xstrndup.h.
8264 * src/system.h (MALLOC): Use xnmalloc, for better overflow checking.
8265 (REALLOC): Use xnrealloc, for likewise.
8266 (xstrndup, stpcpy): Remove decls, as gnulib does this for us now.
8267 (strnlen, memrchr): Remove decls; functions no longer used.
8270 * config/depcomp, config/install-sh, lib/alloca.c, lib/argmatch.c,
8271 lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
8272 lib/error.c, lib/error.h, lib/getopt.c, lib/getopt.h,
8273 lib/getopt1.c, lib/gettext.h, lib/hash.c, lib/hash.h,
8274 lib/malloc.c, lib/mbswidth.c, lib/mbswidth.h, lib/memchr.c,
8275 lib/memcmp.c, lib/memrchr.c, lib/obstack.c, lib/obstack.h,
8276 lib/quote.c, lib/quote.h, lib/quotearg.c, lib/quotearg.h,
8277 lib/realloc.c, lib/stdbool_.h, lib/stpcpy.c, lib/strcasecmp.c,
8278 lib/strchr.c, lib/strncasecmp.c, lib/strnlen.c, lib/strrchr.c,
8279 lib/strspn.c, lib/strtol.c, lib/strtoul.c, lib/unlocked-io.h,
8280 lib/xalloc.h, lib/xmalloc.c, lib/xstrdup.c, lib/xstrndup.c,
8281 m4/Makefile.am, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
8282 m4/error.m4, m4/getopt.m4, m4/hash.m4, m4/malloc.m4,
8283 m4/mbrtowc.m4, m4/mbswidth.m4, m4/memchr.m4, m4/memcmp.m4,
8284 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/prereq.m4,
8285 m4/quote.m4, m4/quotearg.m4, m4/realloc.m4, m4/stdbool.m4,
8286 m4/stpcpy.m4, m4/strnlen.m4, m4/strtol.m4, m4/strtoul.m4,
8287 m4/unlocked-io.m4, m4/xalloc.m4, po/LINGUAS, po/Makefile.in.in,
8288 po/Makevars, po/da.po, po/de.po, po/es.po, po/et.po, po/fr.po,
8289 po/hr.po, po/id.po, po/it.po, po/ja.po, po/ms.po, po/nl.po,
8290 po/pt_BR.po, po/ro.po, po/ru.po, po/sv.po, po/tr.po:
8291 Remove, as these files are now generated automatically
8292 by bootstrap or automake.
8294 * po/ChangeLog: Remove: all but one entry was a duplicate
8295 of this file, and I moved that 2000-11-02 entry here.
8297 * config/.cvsignore: Add Makefile, depcomp, install-sh.
8298 * lib/.cvsignore: Add alloca.c, alloca.h, alloca_.h, argmatch.c,
8299 argmatch.h, basename.c, dirname.c, dirname.h, error.c, error.h,
8300 exit.h, exitfail.c, exitfail.h, getopt.c, getopt.h, getopt1.c,
8301 getopt_int.h, gettext.h, gnulib.mk, hard-locale.c, hard-locale.h,
8302 hash.c, hash.h, malloc.c, mbswidth.c, mbswidth.h, memchr.c,
8303 memcmp.c, memrchr.c, obstack.c, obstack.h, quote.c, quote.h,
8304 quotearg.c, quotearg.h, realloc.c, stdbool_.h, stpcpy.c, stpcpy.h,
8305 strcasecmp.c, strchr.c, stripslash.c, strncasecmp.c, strndup.c,
8306 strnlen.c, strrchr.c, strspn.c, strtol.c, strtoul.c,
8307 unlocked-io.h, xalloc.h, xmalloc.c, xstrdup.c, xstrndup.c,
8309 * m4/.cvsignore: Remove Makefile, Makefile.in. Add alloca.m4,
8310 dirname.m4, dos.m4, error.m4, getopt.m4, hash.m4, mbrtowc.m4,
8311 mbswidth.m4, obstack.m4, onceonly.m4, quote.m4, quotearg.m4,
8312 stdbool.m4, stpcpy.m4, strnlen.m4, unlocked-io.m4, xalloc.m4.
8313 * po/.cvsignore: Add *.po, LINGUAS, Makefile.in.in, Makevars.
8314 * src/.cvsignore: Remove *_.c.
8317 * Makefile.maint (GZIP_ENV): Don't use --rsyncable if gzip doesn't
8318 support it. (The latest stable gzip doesn't.)
8320 2004-04-27 Paul Eggert <eggert@twinsun.com>
8322 * data/lalr1.cc (Parser::stos_) [! YYDEBUG]: Define even in this
8323 case, as stos_ is now used by destructors due to the 2004-02-09
8326 Remove more K&R C support.
8327 * lib/libiberty.y (PARAMS): Remove. All uses removed.
8328 * lib/subpipe.c (errno): Remove decl.
8329 Include <stdlib.h> unconditionally.
8330 (EXIT_FAILURE): Remove macro.
8331 * src/complain.c (vfprintf, strerror): Remove.
8332 * src/system.h: Include limits.h, stdlib.h, string.h, locale.h
8334 (EXIT_FAILURE, EXIT_SUCCESS, setlocale): Remove defns.
8335 Use latest Autoconf recommendations for including inttypes.h, stdint.h.
8336 (strchr, strspn, memchr): Remove decls.
8337 * tests/calc.at (_AT_DATA_CALC_Y): Include stdlib.h, string.h
8338 unconditionally. Do not declare perror.
8339 * tests/conflicts.at (%nonassoc and eof): Include stdlib.h
8342 * src/complain.c (_): Remove useless defn, as system.h defines this.
8344 * lib/bitset.h (__INT_TO_PTR): Remove; workaround no longer needed
8345 with latest obstack.h.
8346 * lib/ebitset.c (ebitset_elt_alloc): Don't bother to cast args
8347 to procedure types, as obstack.h now does that for us.
8348 * lib/lbitset.c (lbitset_elt_alloc): Likewise.
8350 * lib/subpipe.h [HAVE_SYS_TYPES_H]: Include <sys/types.h>,
8351 so that this include file can stand alone.
8352 * lib/subpipe.c: Do not include <sys/types.h>, as subpipe.h
8353 does this now. Include subpipe.h first after config.h, to
8354 test whether it can stand alone.
8356 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't
8357 declare yyerror when using lalr.cc, as GCC 3.4.0 warns about the
8360 * tests/synclines.at (%union synch line): Put a dummy member in
8361 the union, because empty unions aren't allowed in C. Caught
8364 2004-04-13 Jim Meyering <jim@meyering.net>
8366 * src/conflicts.c (conflicts_print): Correct format string typo:
8367 use `%%' to produce literal `%'. (trivial change)
8369 2004-03-30 Paul Eggert <eggert@twinsun.com>
8371 * src/getargs.c (version): Update copyright year to 2004.
8373 * data/c.m4 (b4_int_type): Use 'short int' rather than
8374 'short', and similarly for 'long', 'unsigned', etc.
8375 * data/glr.c (YYTRANSLATE, yyconfl, yySymbol, yyItemNum,
8376 yygetLRActions, yyprocessOneStack, yyrecoverSyntaxError,
8377 yy_yypstack, yydumpstack): Likewise.
8378 * data/lalr1.cc (user_token_number_max_, user_token_number_max_,
8379 translate_, seq_, [], pop, Slice, range_, operator+, operator+=):
8381 * data/yacc.c (b4_int_type, yyss, YYSTACK_BYTES, yysigned_char,
8382 yy_stack_print, yyparse): Likewise.
8383 * doc/bison.texinfo (Prologue, Multiple Types): Likewise.
8384 * lib/bbitset.h (bitset_word, BITSET_WORD_BITS): Likewise.
8385 * lib/bitset.c (bitset_print): Likewise.
8386 * lib/bitset_stats.c (bitste_log_histogram_print): Likewise.
8387 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
8388 * lib/bitsetv.c (bitsetv_dump): Likewise.
8389 * lib/ebitset.c (EBITSET_ELT_BITS, ebitset_elt_alloc): Likewise.
8390 * lib/lbitset.c (LBITSET_ELT_BITS, lbitset_elt_alloc, debug_lbitset):
8392 * src/LR0.c (allocate_itemsets): Likewise.
8393 * src/gram.h (rule_number, rule): Likewise.
8394 * src/lalr.h (goto_number): Likewise.
8395 * src/nullable.c (nullable_compute): Likewise.
8396 * src/output.c (prepare_rules): Likewise.
8397 * src/relation.c (relation_print, relation_digraph): Likewise.
8398 * src/relation.h (relation_node): Likewise.
8399 * src/state.h (state_number, transitions, errs, reductions,
8400 struct state): Likewise.
8401 * src/symtab.h (symbol_number, struct symbol): Likewise.
8402 * src/tables.c (vector_number, tally, action_number,
8403 default_goto, goto_actions): Likewise.
8404 * tests/existing.at (GNU Cim Grammar): Likewise.
8405 * tests/regression.at (Web2c Actions): Likewise.
8407 * src/output.c (muscle_insert_short_int_table): Renamed from
8408 muscle_insert_short_table. All uses changed.
8410 2004-03-25 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
8412 * src/parse-gram.y: Define PERCENT_EXPECT_RR.
8413 (declaration): Replace expected_conflicts with expected_sr_conflicts.
8414 Add %expect-rr rule.
8416 * src/scan-gram.l: Recognize %expect-rr.
8418 * src/conflicts.h (expected_sr_conflicts): Rename from
8420 (expected_rr_conflicts): Declare.
8422 * src/conflicts.c (expected_sr_conflicts): Rename from
8424 (expected_rr_conflicts): Define.
8425 (conflicts_print): Check r/r conflicts against expected_rr_conflicts
8427 Use expected_sr_conflicts in place of expected_conflicts.
8428 Warn if expected_rr_conflicts used in non-GLR parser.
8430 * doc/bison.texinfo: Add documentation for %expect-rr.
8432 2004-03-08 Paul Eggert <eggert@gnu.org>
8434 Add support for hex token numbers. Suggested by Odd Arild Olsen in
8435 <http://lists.gnu.org/archive/html/bison-patches/2004-03/msg00000.html>.
8437 * NEWS: Document hexadecimal tokens, no NUL bytes, %destructor
8439 * doc/bison.texinfo (Token Decl): Add hexadecimal token numbers.
8440 * src/scan-gram.l (scan_integer): New function.
8442 (0[xX][0-9abcdefABCDEF]+): New pattern, to support hex numbers.
8443 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>, \\x[0-9abcdefABCDEF]+,
8444 handle_action_dollar, handle_action_at, convert_ucn_to_byte):
8445 Say "long int", not "long", for uniformity with GNU style.
8447 2004-02-25 Paul Eggert <eggert@twinsun.com>
8449 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Ignore stdout from
8450 compilers. This fixes a problem with Intel's C++ compiler being
8451 chatty, reported by Guido Trentalancia in
8452 <http://lists.gnu.org/archive/html/bug-bison/2004-02/msg00030.html>.
8454 2004-02-09 Alexandre Duret-Lutz <adl@gnu.org>
8456 Support %destructor and merge error locations in lalr1.cc.
8458 * data/lalr1.cc (b4_cxx_destruct_def): New macro.
8459 (Parser::stos_): Define unconditionally.
8460 (Parser::destruct_): New method. Generate its body with
8461 b4_yydestruct_generate.
8462 (Parser::error_start_): New attribute.
8463 (Parser::parse) <yyerrlab, yyerrlab1>: Call destruct_ on erroneous
8464 token which are discarded.
8465 (Parser::parse) <yyerrlab, yyerrorlab, yyerrlab1>: Update
8466 error_start_ when erroneous token are discarded.
8467 (Parser::parse) <yyerrlab1>: Compute the location of the error
8468 token so that it covers all the discarded tokens.
8469 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust so
8470 it can be called with `%skeleton "lalr1.cc"', and do that.
8472 2004-02-02 Paul Eggert <eggert@twinsun.com>
8474 * src/Makefile.am (AM_CPPFLAGS): New macro. It mentions
8475 $(top_srcdir)/lib and ../lib. This fixes a bug reported
8476 by Paul Hilfinger; the old INCLUDES value didn't mention ../lib.
8477 There's no need to mention top_builddir since Automake does that
8479 (INCLUDES): Remove, as Automake says it's obsolescent.
8480 Contents migrated into AM_CPPFLAGS as described above.
8481 * lib/Makefile.am (INCLUDES): Remove; obsolescent.
8483 2004-01-14 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
8485 * data/glr.c (yytokenName): Bullet-proof against YYEMPTY token.
8486 (yyreportSyntaxError): Handle case where lookahead token is
8489 2004-01-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
8491 * data/glr.c: Put casts on uses of YYREALLOC and YYMALLOC so that
8492 resulting parsers are compilable with C++.
8494 2003-12-23 Paul Eggert <eggert@twinsun.com>
8496 * config/depcomp, config/install-sh: Sync with Automake 1.8.
8497 * src/output.c (output_skeleton): Rename local var.
8498 * tests/input.at (Torturing the Scanner): Don't use \x0 or \0 in
8499 Bison tokens, as this runs afoul of the 2003-10-07 change that
8500 disallowed NUL bytes in character constants or string literals.
8502 * tests/local.at: Require Autoconf 2.59's Autotest.
8503 * tests/testsuite.at: Don't include local.at, since we now assume
8504 Autoconf 2.59 or later. Autoconf 2.59 had some problems with
8506 * tests/Makefile.am ($(TESTSUITE)): Remove warning about ignoring
8507 multiple inclusion warnings.
8509 2003-12-02 Akim Demaille <akim@epita.fr>
8511 * doc/bison.texinfo (How Can I Reset the Parser): More about start
8515 2003-11-18 Alexandre Duret-Lutz <adl@gnu.org>
8517 * doc/bison.texinfo (Bison Options): Escape `@' in `$@'.
8519 2003-10-07 Paul Eggert <eggert@twinsun.com>
8521 * tests/Makefile.am (clean-local): Don't run 'testsuite --clean'
8522 if testsuite doesn't exist.
8524 * doc/bison.texinfo (Symbols): NUL bytes are not allowed in string
8525 literals, unfortunately.
8526 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
8527 Complain about NUL bytes in character constants or string literals.
8529 2003-10-05 Paul Eggert <eggert@twinsun.com>
8531 * NEWS: Don't document %no-default-prec, as it's still
8533 * doc/bison.texinfo: Document %no-default-prec only if
8534 the defaultprec flag is set. Normally it's not.
8536 2003-10-04 Paul Eggert <eggert@twinsun.com>
8538 * data/glr.c (b4_rhs_value, b4_rhs_location): Yield a
8539 non-modifiable lvalue, instead of a modifiable one.
8540 * doc/bison.texinfo (Actions): Document that $$ can
8541 be assigned to. Do not claim that $$ and $N are
8542 array element references: user code should not rely on this.
8544 2003-10-01 Paul Eggert <eggert@twinsun.com>
8546 * src/parse-gram.h (PERCENT_NO_DEFAULT_PREC): New token.
8547 (grammar_declaration): Use it.
8548 * src/scan-gram.l: New token %no-default-prec.
8549 * tests/conflicts.at: Revamp tests to use %no-default-prec.
8550 * NEWS, doc/bison.texinfo: Document the above.
8552 2003-10-01 Akim Demaille <akim@epita.fr>
8554 VCG no longer supports long_straight_phase.
8556 * src/vcg.c, src/vcg.h: Remove the handling of long_straight_phase.
8557 * src/print_graph.c (print_graph): Adjust.
8559 2003-09-30 Frank Heckenbach <frank@g-n-u.de>
8560 and Paul Eggert <eggert@twinsun.com>
8562 * doc/bison.texinfo (Decl Summary, Contextual Precedence,
8563 Table of Symbols): Document %default-prec.
8564 * src/parse-gram.y (PERCENT_DEFAULT_PREC): New token.
8565 (grammar_declaration): Set default_prec on %default-prec.
8566 * src/scan-gram.l (%default-prec): New token.
8567 * src/reader.h (default_prec): New flag.
8568 * src/reader.c: Likewise.
8569 (packgram): Handle it.
8570 * tests/conflicts.at (%default-prec without %prec,
8571 %default-prec with %prec, %default-prec 1): New tests.
8573 2003-09-30 Paul Eggert <eggert@twinsun.com>
8575 * tests/testsuite.at: Include local.at, not input.at, fixing
8576 a typo in the 2003-08-25 patch.
8578 2003-08-27 Akim Demaille <akim@epita.fr>
8580 * data/lalr1.cc (yyparse) [__GNUC__]: "Use" yyerrorlab to pacify
8583 2003-08-26 Akim Demaille <akim@epita.fr>
8585 * config/announce-gen (print_changelog_deltas): Neutralize "<#" as
8586 "<\#" to avoid magic from Gnus when posting parts of this script.
8588 2003-08-26 Akim Demaille <akim@epita.fr>
8590 * data/lalr1.cc (Parser::report_syntax_error_): New, extracted from
8591 (Parser::parse): here.
8592 Adjust: nerrs and errstatus is now replaced by...
8593 (Parser::nerrs_, Parser::errstatus_): New.
8595 2003-08-25 Akim Demaille <akim@epita.fr>
8597 * config/announce-gen, Makefile.cfg: New.
8598 * Makefile.am: Adjust.
8599 * GNUmakefile, Makefile.maint: Update from CVS Autoconf, but
8600 keeping local WGET and WGETFLAGS modifications from Paul Eggert.
8602 2003-08-25 Akim Demaille <akim@epita.fr>
8604 When reducing initial empty rules, Bison parser read an initial
8605 location that is not defined. This results in garbage, and that
8606 affects Bison's own parser. Therefore we need (i) to extend Bison
8607 to support a means to initialize this location, and (ii) to use
8608 this CVS Bison to fix CVS Bison's parser.
8610 * src/reader.h, reader.c (epilogue_augment): Remove, replace
8612 * src/muscle_tab.h, src/muscle_tab.c (muscle_code_grow): this.
8613 * src/parse-gram.y: Adjust.
8614 (%initial-action): New.
8615 (%error-verbose): Since we require CVS Bison, there is no reason
8617 * src/scan-gram.l: Adjust.
8618 * src/Makefile.am (YACC): New, to make sure we use our own parser.
8619 * data/yacc.c (yyparse): Use b4_initial_action.
8621 2003-08-25 Akim Demaille <akim@epita.fr>
8623 * doc/bison.texinfo: Don't promote stdout for error messages.
8625 2003-08-25 Akim Demaille <akim@epita.fr>
8627 * data/lalr1.cc (Parser::reduce_print_): Remove unused yyi.
8628 From Alexandre Duret-Lutz.
8630 2003-08-25 Akim Demaille <akim@epita.fr>
8634 2003-08-25 Akim Demaille <akim@epita.fr>
8636 * data/lalr1.cc (Parser::stack_print_, YY_STACK_PRINT): New.
8639 2003-08-25 Akim Demaille <akim@epita.fr>
8641 * data/lalr1.cc (Parser::reduce_print_): New.
8644 2003-08-25 Akim Demaille <akim@epita.fr>
8646 Have lalr1.cc catch with Paul Eggert's patch to fix the infinite
8647 error recovery loops. This patch is based on
8648 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00000.html>.
8649 Also, augment the similarity between lalr1.cc and yacc.c.
8650 Note: the locations of error recovery rules are not correct yet.
8652 * data/lalr1.cc: Comment changes to augment the similarity between
8653 lalr1.cc and yacc.c.
8654 (YYERROR): Goto to yyerrorlab, not yyerrlab1.
8655 (yyerrlab1): Remove, but where it used to be (now the bottom part of
8656 yyerrlab), when hitting EOF, pop the whole stack here instead of
8657 merely falling thru the default error handling mechanism.
8658 (yyerrorlab): New label, with the old contents of YYERROR,
8659 plus the following change: pop the stack of rhs corresponding
8660 to the production that invoked YYERROR. That is how Yacc
8661 behaves (required by POSIX).
8662 * tests/calc.at (AT_CHECK_CALC_LALR1_CC): No longer expected to
8665 2003-08-25 Akim Demaille <akim@epita.fr>
8667 Tune local.at so that people can "autom4te -l autotest calc.at -o
8668 calc" for instance, to extract a sub test suite.
8670 * tests/testsuite.at: Move the initialization, Autotest version
8671 requirement, and AT_TESTED invocation into...
8672 * tests/local.at: here.
8673 * tests/testsuite.at: Include it for compatibility with Autoconf
8675 * tests/Makefile.am ($(TESTSUITE)): Report that the warning should
8678 2003-08-04 Paul Eggert <eggert@twinsun.com>
8680 Rework code slightly to avoid gcc -Wtraditional warnings.
8681 * data/glr.c (yyuserMerge): Return void, not YYSTYPE.
8682 The returned value is now stored in *YY0. All callers changed.
8683 * src/output.c (merge_output): Adjust to the above change.
8685 2003-07-26 Paul Eggert <eggert@twinsun.com>
8687 * data/glr.c (YYASSERT): New macro.
8688 (yyfillin, yydoAction, yyglrReduce, yysplitStack,
8689 yyresolveStates, yyprocessOneStack):
8690 Use `YYASSERT (FOO);' rather than `if (! (FOO)) abort ();'.
8691 Derived from a suggestion by Frank Heckenbach.
8693 2003-07-25 Paul Eggert <eggert@twinsun.com>
8695 * data/glr.c (yyglrReduce): Don't use C89 string concatenation,
8696 for portability to K&R C (after ansi2knr, presumably). See
8697 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>
8698 by Frank Heckenbach, though I have omitted the structure-initialization
8699 part of his glr-knr.diff patch since I recall that the Portable
8700 C Compiler didn't require that change.
8702 Let the user specify how to allocate and free memory.
8703 Derived from a suggestion by Frank Heckenbach in
8704 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>.
8705 * data/glr.c (YYFREE, YYMALLOC, YYREALLOC): New macros.
8706 All uses of free, malloc, realloc changed to use these macros,
8707 and unnecessary casts removed.
8708 * data/yacc.c (YYFREE, YYMALLOC): Likewise.
8710 2003-07-06 Matthias Mann <MatthiasMann@gmx.de>
8712 * data/lalr1.cc (operator<<(std::ostream&, const Position&)):
8713 use s.empty() rather than s == "" to test for empty string; see
8714 <http://lists.gnu.org/archive/html/bison-patches/2003-07/msg00003.html>
8717 2003-06-25 Akim Demaille <akim@epita.fr>
8719 * config/depcomp, config/install-sh: Update from masters.
8721 2003-06-20 Paul Eggert <eggert@twinsun.com>
8723 * data/glr.c (YYLLOC_DEFAULT): Parenthesize arguments as needed,
8724 and return properly parenthesized result.
8725 * data/lalar1.cc (YYLLOC_DEFAULT): Likewise.
8726 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
8727 Remove unnecessary parentheses from uses.
8728 * doc/bison.texinfo (Location Default Action): Describe the
8729 conventions for parentheses.
8731 2003-06-19 Paul Eggert <eggert@twinsun.com>
8733 * data/glr.c (yyremoveDeletes, yy_reduce_print, yyglrReduce,
8734 yyreportTree): Do not assume that size_t is the same width as int,
8735 when printing sizes. Print sizes using an unsigned format.
8736 Problem reported by Frank Heckenbach in
8737 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00035.html>.
8739 Port to Forte Developer 7 C compiler.
8740 * data/glr.c (struct YYLTYPE): If locations are not being used,
8741 declare a single dummy member, as empty structs do not conform
8743 (YYERROR, YYBACKUP): Do not use "do { ...; return foo; } while (0)";
8744 the Forte Developer 7 C compiler complains that end-of-loop
8745 code is not reached.
8747 2003-06-17 Paul Eggert <eggert@twinsun.com>
8749 * lib/libiberty.h (PARAMS): Spell argument as Args, not as X, to
8750 avoid warnings from picky compilers about redefinition of PARAMS.
8752 2003-06-17 Paul Eggert <eggert@twinsun.com>
8756 * NEWS: Document 1.875b.
8758 * lib/bbitset.h: Do not include config.h; that's the includer's job.
8759 Do not include <sys/types.h>; shouldn't be needed on a C89 host.
8760 * lib/bitset.h (bitset_compatible_p): Indent as per GNU standard.
8761 Don't use 'index' in comments, as it's a builtin fn on some hosts.
8762 * lib/bitset_stats.c: Include gettext.h unconditionally, as
8763 per recent gettext manual's suggestion.
8764 * lib/ebitset.c (ebitset_resize, ebitset_unused_clear):
8765 Use prototypes, not old-style definitions.
8766 * lib/lbitset.c (lbitset_unused_clear): Likewise.
8767 * lib/vbitset.c (vbitset_resize, vbitset_ones, vbitset_zero,
8768 vbitset_empty_p, vbitset_copy1, vbitset_not, vbitset_equal_p,
8769 vbitset_subset_p, vbitset_disjoint_p, vbitset_and, vbitset_and_cmp,
8770 vbitset_andn, vbitset_andn_cmp, vbitset_or, vbitset_or_cmp,
8771 vbitset_xor, vbitset_xor_cmp, vbitset_and_or, vbitset_and_or_cmp,
8772 vbitset_andn_or, vbitset_andn_or_cmp, vbitset_or_and,
8773 vbitset_or_and_cmp, vbitset_copy): Likewise.
8775 * lib/libiberty.h: Do not include config.h; that's the includer's job.
8776 Do not include <stdlib.h>.
8777 (PARAMS): Define unconditionally for C89.
8778 (ATTRIBUTE_NORETURN): Remove.
8779 (ATTRIBUTE_UNUSED): Define unconditionally.
8781 Upgrade to 2003-06-08 libbitset, submitted by Michael Hayes in:
8782 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00005.html>
8783 * lib/Makefile.am (bitsets_sources): Add vbitset.c, vbitset.h.
8784 * lib/vbitset.c, lib/vbitset.h: New files.
8785 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
8786 lib/bitset_stats.c, lib/ebitset.c, lib/lbitset.c: Import
8789 * doc/bison.texinfo (How Can I Reset the Parser): Renamed from
8790 `How Can I Reset @code{yyparse}', since texinfo does not allow
8791 arbitrary @ in node names.
8793 * m4/Makefile.am (EXTRA_DIST): Add the following files, which
8794 shouldn't be needed according to the gettext 0.12.1 documentation
8795 but which seem to be needed anyway: codeset.m4 glibc21.m4
8796 intdiv0.m4 inttypes-pri.m4 inttypes.m4 inttypes_h.m4 isc-posix.m4
8797 lcmessage.m4 nls.m4 po.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4.
8798 * po/Makefile.in.in: Upgrade to gettext 0.12.1 version.
8800 * lib/.cvsignore: Add stdbool.h.
8801 * m4/.cvsignore: Add nls.m4, po.m4.
8803 Upgrade to CVS gnulib.
8804 * stdbool_.h: File renamed from stdbool.h.in.
8805 * configure.ac (AM_STDBOOL_H): Invoke this instead of
8807 (AM_GNU_GETTEXT): Put brackets around args, as latest manual suggests.
8808 (AM_GNU_GETTEXT_VERSION): Update to 0.12.1.
8809 * lib/Makefile.am (EXTRA_DIST): Add stdbool_.h.
8810 (MOSTLYCLEANFILES): New var.
8811 ($(libbison_a_OBJECTS)): Depend on $(STDBOOL_H).
8812 (stdbool.h): New rule.
8813 * lib/dirname.c, lib/dirname.h, lib/hash.c, lib/hash.h,
8814 lib/malloc.c, lib/obstack.h, lib/quote.c, lib/realloc.c,
8815 lib/strcasecmp.c, lib/xalloc.h, m4/alloca.m4, m4/onceonly.m4,
8816 m4/quote.m4: Upgrade to today's gnulib.
8818 * tests/calc.at (AT_CHECK_CALC): New option EXPECTED-TO-FAIL.
8819 (AT_CHECK_CALC_LALR1_CC): Use it, since the C++ LALR parser fails
8820 the tests right now.
8821 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Ensure yylex and
8822 yyerror are declared before use; C99 requires this.
8824 2003-06-09 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
8826 * data/glr.c (YYERROR): Update definition to reset yyerrState to 0
8828 (yyrecoverSyntaxError): Correct the logic for setting and testing
8830 Correct comment on handling EOF.
8831 Allow states with only a default reduction, rather than failing
8832 (I can't quite reconstruct why these were not allowed before).
8834 Fixes to avoid problem that $-N rules in GLR parsers can cause
8835 buffer overruns, corrupting state.
8837 * src/output.c (prepare_rules): Output max_left_semantic_context
8839 * src/reader.h (max_left_semantic_context): New variable declaration.
8840 * src/scan-gram.l (max_left_semantic_context): Define.
8841 (handle_action_dollar): Update max_left_semantic_context.
8842 * data/glr.c (YYMAXLEFT): New definition.
8843 (yydoAction): Increase size of yyrhsVals by YYMAXLEFT.
8844 (yyresolveAction): Ditto.
8846 Fixes to problems with location handling in GLR parsers reported by
8847 Frank Heckenbach (2003/06/05).
8849 * data/glr.c (YYLTYPE): Make trivial if locations not used.
8850 (YYRHSLOC): Add parentheses, and define only if locations used.
8851 (YYLLOC_DEFAULT): Add parentheses, and give trivial definition if
8853 (yyuserAction): Use YYLLOC_DEFAULT to set *yylocp.
8854 (yydoAction): Remove redundant initialization of *yyvalp and *yylocp.
8856 * tests/cxx-type.at: Exercise location information; update tests
8857 to differentiate output with and without locations.
8858 Remove forward declarations of yylex and yyerror---caused errors
8859 because default YYLTYPE not yet defined.
8860 Change semantic actions to compute strings, rather than printing
8861 them directly (to test proper passing of semantics values). Change
8862 output to prefix notation and update test data and expected results.
8863 (yylex): Track locations.
8864 (stmtMerge): Return value rather than printing, and include arguments
8867 2003-06-03 Paul Eggert <eggert@twinsun.com>
8869 Avoid warnings generated by GCC 2.95.4 when Bison is
8870 configured with --enable-gcc-warnings.
8871 * data/lalr1.cc (yy::]b4_parser_class_name[::parse,
8872 yy::]b4_parser_class_name[::translate_,
8873 yy::Stack::operator[] (unsigned),
8874 yy::Stack::operator[] (unsigned) const,
8875 yy::Slice::operator[] (unsigned),
8876 yy::Slice::operator[] (unsigned) const):
8877 Rename local vars to avoid warnings.
8878 * tests/glr-regression.at (Improper handling of embedded actions
8879 and $-N in GLR parsers): Remove unused local variable from yylex.
8880 * tests/regression.at (_AT_DATA_DANCER_Y): Declare yylex to take
8881 (void) as arg when not pure, since we now assume C89 when building
8882 Bison. Pacify GCC by using parameter.
8884 2003-06-02 Paul Eggert <eggert@twinsun.com>
8886 * data/lalr1.cc (yy::Position::lines, yy::Position::columns,
8887 yy::Location::lines, yy::Location::columns): Rename arguments
8888 to avoid shadowing; this removes a warning generated by GCC 3.3.
8890 2003-06-01 Paul Eggert <eggert@twinsun.com>
8892 Don't pass C-only warning optins (e.g., -Wmissing-declarations)
8893 to g++, as GCC 3.3 complains if you do it.
8894 * configure.ac (WARNING_CXXFLAGS): New subst. Set it to
8895 everything that WARNING_CFLAGS has, except omit warnings
8896 not suitable for C++.
8897 (AC_PROG_CXX): Use this instead of AC_CHECK_PROGS([CXX], [g++]).
8898 * tests/atlocal.in (CXXFLAGS): New var.
8899 * tests/local.at (AT_COMPILE_CXX): Use it instead of CFLAGS.
8901 Fix a GLR parser bug I reported in February; see
8902 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00008.html>.
8903 The problem was that GLR parsers did not conform to the C standard,
8904 because actions like { $1 = $2 + $3; } expanded to expressions
8905 that invoked YYFILL in separate subexpressions, and YYFILL assigned
8906 to a local variable. The C standard says that expressions
8907 like (var = f ()) + (var = f ()) have undefined behavior.
8908 Another problem was that GCC sometimes issues warnings that
8909 yyfill and its parameters are unused.
8911 * data/glr.c (yyfillin): Renamed from the old yyfill. Mark
8913 (yyfill): New function.
8915 (yyuserAction): Change type of yynormal to bool, so that it matches
8916 the new yyfill signature. Mark it as possibly unused.
8919 Follow up on a bug I reported in February, where a Bison-generated
8920 parser can loop. Provide a test case and a fix for yacc.c. I
8921 don't have a fix for lalr1.cc or for glr.c, unfortunately.
8922 The original bug report is in:
8923 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00044.html>
8925 * data/yacc.c (YYERROR): Now just 'goto yyerrorlab', since the
8926 macro's size was becoming unwieldy.
8927 (yyerrlab): Do not discard an empty lookahead symbol, as this
8928 might destroy garbage.
8929 (yyerrorlab): New label, with the old contents of YYERROR,
8930 plus the following change: pop the stack of rhs corresponding
8931 to the production that invoked YYERROR. That is how Yacc
8932 behaves, and POSIX requires this behavior.
8933 (yyerrlab1): Use YYPOPSTACK instead of its definiens.
8934 * tests/calc.at (_AT_DATA_CALC_Y): Include unistd.h if available.
8935 Define 'alarm' to do nothing if unistd.h is not available.
8936 Add a new rule "exp: '-' error;" to test the above change to
8937 data/yacc.c. Use 'alarm' to abort any test taking longer than
8938 10 seconds, as it's probably looping.
8939 (AT_CHECK_CALC): Test recovery from error in new grammar rule.
8940 Also, the new yacc.c generates two fewer diagnostics for an
8943 2003-05-24 Paul Eggert <eggert@twinsun.com>
8945 * data/glr.c (YYSTACKEXPANDABLE): Do not evaluate
8946 YYSTYPE_IS_TRIVIAL or YYSTYPE_IS_TRIVIAL unless they are defined.
8947 This fixes a problem reported by John Bowman when the Compaq/HP
8948 Alpha cxx compiler happy (e.g. using cxx -D__USE_STD_IOSTREAM
8950 * data/yacc.c (union yyalloc): Likewise.
8951 (YYCOPY): Do not evaluate __GNUC__ unless it is defined.
8953 Switch from 'int' to 'bool' where that makes sense.
8955 * lib/abitset.c (abitset_test, abitset_empty_p, abitset_equal_p,
8956 abitset_subset_p, abitset_disjoint_p, abitset_and_cmp,
8957 abitset_andn_cmp, abitset_or_cmp, abitset_xor_cmp, abitset_and_or,
8958 abitset_and_or_cmp, abitset_andn_or_cmp, abitset_or_and_cmp):
8959 Return or accept bool, not int. All callers changed.
8960 * lib/bbitset.h: (bitset_toggle_, bitset_copy_, bitset_and_or_cmp_,
8961 bitset_andn_or_cmp_, bitset_or_and_cmp_): Likewise.
8962 * lib/bitset.c (bitset_only_set_p, bitset_print, bitset_toggle_,
8963 bitset_copy_, bitset_op4_cmp, bitset_and_or_cmp_, bitset_andn_or_cmp_,
8964 bitset_or_and_cmp_): Likewise.
8965 * lib/bitset.h (bitset_test, bitset_only_set_p): Likewise.
8966 * lib/bitset_stats.c (bitset_stats_print, bitset_stats_toggle,
8967 bitset_stats_test, bitset_stats_empty_p, bitset_stats_disjoint_p,
8968 bitset_stats_equal_p, bitset_stats_subset_p, bitset_stats_and_cmp,
8969 bitset_stats_andn_cmp, bitset_stats_or_cmp, bitset_stats_xor_cmp,
8970 bitset_stats_and_or_cmp, bitset_stats_andn_or_cmp,
8971 bitset_stats_or_and_cmp): Likewise.
8972 * lib/ebitset.c (ebitset_elt_zero_p, ebitset_equal_p, ebitset_copy_cmp,
8973 ebitset_test, ebitset_empty_p, ebitset_subset_p, ebitset_disjoint_p,
8974 ebitset_op3_cmp, ebitset_and_cmp, ebitset_andn_cmp, ebitset_or_cmp,
8975 ebitset_xor_cmp): Likewise.
8976 * lib/lbitset.c (lbitset_elt_zero_p, lbitset_equal_p, lbitset_copy_cmp,
8977 lbitset_test, lbitset_empty_p, lbitset_subset_p, lbitset_disjoint_p,
8978 lbitset_op3_cmp, lbitset_and_cmp, lbitset_andn_cmp, lbitset_or_cmp,
8979 lbitset_xor_cmp): Likewise.
8980 * lib/bbitset.h: Include <stdbool.h>.
8981 (struct bitset_vtable): The following members now return bool, not
8982 int: toggle, test, empty_p, disjoint_p, equal_p, subset_p,
8983 and_cmp, andn_cmp, or_cmp, xor_cmp, and_or_cmp, andn_or_cmp,
8985 * src/conflicts.c (count_rr_conflicts): Likewise.
8986 * lib/bitset_stats.h (bitset_stats_enabled): Now bool, not int.
8988 * lib/ebitset.c (ebitset_obstack_init): Likewise.
8989 * lib/lbitset.c (lbitset_obstack_init): Likewise.
8990 * src/getargs.c (debug_flag, defines_flag, locations_flag,
8991 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
8992 graph_flag): Likewise.
8993 * src/getargs.h (debug_flag, defines_flag, locations_flag,
8994 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
8995 graph_flag): Likewise.
8996 * src/output.c (error_verbose): Likewise.
8997 * src/output.h (error_verbose): Likewise.
8998 * src/reader.c (start_flag, typed): Likewise.
8999 * src/reader.h (typed): Likewise.
9000 * src/getargs.c (LOCATIONS_OPTION): New constant.
9001 (long_options, getargs): Use it.
9002 * src/lalr.c (build_relations): Use bool, not int.
9003 * src/nullable.c (nullable_compute): Likewise.
9004 * src/print.c (print_reductions): Likewise.
9005 * src/tables.c (action_row, pack_vector): Likewise.
9006 * src/muscle_tab.h (MUSCLE_INSERT_BOOL): New macro.
9007 * src/output.c (prepare): Use it.
9008 * src/output.c (token_definitions_output,
9009 symbol_destructors_output, symbol_destructors_output): Use string,
9010 not boolean integer, to keep track of whether to output separator.
9011 * src/print_graph.c (print_core): Likewise.
9012 * src/state.c (state_rule_lookaheads_print): Likewise.
9014 * config/install-sh: Sync from automake 1.7.5.
9016 2003-05-14 Paul Eggert <eggert@twinsun.com>
9018 * src/parse-gram.y (rules_or_grammar_declaration): Require a
9019 semicolon after a grammar declaration, in the interest of possible
9020 future changes to the Bison input language.
9021 Do not allow a stray semicolon at the start of the grammar.
9022 (rhses.1): Allow one or more semicolons after any rule, including
9023 just before "|" as required by POSIX.
9024 * tests/input.at (Torturing the Scanner): Add tests for ";|" in a
9027 2003-05-14 Alexandre Duret-Lutz <adl@gnu.org>
9029 %parse-param support for lalr1.cc.
9031 * data/lalr1.cc (b4_parse_param_decl, b4_parse_param_cons,
9032 b4_cc_constructor_calls, b4_cc_constructor_call,
9033 b4_parse_param_vars, b4_cc_var_decls, b4_cc_var_decl): New m4
9035 (yy::b4_parser_class_name::b4_parser_class_name): Take extra
9036 parse-param arguments.
9037 (yy::b4_parser_class_name): Declare instance variables to
9038 hold parse-param arguments.
9039 * tests/calc.at: s/value/semantic_value/ because value clashes
9040 with a member of yy::b4_parser_class_name. Adjust C++ code
9041 to handle %parse-param. Enable %parse-param test in C++.
9043 2003-05-12 Paul Eggert <eggert@twinsun.com>
9045 * doc/bison.texinfo (How Can I Reset @code{yyparse}): Reword the
9046 English a bit. Fix fclose typo. Change "const char" to "char
9047 const", and use ANSI C rather than K&R for "main". Suggest
9048 YY_FLUSH_BUFFER over yyrestart (as that is what Flex recommends)
9049 and suggest yy_switch_to_buffer.
9051 2003-05-05 Paul Eggert <eggert@twinsun.com>
9053 * lib/bitset.h (__INT_TO_PTR): Define to a value that presumes
9054 C89. This avoids a diagnostic on compilers that define __STDC__
9055 to 0, fixing a problem with Tru64 cc reported by Martin Mokrejs in
9056 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
9058 2003-05-03 Paul Eggert <eggert@twinsun.com>
9060 * lib/bitset.h (BITSET_FOR_EACH, BITSET_FOR_EACH_REVERSE):
9061 Do not overrun array bounds.
9062 This should fix a bug reported today by Olatunji Oluwabukunmi in
9063 <http://lists.gnu.org/archive/html/bug-bison/2003-05/msg00004.html>.
9065 2003-04-29 Akim Demaille <akim@epita.fr>
9067 * src/gram.h, src/gram.c (pure_parser, glr_parser): Move to...
9068 * src/getargs.c, src/getargs.h: here, as bool, not int.
9069 (nondeterministic_parser): New.
9070 * src/parse-gram.y, src/scan-gram.l: Support
9071 %nondeterministic-parser.
9072 * src/output.c (prepare): Use nondeterministic_parser instead
9073 of glr_parser where appropriate.
9074 * src/tables.c (conflict_row, action_row, save_row)
9075 (token_actions, token_actions, pack_vector): Ditto.
9077 2003-04-29 Akim Demaille <akim@epita.fr>
9079 * doc/bison.texinfo (C++ Parsers, Implementing Loops): New.
9081 2003-04-29 Akim Demaille <akim@epita.fr>
9083 * tests/calc.at: Also test yacc.c and glr.c (but not lalr1.cc yet)
9084 with %pure-parser and %locations to exercise the patch from Yakov
9087 2003-04-28 Tim Van Holder <tim.van.holder@pandora.be>
9089 * data/yacc.c: (b4_lex_param): Corrected for the case where
9090 %lex-param is provided and %pure-parser isn't.
9092 2003-04-27 Paul Eggert <eggert@twinsun.com>
9094 Avoid gcc -Wundef warnings reported by Gerald Pfeifer in
9095 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00044.html>.
9096 * data/yacc.c (YYSTACK_ALLOC): Don't evaluate YYSTACK_USE_ALLOCA
9097 if it is not defined.
9098 (YYMAXDEPTH): Don't evaluate YYMAXDEPTH if it is not defined.
9100 2003-04-26 Paul Eggert <eggert@twinsun.com>
9102 * data/lalr1.cc (yy::Parser::pact_ninf_, yy::Parser::table_ninf_):
9103 Declare to be of type suitable for the ninf value itself, not of
9104 type suitable for the corresponding table, since the latter might
9105 be unsigned but the ninf value might be negative. This fixes a
9106 bug reported by Alexandre Duret-Lutz in
9107 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00017.html>.
9109 * configure.ac (AC_FUNC_ERROR_AT_LINE): Remove, since gl_ERROR
9110 invokes it. We shouldn't invoke it twice because it will attempt
9111 to put error.o in the archive twice. This fixes a glitch reported
9112 by Martin Mokrejs in
9113 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
9115 2003-04-21 Paul Eggert <eggert@twinsun.com>
9117 * m4/error.m4: Update from Bruno Haible's 2003-04-14 patch
9120 2003-04-21 Yakov Markovitch <Markovitch@iso.ru>
9122 * data/glr.c (yyexpandGLRStack) [!YYSTACKEXPANDABLE]:
9123 Fix obvious typo that results in uncompilable GLR parsers
9124 when both %pure-parser and %locations are used. (trivial change)
9126 2003-04-17 Paul Eggert <eggert@twinsun.com>
9128 * src/scan-gram.l: Add %option nounput, since we no longer use unput.
9129 (unexpected_eof): Renamed from unexpected_end_of_file, for brevity.
9130 Do not insert the expected token via unput, as this runs afoul
9131 of a POSIX-compatibility bug in flex 2.5.31.
9132 All uses changed to BEGIN the parent state,
9133 since we no longer insert the expected token via unput.
9134 * tests/regression.at (Invalid inputs): Remove cascaded diagnostic
9135 that is no longer emitted after the above change.
9137 * src/conflicts.c (set_conflicts): Resolve all conflicts, not just
9138 the first one. This change is from Paul Hilfinger, and it fixes
9139 regression reported by Werner Lemberg in
9140 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
9142 (resolve_sr_conflict): Don't invoke state_errs_set
9143 unless one or more tokens have been explicitly made errors.
9144 Otherwise, the above change causes Bison to abort.
9146 * tests/existing.at (GNU pic Grammar): New test case, taken from
9149 2003-03-31 Akim Demaille <akim@epita.fr>
9151 * doc/Makefile.am (AM_MAKEINFOFLAGS): Don't split the info file.
9153 2003-03-31 Akim Demaille <akim@epita.fr>
9155 * src/output.c (prepare_symbols): Avoid trailing spaces in the
9158 2003-03-31 Akim Demaille <akim@epita.fr>
9160 * doc/bison.texinfo (Strings are Destroyed): s/losses/loses/.
9161 From Paul Hilfinger.
9163 2003-03-29 Akim Demaille <akim@epita.fr>
9165 * m4/error.m4: Do not put under dynamic conditions some code which
9166 expansion is under static control.
9168 2003-03-29 Akim Demaille <akim@epita.fr>
9170 * doc/bison.texinfo (How Can I Reset @code{yyparse}): New.
9172 2003-03-29 Akim Demaille <akim@epita.fr>
9174 * doc/bison.texinfo (Strings are Destroyed): New.
9176 2003-03-13 Paul Eggert <eggert@twinsun.com>
9178 * .cvsignore: Add configure.lineno.
9179 * src/.cvsignore: Add yacc.
9180 * tests/.cvsignore: Add testsuite.log.
9181 * doc/fdl.texi: Sync with latest FSF version.
9183 2003-03-12 Paul Eggert <eggert@twinsun.com>
9185 * scan-gram.l (YY_USER_INIT): Initialize code_start, too.
9186 (<INITIAL><<EOF>>, <SC_PRE_CODE><<EOF>>): Set *loc to the scanner
9187 cursor, instead of leaving it undefined. This fixes a bug
9188 reported by Tim Van Holder in
9189 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00023.html>.
9190 * tests/input.at (Torturing the Scanner): Test the scanner on
9191 an empty input file, which was Tim Van Holder's test case.
9193 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): When checking whether
9194 <sys/resource.h> can be included, include sys/time.h and
9195 sys/times.h first, if available. This works around the SunOS
9196 4.1.4 porting bug reported by Bruce Becker in
9197 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00018.html>.
9199 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't
9200 AC_CHECK_HEADERS([sys/wait.h]), as this interferes with
9203 Merge changes from gnulib. This was prompted because the CVS
9204 snapshot didn't build on Solaris 7 due to strnlen problems.
9206 These changes need to be merged back into gnulib:
9207 * lib/hash.c: Include <stdbool.h> unconditionally.
9208 * m4/onceonly.m4 (m4_quote): New macro.
9209 (AC_CHECK_HEADERS_ONCE, AC_CHECK_FUNCS_ONCE, AC_CHECK_DECLS_ONCE):
9210 Quote AC_FOREACH variable-expansions properly.
9211 The 2003-01-03 obstack.h change also needs merging.
9212 {end of changes requiring merging}
9214 * lib/stdbool.h.in, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
9215 m4/getopt.m4, m4/hash.m4, m4/malloc.m4, m4/memchr.m4,
9216 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/quote.m4,
9217 m4/quotearg.m4, m4/realloc.m4, m4/stpcpy.m4, m4/strnlen.m4,
9218 m4/strtol.m4, m4/strtoul.m4, m4/unlocked-io.m4, m4/xalloc.m4:
9219 New files, imported from gnulib.
9220 * m4/Makefile.am (EXTRA_DIST): Add the new m4/*.m4 files mentioned
9223 * lib/mbswidth.c, m4/error.m4, m4/mbrtowc.m4, m4/mbswidth.m4,
9224 m4/memcmp.m4, m4/prereq.m4, m4/stdbool.m4: Update to current
9227 * configure.ac (gl_DIRNAME, gl_GETOPT, gl_HASH, gl_QUOTE, gl_XALLOC):
9229 (gl_ERROR): New, replacing jm_PREREQ_ERROR.
9230 (gl_FUNC_ALLOCA): New, replacing AC_FUNC_ALLOCA.
9231 (gl_FUNC_STPCPY): New, replacing AC_REPLACE_FUNCS(stpcpy).
9232 (gl_FUNC_STRNLEN): New, replacing AC_FUNC_STRNLEN.
9233 (gl_MBSWIDTH): New, replacing jm_PREREQ_MBSWIDTH.
9234 (gl_OBSTACK): New, replacing AC_FUNC_OBSTACK.
9235 (gl_QUOTEARG): New, replacing jm_PREREQ_QUOTEARG.
9236 (jm_FUNC_GLIBC_UNLOCKED_IO, gl_FUNC_STPCPY, gl_FUNC_STRTOL): New.
9237 (jm_FUNC_MALLOC): New, replacing AC_FUNC_MALLOC.
9238 (jm_FUNC_REALLOC): New, replacing AC_FUNC_REALLOC.
9239 (jm_PREREQ_ARGMATCH): Remove.
9240 (AC_REPLACE_FUNCS): Remove memchr, memrchr, stpcpy, strtol, strtoul.
9241 * lib/Makefile.am (libbison_a_SOURCES): Add argmatch.c, argmatch.h.
9243 * src/system.h: Include <stdbool.h> unconditionally.
9245 * lib/bbitset.h: Include <limits.h> unconditionally. We have been
9246 assuming at least C89 in the bitset code for some time now.
9248 2003-03-03 Akim Demaille <akim@epita.fr>
9252 2003-03-02 Akim Demaille <akim@epita.fr>
9254 * doc/bison.texinfo (Table of Symbols): Reactivate the
9255 documentation for %lex-param, and %parse-param.
9257 2003-03-02 Akim Demaille <akim@epita.fr>
9259 * data/yacc.c, data/glr.c, data/lal1.cc: Use similar code to
9260 generate verbose error messages.
9261 Use the number of tokens as an upper bound in yytname, as it
9262 cannot be a non terminal.
9264 2003-03-02 Akim Demaille <akim@epita.fr>
9266 * tests/regression.at (_AT_DATA_DANCER_Y): Fix the expected error
9269 2003-03-02 Akim Demaille <akim@epita.fr>
9271 * tests/regression.at (_AT_DATA_DANCER_Y, AT_CHECK_DANCER): New.
9272 Use them to exercise yycheck overrun.
9273 Based on Andrew Suffield's grammar.
9275 2003-03-02 Akim Demaille <akim@epita.fr>
9277 Create tests/local.at for Bison generic testing macros.
9279 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Move to...
9280 * tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS):
9282 * tests/calc.at (AT_CHECK_CALC): Adjust.
9283 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR)
9284 (AT_COMPILE, AT_COMPILE_CXX, AT_PARSER_CHECK): Move to...
9285 * tests/local.at: here.
9286 (AT_COMPILE_CXX): Tags the tests using it as c++.
9287 Ignore the test if CXX is not functional.
9289 2003-03-01 Paul Eggert <eggert@twinsun.com>
9291 * src/scan-gram.l (code_start): Initialize it to scanner_cursor,
9292 not loc->end, since loc->end might contain garbage and this leads
9293 to undefined behavior on some platforms.
9294 (id_loc, token_start): Use (IF_LINTed) initial values that do not
9295 depend on *loc, so that the reader doesn't give the the false
9296 impression that *loc is initialized.
9297 (<INITIAL>"%%"): Do not bother setting code_start, since its value
9298 does not survive the return.
9300 2003-03-01 Akim Demaille <akim@epita.fr>
9302 * src/scan-gram.l (code_start): Always initialize it when entering
9303 into yylex, as SC_EPILOGUE is activated *before* the corresponding
9304 yylex invocation. An alternative would be making it static, but
9305 then it starts with the second %%'s beginning, instead of its end.
9307 2003-02-28 Paul Eggert <eggert@twinsun.com>
9309 * lib/mbswidth.c: Include <wchar.h> before "mbswidth.h", to work
9310 around a UnixWare 7.1.1 porting bug reported by John Hughes in
9311 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00030.html>.
9313 2003-02-26 Paul Eggert <eggert@twinsun.com>
9315 * README: Mention compiler bug in Sun Forte Developer 6 update 2.
9316 Remove Sequent/Pyramid discussion (nobody uses them any more).
9317 Merge VMS and MS-DOS discussion; these ports may well be dead
9318 but let's keep mentioning them for now. Put <> around email
9319 addresses. Add copyright notice.
9321 2003-02-24 Paul Eggert <eggert@twinsun.com>
9323 * data/glr.c (yy_reduce_print): yylineno -> yylno,
9324 to avoid collision with flex use of yylineno.
9325 Problem reported by Bruce Lilly in
9326 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00016.html>.
9327 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
9328 * data/yacc.c (yy_reduce_print): Likewise.
9330 * config/depcomp: Sync with Automake 1.7.3.
9332 2003-02-21 Akim Demaille <akim@epita.fr>
9334 * data/lalr1.cc: Use temporary variables instead of casts to
9335 change integer types.
9336 Suggested by Paul Eggert.
9338 2003-02-21 Akim Demaille <akim@epita.fr>
9340 * doc/bison.texinfo: Use "location" consistently to refer to @n,
9341 to avoid confusions with lalr1.cc's notion of Position.
9342 Suggested by Paul Eggert.
9344 2003-02-20 Akim Demaille <akim@epita.fr>
9346 * data/lalr1.cc (position.hh): Make sure "columns" never pushes
9347 before initial_columns.
9348 (location.hh): Use consistent variable names when defining the
9350 Use "last" so that we subtract from Positions, not from unsigned.
9352 2003-02-20 Akim Demaille <akim@epita.fr>
9354 * data/lalr1.cc (position.hh): New subfile, including the extended
9355 and Doxygen'ed documentation of class Position.
9356 (location.hh): Use it.
9357 Document a` la Doxygen.
9358 With the help of Benoit Perrot.
9360 2003-02-20 Akim Demaille <akim@epita.fr>
9362 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Define
9364 Redefine AT_YYERROR_SEES_LOC_IF using it.
9365 (_AT_DATA_CALC_Y): Don't declare yyerror when lalr1.cc, as it is
9367 Don't use the location in yy::Parser::error_ and
9368 yy::Parser::print_ when not %locations.
9369 Activate more lalr1.cc tests.
9371 2003-02-19 Akim Demaille <akim@epita.fr>
9373 * data/lalr1.cc: When displaying a line number, be sure to make it
9376 2003-02-19 Akim Demaille <akim@epita.fr>
9378 * data/lalr1.cc (b4_stack_depth_init, yy::Parser::initdepth_):
9380 (YYABORT, YYACCEPT, YYERROR): New.
9381 * tests/calc.at: Renable the lalr1.cc test.
9383 2003-02-19 Akim Demaille <akim@epita.fr>
9385 * tests/calc.at (AT_CHECK_CALC): Check different scenarios of
9386 error recovery, mixing with/without pops and discarding of the
9389 Disable the lalr1.cc tests as currently it doesn't support YYERROR.
9391 2003-02-17 Paul Eggert <eggert@twinsun.com>
9393 * tests/atlocal.in (LDFLAGS, LIBS): New vars.
9394 * tests/testsuite.at (AT_COMPILE): Use them.
9395 This fixes the testsuite problem reported by Robert Lentz in
9396 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00011.html>.
9398 2003-02-12 Paul Eggert <eggert@twinsun.com>
9400 * data/yacc.c (yyerrlab) [YYERROR_VERBOSE]:
9401 Avoid subscript error in yycheck. Bug reported by Andrew Suffield in
9402 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00003.html>.
9403 * data/glr.c (yyreportSyntaxError) [YYERROR_VERBOSE]: Likewise.
9404 Check for malloc failure, for consistency with yacc.c.
9405 (yytname_size): Remove, for consistency with yacc.c.
9407 The bug still remains in data/lalr1.cc, as I didn't have time
9410 2003-02-06 Akim Demaille <akim@epita.fr>
9412 * configure.ac (GXX): Rename as...
9413 (CXX): this, to keep the original Autoconf semantics.
9415 * data/lalr1.cc: Fix b4_copyright invocations.
9416 If YYDEBUG is not defined, don't depend upon name_ being defined.
9417 (location.hh): Include string and iostream.
9418 (Position::filename): New member.
9419 (Position::Position ()): New.
9420 (operator<< (Position)): New.
9421 (operator- (Position, int)): New.
9422 (Location::first, Location::last): Rename as...
9423 (Location::begin, Location::end): these, to mock the conventional
9425 (operator<< (Location)): New.
9426 * tests/atlocal.in (CXX): New.
9427 * tests/testsuite.at (AT_COMPILE_CXX): New.
9428 * tests/calc.at (_AT_DATA_CALC_Y): Adjust yyerror to report the
9429 locations in a more synthetic way.
9430 (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF is positive if
9432 Adjust the C locations to match those from Emacs: first column is
9434 Change all the expected results.
9435 Conform to the GCS: simplify the locations when applicable.
9436 (LOC, VAL, YYLLOC_FORMAL, YYLLOC_ARG, USE_YYLLOC, LEX_FORMALS)
9437 (LEX_ARGS, USE_LEX_ARGS, LEX_PRE_FORMALS, LEX_PRE_ARGS): Replace
9438 these CPP macros with the m4 macros new defined by...
9439 (AT_CHECK_PUSHDEFS): this, i.e.:
9440 (AT_LALR1_CC_IF, AT_PURE_LEX_IF, AT_LOC, AT_VAL, AT_LEX_FORMALS)
9441 (AT_LEX_ARGS, AT_USE_LEX_ARGS, AT_LEX_PRE_FORMALS, AT_LEX_PRE_ARGS)
9443 (AT_CHECK_POPDEFS): Undefine them.
9444 (AT_CHECK_CALC_LALR1_CC): New.
9445 Use it for the first lalr1.cc test.
9447 2003-02-04 Akim Demaille <akim@epita.fr>
9449 * data/lalr1.cc (YYLLOC_DEFAULT): Fix its definition: be based on
9450 Location as is defined.
9452 2003-02-04 Akim Demaille <akim@epita.fr>
9454 * data/lalr1.cc: If YYDEBUG is not defined, don't depend upon
9455 name_ being defined.
9457 2003-02-03 Paul Eggert <eggert@twinsun.com>
9459 * src/gram.h (start_symbol): Remove unused decl.
9461 Use more-consistent naming conventions for local vars.
9463 * src/derives.c (derives_compute): Change type of local var from
9465 * src/gram.c (grammar_rules_partial_print): Likewise.
9466 * src/print.c (print_core): Likewise.
9467 * src/reduce.c (reduce_grammar_tables): Likewise.
9469 * src/gram.c (grammar_dump): Change name of item_number *
9470 local var from r to rp.
9471 * src/nullable.c (nullable_compute): Likewise.
9473 * src/gram.h (ISTOKEN, ISVAR): Use i, not s, for int var.
9475 * src/gram.h (symbol_number_as_item_number): Use sym, not s,
9476 for symbol or symbol_number var.
9477 * src/reader.c (grammar_start_symbol_set): Likewise.
9478 * src/reader.h (grammar_start_symbol_set, grammar_symbol_append):
9480 * src/state.c (transitions_to): Likewise.
9481 * src/state.h: Likewise.
9482 * src/tables.c (symbol_number_to_vector_number): Likewise.
9484 * src/muscle_tab.h (MUSCLE_OBSTACK_SGROW): Use p, not s, for
9487 * src/parse-gram.y (lloc_default): Use loc, not r, for YYLTYPE
9490 * src/scan-gram.l (no_cr_read): Use bytes_read, not s, for size
9493 * src/system.h (xstrndup, strchr, strspn, strnlen, memchr, memrchr):
9494 Use str, not s, for char * var. Use ch, not c, for character var.
9495 Use size for size var.
9497 * src/uniqstr.c (uniqstr_new, uniqstr_assert): Use str, not s, for
9499 (uniqstr_print, uniqst_print_processor): Use ustr, not s, for
9501 * src/uniqstr.h: Likewise.
9503 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
9504 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
9505 get_node_alignment_str, get_arrow_mode_str, get_crossing_type_str,
9506 get_view_str, get_linestyle_str, get_arrowstyle_str): Rename
9507 param to have same name as that of enum, so that we don't use
9508 "s" to stand for a non-state.
9510 2003-02-02 Akim Demaille <akim@epita.fr>
9512 * src/scan-skel.l: Scan more than one inert character per yylex
9515 2003-02-01 Paul Eggert <eggert@twinsun.com>
9519 * po/LINGUAS: Add ms.
9521 2003-01-30 Akim Demaille <akim@epita.fr>
9523 * doc/Makefile.am (CLEANFILES): Add bison.fns for distcheck.
9525 2003-01-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
9527 * tests/cxx-type.at: Correct apparent typo in Bison input: $$ instead
9530 Changes in response to error report by S. Eken: GLR mode does not
9531 handle negative $ indices or $ indices in embedded rules correctly.
9532 See <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00076.html>.
9534 * data/glr.c (b4_rhs_value): Change to use YYFILL macro.
9535 (b4_rhs_location): Ditto.
9536 (yyfill): New function to copy from stack tree into array
9538 (yyuserAction): Modify to allow incremental move of semantic values
9539 to rhs array when in GLR mode.
9540 Define YYFILL to use in user-defined actions to fill semantic array
9542 Remove dummy use of yystack, as there is now a guaranteed use.
9543 (yydoAction): Modify to allow incremental move of semantic values
9544 to rhs array when in GLR mode.
9545 (yyresolveAction): Ditto.
9546 (yyglrShiftDefer): Update comment.
9547 (yyresolveStates): Use X == NULL for pointers, not !X.
9548 (yyglrReduce): Ditto.
9551 * tests/glr-regr1.at: Rename to ...
9552 * tests/glr-regression.at: Add new regression test for the problems
9553 described above (adapted from S. Eken).
9554 Update copyright notice.
9555 * tests/testsuite.at: Rename glr-regr1.at to glr-regression.at.
9556 * tests/Makefile.am: Ditto.
9558 2003-01-28 Paul Eggert <eggert@twinsun.com>
9560 * data/lalr1.cc: Do not use @output_header_name@ unless
9561 b4_defines_flag is set. This fixes two bugs reported by
9563 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00071.html>
9564 and <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00073.html>.
9566 2003-01-21 Paul Eggert <eggert@twinsun.com>
9568 * data/yacc.c (YYERROR): Move code from yyerrlab1 to here, so that
9569 we don't need to worry about yyerrlab1 being reported as an
9570 "unused label" by non-GCC C compilers. The downside is that if
9571 locations are used then a couple of statements are duplicated each
9572 time YYERROR is invoked, but the upside is that the warnings
9574 (yyerrlab1): Move code to YERROR.
9575 (yyerrlab2): Remove. Change uses back to yyerrlab1.
9576 This reverts some of the 2002-12-27 change.
9578 2003-01-17 Paul Eggert <eggert@twinsun.com>
9580 * src/output.c (symbol_printers_output): Fix typo that led
9581 to core dump. Problem reported by Antonio Rus in
9582 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00058.html>.
9584 2003-01-13 Akim Demaille <akim@epita.fr>,
9585 Quoc Peyrot <chojin@lrde.epita.fr>,
9586 Robert Anisko <anisko_r@lrde.epita.fr>
9588 * data/lalr1.cc (parse::yyerrlab1): When popping the stack, stop
9589 when the stacks contain one element, as the loop would otherwise
9590 free the last state, and then use the top state (the one we just
9591 popped). This means that the initial elements will not be freed
9592 explicitly, as is the case in yacc.c; it is not a problem, as
9593 these elements have fake values.
9595 2003-01-11 Paul Eggert <eggert@twinsun.com>
9597 * NEWS: %expect-violations are now just warnings, reverting
9598 to Bison 1.30 and 1.75 behavior. This fixes the GCC 3.2
9599 bootstrapping problem reported by Matthias Klose; see
9600 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00053.html>.
9601 * src/conflicts.c (conflicts_print): Likewise.
9602 * tests/conflicts.at (%expect not enough, %expect too much,
9603 %expect with reduce conflicts): Likewise.
9604 * doc/bison.texinfo (Expect Decl): Document this. Also mention
9605 that the warning is enabled if the number of conflicts changes
9606 (not necessarily increases).
9608 * src/getargs.c (version): Update copyright year.
9610 2003-01-09 Akim Demaille <akim@epita.fr>
9612 * src/Makefile.am, lib/Makefile.am: Use $(VAR) instead of @VAR@.
9614 2003-01-08 Paul Eggert <eggert@twinsun.com>
9616 * Makefile.maint (WGETFLAGS):
9617 New macro, containing "-C off" to disable proxy caches.
9618 All uses of $(WGET) changed to $(WGET) $(WGETFLAGS).
9619 (rel-check): Use $(WGET) instead of wget.
9621 2003-01-06 Paul Eggert <eggert@twinsun.com>
9623 * doc/bison.texinfo (Generalized LR Parsing): Add a reference to
9624 the GLR paper of Scott, Johnstone and Hussain.
9626 2003-01-04 Paul Eggert <eggert@twinsun.com>
9628 * configure.ac (AC_ARG_ENABLE): Add --disable-yacc.
9629 (YACC_SCRIPT, YACC_LIBRARY): New vars to AC_SUBST.
9630 * lib/Makefile.am (lib_LIBRARIES): liby.a -> @YACC_LIBRARY@.
9631 (EXTRA_LIBRARIES): New var, for liby.a.
9632 * src/Makefile.am (bin_SCRIPTS): yacc -> @YACC_SCRIPT@.
9633 (EXTRA_SCRIPTS): New var, for yacc.
9635 * data/yacc.c (yyerrlab1): Omit attribute if __cplusplus is defined,
9636 since GNU C++ (as of 3.2.1) does not allow attributes on labels.
9637 Problem reported by Nelson H. F. Beebe.
9639 2003-01-03 Paul Eggert <eggert@twinsun.com>
9641 * lib/obstack.h (__INT_TO_PTR) [__STDC__]: Cast result to
9642 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
9643 when compiling Bison 1.875's `bitset bset = obstack_alloc
9644 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
9646 * src/scan-skel.l (QPUTS): Omit redundant `;' from macro definition.
9647 ([^@\n]): Renamed from [^@\n]+ so that the token buffer does not
9648 grow to a huge size with typical invocation.
9650 * lib/hash.c (_Bool, bool, false, true, __bool_true_false_are_defined):
9651 Use the pattern recommended by Autoconf 2.57, except also protect
9652 against double-definition.
9653 * src/system.h: Likewise.
9654 Portability issues reported by Nelson H. F. Beebe.
9656 * data/glr.c (yybool): Renamed from bool, to avoid collisions in C.
9657 All uses changed. Provide a definition in both C and C++.
9658 (yytrue, yyfalse): Define even if defined (__cplusplus).
9660 * lib/bitset_stats.c (bitset_stats_list): Remove unused var.
9661 Reported by Nelson H. F. Beebe.
9663 * src/scan-skel.l ("@oline@"): Output lineno+1, not lineno.
9665 2003-01-02 Paul Eggert <eggert@twinsun.com>
9667 * data/yacc.c (yyerrlab1): Append `;' after attribute, to
9668 pacify the buggy "smart preprocessor" in MacOS 10.2.3.
9669 Bug reported by Nelson H. F. Beebe.
9671 2003-01-01 Paul Eggert <eggert@twinsun.com>
9675 2002-12-30 Paul Eggert <eggert@twinsun.com>
9677 * src/scan-gram.l (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>","):
9679 (<INITIAL>","): Here. This causes stray "," to be treated
9682 * src/scan-gram.l (<SC_BRACED_CODE>"}"): Output ";" before the
9683 last brace in braced code when not in Yacc mode, for compatibility
9684 with Bison 1.35. This resurrects the 2001-12-15 patch to
9687 * src/reader.h (YYDECL): Use YYSTYPE, not its deprecated alias
9688 yystype. This follows up the 2002-12-24 YYSTYPE bug fix.
9690 2002-12-28 Paul Eggert <eggert@twinsun.com>
9692 * src/symtab.c (symbol_make_alias): Set type of SYMVAL to be
9693 that of SYM's type. This fixes Debian bug 168069, reported by
9696 2002-12-28 Paul Eggert <eggert@twinsun.com>
9700 Switch back to the Yacc style of conflict reports, undoing some
9701 of the 2002-07-30 change.
9702 * doc/bison.texinfo (Understanding): Use Yacc style for
9703 conflict reports. Also, use new way of locating rules.
9704 * src/conflicts.c (conflict_report):
9705 Renamed from conflict_report_yacc, removing the old
9706 'conflict_report'. Translate the entire conflict report at once,
9707 so that we don't assume that "," has the same interpretation in
9709 (conflicts_output): Use Yacc-style conflict report for each state,
9710 instead of our more-complicated style.
9711 (conflicts_print): Use Yacc-style conflict report, except print
9712 the input file name when not emulating Yacc.
9713 * tests/conflicts.at (Unresolved SR Conflicts, Defaulted
9714 Conflicted Reduction, %expect not enough, %expect too much,
9715 %expect with reduce conflicts): Switch to Yacc-style conflict reports.
9716 * tests/existing.at (GNU Cim Grammar): Likewise.
9717 * tests/glr-regr1.at (Badly Collapsed GLR States): Likewise.
9719 * src/complain.c (warn_at, warn, complain_at, complain, fatal_at,
9720 fatal): Don't invoke fflush; it's not needed and it might even be
9721 harmful for stdout, as stdout might not be open.
9722 * src/reduce.c (reduce_print): Likewise.
9724 2002-12-27 Paul Eggert <eggert@twinsun.com>
9726 Fix a bug where error locations were not being recorded correctly.
9727 This problem was originally reported by Paul Hilfinger in
9728 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00086.html>.
9730 * data/yacc.c (yyparse): New local var yylerrsp, to record the
9731 top of the location stack's error locations.
9732 (yyerrlab): Set it. When discarding a token, push its location
9733 onto yylerrsp so that we don't lose track of the error's end.
9734 (yyerrlab1): Now is only the target of YYERROR, so that we can
9735 properly record the location of the action that failed. For GCC
9736 2.93 and later, insert an __attribute__ ((__unused__)) to avoid
9737 GCC warning about yyerrlab1 being unused if YYERROR is unused.
9738 (yyerrlab2): New label, which yyerrlab now falls through to.
9739 Compute the error's location by applying YYLLOC_DEFAULT to
9740 the locations of all the symbols that went into the error.
9741 * doc/bison.texinfo (Location Default Action): Mention that
9742 YYLLOC_DEFAULT is also invoked for syntax errors.
9743 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
9744 Error locations include the locations of all the tokens that were
9745 discarded, not just the last token.
9747 2002-12-26 Paul Eggert <eggert@twinsun.com>
9749 * src/files.c: Include quote.h.
9750 (compute_output_file_names): Warn if we detect conflicting
9751 outputs to the same file. This should catch the misunderstanding
9752 exemplified by Debian Bug 165349, reported by Bruce Stephens..
9754 * src/conflicts.c (conflicts_print): If the user specifies
9755 "%expect N", report an error if there are any reduce/reduce
9756 conflicts. This is what the manual says should happen.
9757 This fixes Debian bug 130890, reported by Anthony DeRobertis.
9758 * tests/conflicts.at (%expect with reduce conflicts): New test.
9760 Don't use m4_include on relative file names, as it doesn't work as
9761 desired if there happens to be a file with that name under ".".
9763 * m4sugar/version.m4: Remove; it was included but it wasn't used.
9764 * data/Makefile.am (dist_m4sugar_DATA): Remove m4sugar/version.m4.
9765 * data/m4sugar/m4sugar.m4: Don't include m4sugar/version.m4.
9766 * data/glr.c, data/lalr1.cc, data/yacc.c: Don't include c.m4.
9767 * src/output.c (output_skeleton): Use full path names when
9768 specifying a file to include; don't rely on include path, as
9769 it's unreliable when the working file contains a file with
9772 2002-12-25 Paul Eggert <eggert@twinsun.com>
9774 Remove obsolete references to bison.simple and bison.hairy.
9775 Problem mentioned by Aubin Mahe in
9776 <http://lists.gnu.org/archive/html/help-bison/2002-12/msg00010.html>.
9777 * data/glr.c: Comment fix.
9778 * doc/bison.1: Remove references. Also, mention "yacc".
9780 * src/getargs.c (getargs) [MSDOS]: Don't assume optarg != NULL
9783 * src/parse-gram.y (declaration): Use enum "report_states" rather
9784 than its numeric value 1.
9786 * src/scan-skel.l ("@output ".*\n): Close any old yyout before
9787 opening a new one. This fixes Debian bug 165349, reported by
9790 2002-12-24 Paul Eggert <eggert@twinsun.com>
9794 * Makefile.maint (cvs-update): Don't assume that the shell
9795 supports $(...), as Solaris sh doesn't.
9797 * src/parse-gram.y (lloc_default): Remove test for empty
9798 nonterminals at the end, since it didn't change the result.
9800 2002-12-24 Paul Eggert <eggert@twinsun.com>
9802 If the user does not define YYSTYPE as a macro, Bison now declares it
9803 using typedef instead of defining it as a macro. POSIX requires this.
9804 For consistency, YYLTYPE is also declared instead of defined.
9806 %union directives can now have a tag before the `{', e.g., the
9807 directive `%union foo {...}' now generates the C code
9808 `typedef union foo { ... } YYSTYPE;'; this is for Yacc compatibility.
9809 The default union tag is `YYSTYPE', for compatibility with Solaris 9
9810 Yacc. For consistency, YYLTYPE's struct tag is now `YYLTYPE'
9811 instead of `yyltype'.
9813 `yystype' and `yyltype' are now obsolescent macros instead of being
9814 typedefs or tags; they are no longer documented and will be
9815 withdrawn in a future release.
9817 * data/glr.c (b4_location_type): Remove.
9818 (YYSTYPE): Renamed from yystype.
9819 (YYSTYPE_IS_DECLARED): New macro, used to prevent double-typedef.
9820 (struct YYLTYPE): Renamed from struct yyltype.
9821 (YYLTYPE): Renamed from yyltype.
9822 (yyltype, yystype): New (and obsolescent) macros,
9823 for backward compatibility.
9824 * data/yacc.c: Likewise.
9826 * data/yacc.c (YYSTYPE): Declare as union YYSTYPE if the user
9827 does not specify a union tag. This is for compatibility with
9830 * src/parse-gram.y (add_param): 2nd arg is now char * not char
9831 const *, since it is now modified by stripping surrounding { }.
9832 (current_braced_code): Remove.
9833 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_UNION,
9834 PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Change names to include
9835 trailing " {...}". Now of type <chars>.
9836 (grammar_declaration): Adjust to bundled tokens.
9837 (code_content): Remove; stripping is now done by add_param.
9838 (print_token_value): Print contents of bundled tokens.
9839 (token_name): New function.
9841 * src/reader.h (braced_code, current_braced_code): Remove.
9842 (token_name): New decl.
9844 * src/scan-gram.l (handle_dollar, handle_at): Now takes int
9845 token_type, not braced_code code_kind. All uses changed.
9846 (SC_PRE_CODE): New state, for scanning after a keyword that
9847 has (or usually has) an immediately-following braced code.
9848 (token_type): New local var, to keep track of which token type
9849 to return when scanning braced code.
9850 (<INITIAL>"%destructor", <INITIAL>"%lex-param",
9851 <INITIAL>"%parse-param", <INITIAL>"%printer",
9852 <INITIAL>"%union"): Set token type and BEGIN SC_PRE_CODE
9853 instead of returning a token type immediately.
9854 (<INITIAL>"{"): Set token type.
9855 (<SC_BRACED_CODE>"}"): Use it.
9856 (handle_action_dollar, handle_action_at): Now returns bool
9857 indicating success. Fail if ! current_rule; this prevents a core dump.
9858 (handle_symbol_code_dollar, handle_symbol_code_at):
9859 Remove; merge body into caller.
9860 (handle_dollar, handle_at): Complain in invalid contexts.
9862 * NEWS, doc/bison.texinfo: Document the above.
9863 * NEWS: Fix years and program names in copyright notice.
9865 2002-12-17 Paul Eggert <eggert@twinsun.com>
9867 * NEWS, doc/bison.texinfo (Parser Function, Pure Calling, Error
9868 Reporting, Table of Symbols): Omit mentions of %lex-param and
9869 %parse-param from the documentation for now.
9871 2002-12-15 Paul Eggert <eggert@twinsun.com>
9873 Undo most of the 2002-11-12 yychar -> yytoken patch, as it broke
9874 GCC 3.2.1 (which depends on yychar == YYEMPTY when there is no
9875 lookahead symbol, and which sets yychar in parser actions) and it
9876 disagreed with the Bison documentation. Bug
9877 reported by Andrew Walrond.
9879 * data/yacc.c (YYTRANSLATE): Don't check for negative argument,
9880 as the caller now does that.
9881 (yyclearin, YYBACKUP, yyparse): Use yychar, not yytoken.
9882 (YYEMPTY): Parenthesize right hand side, since others use it.
9883 (yyparse): Don't assume that our generated code is the only code
9886 2002-12-13 Paul Eggert <eggert@twinsun.com>
9890 POSIX requires a "yacc" command.
9891 * src/Makefile.am (bin_SCRIPTS): New macro, for yacc.
9892 (MOSTLYCLEANFILES): Add yacc.
9894 * doc/bison.texinfo (Invocation, Bison Options): Mention yacc
9895 as an alias for bison y.
9897 * po/LINGUAS: Add da.
9899 * src/getargs.c (__GNU_LIBRARY__) [lint]: Define to work around
9900 problem with latest <getopt.h>.
9901 (HACK_FOR___GNU_LIBRARY___PROTOTYPE): New macro.
9903 * doc/fdl.texi: Upgrade to 1.2.
9904 * lib/alloca.c, lib/error.c, lib/getopt.c, lib/getopt.h
9905 lib/getopt1.c, lib/gettext.h, lib/memrchr.c, lib/obstack.c,
9906 lib/obstack.h, lib/strnlen.c, lib/unlocked-io.h: Sync with
9908 * config/install-sh: Sync with autotools.
9910 Fix a bad interaction with flex 2.5.23 reported by Bruce Lilly in
9911 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
9912 * data/yacc.c (YYLTYPE, struct yyltype): Do not define unless
9913 locations are requested.
9914 (union yyalloc): Do not depend on YYLTYPE_IS_TRIVIAL unless
9915 locations are requested.
9917 2002-12-12 Paul Eggert <eggert@twinsun.com>
9919 Remove unportable casts and storage allocation tricks.
9920 While we're at it, remove almost all casts, since they
9921 usually aren't needed and are a sign of trouble.
9923 * configure.ac (AC_CHECK_TYPES): Check for uintptr_t.
9925 * src/derives.c (derives_compute): Do not subtract NTOKENS from
9926 the pointer DSET returned by malloc; this isn't portable.
9927 Instead, always use DSET[i - NTOKENS] rather than DSET[i].
9928 Similarly for DERIVES.
9929 * src/lalr.c (set_goto_map): Likewise, for GOTO_MAP and TEMP_MAP.
9930 * src/nullable.c (nullable_compute): Likewise, for RSETS and NULLABLE.
9931 * src/reduce.c (reduce_grammar_tables): Likewise, for nontermmap
9933 * src/derives.c (derives_compute): Do not bother invoking
9934 int_of_rule_number, since rule numbers are integers.
9936 * src/files.c (concat2, tr, compute_base_name): Use xmalloc (N)
9937 rather than XMALLOC (char, N).
9939 * src/files.c (filename_split): Rewrite to avoid cast.
9941 * src/gram.h (symbol_number_as_item_number,
9942 item_number_as_symbol_number, rule_number_as_item_number,
9943 item_number_as_rule_number):
9944 Now inline functions rather than macros, to avoid casts.
9945 * src/state.h (state_number_as_int): Likewise.
9946 * src/tables.c (state_number_to_vector_number,
9947 symbol_number_to_vector_number): Likewise.
9949 * src/gram.h (int_of_rule_number): Remove; no longer used.
9951 * src/lalr.c (add_lookback_edge): Use malloc rather than calloc,
9952 since the resulting storage is always stored into.
9954 * src/main.c (alloca) [C_ALLOCA]: Add decl here, the only place
9957 * src/muscle_tab.c (muscle_m4_output):
9958 Now inline. Return bool, not int.
9959 * src/state.c (state_compare): Likewise.
9960 * src/symtab.c (symbol_check_defined,
9961 symbol_check_alias_consistency, symbol_pack, symbol_translation,
9962 hash_compare_symbol, hash_symbol):
9964 * src/uniqstr.c (uniqstr_print): Likewise.
9965 * src/muscle_tab.c (muscle_m4_output_processor):
9966 New function, to avoid casts.
9967 * src/state.c (state_comparator, stage_hasher): Likewise.
9968 * src/symtab.c (symbol_check_defined_processor,
9969 symbol_check_alias_consistency_processor, symbol_pack_processor,
9970 symbol_translation_processor, hash_symbol_comparator,
9971 hash_symbol_hasher): Likewise.
9972 * src/uniqstr.c (uniqstr_print_processor): Likewise.
9973 * src/muscle_tab.c (muscles_m4_output):
9974 Use new functions instead of casting old functions unportably.
9975 * src/state.c (state_hash_new): Likewise.
9976 * src/symtab.c (symbols_new, symbols_do, symbols_check_defined,
9977 symbols_token_translations_init):
9979 * src/uniqstr.c (uniqstrs_new, hash_initialize, uniqstrs_do): Likewise.
9981 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): Use long local
9982 var instead of casting to long, to avoid casts.
9983 (prepare_states): Use MALLOC rather than alloca, so that we don't
9984 have to worry about alloca.
9985 * src/state.c (state_hash_lookup): Likewise.
9987 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>"'"): Use unsigned char
9988 local var instead of casting to unsigned char, to avoid casts.
9990 * src/state.c (TRANSITIONS_ALLOC, ERRS_ALLOC, REDUCTIONS_ALLOC,
9991 STATE_ALLOC): Remove.
9992 (transitions_new, errs_new, reductions_new, state_new): Use malloc
9993 rather than calloc, and use offsetof to avoid allocating slightly
9995 (state_new): Initialize all members.
9997 * src/state.c (state_hash): Use unsigned accumulator, not signed.
9999 * src/symtab.c (symbol_free): Remove; unused.
10000 (symbol_get): Remove cast in lhs of assignment.
10001 (symbols_do): Now static. Accept generic arguments, not
10002 hashing-related ones.
10004 * src/symtab.h: (NUMBER_UNDEFINED): Remove unnecessary cast.
10005 (symbol_processor): Remove.
10006 (symbols_do): Remove decl; now static.
10008 * src/system.h (alloca): Remove; decl no longer needed.
10009 (<stddef.h>): Include, for offsetof.
10010 (<inttypes.>, <stdint.h>): Include if available.
10011 (uintptr_t): New type, if system lacks it.
10012 (CALLOC, MALLOC, REALLOC): New macros.
10013 All uses of XCALLOC, XMALLOC, and XREALLOC changed to use these
10016 * src/tables.c (table_size): Now int, to pacify GCC.
10017 (table_grow, table_ninf_remap): Use signed table size.
10018 (save_row): Don't bother initializing locals when not needed.
10019 (default_goto, goto_actions, pack_vector): Remove unnecessary casts.
10020 * src/uniqstr.c (hash_compare_uniqstr): Likewise.
10022 * src/vcg.h: Correct misspellings.
10024 * src/vcg_defaults.h (G_CMAX): Now INT_MAX.
10027 * src/getargs.c (getargs): Don't assume EOF == -1.
10029 2002-12-09 Paul Eggert <eggert@twinsun.com>
10031 Change identifier spellings to avoid collisions with names
10032 that are reserved by POSIX.
10034 Don't use names ending in _t, since POSIX reserves them.
10035 For consistency, remove _e and _s endings -- they're weren't
10036 needed to remove ambiguity. All uses changed.
10037 * src/uniqstr.h (uniqstr): Renamed from uniqstr_t, which in
10038 turn was just renamed from struniq_t.
10039 * src/uniqstr.c (uniqstr_processor): Renamed from struniq_processor,
10040 which in turn was just renamed from struniq_processor_t.
10041 (hash_compare_uniqstr): Renamed from hash_compare_struniq, which
10042 in turn was renamed from hash_compare_struniq_t.
10043 * src/LR0.c (struct state_list): Renamed from struct state_list_s.
10044 (state_list): Renamed from state_list_t.
10045 * src/assoc.h (assoc): Renamed from assoc_t.
10046 * src/conflicts.c (enum conflict_resolution): Renamed from
10047 enum conflict_resolution_e.
10048 * src/derives.c (struct rule_list): Renamed from struct rule_list_s.
10049 (rule_list): Renamed from rule_list_t.
10050 * src/getargs.h (enum trace): Renamed from enum trace_e.
10051 (enum report): Renamed from enum report_e.
10052 * src/gram.h (item_number): Renamed from item_number_t.
10053 (rule_number): Renamed from rule_number_t.
10054 (struct rule_s): Remove the "rule_s" part; not used.
10055 (rule): Renamed from rule_t.
10056 (rule_filter): Renamed from rule_filter_t.
10057 * src/lalr.c (struct goto_list): Renamed from struct goto_list_s.
10058 (goto_list): Renamed from goto_list_t.
10059 * src/lalr.h (goto_number): Renamed from goto_number_t.
10060 * src/location.h (location): Renamed from location_t.
10061 * src/muscle_tab.c (muscle_entry): Renamed from muscle_entry_t,
10062 and moved here from:
10063 * src/muscle_tab.h (muscle_entry_t): here.
10064 * src/nullable.c (struct rule_list): Renamed from struct rule_list_s.
10065 (rule_list): Renamed from rule_list_t.
10066 * src/print_graph.c (static_graph): Renamed from graph.
10067 * src/reader.h (braced_code): Renamed from braced_code_t.
10068 Remove brace_code_e tag.
10069 * src/relation.h (relation_node): Renamed from relation_node_t.
10070 (relation_nodes): Renamed from relation_nodes_t.
10071 (relation): Renamed from relation_t.
10072 * src/state.h (state_number): Renamed from state_number_t.
10073 (struct state): Renamed from struct state_s.
10074 (state): Renamed from state_t.
10075 (transitions): Renamed from transitions_t. Unused (and
10076 misspelled) transtion_s tag removed.
10077 (errs): Renamed from errs_t. Unused errs_s tag removed.
10078 (reductions): Renamed from reductions_t. Unused tag
10079 reductions_s removed.
10080 * src/symlist.h (symbol_list): Renamed from symbol_list_t.
10081 (struct symbol_list): Renamed from struct symbol_list_s.
10082 * src/symtab.h (symbol_number): Renamed from symbol_number_t.
10083 (struct symbol): Renamed from struct symbol_s.
10084 (symbol): Renamed from symbol_t.
10085 * src/tables.c (vector_number): Renamed from vector_number_t.
10086 (action_number): Renamed from action_t.
10087 * src/tables.h (base_number): Renamed from base_t.
10088 * src/vcg.h (enum color): Renamed from enum color_e.
10089 (enum textmode): Renamed from enum textmode_e.
10090 (enum shape): Renamed from enum shape_e.
10091 (struct colorentry): Renamed from struct colorentry_s.
10092 (struct classname): Renamed from struct classname_s.
10093 (struct infoname): Renamed from struct infoname_s.
10094 (enum layoutalgorithm): Renamed from enum layoutalgorithm_e.
10095 (enum decision): Renamed from enum decision_e.
10096 (enum orientation): Renamed from enum orientation_e.
10097 (enum alignment): Renamed from enum alignment_e.
10098 (enum arrow_mode): Renamed from enum arrow_mode_e.
10099 (enum crossing_type): Renamed from enum crossing_type_e.
10100 (enum view): Renamed from enum view_e.
10101 (struct node): Renamed from struct node_s.
10102 (node): Renamed from node_t.
10103 (enum linestyle): Renamed from enum linestyle_e.
10104 (enum arrowstyle): Renamed from enum arrowstyle_e.
10105 (struct edge): Renamed from struct edge.
10106 (edge): Renamed from edge_t.
10107 (struct graph): Renamed from struct graph_s.
10108 (graph): Renamed from graph_t.
10109 * tests/calc.at (_AT_DATA_CALC_Y, Simple LALR Calculator):
10110 Rename value_t -> value.
10111 * tests/input.at (Torturing the Scanner): Rename value_t -> value,
10112 value_t_as_yystype -> value_as_yystype.
10114 Don't include <errno.h> in the mainstream code, since it
10115 reserves E[A-Z0-9]* and we want to use symbols like 'EQUALS'.
10116 * lib/get-errno.c, lib/get-errno.h: New files.
10117 * lib/Makefile.am (libbison_a_SOURCES): Add get-errno.h,
10119 * src/files.c (xfopen, xfclose): Use get_errno instead of errno.
10120 * src/output.c (output_skeleton): Likewise.
10121 * src/scan-gram.l (<INITIAL>{int}): Use set_errno and get_errno
10123 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>\\x[0-9abcdefABCDEF]+):
10125 (handle_action_dollar, handle_action_at): Likewise.
10126 * src/system.h: Do not include <errno.h>.
10127 (TAB_EXT): Renamed from EXT_TAB.
10128 (OUTPUT_EXT): Renamed from EXT_OUTPUT.
10130 Avoid str[a-z]*, since <string.h> reserves that name space.
10131 Change all instances of "struniq" in names to "uniqstr", and
10132 likewise for "STRUNIQ" and "UNIQSTR".
10133 * src/uniqstr.c: Renamed from src/struniq.c.
10134 * src/uniqstr.h: Renamed from src/struniq.h.
10135 * src/Makefile.am (bison_SOURCES): Adjust to these renamings.
10136 * src/files.c (strsuffix): Remove; unused.
10137 (concat2): Renamed from stringappend. Now static.
10138 * src/files.h (strsuffix, stringappend): Remove; unused.
10139 * src/parse-gram.y (<chars>): Renamed from <string>.
10140 (<uniqstr>): Renamed from <struniq>.
10141 * src/scan-gram.l (obstack_for_string): Renamed from string_obstack.
10142 * src/vcg.h (struct node_s.expand): Renamed from struct node_s.stretch.
10143 (struct graph_s.expand): Renamed from struct graph_s.stretch.
10144 * src/vcg_defaults.h (G_EXPAND): Renamed from G_STRETCH.
10145 (G_LONG_STRAIGHT_PHASE): Renamed from G_STRAIGHT_PHASE.
10146 (N_EXPAND): Renamed from N_STRETCH.
10148 Avoid *_MAX and *_MIN, since <limits.h> reserves that name space.
10149 * data/yacc.c (YYSTACK_GAP_MAXIMUM): Renamed from YYSTACK_GAP_MAX.
10150 * src/gram.h (ITEM_NUMBER_MAX, ITEM_NUMBER_MIN, RULE_NUMBER_MAX):
10152 * src/lalr.h (GOTO_NUMBER_MAXIMUM): Renamed from GOTO_NUMBER_MAX.
10153 * src/state.h (STATE_NUMBER_MAXIMUM): Renamed from STATE_NUMBER_MAX.
10154 * src/symtab.h (SYMBOL_NUMBER_MAXIMUM): Renamed from SYMBOL_NUMBER_MAX.
10155 * src/tables.c (VECTOR_NUMBER_MAX, VECTOR_NUMBER_MIN): Remove; unused.
10156 (BASE_MAXIMUM): Renamed from BASE_MAX.
10157 (BASE_MINIMUM): Renamed from BASE_MIN.
10158 (ACTION_MAX): Remove; unused.
10159 (ACTION_NUMBER_MINIMUM): Renamed from ACTION_MIN.
10160 Unnecessary casts removed from above defines.
10163 Fix misspelling in names.
10164 * src/vcg.h (enum_alignment_e): Renamed from enum_alignement_e.
10165 * src/vcg_defaults.h (G_NODE_ALIGNMENT): Renamed from
10169 * lib/timevar.c (timevar_report): Renamed from time_report,
10170 for consistency with other names.
10171 * lib/timevar.h (timevar_report): New decl.
10172 * src/system.h (time_report): Remove; decl is now in lib/timevar.h.
10175 Sort include-file uses.
10177 Reorder all include files under src to be in the order "system.h".
10178 then the ../lib include files in angle brackets (alphabetized),
10179 then the . include files in double-quotes (alphabetized). Fix
10180 dependency breakages encountered in this process, as follows:
10181 * src/closure.h, src/derives.h, src/state.h: Include "gram.h".
10182 * src/complain.c: Don't include stdlib.h, string.h _LIBC stuff.
10183 * src/state.h: Include "symtab.h".
10185 2002-12-08 Paul Eggert <eggert@twinsun.com>
10187 * data/glr.c, data/lalr1.cc, data/yacc.c: Do not use __file__,
10188 since this causes problems when __file__ contains character
10189 sequences like "@" that are treated specially by src/scan-skel.l.
10190 Instead, just use the file's basename. This fixes the bug
10191 reported by Martin Mokrejs in
10192 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00007.html>.
10194 2002-12-06 Paul Eggert <eggert@twinsun.com>
10196 Add support for rules that do not have trailing semicolons, as
10197 POSIX requires. Improve the quality of locations in Bison
10200 * src/location.c: Include <quotearg.h>.
10201 (empty_location): Now const.
10202 (location_print): New function. Follow the recommendation of the
10203 GNU Coding Standards for locations that span file boundaries.
10204 * src/location.h: Do not include <quotearg.h>; no longer needed.
10205 (boundary): New type.
10206 (location_t): Use it. This allows locations to span file boundaries.
10207 All member uses changed: file -> start.file or end.file (as needed),
10208 first_line -> start.line, first_column -> start.column,
10209 last_line -> end.line, last_column -> end.column.
10210 (equal_boundaries): New function.
10211 (LOCATION_RESET, LOCATION_STEP): Remove.
10212 (LOCATION_PRINT): Remove. All callers changed to use location_print.
10213 (empty_location): Now const.
10214 (location_print): New decl.
10215 * src/parse-gram.y (lloc_default): New function, which handles
10216 empty locations more accurately.
10217 (YYLLOC_DEFAULT): Use it.
10218 (%token COLON): Remove.
10219 (%token ID_COLON): New token.
10221 (declarations, rules): Remove trailing semicolon.
10222 (declaration, rules_or_grammar_declaration):
10223 Allow empty (";") declaration.
10224 (symbol_def): Remove empty actions; no longer needed.
10225 (rules_or_grammar_declaration): Remove trailing semicolon.
10226 (semi_colon.opt): Remove.
10227 * src/reader.h: Include location.h.
10228 (scanner_cursor): New decl.
10229 * src/reduce.c (nonterminals_reduce): Use warn_at rather than
10231 * src/scan-gram.l (YY_USER_INIT): Initialize scanner_cursor instead
10233 (STEP): Remove. No longer needed, now that adjust_location does
10234 the work. All uses removed.
10235 (scanner_cursor): New var.
10236 (adjust_location): Renamed from extend_location. It now sets
10237 *loc and adjusts the scanner cursor. All uses changed.
10238 Don't bother testing for CR.
10239 (handle_syncline): Remove location arg; now updates scanner cursor.
10240 All callers changed.
10241 (unexpected_end_of_file): Now accepts start boundary of token or
10242 comment, not location. All callers changed. Update scanner cursor,
10244 (SC_AFTER_IDENTIFIER): New state.
10245 (context_state): Renamed from c_context. All uses changed.
10246 (id_loc, code_start, token_start): New local vars.
10247 (<INITIAL,SC_AFTER_IDENTIFIER>): New initial context. Move all
10248 processing of Yacc white space and equivalents here.
10249 (<INITIAL>{id}): Save id_loc. Begin state SC_AFTER_IDENTIFIER
10250 instead of returning ID immediately, since we need to search for
10251 a subsequent colon.
10252 (<INITIAL>"'", "\""): Save token_start.
10253 (<INITIAL>"%{", "{", "%%"): Save code_start.
10254 (<SC_AFTER_IDENTIFIER>): New state, looking for a colon.
10255 (<SC_YACC_COMMENT>, <SC_COMMENT>, <SC_LINE_COMMENT>):
10256 BEGIN context_state at end, not INITIAL.
10257 (<SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'",
10258 <SC_BRACED_CODE>"}", <SC_PROLOGUE>"%}", <SC_EPILOGUE><<EOF>>):
10259 Return correct token start.
10260 (<SC_BRACED_CODE,SC_PROLOGUE,SC_EPILOGUE>): Save start boundary when
10261 the start of a character, string or multiline comment is found.
10262 * tests/conflicts.at (S/R in initial, Defaulted Conflicted
10263 Reduction): Adjust reported locations to match the more-precise
10264 results now expected.
10265 * tests/input.at (Invalid $n, Invalid @n, Type Clashes): Likewise.
10266 * tests/reduce.at (Useless Rules, Reduced Automaton,
10267 Underivable Rules): Likewise.
10268 * tests/regression.at (Invalid inputs): No longer `expecting ";"
10269 or "|"' now that so many other tokens are allowed by the new grammar.
10271 * src/complain.h (current_file): Remove duplicate decl;
10272 current_file is now owned by files.h.
10273 * src/complain.c, src/scan-gram.l: Include files.h.
10275 2002-12-06 Paul Eggert <eggert@twinsun.com>
10277 * data/glr.c (yy_reduce_print): Don't assume that yyrline[yyrule]
10278 promotes to int; it might be unsigned int.
10279 * data/yacc.c (yy_reduce_print): Likewise.
10281 * doc/bison.texinfo (Table of Symbols): YYERROR_VERBOSE should
10282 be #defined in the prologue, not in the Bison declarations.
10283 This fixes Debian Bug 102878, reported by Shaul Karl.
10285 2002-12-02 Paul Eggert <eggert@twinsun.com>
10287 * configure.ac (AC_REPLACE_FUNCS): Add strtoul.
10288 * lib/strtoul.c: New file, from gnulib.
10289 This fixes a porting bug reported by Peter Klein in
10290 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00000.html>.
10292 2002-11-30 Paul Eggert <eggert@twinsun.com>
10294 * src/scan-gram.l (no_cr_read, extend_location): Move to epilogue,
10295 and put only a forward declaration in the prologue. This is for
10296 consistency with the other scanner helper functions.
10298 Type clashes now generate warnings, not errors, since it
10299 appears that POSIX may allow some grammars with type clashes.
10300 * src/reader.c (grammar_current_rule_check): Warn about
10301 type clashes instead of complaining.
10302 * tests/input.at (Type Clashes): Expect warnings, not complaints.
10304 Add Yacc library, since POSIX requires it.
10305 * doc/bison.texinfo (Yacc Library): New node. Regenerate top menu.
10306 * lib/Makefile.am (lib_LIBRARIES, liby_a_SOURCES): New macros.
10307 * lib/main.c, lib/yyerror.c: New files.
10309 gram_error can be static; it need not be extern.
10310 * src/reader.h (gram_error): Remove decl.
10311 * src/parse-gram.y (gram_error): Now static. Add static decl.
10312 (print_token_value): Omit parameter names from forward decl,
10315 2002-11-29 Paul Eggert <eggert@twinsun.com>
10317 * doc/bison.texinfo: Emphasize that yylex and yyerror must
10318 be declared before being used. E.g., one should typically
10319 declare them in the prologue. Use GNU coding style in examples.
10320 Put "const" consistently after the type it modifies. Mention
10321 that C99 supports "inline". Mention that yyerror traditionally
10324 %parse-param and %lex-param now take just one argument, the
10325 declaration; the argument name is deduced from the declaration.
10327 * doc/bison.texinfo (Parser Function, Pure Calling, Error
10328 Reporting, Table of Symbols): Document this.
10329 * src/parse-gram.y (add_param): New function.
10331 (declaration): Implement new rule for %parse-param and %lex-param.
10332 * src/scan-gram.l: "," now elicits a warning, rather than being
10333 a token; this is more compatible with byacc.
10334 * tests/calc.at (Simple LALR Calculator): Adopt new convention.
10336 2002-11-27 Paul Eggert <eggert@twinsun.com>
10338 Rename identifiers to avoid real and potential collisions.
10340 * data/c.m4 (b4_yysymprint_generate): yyout -> yyoutput,
10341 to avoid collision with lex macro described by Bruce Lilly in
10342 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
10343 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
10344 * doc/bison.texinfo (Prologue, Tracing): yyprint -> print_token_value.
10345 * src/parse-gram.y (print_token_value): Renamed from yyprint.
10347 (YYPARSE_PARAM, YYLEX_PARAM, yycontrol): Remove. All uses changed.
10348 The name "yycontrol" violates the name space rules, and this stuff
10349 wasn't being used anyway.
10350 (input): Remove action; this stuff wasn't being used.
10351 (gram_error): Rename local variable yylloc -> loc.
10352 * src/reader.h (struct gram_control_s, gram_control_t): Remove.
10353 (YY_DECL): Don't use "yy" at start of local variables.
10354 All uses changed, e.g., yylloc -> loc.
10355 * src/scan-gram.l (STEP): Renamed from YY_STEP. All uses changed.
10356 (STRING_GROW): Renamed from YY_OBS_GROW. All uses changed.
10357 (STRING_FINISH): Renamed from YY_OBS_FINISH. All uses changed.
10358 (STRING_FREE): Renamed from YY_OBS_FREE. All uses changed.
10360 * src/parse-gram.y (gram_error): loc is now const *.
10361 * src/reader.h (gram_error): Likewise.
10363 2002-11-24 Paul Eggert <eggert@twinsun.com>
10367 * tests/actions.at (Actions after errors): Use an output format
10368 more similar to that of the Printers and Destructors test.
10369 Test the position of the ';' token too.
10370 (Printers and Destructors): Likewise.
10371 (Printers and Destructors: %glr-parser): Remove for now, to avoid
10372 unnecessarily alarming people when the test fails.
10374 * data/yacc.c (yyerrlab1): Move this label down, so that the
10375 parser does not discard the lookahead token if the user code
10376 invokes YYERROR. This change is required for POSIX conformance.
10378 * lib/error.c: Sync with gnulib.
10380 2002-11-22 Paul Eggert <eggert@twinsun.com>
10382 * lib/quotearg.c, lib/quotearg.h: Sync with gnulib.
10383 * lib/mbswidth.c, lib/mbswidth.h: Likewise.
10384 * lib/xmalloc.c: Likewise.
10386 2002-11-20 Paul Eggert <eggert@twinsun.com>
10388 * lib/argmatch.c, lib/argmatch.h: Sync with gnulib.
10390 2002-11-20 Paul Eggert <eggert@twinsun.com>
10392 Avoid use of <assert.h>, as the GNU Coding Standards hint that one
10393 should use `if (! x) abort ();' rather than `assert (x);', and
10394 anyway it's one less thing to worry about configuring.
10396 * data/glr.c, lib/hash.c, src/system.h: Do not include <assert.h>.
10397 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise,
10398 and replace all instances of assert with abort.
10399 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
10400 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Likewise.
10402 * data/glr.c (yydoAction, yyglrReduce, yysplitStack, yyresolveStates,
10403 yyresolveAction, yyprocessOneStack): Use abort rather than assert.
10404 * lib/hash.c (hash_lookup, hash_get_first, hash_get_next,
10405 hash_find_entry, hash_rehash, hash_insert): Likewise.
10406 * src/conflicts.c (resolve_sr_conflict): Likewise.
10407 * src/lalr.c (set_goto_map, map_goto): Likewise.
10408 * src/nullable.c (nullable_compute): Likewise.
10409 * src/output.c (prepare_rules, token_definitions_output): Likewise.
10410 * src/reader.c (packgram, reader): Likewise.
10411 * src/state.c (state_new, state_free, state_transitions_set,
10412 state_reduction_find): Likewise.
10413 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias,
10414 symbol_pack): Likewise.
10415 * src/tables.c (conflict_row, pack_vector): Likewise.
10416 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
10417 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
10418 get_node_alignement_str, get_arrow_mode_str, get_crossing_type_str,
10419 get_view_str, get_linestyle_str, get_arrowstyle_str): Likewise.
10421 * lib/argmatch.h (ARRAY_CARDINALITY): Do not bother to #undef.
10422 (ARGMATCH_CONSTRAINT): New macro.
10423 (ARGMATCH_ASSERT): Use it.
10425 * src/system.h (verify): New macro.
10426 * src/getargs.c (trace_argmatch, report_argmatch): Use verify
10427 rather than assert.
10428 * src/tables.c (tables_generate): Likewise.
10430 * src/struniq.c (struniq_assert): Now returns void, and aborts
10431 if the assertion is false.
10432 (struniq_assert_p): Remove.
10433 * src/struniq.h: Likewise.
10435 2002-11-18 Paul Eggert <eggert@twinsun.com>
10437 * data/glr.c (yygetLRActions): Replace `yyindex' with
10438 `yytable[yyindex]' to fix typo introduced in my 2002-11-09 patch.
10439 This fixes the regression with Sun ONE Studio 7 cc that I reported in
10440 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00077.html>.
10442 2002-11-18 Akim Demaille <akim@epita.fr>
10444 * doc/bison.texinfo (Tracing): `yyprint' shouldn't prepend a
10446 From Tim Van Holder.
10448 2002-11-17 Paul Eggert <eggert@twinsun.com>
10450 Pacify Sun ONE Studio 7 lint. Also, rename "ParseError"
10451 to "SyntaxError" for consistency with my 2002-11-15 change.
10453 * data/glr.c (YYDPRINTF, YYDSYMPRINT, YYDSYMPRINTF) [!YYDEBUG]: Do
10454 not define to {}, since this breaks the common use of `YYDPRINTF
10455 ((...));' if a single statement is desired (e.g. before `else').
10456 Work around GCC warnings by surrounding corresponding calls with
10458 (yyhasResolvedValue): Remove unused function.
10459 (yymergeOptionSets, yyresolvStack): Use `continue;' for empty
10461 (yyreportSyntaxError): Renamed from yyreportParseError.
10462 (yyrecoverSyntaxError): Renamed from yyrecoverParseError.
10464 * tests/calc.at (_AT_DATA_CALC_Y): Make vars static instead of
10465 extern when possible. Remove unused initializations.
10467 2002-11-16 Akim Demaille <akim@epita.fr>
10469 Augment the similarity between GLR and LALR traces.
10471 * data/yacc.c (yy_stack_print, YY_STACK_PRINT, yy_reduce_print)
10472 (YY_REDUCE_PRINT): New.
10473 (yyparse): Use them.
10474 * data/glr.c (yy_reduce_print): Use YYFPRINTF, no need for
10476 (yyglrReduce, yyrecoverParseError, yyparse): Don't report the
10477 state reached after the reduction/recovery, since...
10478 (yyparse, yyprocessOneStack): Report the state we are entering in.
10480 2002-11-16 Akim Demaille <akim@epita.fr>
10482 * src/getargs.h, src/getargs.c (trace_e, trace_args, trace_types):
10483 Add support for --trace=skeleton.
10484 * src/scan-skel.l: %option debug.
10485 Scan strings of non-@ or \n instead of character by character.
10486 (scan_skel): Handle trace_skeleton.
10488 (@output_parser_name@, @output_header_name@): ``Restore'' their
10489 support (used to be M4 macros).
10490 * data/yacc.c: Quote larger chunks, a la glr.c.
10491 * data/lalr1.cc: Likewise.
10492 The header guards are no longer available, so use some other
10493 string than `YYLSP_NEEDED'.
10495 2002-11-16 Akim Demaille <akim@epita.fr>
10497 Make the ``Printers and Destructors'' test more verbose, taking
10498 `yacc.c''s behavior as (possibly wrong) reference.
10500 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use printf
10501 instead of fprint on stdout.
10502 Set and report the last_line of the symbols.
10503 Consistently display values and locations.
10505 2002-11-16 Paul Eggert <eggert@twinsun.com>
10507 * data/yacc.c: Avoid over-quoting of __line__ and __file__.
10509 2002-11-15 Paul Eggert <eggert@twinsun.com>
10511 * tests/actions.at (Actions after errors): New test case.
10513 * data/glr.c, data/lalr1.cc, data/yacc.cc, doc/bison.texinfo,
10514 src/conflicts.c, src/parse-gram.y, src/tables.c, src/tables.h,
10515 tests/action.at, tests/calc.at, tests/conflicts.at,
10516 tests/cxx-type.at, tests/regression.at:
10517 "parse error" -> "syntax error" for POSIX compatibility.
10518 "parsing stack overflow..." -> "parser stack overflow" so
10519 that code matches Bison documentation.
10521 2002-11-15 Akim Demaille <akim@epita.fr>
10523 * src/parse-gram.y (declaration): Have %parse-param and %lex-param
10524 take two BRACED_CODE, not two string_content.
10525 Free the scanner's obstack when we are done.
10526 (code_content): New.
10527 * tests/calc.at: Adjust.
10528 * doc/bison.texinfo: Adjust.
10529 Also, make sure to include the `,' for these declarations.
10531 2002-11-15 Tim Van Holder <tim.van.holder@pandora.be>
10533 * m4/prereq.m4: Removed the commented jm_PREREQ_HASH
10534 definition; avoids potential autoreconf problems.
10536 2002-11-15 Akim Demaille <akim@epita.fr>
10538 Always check the value returned by yyparse.
10540 * tests/calc.at (_AT_DATA_CALC_Y): Have `main' exit with the value
10541 returned by yyparse.
10542 (_AT_CHECK_CALC_ERROR): Take the expected exit value as argument.
10544 * tests/glr-regr1.at (glr-regr1.y): Have `main' exit with the value
10545 returned by yyparse.
10547 2002-11-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10549 * data/glr.c (yyFail): Always set yyerrflag. Corrects regression
10552 2002-11-14 Paul Eggert <eggert@twinsun.com>
10554 * src/output.c (output_skeleton): Call xfopen instead of
10555 duplicating xfopen's body.
10557 Fix bugs reported by Nelson H. F. Beebe in
10558 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00078.html>.
10560 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that
10561 "$CC -E foo.h" is allowed, as this doesn't work with the Portland
10562 Group compiler. Instead, use "$CC -E bar.c". Include the .h
10563 file twice in the grammar, as an extra check.
10565 * tests/input.at (Torturing the Scanner): Surround the
10566 backslash-newline tests with "#if 0", to make it less likely that
10567 we'll run into compiler bugs. Bring back solitary \ inside
10568 comment, but add a closing comment to work around HP C bug. Don't
10569 test backslash-newline in C character constant.
10571 2002-11-14 Akim Demaille <akim@epita.fr>
10573 * tests/synclines.at (AT_SYNCLINES_COMPILE): Ignore the exit
10574 status of the compiler.
10575 Calling `exit 1' is no longer needed.
10576 Reported by Nelson H. F. Beebe.
10578 2002-11-14 Akim Demaille <akim@epita.fr>
10580 * tests/atlocal.in (CPPFLAGS): We have config.h.
10581 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR):
10583 * tests/actions.at, tests/calc.at, tests/conflicts.at,
10584 * tests/cxx-type.at, tests/glr-regr1.at, tests/headers.at,
10585 * tests/regression.at, tests/torture.at: Use them for all the
10586 grammars that are to be compiled.
10587 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Rename as...
10588 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): this.
10589 * doc/bison.texinfo (GLR Parsers): Document `inline'.
10591 2002-11-14 Akim Demaille <akim@epita.fr>
10593 * doc/bison.texinfo: Various formatting changes (alignments in
10594 samples, additional @group/@end group, GCS in samples.
10595 Use @deffn instead of simple @table to define the directives,
10596 macros, variables etc.
10598 2002-11-13 Paul Eggert <eggert@twinsun.com>
10600 Fix some bugs reported by Albert Chin-A-Young in
10601 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00066.html>.
10603 * tests/input.at (Torturing the Scanner): Don't invoke "cc a.c b.c
10604 -o c"; the HP C compiler chatters during compilation.
10605 Instead, invoke "cc -c a.c -o a.o; cc -c b.c -o b.o; cc a.o b.o -o c".
10606 * tests/headers.at (export YYLTYPE): Likewise.
10608 * tests/input.at (Torturing the Scanner): Remove lines containing
10609 solitary backslashes, as they tickle a bug in the HP C compiler.
10611 * tests/glr-regr1.at (Badly Collapsed GLR States): Avoid //
10612 comments, since they're not portable. Use GNU coding style.
10614 2002-11-13 Akim Demaille <akim@epita.fr>
10616 * data/yacc.c: Leave bigger chunks of quoted text.
10617 (YYDSYMPRINTF): New.
10618 Use it to report symbol activities.
10619 * data/glr.c (YYDSYMPRINTF): New.
10622 2002-11-12 Paul Eggert <eggert@twinsun.com>
10626 * data/glr.c (yydoAction): Return YYRESULTTAG, not int.
10627 (yyglrReduce): Return yyok, not 0.
10628 This should avoid the enumerated-type warnings reported
10629 by Nelson H. F. Beebe in
10630 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00057.html>.
10632 * lib/bbitset.h (BITSET_INLINE): Remove.
10633 * lib/bitset.h [! BITSET_INLINE]: Remove.
10634 (bitset_set, bitset_reset, bitset_test): Rename local vars
10635 to avoid shadowing warnings by GCC.
10637 * data/glr.c (inline): Remove #define. It's the user's
10638 responsibility to #define it away, just like 'const'.
10639 This fixes one of the bugs reported by Nelson H. F. Beebe in
10640 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00058.html>.
10642 * Makefile.maint (po-check): Scan .l and .y files instead of the
10643 .c and the .h files that they generate. This fixes the bug
10644 reported by Tim Van Holder in:
10645 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00062.html>
10646 Look for N_ as well as for _. Try to avoid matching #define for
10648 * po/POTFILES.in: Remove src/parse-gram.c, src/scan-gram.c,
10649 src/system.h. Add src/parse-gram.y, src/scan-gram.l.
10650 * src/scan-gram.l: Revamp regular expressions so that " and '
10651 do not confuse xgettext.
10653 * src/struniq.h (struniq_new): Do not declare the return type
10654 to be 'const'; this violates the C standard.
10655 * src/struniq.c (struniq_new): Likewise.
10657 2002-11-12 Albert Chin-A-Young <china@thewrittenword.com>
10659 * src/Makefile.am (LDADD): Link $(LIBINTL) last to avoid the
10660 duplicate definition of optind on Tru64 UNIX 4.0D with the Compaq
10663 2002-11-12 Akim Demaille <akim@epita.fr>
10665 * Makefile.maint: Sync with Autoconf:
10666 (local_updates): New.
10668 2002-11-12 Akim Demaille <akim@epita.fr>
10670 * po/POTFILES.in (src/lalr.c, src/state.c): Remove
10672 2002-11-12 Akim Demaille <akim@epita.fr>
10674 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Display the
10677 2002-11-12 Akim Demaille <akim@epita.fr>
10679 * data/c.m4 (b4_yysymprint_generate): Pass *yyvaluep to YYPRINT,
10682 2002-11-12 Akim Demaille <akim@epita.fr>
10684 * tests/actions.at (AT_CHECK_PRINTER_AND_DESTRUCTOR): New.
10685 Use it to test the GLR parser.
10687 2002-11-12 Akim Demaille <akim@epita.fr>
10689 * tests/regression.at (input.y): s/YYEOF/MYEOF/, as the skeleton
10691 * data/glr.c (yystos): New.
10692 (b4_yysymprint_generate, b4_yydestruct_generate): Invoke.
10693 (YYDSYMPRINT): New.
10694 (yyval): Don't define it, it is handled via M4.
10695 (yyrecoverParseError): Free verbosely the discarded symbols.
10696 * data/yacc.c (yysymprint): Remove, rather...
10697 (b4_yysymprint_generate): invoke.
10698 * data/c.m4 (b4_yysymprint_generate): New.
10699 Accept pointers as arguments, as opposed to the version from
10701 (b4_yydestruct_generate): Likewise.
10702 * tests/cations.at (Printers and Destructors): Use Bison directives
10703 instead of CPP macros.
10704 Don't rely on internal details.
10706 2002-11-12 Akim Demaille <akim@epita.fr>
10708 * data/c.m4 (b4_yydestruct_generate, b4_symbol_actions): New.
10709 * data/yacc.c: Rename yychar1 as yytoken, as in glr.c.
10710 Don't work on yychar (i.e., do set it to YYEMPTY, don't match
10711 it against YYEMPTY and so forth), work on yytoken (i.e., set
10712 it to YYEMPTY etc.).
10713 (yydestruct): Replace with a b4_yydestruct_generate invocation.
10714 (b4_symbol_actions): Remove.
10715 * data/glr.c (YYTRANSLATE): As for yacc.c, if negative, it stands
10716 for 0, end-of-input.
10718 2002-11-12 Akim Demaille <akim@epita.fr>
10720 * doc/bison.texinfo (Destructor Decl): New.
10722 2002-11-12 Akim Demaille <akim@epita.fr>
10724 * src/tables.c (tables_generate): Use free for pointers that
10725 cannot be NULL, not XFREE.
10726 (pack_vector): Use assert, not fatal, for bound violations.
10727 * src/state.c (state_new): Likewise.
10728 * src/reader.c (reader): Likewise.
10729 * src/lalr.c (set_goto_map): Likewise.
10730 * src/location.h (LOCATION_PRINT): If first_line is 0, just issue
10733 2002-11-12 Akim Demaille <akim@epita.fr>
10735 * src/scan-gram.l, src/reader.h (scanner_last_string_free):
10737 * src/scan-gram.l (last_string): Is global to the file, not to
10739 * src/parse-gram.y (input): Don't append the epilogue here,
10740 (epilogue.opt): do it here, and free the scanner's obstack.
10741 * src/reader.c (epilogue_set): Rename as...
10742 (epilogue_augment): this.
10743 * data/c.m4 (b4_epilogue): Defaults to empty.
10745 2002-11-12 Akim Demaille <akim@epita.fr>
10747 * src/getargs.c (long_options): Remove duplicates.
10748 * src/vmsgetargs.c, src/build.com, src/bison.cld, src/vmshlp.mar:
10750 * doc/bison.rnh: Remove.
10751 * doc/bison.texinfo (VMS Invocation): Remove.
10753 2002-11-12 Akim Demaille <akim@epita.fr>
10755 * src/struniq.h, src/struniq.c (struniq_t): Is const.
10756 (STRUNIQ_EQ, struniq_assert, struniq_assert_p): New.
10758 Use struniq for symbols.
10760 * src/symtab.h (symbol_t): The tag member is a struniq.
10761 (symbol_type_set): Adjust.
10762 * src/symtab.c (symbol_new): Takes a struniq.
10763 (symbol_free): Don't free the tag member.
10764 (hash_compare_symbol_t, hash_symbol_t): Rename as...
10765 (hash_compare_symbol, hash_symbol): these.
10766 Use the fact that tags as struniqs.
10767 (symbol_get): Use struniq_new.
10768 * src/symlist.h, src/symlist.c (symbol_list_n_type_name_get):
10770 * src/reader.h (merger_list, grammar_currentmerge_set): The name
10771 and type members are struniqs.
10772 * src/reader.c (get_merge_function)
10773 (grammar_current_rule_merge_set): Adjust.
10774 (TYPE, current_type): Are struniq.
10776 Use struniq for file names.
10778 * src/files.h, src/files.c (infile): Split into...
10779 (grammar_file, current_file): these.
10780 * src/scan-gram.c (YY_USER_INIT, handle_syncline): Adjust.
10781 * src/reduce.c (reduce_print): Likewise.
10782 * src/getargs.c (getargs): Likewise.
10783 * src/complain.h, src/complain.c: Likewise.
10784 * src/main.c (main): Call struniqs_new early enough to use it for
10786 Don't free the input file name.
10788 2002-11-12 Akim Demaille <akim@epita.fr>
10790 * src/symtab.c (symbol_free): Remove dead deactivated code:
10791 type_name are properly removed.
10792 Don't use XFREE to free items that cannot be NULL.
10793 * src/struniq.h, src/struniq.c: New.
10794 * src/main.c (main): Initialize/free struniqs.
10795 * src/parse-gram.y (%union): Add astruniq member.
10797 * src/scan-gram.l (<{tag}>): Return a struniq.
10798 Free the obstack bit that used to store it.
10799 * src/symtab.h (symbol_t): The 'type_name' member is a struniq.
10801 2002-11-11 Paul Eggert <eggert@twinsun.com>
10803 Revamp to fix many (but not all) of the C- and M4-related quoting
10804 problems. Among other things, this fixes the Bison bug reported
10805 by Jan Hubicka when processing the Bash grammar; see:
10806 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00039.html>
10808 Use new @ escapes consistently. Represent brackets with @{ and @}
10809 rather than @<:@ and @:>@, since this works a bit better with dumb
10810 editors like vi. Represent @ with @@, since @ is now consistently
10811 an escape. Use @oline@ and @ofile@ rather than __oline__ and
10812 __ofile__, to avoid unexpected expansions. Similarly, use @output
10813 rather than #output.
10815 * data/c.m4 (b4_copyright): Omit file name from comment, since
10816 the file name could contain "*/".
10817 (b4_synclines_flag): Don't quote the 2nd argument; it should already
10818 be quoted. All uses changed.
10820 * data/glr.c: Use new @ escapes consistently.
10821 (b4_input_suffix, b4_output_parser_suffix, b4_output_parser_name,
10822 b4_output_header_suffix, b4_output_header_name, b4_header_guard):
10823 Remove, since they couldn't handle arbitrary characters in file
10825 * data/lalr1.cc: Likewise.
10826 * data/yacc.c: Likewise.
10828 * src/files.c (output_infix): Remove; all uses removed.
10829 * src/files.h: Likewise.
10831 * data/glr.c: Remove use of "#ifdef b4_header_guard", since it
10832 mishandled funny characters in file names, and anyway it isn't
10834 * data/yacc.c: Likewise.
10835 * data/lalr1.cc: Use YYSLP_NEEDED instead of b4_header_guard.
10837 * data/glr.c (YYSTYPE_IS_TRIVIAL): Define when the .h file would.
10838 * data/yacc.c: Likewise.
10840 * src/muscle_tab.c: Include quotearg.h, since we need to quote C
10842 (muscle_init): Quote filename as a C string.
10843 * src/muscle_tab.h (MUSCLE_GROW_STRING_PAIR): Remove; unused.
10844 (MUSCLE_OBSTACK_SGROW, MUSCLE_INSERT_C_STRING): New macros.
10845 * src/output.c (escaped_file_name_output): New function.
10846 (prepare_symbols): Quote tokens for M4.
10847 (prepare): Don't insert output_infix, output_prefix,
10848 output_parser_name, output_header_name; this is now down by scan-skel.
10849 Insert skeleton as a C string.
10851 * src/output.c (user_actions_output, symbol_destructors_output,
10852 symbol_printers_output): Quote filenames for C and M4.
10853 * src/reader.c (prologue_augment, epilogue_set): Likewise.
10855 * src/scan-gram.l (<SC_CHARACTER>): Don't worry about any backslash
10856 escapes other than \\ and \'; this simplifies the code.
10857 (<SC_STRING>): Likewise, for \\ and \".
10858 (<SC_COMMENT,SC_LINE_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,
10859 SC_PROLOGUE,SC_EPILOGUE>): Escape $ and @, too.
10860 Use new escapes @{ and @} for [ and ].
10862 * src/scan-skel.l (yylineno, yyoutname): Remove static vars, replacing
10863 them with auto vars.
10864 Switch to new escape scheme, where @ is the escape character uniformly.
10865 Abort if a stray escape character is found. Avoid unbounded input
10866 buffer when parsing non-escaped text.
10868 * tests/input.at (Torturing the Scanner): Add tests that @oline@,
10869 __oline__, #output, $@, and @{ do not have unintended meanings.
10871 2002-11-09 Paul Eggert <eggert@twinsun.com>
10873 Fix the test failure due to GCC warnings described in
10874 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00000.html>.
10875 * data/glr.c (yyis_pact_ninf, yyis_table_ninf): New macros, which
10876 evaluate to 0 if it's impossible for NINF to be in the respective
10878 (yygetLRActions, yyrecoverParseError): Use them.
10880 * src/scan-gram.l (unexpected_end_of_file): Fix bug: columns were
10881 counted in the token inserted at end of file. Now takes
10882 location_t *, not location_t, so that the location can be
10883 adjusted. All uses changed.
10885 * tests/regression.at (Invalid inputs): Adjust wording in
10886 diagnostic to match the new behavior.
10888 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR,
10889 AT_DATA_HORIZONTAL_GRAMMAR, AT_DATA_LOOKAHEADS_GRAMMAR,
10890 AT_DATA_STACK_TORTURE): Replace `assert (x);' with `if (! (x))
10891 abort ();'. This reduces the runtime of the "Many lookaheads"
10892 test from 27.6 to 2.7 minutes on a 440 MHz Ultrasparc III running
10895 2002-11-07 Paul Eggert <eggert@twinsun.com>
10897 * src/parse-gram.y (CHARACTER): Remove unused token.
10900 * src/scan-gram.l: Remove stack option. We no longer use the
10901 stack, since the stack was never deeper than 1; instead, use the
10902 new auto var c_context to record the stacked value.
10904 Remove nounput option. At an unexpected end of file, we now unput
10905 the minimal input necessary to end cleanly; this simplifies the
10908 Avoid unbounded token sizes where this is easy.
10910 (unexpected_end_of_file): New function.
10911 Use it to systematize the error message on unexpected EOF.
10912 (last-string): Now auto, not static.
10913 (YY_OBS_FREE): Remove unnecessary do while (0) wrapper.
10914 (scanner_last_string_free): Remove; not used.
10915 (percent_percent_count): Move decl to just before use.
10916 (SC_ESCAPED_CHARACTER): Return ID at unexpected end of file,
10917 not the (never otherwised-used) CHARACTER.
10919 2002-11-07 Akim Demaille <akim@epita.fr>
10921 Let yyerror always receive the msg as last argument, so that
10922 yyerror can be variadic.
10924 * data/yacc.c (b4_yyerror_args): New.
10925 Use it when calling yyerror.
10926 * data/glr.c (b4_yyerror_args, b4_lyyerror_args): New.
10927 Use it when calling yyerror.
10928 * doc/bison.texinfo (Error Reporting): Adjust.
10929 * tests/calc.at (_AT_DATA_CALC_Y): Adjust.
10930 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Adjust.
10932 2002-11-06 Akim Demaille <akim@epita.fr>
10934 #line should have quoted strings.
10935 Ideally, this should be done by m4_quotearg.
10937 * src/scan-skel.l: Include quotearg.h.
10939 * src/output.c (symbol_printers_output)
10940 (symbol_destructors_output): Quote the file name.
10942 2002-11-06 Akim Demaille <akim@epita.fr>
10944 * tests/regression.at (Invalid inputs): Adjust to the recent
10947 2002-11-06 Akim Demaille <akim@epita.fr>
10949 Restore --no-lines.
10950 Reported by Jim Kent.
10952 * data/c.m4 (b4_syncline): New.
10953 * data/glr.c, data/yacc.c, data/lalr1.cc: Use it.
10954 * src/reader.c (prologue_augment, epilogue_set): Use b4_syncline.
10955 * src/output.c (user_actions_output): Likewise.
10956 (prepare): Define 'b4_synclines_flag'.
10957 * src/muscle_tab.c (muscle_init): Don't define b4_linef.
10959 2002-11-06 Akim Demaille <akim@epita.fr>
10961 * src/main.c (main): Free `infile'.
10962 * src/scan-gram.l (handle_syncline): New.
10964 * src/output.c (user_actions_output, symbol_destructors_output)
10965 (symbol_printers_output): Use the location's file name, not
10967 * src/reader.c (prologue_augment, epilogue_set): Likewise.
10969 2002-11-05 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10971 * src/tables.c (matching_state): Don't allow states to match if
10972 either has GLR conflict entries.
10974 2002-11-05 Paul Eggert <eggert@twinsun.com>
10976 * src/scan-gram.l: Use more accurate diagnostics, e.g.
10977 "integer out of range" rather than "invalid value".
10978 * tests/input.at (Invalid $n, Invalid @n): Change expected wording
10981 Scan <% and %> digraphs in C code as POSIX 1003.1-2001 requires.
10982 Also, remove one static variable in the scanner.
10984 * src/scan-gram.l (braces_level): Now auto, not static.
10985 Initialize to zero if the compiler is being picky.
10986 (INITIAL): Clear braces_level instead of incrementing it.
10987 (SC_BRACED_CODE): Treat <% and %> as { and } when inside C code,
10988 as POSIX 1003.1-2001 requires.
10989 * src/system.h (IF_LINT): New macro, taken from coreutils.
10990 * configure.ac: Define "lint" if --enable-gcc-warnings.
10992 2002-11-05 Akim Demaille <akim@epita.fr>
10994 * src/scan-gram.l: When it starts with `%', complain about the
10995 whole directive, not just that `invalid character: %'.
10997 2002-11-04 Akim Demaille <akim@epita.fr>
10999 * Makefile.maint: Update from Autoconf.
11000 (update, cvs-update, po-update, do-po-update): New.
11002 2002-11-04 Akim Demaille <akim@epita.fr>
11004 * tests/glr-regr1.at (Badly Collapsed GLR States): Prototype yylex
11006 Have yyerror `use' its arguments.
11007 * tests/calc.at (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF
11008 returns true when location & yacc & pure & parse-param.
11009 (_AT_DATA_CALC_Y): Let yyerror ``use'' its arguments.
11011 2002-11-04 Akim Demaille <akim@epita.fr>
11013 * src/location.h (LOCATION_PRINT): Use quotearg slot 3 to avoid
11015 * src/scan-gram.l: Use [\'] instead of ['] to pacify
11018 Use quote, not quote_n since LOCATION_PRINT no longer uses the
11021 2002-11-03 Paul Eggert <eggert@twinsun.com>
11023 * src/reader.c (get_merge_function, grammar_current_rule_check):
11024 Use consistent diagnostics for reporting type name clashes.
11025 Quote the types with <>, for consistency with Yacc.
11026 * tests/input.at (Type Clashes): Adjust to diagnostic changes.
11028 2002-11-03 Akim Demaille <akim@epita.fr>
11030 * data/c.m4 (b4_identification, b4_user_args, b4_parse_param):
11032 * data/yacc.m4 (b4_pure_args, b4_Pure_args): New.
11033 (b4_parse_param): Remove.
11034 Use b4_identification.
11035 Propagate b4_pure_args where needed to pass them to yyerror.
11036 * data/glr.m4 (b4_parse_param): Remove.
11037 (b4_user_formals, b4_pure_args, b4_pure_formals, b4_lpure_args)
11038 (b4_lpure_formals): New.
11039 Use b4_identification.
11040 (YY_USER_FORMALS, YY_USER_ARGS): Remove, replaced by
11041 b4_user_formals and b4_user_args.
11042 (yyexpandGLRStack, yyFail, yyaddDeferredAction, yyglrShiftDefer)
11043 (yyreportAmbiguity): When using a pure parser, also need
11044 the location, and the parse-params.
11046 (yyuserAction, yyglrShift, yyreportParseError, yyrecoverParseError):
11047 When using a pure parser, also need the parse-params.
11049 * tests/calc.at: Test pure (%pure-parser) and absolutely pure
11050 (%pure-parser + %parse-param) LALR and GLR parsers.
11051 (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): New, define AT_PARAM_IF,
11052 AT_LOCATION_IF, AT_PURE_IF, AT_GLR_IF, AAT_PURE_AND_LOC_IF,
11053 AT_GLR_OR_PARAM_IF, AT_YYERROR_ARG_LOC_IF, AT_YYERROR_SEES_LOC_IF.
11054 (_AT_DATA_CALC_Y): Equip for purity of yyerror.
11055 (_AT_CHECK_CALC_ERROR): Use AT_YYERROR_SEES_LOC_IF.
11056 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Equip for yyerror purity.
11057 * doc/bison.texinfo: Untabify the whole file.
11058 (Parser Function): Document %parse-param, deprecate YYPARSE_PARAM.
11059 (Pure Calling): Document %lex-param, deprecate YYLEX_PARAM.
11060 (Error Reporting): Adjust to these new directives.
11061 Document %error-verbose, deprecate YYERROR_VERBOSE.
11063 2002-11-03 Akim Demaille <akim@epita.fr>
11065 * tests/calc.at: Change all the AT_CHECK_CALC_LALR and
11066 AT_CHECK_CALC_GLR invocations to use % directives, instead of
11067 command line options.
11068 * tests/cxx-type.at: Formatting changes.
11070 2002-11-03 Paul Eggert <eggert@twinsun.com>
11072 * src/scan-gram.l: Revamp to fix POSIX incompatibilities,
11073 to count columns correctly, and to check for invalid inputs.
11075 Use mbsnwidth to count columns correctly. Account for tabs, too.
11076 Include mbswidth.h.
11077 (YY_USER_ACTION): Invoke extend_location rather than LOCATION_COLUMNS.
11078 (extend_location): New function.
11079 (YY_LINES): Remove.
11081 Handle CRLF in C code rather than in Lex code.
11082 (YY_INPUT): New macro.
11083 (no_cr_read): New function.
11085 Scan UCNs, even though we don't fully handle them yet.
11086 (convert_ucn_to_byte): New function.
11088 Handle backslash-newline correctly in C code.
11089 (SC_LINE_COMMENT, SC_YACC_COMMENT): New states.
11090 (eols, blanks): Remove. YY_USER_ACTION now counts newlines etc.;
11092 (tag, splice): New EREs. Do not allow NUL or newline in tags.
11093 Use {splice} wherever C allows backslash-newline.
11094 YY_STEP after space, newline, vertical-tab.
11095 ("/*"): BEGIN SC_YACC_COMMENT, not yy_push_state (SC_COMMENT).
11097 (letter, id): Don't assume ASCII; e.g., spell out a-z.
11099 ({int}, handle_action_dollar, handle_action_at): Check for integer
11102 (YY_STEP): Omit trailing semicolon, so that it's more like C.
11104 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>): Allow \0 and \00
11105 as well as \000. Check for UCHAR_MAX, not 255.
11106 Allow \x with an arbitrary positive number of digits, as in C.
11107 Check for overflow here.
11108 Allow \? and UCNs, for compatibility with C.
11110 (handle_symbol_code_dollar): Use quote_n slot 1 to avoid collision
11111 with quote slot used by complain_at.
11113 * tests/input.at: Add tests for backslash-newline, m4 quotes
11114 in symbols, long literals, and funny escapes in strings.
11116 * configure.ac (jm_PREREQ_MBSWIDTH): Add.
11117 * lib/Makefile.am (libbison_a_SOURCES): Add mbswidth.h, mbswidth.c.
11118 * lib/mbswidth.h, lib/mbswidth.c: New files, from GNU gettext.
11119 * m4/Makefile.am (EXTRA_DIST): Add mbswidth.m4.
11120 * m4/mbswidth.m4: New file, from GNU coreutils.
11122 * doc/bison.texinfo (Grammar Outline): Document // comments.
11123 (Symbols): Document that trigraphs have no special meaning in Bison,
11124 nor is backslash-newline allowed.
11125 (Actions): Document that trigraphs have no special meaning.
11127 * src/location.h (LOCATION_COLUMNS, LOCATION_LINES): Remove;
11130 2002-11-02 Paul Eggert <eggert@twinsun.com>
11132 * src/reader.c: Don't include quote.h; not needed.
11133 (get_merge_function): Reword warning to be consistent with
11134 type clash diagnostic in grammar_current_rule_check.
11136 * lib/quotearg.c (quotearg_buffer_restyled): Fix off-by-two
11137 bug in trigraph handling.
11139 * src/output.c (prepare_symbols): When printing token names,
11140 escape "[" as "@<:@" and likewise for "]".
11142 * src/system.h (errno): Remove declaration, as we are now
11143 assuming C89 or better, and C89 guarantees errno.
11145 2002-10-30 Paul Eggert <eggert@twinsun.com>
11147 * lib/bitset_stats.c (bitset_stats_read, bitset_stats_write):
11148 Check for close failures.
11149 * src/files.h (xfclose): Return void, not int, since it always
11151 * src/files.c (xfclose): Likewise. Report I/O error if ferror
11153 * src/output.c (output_skeleton): Use xfclose rather than fclose
11154 and ferror. xfclose now checks ferror.
11156 * data/glr.c (YYLEFTMOST_STATE): Remove.
11157 (yyreportTree): Use a stack-based leftmost state. This avoids
11158 our continuing battles with bogus warnings about initializers.
11160 2002-10-30 Akim Demaille <akim@epita.fr>
11162 * src/system.h: Don't use #ifdef/#ifndef on HAVE_ values, only
11165 2002-10-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11167 * tests/glr-regr1.at: New test for reported regressions.
11168 * tests/testsuite.at: Add glr-regr1.at test.
11169 * tests/Makefile.am: Add glr-regr1.at test.
11171 2002-10-24 Paul Eggert <eggert@twinsun.com>
11175 * tests/calc.at (_AT_DATA_CALC_Y): Remove unused strcat declaration.
11176 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Include stdlib.h, since
11177 we use malloc. Don't assume 'A' through 'Z' are contiguous.
11178 Don't assume strdup exists; POSIX says its an XSI extension.
11179 Check for buffer overflow on input.
11181 2002-10-24 Akim Demaille <akim@epita.fr>
11183 * src/output.c (output_skeleton): Don't disable M4sugar comments
11184 too soon: it results in comments being expanded.
11185 * data/yacc.c, data/glr.c, data/lalr1.cc: Do it right before the
11188 2002-10-24 Akim Demaille <akim@epita.fr>
11190 * data/yacc.c (m4_int_type): New.
11191 * data/c.m4 (m4_int_type): Don't use yysigned_char, but `signed
11192 char' as only yacc.c wants K&R portability.
11193 * data/glr.c (yysigned_char): Remove.
11194 * data/lalr1.cc: Rename the trailing b4_name as b4_parser_class_name.
11195 Reported by Quoc Peyrot.
11197 2002-10-23 Paul Eggert <eggert@twinsun.com>
11199 * src/main.c (main): With --trace=time, report times even if a
11200 non-fatal error occurs. Formerly, the times were reported in some
11201 such cases but not in others.
11202 * src/reader.c (reader): Just return if a complaint has been issued,
11203 instead of exiting, so that 'main' can report times.
11205 2002-10-22 Akim Demaille <akim@epita.fr>
11207 * src/system.h: Include sys/types.
11208 Reported by Bert Deknuydt.
11210 2002-10-23 Paul Eggert <eggert@twinsun.com>
11212 * configure.ac (AC_PROG_LEX): Use instead of AM_PROG_LEX.
11213 Suggested by Art Haas.
11215 2002-10-22 Paul Eggert <eggert@twinsun.com>
11217 * src/complain.c (exit) [! (STDC_HEADERS || _LIBC)]: Remove exit
11218 decl; not needed any more.
11219 * src/main.c (main): Use return to exit, undoing yesterday's change.
11220 The last OS that we could find where this wouldn't work is
11221 SunOS 3.5, and that's too old to worry about now.
11223 * data/glr.c (struct yyltype): Define members even when not
11224 doing locations. This is more consistent with yacc.c, and it
11225 works around the following bug reports:
11226 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00106.html
11227 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00111.html
11229 * doc/bison.texinfo: Minor spelling and typographical fixes. Use
11230 @acronym consistently. Standardize on "Yacc" instead of "YACC",
11231 "Algol" instead of "ALGOL". Give a bit more history about BNF.
11233 2002-10-22 Akim Demaille <akim@epita.fr>
11235 * data/README: New.
11237 2002-10-21 Paul Eggert <eggert@twinsun.com>
11239 Be consistent about 'bool'; the old code used an enum in one
11240 module and an int in another, and this violates the C standard.
11241 * m4/stdbool.m4: New file, from coreutils 4.5.3.
11242 * configure.ac (AC_HEADER_STDBOOL): Add.
11243 * m4/Makefile.am (EXTRA_DIST): Add stdbool.m4.
11244 * src/muscle_tab.c (hash_compare_muscles): (a ? FALSE : TRUE) -> (! a)
11245 * src/symtab.c (hash_compare_symbol_t): Likewise.
11246 * src/system.h (bool, false, true): Use a definition consistent
11247 with ../lib/hash.c. All uses changed.
11249 * src/complain.c (warning_issued): Renamed from warn_message_count,
11250 so that we needn't worry about integer overflow (!).
11251 Now of type bool. All uses changed.
11252 (complaint_issued): Renamed from complain_message_count; likewise.
11254 * src/main.c (main): Use exit to exit with failure.
11256 * src/complain.c (fatal_at, fatal): Use EXIT_FAILURE and EXIT_SUCCESS
11257 rather than 1 and 0.
11258 * src/main.c (main): Likewise.
11259 * src/getargs.c (getargs): Likewise.
11260 * src/reader.c (reader): Likewise.
11262 * src/getarg.c (getargs): Remove duplicate code for
11263 "Try `bison --help'".
11265 * src/files.c (xfopen, xfclose): Use EXIT_FAILURE rather than 2.
11266 What was that "2" for?
11268 * src/complain.h (fatal, fatal_at): Add __attribute__((__noreturn__)).
11269 * src/getargs.c (usage): Likewise.
11271 * src/getargs.c (getargs): When there are too few operands, report
11272 the last one. When there are too many, report the first extra
11273 one. This is how diffutils does it.
11275 2002-10-20 Paul Eggert <eggert@twinsun.com>
11277 Remove K&R vestiges.
11278 * configure.ac (AC_C_CONST, AM_C_PROTOTYPES): Remove.
11279 * src/complain.c (VA_START): Remove. Assume prototypes.
11280 (vfprintf) [! (HAVE_VPRINTF || defined vfprintf)]: New macro.
11281 (private_strerror, warn_at, warn, complain_at, complain, fatal_at,
11282 fatal): Assume prototypes.
11283 * src/complain.h: Assume prototypes.
11284 * src/system.h (PARAMS): Remove.
11285 Include <limits.h> unconditionally, since it's guaranteeed even
11286 for a freestanding C89 compiler.
11287 (SHRT_MIN, SHRT_MAX): Remove, since C89 guarantees them.
11288 * src/vmsgetargs.c (getargs, cli_present, cli_get_value): Prototype.
11290 2002-10-20 Akim Demaille <akim@epita.fr>
11292 * src/muscle_tab.c (muscle_grow): Remove trailing debugging code.
11293 * data/glr.c (YY_USER_FORMALS, YY_USER_ARGS): New.
11294 (yyuserAction, yydoAction, yyglrReduce, yyresolveValue)
11295 (yyresolveStates, yyresolveAction, yyresolveStack)
11296 (yyprocessOneStack): Use them.
11297 (yy_reduce_print): New.
11298 * tests/calc.at (_AT_DATA_CALC_Y): Exercise %parse-param.
11300 2002-10-20 Akim Demaille <akim@epita.fr>
11302 * data/c.m4 (b4_c_ansi_args): Recognize functions with no
11303 arguments and output `void'.
11304 (b4_c_function): Rename as...
11305 (b4_c_function_def): this.
11306 (b4_c_function_decl, b4_c_ansi_function_def)
11307 (b4_c_ansi_function_decl): New.
11308 Change the interpretation of the arguments: before `int, foo', now
11310 * data/yacc.c (yyparse): Prototype and define thanks to these.
11311 Adjust b4_c_function_def uses.
11312 * data/glr.c (yyparse): Likewise, but ANSI only.
11314 2002-10-20 Akim Demaille <akim@epita.fr>
11316 * src/output.c (prepare): Move the definition of `tokens_number',
11317 `nterms_number', `undef_token_number', `user_token_number_max'
11319 (prepare_tokens): Here.
11320 (prepare_tokens): Rename as...
11321 (prepare_symbols): this.
11322 (prepare): Move the definition of `rules_number' to...
11323 (prepare_rules): here.
11324 (prepare): Move the definition of `last', `final_state_number',
11325 `states_number' to...
11326 (prepare_states): here.
11327 * data/yacc.c, data/lalr1.cc, data/glr.c: Normalize `>' into `<'.
11329 2002-10-20 Akim Demaille <akim@epita.fr>
11331 * src/tables.h, src/tables.c, src/output.c: Comment changes.
11333 2002-10-20 Akim Demaille <akim@epita.fr>
11335 * data/yacc.c, data/yacc.c (b4_location_if, b4_pure_if): Move to...
11338 2002-10-20 Akim Demaille <akim@epita.fr>
11340 * src/output.c (prepare): Use MUSCLE_INSERT_STRING.
11341 * src/muscle_tab.c (muscle_pair_list_grow): Rename `val as
11343 (muscle_init): Move the `b4_ltype', `b4_maxdepth', `b4_initdepth',
11345 * data/glr.c, data/lalr1.cc, data/yacc.c (b4_location_type)
11346 (b4_stack_depth_init, b4_stack_depth_max, b4_parser_class_name):
11349 2002-10-19 Paul Eggert <eggert@twinsun.com>
11351 Do not create a temporary file, as that involves security and
11352 cleanup headaches. Instead, use a pair of pipes.
11353 Derived from a suggestion by Florian Krohm.
11354 * lib/subpipe.c, lib/subpipe.h, m4/subpipe.m4: New files.
11355 * lib/mkstemp.c, lib/readpipe.c, lib/tempname.c, m4/mkstemp.m4: Remove.
11356 * configure.ac (UTILS_FUNC_MKSTEMP, jm_PREREQ_TEMPNAME): Remove.
11357 (BISON_PREREQ_SUBPIPE): Add.
11358 * lib/Makefile.am (libbison_a_SOURCES): Remove readpipe.c.
11359 Add subpipe.h, subpipe.c.
11360 * m4/Makefile.am (EXTRA_DIST): Remove mkstemp.m4. Add subpipe.m4.
11361 * po/POTFILES.in: Add lib/subpipe.c.
11362 * src/output.c: Include "subpipe.h".
11363 (m4_invoke): Remove decl.
11364 (scan_skel): New decl.
11365 (output_skeleton): Use pipe rather than temporary file for m4 input.
11366 Check that m4sugar.m4 is readable, to avoid deadlock.
11367 Check for pipe I/O error.
11368 * src/scan-skel.l (readpipe): Remove decl.
11369 (scan_skel): New function, to be used in place of m4_invoke.
11370 Read from stream rather than file.
11372 * lib/timevar.c (TICKS_TO_MSEC, CLOCKS_TO_MSEC): Do not cast to
11373 float, as this generates a warning on Solaris 8 + GCC 3.2 with
11374 --enable-gcc-warnings. Instead, divide into 1.0 rather than 1;
11375 this generates a more-accurate value anyway.
11377 * lib/timevar.c (timervar_accumulate): Rename locals to
11378 avoid confusion with similarly-named more-global.
11379 * src/muscle_tab.c (muscle_pair_list_grow): Likewise.
11381 * src/output.c (prepare): Use xstrdup to convert char const *
11382 to char *, to avoid GCC warning.
11384 2002-10-19 Akim Demaille <akim@epita.fr>
11386 * tests/calc.at (_AT_DATA_CALC_Y): Define VAL, LOC, LEX_FORMALS,
11387 LEX_PRE_FORMALS, LEX_ARGS, LEX_PRE_ARGS, USE_LEX_ARGS.
11388 Use them to have `calc.y' ready for %pure-parser.
11389 * data/yacc.c (YYLEX): Pass a yylex return type to
11390 b4_c_function_call.
11392 2002-10-19 Akim Demaille <akim@epita.fr>
11394 Prototype support of %lex-param and %parse-param.
11396 * src/parse-gram.y: Add the definition of the %lex-param and
11397 %parse-param tokens, plus their rules.
11398 Drop the `_' version of %glr-parser.
11400 * src/scan-gram.l (INITIAL): Scan them.
11401 * src/muscle_tab.c: Comment changes.
11402 (muscle_insert, muscle_find): Rename `pair' as `probe'.
11403 * src/muscle_tab.h (MUSCLE_INSERT_PREFIX): Remove unused.
11404 (muscle_entry_s): The `value' member is no longer const.
11405 Adjust all dependencies.
11406 * src/muscle_tab.c (muscle_init): Adjust: use
11407 MUSCLE_INSERT_STRING.
11408 Initialize the obstack earlier.
11409 * src/muscle_tab.h, src/muscle_tab.c (muscle_grow)
11410 (muscle_pair_list_grow): New.
11411 * data/c.m4 (b4_c_function_call, b4_c_args): New.
11412 * data/yacc.c (YYLEX): Use b4_c_function_call to honor %lex-param.
11413 * tests/calc.at: Use %locations, not --locations.
11414 (AT_CHECK_CALC_GLR): Use %glr-parser, not %glr_parser.
11416 2002-10-19 Akim Demaille <akim@epita.fr>
11418 * src/getargs.c (usage): Take status as argument and exit
11420 Report the traditional `Try ... --help' message when status != 0.
11421 (usage, version): Don't take a FILE * as arg, it is pointless.
11422 (getargs): When there is an incorrect number of arguments, make it
11423 an error, and report it GNUlically thanks to `usage ()'.
11425 2002-10-18 Paul Eggert <eggert@twinsun.com>
11427 * data/glr.c (yyreportParseError): Don't assume that sprintf
11428 yields the length of the printed string, as this is not true
11429 on SunOS 4.1.4. Reported by Peter Klein.
11431 * tests/calc.at (_AT_DATA_CALC_Y): #undef memcmp and realloc.
11432 * tests/conflicts.at (%nonassoc and eof): Likewise.
11433 Fixes SunOS 4.1.4 test failure reported by Peter Klein.
11435 2002-10-17 Akim Demaille <akim@epita.fr>
11437 * src/getargs.h (trace_e): Add trace_scan, and trace_parse.
11438 * src/getargs.c (trace_types, trace_args): Adjust.
11439 * src/reader.c (grammar_current_rule_prec_set)
11440 (grammar_current_rule_dprec_set, grammar_current_rule_merge_set):
11441 Standardize error messages.
11442 And s/@prec/%prec/!
11443 (reader): Use trace_flag to enable scanner/parser debugging,
11444 instead of an adhoc scheme.
11445 * src/scan-gram.l: Remove trailing debugging code.
11447 2002-10-16 Paul Eggert <eggert@twinsun.com>
11449 * src/muscle_tab.h (MUSCLE_TAB_H_): Was misspelled as
11452 * NEWS: Officially drop support for building Bison with K&R C,
11453 since it didn't work anyway and it's not worth worrying about.
11454 * Makefile.maint (wget_files): Remove ansi2knr.c.
11455 (ansi2knr.c-url_prefix): Remove.
11456 * lib/.cvsignore: Remove ansi2knr, ansi2knr.*.
11457 * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
11458 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
11460 2002-10-15 Paul Eggert <eggert@twinsun.com>
11462 Stop using the "enum_" trick for K&R-style function definitions;
11463 it confused me, and I was the author! Instead, assume that people
11464 who want to use K&R C compilers (when using these modules in GCC,
11465 perhaps?) will run ansi2knr.
11467 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): Remove.
11468 All uses of "enum_" changed to "enum ".
11469 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
11470 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
11472 * lib/abitset.c (abitset_and, abitset_and_cmp, abitset_and_or,
11473 abitset_and_or_cmp, abitset_andn, abitset_andn_cmp,
11474 abitset_andn_or, abitset_andn_or_cmp, abitset_bytes, abitset_copy,
11475 abitset_copy1, abitset_disjoint_p, abitset_empty_p,
11476 abitset_equal_p, abitset_init, abitset_list, abitset_list_reverse,
11477 abitset_not, abitset_ones, abitset_or, abitset_or_and,
11478 abitset_or_and_cmp, abitset_or_cmp, abitset_reset, abitset_set,
11479 abitset_size, abitset_small_list, abitset_subset_p, abitset_test,
11480 abitset_unused_clear, abitset_xor, abitset_xor_cmp, abitset_zero):
11481 Use function prototypes; this removes the need for declaring
11482 static functions simply to provide their prototypes.
11483 * lib/bitset.c (bitset_alloc, bitset_and_or_, bitset_and_or_cmp_,
11484 bitset_andn_or_, bitset_andn_or_cmp_, bitset_bytes, bitset_copy_,
11485 bitset_count_, bitset_create, bitset_dump, bitset_first,
11486 bitset_free, bitset_init, bitset_last, bitset_next,
11487 bitset_obstack_alloc, bitset_obstack_free, bitset_only_set_p,
11488 bitset_op4_cmp, bitset_or_and_, bitset_or_and_cmp_, bitset_prev,
11489 bitset_print, bitset_release_memory, bitset_toggle_,
11490 bitset_type_choose, bitset_type_get, bitset_type_name_get,
11491 debug_bitset): Likewise.
11492 * lib/bitset.h (bitset_set, bitset_reset, bitset_test): Likewise.
11493 * lib/bitset_stats.c (bitset_log_histogram_print,
11494 bitset_percent_histogram_print, bitset_stats_and,
11495 bitset_stats_and_cmp, bitset_stats_and_or,
11496 bitset_stats_and_or_cmp, bitset_stats_andn, bitset_stats_andn_cmp,
11497 bitset_stats_andn_or, bitset_stats_andn_or_cmp, bitset_stats_copy,
11498 bitset_stats_count, bitset_stats_disable, bitset_stats_disjoint_p,
11499 bitset_stats_dump, bitset_stats_empty_p, bitset_stats_enable,
11500 bitset_stats_equal_p, bitset_stats_free, bitset_stats_init,
11501 bitset_stats_list, bitset_stats_list_reverse, bitset_stats_not,
11502 bitset_stats_ones, bitset_stats_or, bitset_stats_or_and,
11503 bitset_stats_or_and_cmp, bitset_stats_or_cmp, bitset_stats_print,
11504 bitset_stats_print_1, bitset_stats_read, bitset_stats_reset,
11505 bitset_stats_set, bitset_stats_size, bitset_stats_subset_p,
11506 bitset_stats_test, bitset_stats_toggle, bitset_stats_type_get,
11507 bitset_stats_write, bitset_stats_xor, bitset_stats_xor_cmp,
11508 bitset_stats_zero): Likewise.
11509 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
11510 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
11511 bitsetv_dump, debug_bitsetv): Likewise.
11512 * lib/ebitset.c (ebitset_and, ebitset_and_cmp, ebitset_andn,
11513 ebitset_andn_cmp, ebitset_bytes, ebitset_copy, ebitset_copy_,
11514 ebitset_copy_cmp, ebitset_disjoint_p, ebitset_elt_add,
11515 ebitset_elt_alloc, ebitset_elt_calloc, ebitset_elt_find,
11516 ebitset_elt_free, ebitset_elt_last, ebitset_elt_remove,
11517 ebitset_elt_zero_p, ebitset_elts_grow, ebitset_empty_p,
11518 ebitset_equal_p, ebitset_free, ebitset_init, ebitset_list,
11519 ebitset_list_reverse, ebitset_not, ebitset_ones, ebitset_op3_cmp,
11520 ebitset_or, ebitset_or_cmp, ebitset_release_memory, ebitset_reset,
11521 ebitset_set, ebitset_size, ebitset_subset_p, ebitset_test,
11522 ebitset_weed, ebitset_xor, ebitset_xor_cmp, ebitset_zero):
11524 * lib/lbitset.c (debug_lbitset, lbitset_and, lbitset_and_cmp,
11525 lbitset_andn, lbitset_andn_cmp, lbitset_bytes, lbitset_copy,
11526 lbitset_copy_cmp, lbitset_disjoint_p, lbitset_elt_alloc,
11527 lbitset_elt_calloc, lbitset_elt_find, lbitset_elt_free,
11528 lbitset_elt_link, lbitset_elt_unlink, lbitset_elt_zero_p,
11529 lbitset_empty_p, lbitset_equal_p, lbitset_free, lbitset_init,
11530 lbitset_list, lbitset_list_reverse, lbitset_not, lbitset_ones,
11531 lbitset_op3_cmp, lbitset_or, lbitset_or_cmp, lbitset_prune,
11532 lbitset_release_memory, lbitset_reset, lbitset_set, lbitset_size,
11533 lbitset_subset_p, lbitset_test, lbitset_weed, lbitset_xor,
11534 lbitset_xor_cmp, lbitset_zero): Likewise.
11536 2002-10-14 Akim Demaille <akim@epita.fr>
11540 2002-10-14 Akim Demaille <akim@epita.fr>
11542 * tests/Makefile.am (maintainer-check-posix): New.
11544 2002-10-14 Akim Demaille <akim@epita.fr>
11546 * data/glr.c [YYDEBUG] (YYLEFTMOST_STATE): Initialize the yyloc
11549 2002-10-14 Akim Demaille <akim@epita.fr>
11551 * src/tables.c (table_ninf_remap): base -> tab.
11552 Reported by Matt Rosing.
11554 2002-10-14 Paul Eggert <eggert@twinsun.com>
11556 * tests/action.at, tests/calc.at, tests/conflicts.at,
11557 tests/cxx-type.at, tests/headers.at, tests/input.at,
11558 tests/regression.at, tests/synclines.at, tests/torture.at:
11559 Say "bison -o foo.c foo.y", not "bison foo.y -o foo.c",
11560 so that the tests still work even if POSIXLY_CORRECT is set.
11561 * doc/bison.texinfo (Rpcalc Compile, Invocation): Likewise.
11563 * data/c.m4 (b4_int_type): Use yysigned_char instead of signed char,
11564 for portability to K&R hosts. Fix typo: signed char is guaranteed
11565 only to 127, not to 128.
11566 * data/glr.c (yysigned_char): New type.
11567 * data/yacc.c (yysigned_char): Likewise.
11568 * tests/regression.at (Web2c Actions): signed char -> yysigned_char.
11570 2002-10-13 Paul Eggert <eggert@twinsun.com>
11572 * data/yacc.c (yyparse): Rewrite to avoid "comparison is always
11573 true due to limited range of data type" warning from GCC.
11575 * data/c.m4 (b4_token_defines): Protect against double-inclusion
11576 by wrapping enum yytokentype's definition inside #ifndef
11577 YYTOKENTYPE. This undoes a bug I introduced on 2002-10-12.
11579 2002-10-13 Akim Demaille <akim@epita.fr>
11581 * data/glr.c (yyglrShiftDefer, yyaddDeferredAction, yydoAction):
11582 Un yy- yyrhs to avoid the name clash with the global YYRHS.
11584 2002-10-13 Akim Demaille <akim@epita.fr>
11586 * Makefile.maint: Update from Autoconf 2.54.
11587 * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Remove, shipped with 2.54.
11589 2002-10-13 Akim Demaille <akim@epita.fr>
11591 * src/print.c (print_state): Separate the list of solved conflicts
11592 from the other items.
11593 * tests/conflicts.at (Resolved SR Conflicts): Adjust.
11595 2002-10-13 Akim Demaille <akim@epita.fr>
11597 Let nondeterministic skeletons be usable with deterministic
11600 With the patch, GAWK compiled by GCC without -O2 passes its test
11601 suite using a GLR parser driven by LALR tables. It fails with -O2
11602 because `struct stat' gives two different answers on my machine:
11603 88 (definition of an auto var) and later 96 (memset on this var).
11604 Hence the stack is badly corrumpted. The headers inclusion is to
11605 blame: if I move the awk.h inclusion before GLR's system header
11606 inclusion, the two struct stat have the same size.
11608 * src/tables.c (pack_table): Always create conflict_table.
11609 (token_actions): Always create conflict_list.
11610 * data/glr.c (YYFLAG): Remove, unused.
11612 2002-10-13 Akim Demaille <akim@epita.fr>
11614 * configure.ac (AC_GNU_SOURCE): Use it instead of hand written code.
11616 (VALGRIND, GXX): New.
11617 * tests/atlocal.in (CFLAGS): Use O0FLAGS.
11618 * tests/bison.in: Run $PREBISON a pre-command.
11619 * tests/Makefile.am (maintainer-check, maintainer-check-valgrind)
11620 (maintainer-check-g++): New.
11621 * Makefile.am (maintainer-check): New.
11623 2002-10-13 Akim Demaille <akim@epita.fr>
11625 * data/glr.c: Formatting changes.
11626 Tweak some trace messages to match yacc.c's.
11628 2002-10-13 Akim Demaille <akim@epita.fr>
11630 GLR parsers sometimes raise parse errors instead of performing the
11632 Reported by Charles-Henry de Boysson.
11634 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Don't
11635 check the length of the traces when %glr.
11636 (_AT_CHECK_CALC_ERROR): Also skip `^Stack' lines, coming from
11638 (AT_CHECK_CALC_LALR, AT_CHECK_CALC_GLR): New.
11640 * data/glr.c (YYLEFTMOST_STATE): Fix its value.
11641 (yyltype): Remove the yy prefix from the member names.
11642 (yytable): Complete its comment.
11643 (yygetLRActions): Map error action number from YYTABLE from
11645 (yyisErrorAction): No longer compare YYACTION to YYPACT_NINF
11646 (which was a bug: it should have been YYTABEL_NINF, and yet it was
11647 not satisfying as we could compare an YYACTION computed from
11648 YYDEFACT to YYTABLE_NINF although they are unrelated): 0 is the
11649 only value for error actions.
11650 (yyreportParseError): In verbose parse error messages, don't issue
11651 `error' in the list of expected tokens.
11652 * data/yacc.c (yyparse) <yybackup>: Rewrite the decoding of the
11653 next action to perform to match glr.c's decoding.
11654 (yytable): Complete its comment.
11656 2002-10-13 Paul Eggert <eggert@twinsun.com>
11658 Fix problem reported by Henrik Grubbstroem in
11659 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00098.html>:
11660 "nonterm: { $$ = 123; } { $$ = $1; };" was wrongly rejected,
11661 because the Bison parser reads the second action before reducing
11663 * src/scan-gram.l (rule_length): New static var.
11664 Use it to keep track of the rule length in the scanner, since
11665 we can't expect the parser to be in lock-step sync with the scanner.
11666 (handle_action_dollar, handle_action_at): Use this var.
11667 * tests/actions.at (Exotic Dollars): Test for the problem.
11669 2002-10-12 Paul Eggert <eggert@twinsun.com>
11671 * lib/timevar.c [! IN_GCC && HAVE_SYS_TIME_H]: Include <sys/time.h>.
11672 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): Check for <sys/time.h>.
11673 Include <sys/time.h> when checking for clock_t and struct tms.
11674 Use same include order as source.
11675 This is for the SunOS 4.1.4 porting bug reported by Peter Klein in
11676 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00016.html>.
11678 * lib/timevar.c: Update copyright date and clarify comments.
11679 (get_time) [IN_GCC]: Keep the GCC version for reference.
11681 * lib/timevar.c, lib/timevar.h, lib/timevar.def: Import
11682 GCC version as of today, then merge Bison's changes.
11683 Change "GCC" to "Bison" in copyright notice. timevar.def's
11684 author is Akim, so change that too.
11686 * src/reader.c (grammar_current_rule_check):
11687 Don't worry about the default action if $$ is untyped.
11688 Prevents bogus warnings reported by Jim Gifford in
11689 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00015.html>.
11691 * data/c.m4 (b4_token_enum): Do not define YYTOKENTYPE.
11692 * data/glr.c, data/lalr1.cc, data/yacc.c:
11693 Output token definitions before the first part of user declarations.
11694 Fixes compatibility problem reported by Jim Gifford for kbd in
11695 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00014.html>.
11697 2002-10-11 Paul Eggert <eggert@twinsun.com>
11699 * data/yacc.c (yyreport_parse_error): Remove, putting its body into...
11700 (yyparse): here. This undoes some of the 2002-07-25 change.
11701 Compatibility problem reported by Ralf S. Engelschall with
11702 OSSP cfg <http://www.ossp.org/pkg/lib/cfg/>.
11704 2002-10-11 Akim Demaille <akim@epita.fr>
11706 * tests/regression.at Characters Escapes): New.
11707 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Accept \' in strings and
11709 Reported by Jan Nieuwenhuizen.
11711 2002-10-11 Akim Demaille <akim@epita.fr>
11715 2002-10-10 Paul Eggert <eggert@twinsun.com>
11717 Portability fixes for bitsets; this also avoids several GCC
11720 * lib/abitset.c: Include <stddef.h>, for offsetof.
11721 * lib/lbitset.c: Likewise.
11723 * lib/abitset.c (abitset_bytes): Return a size that is aligned
11724 properly for vectors of objects. Do not assume that adding a
11725 header size to a multiple of a word size yields a value that is
11726 properly aligned for the whole union.
11727 * lib/bitsetv.c (bitsetv_alloc): Likewise.
11729 * lib/bitset_stats.c (bitset_stats_bytes): Adjust to new,
11730 unique names for structures.
11731 * lib/ebitset.c (ebitset_bytes): Likewise.
11732 * lib/lbitset.c (lbitset_bytes): Likewise.
11734 * lib/abitset.c (abitset_ones, abitset_zero, abitset_empty_p,
11735 abitset_copy1, abitset_not, abitset_equal_p, abitset_subset_p,
11736 abitset_disjoint_p, abitset_and, abitset_and_cmp, abitset_andn,
11737 abitset_andn_cmp, abitset_or, abitset_or_cmp, abitset_xor,
11738 abitset_xor_cmp, abitset_and_or, abitset_and_or_cmp,
11739 abitset_andn_or, abitset_andn_or_cmp, abitset_or_and,
11740 abitset_or_and_cmp, abitset_copy): Supply prototype decls,
11741 to improve the type-checking that GCC can do.
11742 * lib/bitset.c (bitset_op4_cmp): Likewise.
11743 * lib/bitset_stats.c (bitset_stats_count,
11744 bitset_stats_empty_p, bitset_stats_ones, bitset_stats_zero,
11745 bitset_stats_copy, bitset_stats_disjoint_p,
11746 bitset_stats_equal_p, bitset_stats_not, bitset_stats_subset_p,
11747 bitset_stats_and, bitset_stats_and_cmp, bitset_stats_andn,
11748 bitset_stats_andn_cmp, bitset_stats_or, bitset_stats_or_cmp,
11749 bitset_stats_xor, bitset_stats_xor_cmp, bitset_stats_and_or,
11750 bitset_stats_and_or_cmp, bitset_stats_andn_or,
11751 bitset_stats_andn_or_cmp, bitset_stats_or_and,
11752 bitset_stats_or_and_cmp): Likewise.
11753 * lib/lbitset.c (lbitset_and, lbitset_and_cmp, lbitset_andn,
11754 lbitset_andn_cmp, lbitset_or, lbitset_or_cmp, lbitset_xor,
11755 lbitset_xor_cmp, lbitset_empty_p, lbitset_ones, lbitset_not,
11756 lbitset_subset_p, lbitset_disjoint_p, debug_lbitset): Likewise.
11758 * lib/abitset.h: Include bitset.h, not bbitset.h.
11759 * lib/ebitset.h: Likewise.
11760 * lib/lbitset.h: Likewise.
11762 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): New types.
11763 All instances of parameters of type enum bitset_opts are now of
11764 type enum_bitset_opts, to conform to the C Standard, and similarly
11765 for enum_bitset_type.
11766 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
11767 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
11769 Do not use "struct bitset_struct" to mean different things in
11770 different modules. Not only is this confusing, it violates
11771 the C Standard, which requires that structure types in different
11772 modules must be compatible if one is to be passed to the other.
11773 * lib/bbitset.h (bitset): Now points to a union, not to a struct.
11774 All instances of "struct bitset_struct *" replaced with "bitset".
11775 * lib/bitset.h (struct bitset_struct): Remove, replacing with....
11776 (union bitset_union, struct abitset_struct, struct ebitset_struct,
11777 struct lbitset_struct, struct bitset_stats_struct): New types.
11778 All uses of struct bitset_struct changed to union bitset_union,
11780 * lib/abitset.c (struct abitset_struct, abitset,
11781 struct bitset_struct): Remove.
11782 * lib/bitset_stats.c (struct bitset_stats_struct, bitset_stats,
11783 struct bitset_struct): Remove.
11784 * lib/ebitset.c (struct ebitset_struct, ebitset, struct
11785 bitset_struct): Remove.
11786 * lib/lbitset.c (struct lbitset_struct, lbitset, bitset_struct):
11789 Do not call a function of type T using a call that assumes the
11790 function is of a different type U. Standard C requires that a
11791 function must be called with a type that is compatible with its
11793 * lib/bbitset.h (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
11795 * lib/bitset.c (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
11797 * lib/ebitset.c (PFV): Remove.
11798 * lib/lbitset.c (PFV): Likewise.
11799 * lib/ebitset.c (ebitset_and, ebitset_andn, ebitset_or,
11800 ebitset_xor, ebitset_copy, ebitset_ones, ebitset_empty_p): New
11802 (ebitset_and, ebitset_andn, ebitset_or, ebitset_xor): New functions.
11803 (ebitset_vtable): Use them.
11804 * lib/lbitset.c (lbitset_and, lbitset_andn, lbitset_or,
11805 lbitset_xor): New functions.
11806 (lbitset_vtable): Use them.
11808 * lib/bitset.h (bitset_next, bitset_prev, bitset_only_set_p):
11811 * lib/bitsetv.c (bitsetv_alloc): Add a cast to (void *) to avoid a
11813 * lib/lbitset.c (LBITSET_CURRENT1): Likewise.
11814 Use offsetof, for simplicity.
11816 2002-10-06 Paul Eggert <eggert@twinsun.com>
11818 * lib/bitset.h (bitset_reset): Do not assume that bitset_word is
11819 the same width as int. This reapplies a hunk of the 2002-08-12 patch
11820 <http://lists.gnu.org/archive/html/bison-patches/2002-08/msg00007.html>,
11821 which was inadvertently undone by the 2002-09-30 patch.
11822 * lib/lbitset.c (debug_lbitset): Do not assume that bitset_word is
11823 the same width as int.
11825 2002-10-04 Paul Eggert <eggert@twinsun.com>
11829 * configure.ac (AC_INIT), NEWS: Increment version number.
11831 * doc/bison.texinfo: Minor spelling, grammar, and white space
11833 (Symbols): Mention that any negative value returned from yylex
11834 signifies end-of-input. Warn about negative chars. Mention
11835 the portable Standard C character set.
11837 The GNU coding standard says CFLAGS and YFLAGS are reserved
11838 for the installer to set.
11839 * lib/Makefile.am (AM_CFLAGS): Renamed from CFLAGS.
11840 * src/Makefile.am (AM_CFLAGS): Likewise.
11841 (AM_YFLAGS): Renamed from YFLAGS.
11843 Fix some MAX and MIN problems.
11844 * src/gram.h (ITEM_NUMBER_MIN): MIN_MAX -> INT_MIN.
11845 * src/lalr.h (GOTO_NUMBER_MAX): INT_MAX -> SHRT_MAX.
11846 * src/symtab.h (SYMBOL_NUMBER_MAX): New macro.
11847 * src/reader.c (reader): Use it.
11849 * tests/regression.at (Braces parsing): Use grep, not fgrep, as
11850 POSIX 1003.1-2001 has removed fgrep.
11852 2002-10-04 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
11854 * lib/bbitset.h (BITSET_WINDEX_MAX): Redefine so that it cannot be
11855 interpreted as signed.
11856 * lib/ebitset.c (ebitset_list): Fix bug.
11858 2002-10-01 Paul Eggert <eggert@twinsun.com>
11860 More fixes for 64-bit hosts and large bitsets.
11862 * lib/abitset.c (struct abitset_struct.n_bits, abitset_small_list,
11863 abitset_size, abitset_list, abitset_list_reverse, abitset_list):
11864 Use bitset_bindex, not int or unsigned int or size_t, to count bits.
11865 * lib/bbitset.h (struct bitset_vtable.size, struct bitset_vtable.count,
11866 struct bitset_vtable.list, struct bitset_vtable.list_reverse,
11867 bitset_count_, bitset_next, bitset_prev, bitset_first, bitset_last,
11868 bitset_count_): Likewise.
11869 * lib/bitset.h (bitset_iterator.num, bitset_iterator.i,
11870 bitset_first, bitset_last): Likewise.
11871 * lib/bitset_stats.c (bitset_stats_size, bitset_stats_list,
11872 bitset_stats_list_reverse, bitset_stats_size,
11873 bitset_stats_count, bitset_stats_list, bitset_stat_list_reverse):
11875 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
11876 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
11877 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
11878 bitsetv_reflexive_transitive_closure): Likewise.
11879 * lib/bitsetv.h (bitsetv_alloc, bitsetv_create): Likewise.
11880 * lib/ebitset.c (ebitset_size, ebitset_list, ebitset_list_reverse):
11882 * lib/lbitset.c (lbitset_size, lbitset_list, lbitset_list_merge):
11885 * lib/abitset.c (abitset_ones, abitset_zero, abitset_bytes):
11886 Use size_t, not unsigned int, to count bytes.
11887 * lib/abitset.h (abitset_bytes): Likewise.
11888 * lib/bitset.c (bitset_bytes, bitset_alloc, bitset_obstack_alloc):
11890 * lib/bitset.h (bitset_bytes): Likewise.
11891 * lib/bitset_stats.c (bitset_stats_bytes, bitset_stats_init): Likewise.
11892 * lib/bitset_stats.h (bitset_stats_bytes): Likewise.
11893 * lib/bitsetv.c (bitsetv_alloc): Likewise.
11894 * lib/ebitset.c (ebitset_bytes): Likewise.
11895 * lib/ebitset.h (ebitset_bytes): Likewise.
11896 * lib/lbitset.c (lbitset_bytes): Likewise.
11897 * lib/lbitset.h (lbitset_bytes): Likewise.
11899 * lib/abitset.c (abitset_empty_p, abitset_not, abitset_equal_p,
11900 abitset_subset_p, abitset_disjoint_p, abitset_and,
11901 abitset_and_cmp, abitset_andn, abitset_andn_cmp, abitset_or,
11902 abitset_or_cmp, abitset_xor, abitset_xor_cmp, abitset_and_or,
11903 abitset_and_or_cmp, abitset_andn_or, abitset_andn_or_cmp,
11904 abitset_or_and, abitset_or_and_cmp):
11905 Use bitset_windex instead of unsigned int.
11906 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
11907 * lib/ebitset.c (struct ebitset_struct.size, ebitset_elts_grow,
11908 ebitset_elt_add, ebitset_elt_remove, ebitset_weed,
11909 ebitset_elt_find, ebitset_list_reverse, ebitset_list, ebitset_init):
11911 * lib/lbitset.c (lbitset_ones, lbitset_not): Likewise.
11913 * lib/bitset.c (bitset_print):
11914 Use proper printf formats for widths of integer types.
11915 * lib/bitset_stats.c (bitset_percent_histogram_print,
11916 bitset_log_histogram_print, bitset_stats_print_1): Likewise.
11917 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
11918 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
11919 * lib/lbitset.c (lbitset_bytes): Likewise.
11921 * lib/bbitset.h (BITSET_BINDEX_MAX, BITSET_WINDEX_MAX,
11922 BITSET_SIZE_MAX): New macros.
11923 (BITSET_INDEX_MAX): Remove. It wasn't right, since it assumed that
11924 sizeof (bitset_word) == sizeof (bitset_windex). All uses changed
11925 to BITSET_WINDEX_MAX.
11927 * lib/bitset.c (bitset_next, bitset_prev, bitset_first,
11928 bitset_last): Return BITSET_BINDEX_MAX (not -1) for no value,
11929 since we now return the bitset_bindex type (not int).
11931 * lib/bitsetv.c (bitsetv_alloc): Check for arithmetic overflow
11932 when computing sizes.
11933 * lib/ebitset.c (ebitset_elts_grow): Likewise.
11935 * lib/lbitset.c (lbitset_elt_find): Simplify windex calculation
11936 and avoid cast to unsigned.
11938 2002-09-30 Akim Demaille <akim@epita.fr>
11940 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
11941 * lib/bitset_stats.c, lib/bitsetv.c, lib/ebitset.c, lib/lbitset.c:
11942 Updates from Michael Hayes.
11944 2002-09-30 Art Haas <ahaas@neosoft.com>
11946 * configure.ac: Update AC_OUTPUT and AM_CONFIG_HEADER
11948 * tests/cxx-type.at (declarator): Don't rely on NDEBUG being not
11951 2002-09-27 Akim Demaille <akim@epita.fr>
11955 2002-09-27 Akim Demaille <akim@epita.fr>
11957 * configure.ac (AM_INIT_AUTOMAKE): We _need_ 1.7.
11958 (Because of AC_LIBSOURCE).
11960 2002-09-27 Akim Demaille <akim@epita.fr>
11962 Playing with Autoscan.
11964 * configure.ac: Remove the old LIBOBJ tweaks.
11965 (AC_REPLACE_FUNCS): Add strrchr and strtol.
11966 * lib/strrchr.c: New.
11967 * lib/strtol.c: New, from the Coreutils 4.5.1.
11969 2002-09-27 Akim Demaille <akim@epita.fr>
11971 Playing with Autoscan.
11973 * m4/prereq.m4 (jm_PREREQ_ARGMATCH, jm_FUNC_ARGMATCH): New.
11974 * lib/Makefile.am (libbison_a_SOURCES): No longer include
11975 argmatch.c and argmatch.h, since they are AC_LIBSOURCE'd.
11976 * lib/strcasecmp.c, lib/strncasecmp.c, lib/memcmp.c: New, from the
11979 2002-09-24 Akim Demaille <akim@epita.fr>
11981 * doc/bison.texinfo (Stack Overflow): xref to Recursion.
11982 (Frequently Asked Questions, Parser Stack Overflow): New.
11984 2002-09-13 Akim Demaille <akim@epita.fr>
11986 Playing with autoscan.
11988 * src/reader.c (get_merge_function): Use xstrdup, not strdup.
11989 * src/files.c (skeleton_find): Remove, unused.
11990 * m4/memcmp.m4: New, from the Coreutils 4.5.1.
11991 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Run jm_FUNC_MEMCMP.
11993 2002-09-13 Akim Demaille <akim@epita.fr>
11995 * configure.ac (AM_INIT_AUTOMAKE): Require Automake 1.6.3.
11996 * Makefile.am (AUTOMAKE_OPTIONS): Don't.
11998 2002-09-13 Akim Demaille <akim@epita.fr>
12000 * configure.ac: Require 2.54.
12001 s/jm_FUNC_MALLOC/AC_FUNC_MALLOC/.
12002 s/jm_FUNC_REALLOC/AC_FUNC_REALLOC/.
12003 * m4/c-bs-a.m4, m4/malloc.m4, m4/mbstate_t.m4, m4/realloc.m4:
12004 Remove, provided by Autoconf macros.
12006 2002-09-12 Akim Demaille <akim@epita.fr>
12008 * m4/prereq.m4: Update, from Coreutils 4.5.1.
12010 2002-09-12 Akim Demaille <akim@epita.fr>
12012 * m4/prereq.m4: Update, from Fileutils 4.1.5.
12013 * configure.ac (jm_PREREQ_TEMPNAME): Invoke it.
12014 Reported by Martin Mokrejs.
12016 2002-09-10 Akim Demaille <akim@epita.fr>
12018 * src/parse-gram.y: Associate a human readable string to each
12020 * tests/regression.at (Invalid inputs): Adjust.
12022 2002-09-10 Gary V. Vaughan <gary@gnu.org>
12024 * tests/Makefile.am ($(srcdir)/package.m4): Bison now ships
12025 with an Autoconf-2.5x style configure.ac.
12027 2002-09-06 Paul Eggert <eggert@twinsun.com>
12029 * doc/bison.texinfo (Conditions): Make explicit that the GPL
12030 exception applies only to yacc.c. This is a modification of a
12031 patch originally suggested by Akim Demaille.
12033 2002-09-06 Akim Demaille <akim@epita.fr>
12035 * data/c.m4 (b4_copyright): Move the GPL exception comment from
12037 * data/yacc.c: here.
12039 * data/lalr1.cc (struct yyltype): Don't define it, since we use
12041 (b4_ltype): Default to yy::Location from location.hh.
12043 2002-09-04 Jim Meyering <jim@meyering.net>
12045 * data/yacc.c: Guard the declaration of yytoknum also with
12046 `#ifdef YYPRINT', so it is declared only when used.
12048 2002-09-04 Akim Demaille <akim@epita.fr>
12050 * configure.in: Rename as...
12051 * configure.ac: this.
12054 2002-09-04 Akim Demaille <akim@epita.fr>
12056 * src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
12057 * src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't
12058 translate maintainer only messages.
12060 2002-08-12 Paul Eggert <eggert@twinsun.com>
12064 * Makefile.am (SUBDIRS): Remove intl.
12065 (DISTCLEANFILES): Remove.
12066 * NEWS: Mention that GNU M4 is now required. Clarify what is
12067 meant by "larger grammars". Mention the pt_BR translation.
12068 * configure.in (AC_CHECK_DECLS): Add getenv, getopt.
12069 (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var.
12070 Bump version from 0.11.2 to 0.11.5.
12071 (BISON_PREREQ_STAGE): Remove.
12072 (AM_GNU_GETTEXT): Use external gettext.
12073 (AC_OUTPUT): Remove intl/Makefile.
12075 * config/depcomp, config/install-sh: Sync with Automake 1.6.3.
12077 * data/glr.c: Include string.h, for strlen.
12078 (yyreportParseError): Use size_t for yysize.
12079 (yy_yypstack): No longer nested inside yypstates, as nested
12080 functions are not portable. Do not assume size_t is the
12082 (yypstates): Do not assume that ptrdiff_t is the same width
12083 as int, and similarly for yyposn and YYINDEX.
12085 * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.
12087 * lib/Makefile.am (INCLUDES): Do not include from the intl
12088 directory, which has been removed.
12089 * src/Makefile.am (INCLUDES): Likewise.
12091 * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
12092 (bitsets_sources, additional_bitsets_sources, timevars_sources):
12095 * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
12096 * tests/Makefile.am (EXTRA_DIST): Likewise.
12098 * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
12099 Do not assume that bitset_windex is the same width as unsigned.
12101 * lib/abitset.c (abitset_unused_clear): Do not assume that
12102 bitset_word is the same width as int.
12103 * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise.
12104 * lib/bitset.h (bitset_set, bitset_reset): Likewise.
12105 * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise.
12106 * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise.
12107 * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise.
12109 * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for
12110 portability to one's complement hosts!).
12111 * lib/ebitset.c (ebitset_op1): Likewise.
12112 * lib/lbitset.c (lbitset_op1): Likewise.
12114 * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar.
12115 * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
12116 lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c:
12117 Sync with fileutils.
12118 * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
12119 lib/gettext.h: Sync with diffutils.
12121 * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
12122 lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.
12124 * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
12125 PROTOTYPES to check for prototypes, and "defined __STDC__" to
12128 * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not
12129 size_t; the old version tried to do this but casted improperly.
12130 (bitset_bindex, bitset_windex): Now size_t, not unsigned long.
12131 (bitset_test): Now returns int, not unsigned long.
12133 * lib/bitset_stats.c: Include "gettext.h".
12135 (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
12136 name locals "index", as it generates unnecessary warnings on some
12137 hosts that have an "index" function.
12139 * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print,
12140 bitset_stats_read, bitset_stats_write): Wrap strings in _() if
12141 they need translation.
12142 * src/LR0.c (state_list_append, new_itemsets, get_state,
12143 append_states, generate_states): Likewise.
12144 * src/assoc.c (assoc_to_string): Likewise.
12145 * src/closure.c (print_closure, set_firsts, closure): Likewise.
12146 * src/gram.c (grammar_dump): Likewise.
12147 * src/injections.c (injections_compute): Likewise.
12148 * src/lalr.c (lookaheads_print): Likewise.
12149 * src/relation.c (relation_transpose): Likewise.
12150 * src/scan-gram.l: Likewise.
12151 * src/tables.c (table_grow, pack_vector): Likewise.
12153 * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4,
12154 glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4.
12155 * m4/malloc.m4, m4/realloc.m4: Sync with diffutils.
12156 * m4/mbstate_t.m4: Sync with fileutils.
12157 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T.
12159 * po/LINGUAS: Add pt_BR.
12160 * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c,
12161 src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c,
12163 Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
12165 Similarly, use src/scan-gram.l instead of src/scan-gram.c.
12167 * src/complain.c (strerror_r): Remove decl; not needed.
12168 (strerror): Use same pattern as ../lib/error.c.
12170 * src/files.c, src/files.h (compute_header_macro): Remove; unused.
12172 * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.
12174 * src/main.c (main): Cast result of bindtextdomain and textdomain
12175 to void, to avoid a GCC warning when --disable-nls is in effect.
12177 * src/scan-gram.l: Use strings rather than escapes when possible,
12178 to minimize the number of warnings from xgettext.
12179 (handle_action_dollar, handle_action_at): Don't use isdigit,
12180 as it mishandles negative chars and it may not work as expected
12181 outside the C locale.
12183 * src/symtab.c (symbol_get): Don't cast LHS of an assignment;
12184 this is a GCC extension and is not portable to other compilers.
12186 * src/system.h (alloca): Use same pattern as ../lib/error.c.
12187 Do not include <ctype.h>; no longer needed.
12188 Do not include <malloc.h>; no longer needed (and generates
12189 warnings on OpenBSD 3.0).
12191 * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
12194 * tests/regression.at: Do not use 'cc -c input.c -o input';
12195 Sun C rejects this. Instead, use 'cc -c input.c -o input.o'.
12197 * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero
12198 exit status as failure, not just exit status 1. Sun C exits
12199 with status 2 sometimes.
12201 * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
12202 Use it for the two large tests.
12204 2002-08-02 Akim Demaille <akim@epita.fr>
12206 * src/conflicts.c (conflicts_output): Don't output rules never
12207 reduced here, since anyway that computation doesn't work.
12208 * src/gram.h, src/gram.h (rule_filter_t, rule_useful_p)
12209 (rule_useless_p, rule_never_reduced_p): New.
12210 (grammar_rules_partial_print): Use a filter instead of a range.
12211 Display the title only if needed.
12212 (grammar_rules_print): Adjust.
12213 (grammar_rules_never_reduced_report): New.
12214 * src/tables.c (action_row): Move the computation of rules never
12216 (token_actions): here.
12217 * src/main.c (main): Make the parser before making the report, so
12218 that rules never reduced are computed.
12219 Call grammar_rules_never_reduced_report.
12220 * src/print.c (print_results): Report rules never reduced.
12221 * tests/conflicts.at, tests/reduce.at: Adjust.
12223 2002-08-01 Akim Demaille <akim@epita.fr>
12225 Instead of attaching lookaheads and duplicating the rules being
12226 reduced by a state, attach the lookaheads to the reductions.
12228 * src/state.h (state_t): Remove the `lookaheads',
12229 `lookaheads_rule' member.
12230 (reductions_t): Add a `lookaheads' member.
12231 Use a regular array for the `rules'.
12232 * src/state.c (reductions_new): Initialize the lookaheads member
12234 (state_rule_lookaheads_print): Adjust.
12235 * src/state.h, src/state.c (state_reductions_find): New.
12236 * src/conflicts.c (resolve_sr_conflict, set_conflicts)
12237 (count_rr_conflicts): Adjust.
12238 * src/lalr.c (LArule): Remove.
12239 (add_lookback_edge): Adjust.
12240 (state_lookaheads_count): New.
12241 (states_lookaheads_initialize): Merge into...
12242 (initialize_LA): this.
12243 (lalr_free): Adjust.
12244 * src/main.c (main): Don't free nullable and derives too early: it
12245 is used by --verbose.
12246 * src/print.c, src/print_graph.c, src/tables.c: Adjust.
12248 2002-08-01 Akim Demaille <akim@epita.fr>
12250 * src/derives.h, src/derives.c (derives): A `rule_t***' instead of
12252 (set_derives, free_derives): Rename as...
12253 (derives_compute, derives_free): this.
12254 Adjust all dependencies.
12255 * src/nullable.c (set_nullable, free_nullable): Rename as...
12256 (nullable_compute, nullable_free): these.
12257 (rule_list_t): Store rule_t *, not rule_number_t.
12258 * src/state.c (state_rule_lookaheads_print): Directly compare rule
12259 pointers, instead of their numbers.
12260 * src/main.c (main): Call nullable_free, and derives_free earlier,
12261 as they were lo longer used.
12263 2002-08-01 Akim Demaille <akim@epita.fr>
12265 * lib/timevar.c (get_time): Include children time.
12266 * src/lalr.h (LA, LArule): Don't export them: used with the
12268 * src/lalr.c (LA, LArule): Static.
12269 * src/lalr.h, src/lalr.c (lalr_free): New.
12270 * src/main.c (main): Call it.
12271 * src/tables.c (pack_vector): Check whether loc is >= to the
12273 (pack_tables): Don't free froms, tos, conflict_tos, and pos...
12274 (tables_generate): do it, since that's also it which allocates
12276 Don't free LA and LArule, main does.
12278 2002-07-31 Akim Demaille <akim@epita.fr>
12280 Separate parser tables computation and output.
12282 * src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
12283 (conflict_list, conflict_list_cnt, table, check, table_ninf)
12284 (yydefgoto, yydefact, high): Move to...
12285 * src/tables.h, src/tables.c: here.
12286 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
12287 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
12288 (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
12289 (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
12290 (ACTION_MIN, actrow, order, nentries, pos, conflrow)
12291 (conflict_list_free, table_size, lowzero, table_grow, conflict_row)
12292 (action_row, save_row, token_actions, save_column, default_goto)
12293 (goto_actions, sort_actions, matching_state, pack_vector)
12294 (table_ninf_remap, pack_table, prepare_actions): Move to...
12295 * src/tables.c: here.
12296 * src/tables.h, src/tables.c(tables_generate, tables_free): New.
12297 * src/output.c (token_actions, output_base, output_conflicts)
12298 (output_check): Merge into...
12299 (prepare_actions): this.
12300 (actions_output): Rename as...
12301 (user_actions_output): this.
12302 * src/main.c (main): Call tables_generate and tables_free.
12304 2002-07-31 Akim Demaille <akim@epita.fr>
12306 Steal GCC's --time-report support.
12308 * lib/timevar.c, lib/timevar.h, lib/timevar.def: New,
12309 stolen/adjusted from GCC.
12310 * m4/stage.m4: Remove time related checks.
12311 * m4/timevar.m4: New.
12312 * configure.in: Adjust.
12313 * src/system.h: Adjust to using timevar.h.
12314 * src/getargs.h, src/getargs.c: Support trace_time for
12316 * src/main.c (stage): Remove.
12317 (main): Replace `stage' invocations with timevar calls.
12318 * src/output.c: Insert pertinent timevar calls.
12320 2002-07-31 Akim Demaille <akim@epita.fr>
12322 Let --trace have arguments.
12324 * src/getargs.h (enum trace_e): New.
12325 * src/getargs.c (trace_args, trace_types, trace_argmatch): New.
12326 (long_options, short_options): --trace/-T takes an optional
12328 Change all the uses of trace_flag to reflect the new flags.
12329 * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
12331 Strengthen `stage' portability.
12333 * m4/stage.m4 (BISON_PREREQ_STAGE): New.
12334 * configure.in: Use it.
12335 Don't check for malloc.h and sys/times.h.
12336 * src/system.h: Include them when appropriate.
12337 * src/main.c (stage): Compile only when mallinfo, struct mallinfo,
12338 times and struct tms are available.
12340 2002-07-30 Akim Demaille <akim@epita.fr>
12342 In verbose parse error message, don't report `error' as an
12344 * tests/actions.at (Printers and Destructors): Adjust.
12345 * tests/calc.at (Calculator $1): Adjust.
12346 * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose
12347 error message, do not report the parser accepts the error token in
12350 2002-07-30 Akim Demaille <akim@epita.fr>
12352 Normalize conflict related messages.
12354 * src/complain.h, src/complain.c (warn, complain): New.
12355 * src/conflicts.c (conflicts_print): Use them.
12356 (conflict_report_yacc): New, extracted from...
12357 (conflicts_print): here.
12358 * tests/conflicts.at, tests/existing.at: Adjust.
12360 2002-07-30 Akim Demaille <akim@epita.fr>
12362 Report rules which are never reduced by the parser: those hidden
12365 * src/LR0.c (save_reductions): Don't make the final state too
12366 different: save its reduction (accept) instead of having a state
12367 without any action (no shift or goto, no reduce).
12368 Note: the final state is now a ``regular'' state, i.e., the
12369 parsers now contain `reduce 0' as default reduction.
12370 Nevertheless, since they decide to `accept' when yystate =
12371 final_state, they still will not reduce rule 0.
12372 * src/print.c (print_actions, print_reduction): Adjust.
12373 * src/output.c (action_row): Track reduced rules.
12374 (token_actions): Report rules never reduced.
12375 * tests/conflicts.at, tests/regression.at: Adjust.
12377 2002-07-30 Akim Demaille <akim@epita.fr>
12379 `stage' was accidently included in a previous patch.
12380 Initiate its autoconfiscation.
12382 * configure.in: Look for malloc.h and sys/times.h.
12383 * src/main.c (stage): Adjust.
12384 Report only when trace_flag.
12386 2002-07-29 Akim Demaille <akim@epita.fr>
12388 * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not
12390 (errs_t): symbol_t*, not symbol_number_t.
12391 (reductions_t): rule_t*, not rule_number_t.
12392 (FOR_EACH_SHIFT): New.
12393 * src/LR0.c, src/conflicts.c, src/lalr.c, src/output.c
12394 * src/print.c, src/print_graph.c: Adjust.
12396 2002-07-29 Akim Demaille <akim@epita.fr>
12398 Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
12400 * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
12401 (endtoken, accept): these.
12402 * src/reader.c (reader): Set endtoken's default tag to "$end".
12403 Set undeftoken's tag to "$undefined" instead of "$undefined.".
12404 * doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
12407 2002-07-29 Akim Demaille <akim@epita.fr>
12409 * src/reduce.c (reduce_grammar): When the language is empty,
12410 complain about the start symbol, not the axiom.
12412 * tests/reduce.at (Empty Language): New.
12414 2002-07-26 Akim Demaille <akim@epita.fr>
12416 * src/reader.h, src/reader.c (gram_error): ... can't get
12417 yycontrol without making too strong assumptions on the parser
12419 * src/output.c (prepare_tokens): Use the real 0th value of
12420 token_translations instead of `0'.
12421 * src/parse-gram.y (yyerror): Don't rely on yycontrol being
12423 * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
12424 for the time being: %locations ought to provide it to yyerror.
12426 2002-07-25 Akim Demaille <akim@epita.fr>
12428 * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
12429 * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
12430 * tests/regression.at (Web2c Actions): Adjust.
12432 2002-07-25 Akim Demaille <akim@epita.fr>
12434 Stop storing rules from 1 to nrules + 1.
12436 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
12437 * src/nullable.c, src/output.c, src/print.c, src/reader.c
12438 * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
12439 Iterate from 0 to nrules.
12440 Use rule_number_as_item_number and item_number_as_rule_number.
12441 Adjust to `derive' now containing possibly 0.
12442 * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
12443 Handle the `- 1' part in rule numbers from/to item numbers.
12444 * src/conflicts.c (log_resolution): Fix the message which reversed
12446 * src/output.c (action_row): Initialize default_rule to -1.
12447 (token_actions): Adjust.
12448 * tests/sets.at (Nullable, Firsts): Fix the previously bogus
12450 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
12452 2002-07-25 Akim Demaille <akim@epita.fr>
12454 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
12455 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
12456 (b4_c_knr_arg_decl): New.
12457 * data/yacc.c: Use it to define yysymprint, yydestruct, and
12458 yyreport_parse_error.
12460 2002-07-25 Akim Demaille <akim@epita.fr>
12462 * data/yacc.c (yyreport_parse_error): New, extracted from...
12464 (yydestruct, yysymprint): Move above yyparse.
12467 2002-07-25 Akim Demaille <akim@epita.fr>
12469 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
12471 (b4_sint_type, b4_uint_type): these.
12472 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
12473 * tests/regression.at (Web2c Actions): Adjust.
12475 2002-07-25 Akim Demaille <akim@epita.fr>
12477 * src/gram.h (TIEM_NUMBER_MAX): New.
12478 (item_number_of_rule_number, rule_number_of_item_number): Rename
12480 (rule_number_as_item_number, item_number_as_rule_number): these.
12481 Adjust dependencies.
12482 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
12483 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
12484 (symbol_number_to_vector_number): New.
12485 (order): Of vector_number_t* type.
12486 (base_t, BASE_MAX, BASE_MIN): New.
12487 (froms, tos, width, pos, check): Of base_t type.
12488 (action_number_t, ACTION_MIN, ACTION_MAX): New.
12489 (actrow): Of action_number_t type.
12490 (conflrow): Of unsigned int type.
12491 (table_ninf, base_ninf): New.
12492 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
12493 (muscle_insert_int_table, muscle_insert_base_table)
12494 (muscle_insert_rule_number_table): New.
12495 (prepare_tokens): Output `toknum' as int_table.
12496 (action_row): Returns a rule_number_t.
12497 Use ACTION_MIN, not SHRT_MIN.
12498 (token_actions): yydefact is rule_number_t*.
12499 (table_ninf_remap): New.
12500 (pack_table): Use it for `base' and `table'.
12501 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
12503 (YYPACT_NINF, YYTABLE_NINF): these.
12504 (yypact, yytable): Compute their types instead of hard-coded
12506 * tests/regression.at (Web2c Actions): Adjust.
12508 2002-07-19 Akim Demaille <akim@epita.fr>
12510 * src/scan-gram.l (id): Can start with an underscore.
12512 2002-07-16 Akim Demaille <akim@epita.fr>
12514 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
12515 Adjust all former `associativity' dependencies.
12516 * src/symtab.c (symbol_new): Default associativity is `undef', not
12518 (symbol_check_alias_consistence): Adjust.
12520 2002-07-09 Akim Demaille <akim@epita.fr>
12522 * doc/bison.texinfo: Properly set the ``header'' part.
12523 Use @dircategory ``GNU programming tools'' as per Texinfo's
12527 2002-07-09 Akim Demaille <akim@epita.fr>
12529 * lib/quotearg.h: Protect against multiple inclusions.
12530 * src/location.h (location_t): Add a `file' member.
12531 (LOCATION_RESET, LOCATION_PRINT): Adjust.
12532 * src/complain.c (warn_at, complain_at, fatal_at): Drop
12533 `error_one_per_line' support.
12535 2002-07-09 Akim Demaille <akim@epita.fr>
12537 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
12538 * src/reader.c (lineno): Remove.
12539 Adjust all dependencies.
12540 (get_merge_function): Take a location and use complain_at.
12541 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
12542 * tests/regression.at (Invalid inputs, Mixing %token styles):
12545 2002-07-09 Akim Demaille <akim@epita.fr>
12547 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
12548 recovery rule, and forbid extensions when --yacc.
12549 (gram_error): Use complain_at.
12550 * src/reader.c (reader): Exit if there were parse errors.
12552 2002-07-09 Akim Demaille <akim@epita.fr>
12554 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
12555 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
12556 Reported by R Blake <blakers@mac.com>.
12558 2002-07-09 Akim Demaille <akim@epita.fr>
12560 * data/yacc.c: Output the copyright notive in the header.
12562 2002-07-03 Akim Demaille <akim@epita.fr>
12564 * src/output.c (froms, tos): Are state_number_t.
12565 (save_column): sp, sp1, and sp2 are state_number_t.
12566 (prepare): Rename `final' as `final_state_number', `nnts' as
12567 `nterms_number', `nrules' as `rules_number', `nstates' as
12568 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
12570 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
12571 * data/lalr1.cc (nsym_): Remove, unused.
12573 2002-07-03 Akim Demaille <akim@epita.fr>
12575 * src/lalr.h, src/lalr.c (goto_number_t): New.
12576 * src/lalr.c (goto_list_t): New.
12578 * src/nullable.c (rule_list_t): New.
12580 * src/types.h: Remove.
12582 2002-07-03 Akim Demaille <akim@epita.fr>
12584 * src/closure.c (print_fderives): Use rule_rhs_print.
12585 * src/derives.c (print_derives): Use rule_rhs_print.
12586 (rule_list_t): New, replaces `shorts'.
12587 (set_derives): Add comments.
12588 * tests/sets.at (Nullable, Firsts): Adjust.
12590 2002-07-03 Akim Demaille <akim@epita.fr>
12592 * src/output.c (prepare_actions): Free `tally' and `width'.
12593 (prepare_actions): Allocate and free `order'.
12594 * src/symtab.c (symbols_free): Free `symbols'.
12595 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
12596 * src/output.c (m4_invoke): Move to...
12597 * src/scan-skel.l: here.
12598 (<<EOF>>): Close yyout, and free its name.
12600 2002-07-03 Akim Demaille <akim@epita.fr>
12602 Fix some memory leaks, and fix a bug: state 0 was examined twice.
12604 * src/LR0.c (new_state): Merge into...
12605 (state_list_append): this.
12606 (new_states): Merge into...
12607 (generate_states): here.
12608 (set_states): Don't ensure a proper `errs' state member here, do it...
12609 * src/conflicts.c (conflicts_solve): here.
12610 * src/state.h, src/state.c: Comment changes.
12611 (state_t): Rename member `shifts' as `transitions'.
12612 Adjust all dependencies.
12613 (errs_new): For consistency, also take the values as argument.
12614 (errs_dup): Remove.
12615 (state_errs_set): New.
12616 (state_reductions_set, state_transitions_set): Assert that no
12617 previous value was assigned.
12619 (states_free): Use it.
12620 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
12621 temporary storage: use `errs' and `nerrs' as elsewhere.
12622 (set_conflicts): Allocate and free this `errs'.
12624 2002-07-02 Akim Demaille <akim@epita.fr>
12626 * lib/libiberty.h: New.
12627 * lib: Update the bitset implementation from upstream.
12628 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
12629 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
12630 * src/main.c: Adjust bitset stats calls.
12632 2002-07-01 Paul Eggert <eggert@twinsun.com>
12634 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
12635 char, so that negative chars don't collide with $.
12637 2002-06-30 Akim Demaille <akim@epita.fr>
12639 Have the GLR tests be `warning' checked, and fix the warnings.
12641 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
12642 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
12643 (yyremoveDeletes): `yyi' and `yyj' are size_t.
12644 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
12645 (yyaddDeferredAction): static.
12646 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
12647 (yyreportParseError): yyprefix is const.
12648 yytokenp is used only when verbose.
12649 (yy__GNUC__): Replace with __GNUC__.
12650 (yypdumpstack): yyi is size_t.
12651 (yypreference): Un-yy local variables and arguments, to avoid
12652 clashes with `yyr1'. Anyway, we are not in the user name space.
12653 (yytname_size): be an int, as is compared with ints.
12654 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
12656 * tests/cxx-gram.at: Use quotation to protect $1.
12657 Use AT_COMPILE to enable warnings hunts.
12658 Prototype yylex and yyerror.
12660 Include `string.h', not `strings.h'.
12661 Produce and prototype stmtMerge only when used.
12662 yylex takes a location.
12664 2002-06-30 Akim Demaille <akim@epita.fr>
12666 We spend a lot of time in quotearg, in particular when --verbose.
12668 * src/symtab.c (symbol_get): Store a quoted version of the key.
12669 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
12670 Adjust all callers.
12672 2002-06-30 Akim Demaille <akim@epita.fr>
12674 * src/state.h (reductions_t): Rename member `nreds' as num.
12675 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
12676 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
12678 2002-06-30 Akim Demaille <akim@epita.fr>
12680 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
12681 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
12682 (shifts_to): Rename as...
12683 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
12684 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
12685 (TRANSITION_IS_DISABLED, transitions_to): these.
12687 2002-06-30 Akim Demaille <akim@epita.fr>
12689 * src/print.c (print_shifts, print_gotos): Merge into...
12690 (print_transitions): this.
12691 (print_transitions, print_errs, print_reductions): Align the
12692 lookaheads columns.
12693 (print_core, print_transitions, print_errs, print_state,
12694 print_grammar): Output empty lines separator before, not after.
12695 (state_default_rule_compute): Rename as...
12696 (state_default_rule): this.
12697 * tests/conflicts.at (Defaulted Conflicted Reduction),
12698 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
12699 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
12701 2002-06-30 Akim Demaille <akim@epita.fr>
12703 Display items as we display rules.
12705 * src/gram.h, src/gram.c (rule_lhs_print): New.
12706 * src/gram.c (grammar_rules_partial_print): Use it.
12707 * src/print.c (print_core): Likewise.
12708 * tests/conflicts.at (Defaulted Conflicted Reduction),
12709 (Unresolved SR Conflicts): Adjust.
12710 (Unresolved SR Conflicts): Adjust and rename as...
12711 (Resolved SR Conflicts): this, as was meant.
12712 * tests/regression.at (Web2c Report): Adjust.
12714 2002-06-30 Akim Demaille <akim@epita.fr>
12716 * src/print.c (state_default_rule_compute): New, extracted from...
12717 (print_reductions): here.
12718 Pessimize, but clarify the code.
12719 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
12721 2002-06-30 Akim Demaille <akim@epita.fr>
12723 * src/output.c (action_row): Let default_rule be always a rule
12726 2002-06-30 Akim Demaille <akim@epita.fr>
12728 * src/closure.c (print_firsts, print_fderives, closure):
12729 Use BITSET_EXECUTE.
12730 * src/lalr.c (lookaheads_print): Likewise.
12731 * src/state.c (state_rule_lookaheads_print): Likewise.
12732 * src/print_graph.c (print_core): Likewise.
12733 * src/print.c (print_reductions): Likewise.
12734 * src/output.c (action_row): Likewise.
12735 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
12737 2002-06-30 Akim Demaille <akim@epita.fr>
12739 * src/print_graph.c: Use report_flag.
12741 2002-06-30 Akim Demaille <akim@epita.fr>
12743 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
12745 * src/relation.h, src/relation.c (traverse, relation_digraph)
12746 (relation_print, relation_transpose): New.
12748 2002-06-30 Akim Demaille <akim@epita.fr>
12750 * src/state.h, src/state.c (shifts_to): New.
12751 * src/lalr.c (build_relations): Use it.
12753 2002-06-30 Akim Demaille <akim@epita.fr>
12755 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
12756 (item_number_of_rule_number, rule_number_of_item_number): New.
12757 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
12758 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
12759 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
12760 Propagate their use.
12761 Much remains to be done, in particular wrt `shorts' from types.h.
12763 2002-06-30 Akim Demaille <akim@epita.fr>
12765 * src/symtab.c (symbol_new): Initialize the `printer' member.
12767 2002-06-30 Akim Demaille <akim@epita.fr>
12769 * src/LR0.c (save_reductions): Remove, replaced by...
12770 * src/state.h, src/state.c (state_reductions_set): New.
12771 (reductions, errs): Rename as...
12772 (reductions_t, errs_t): these.
12773 Adjust all dependencies.
12775 2002-06-30 Akim Demaille <akim@epita.fr>
12777 * src/LR0.c (state_list_t, state_list_append): New.
12778 (first_state, last_state): Now symbol_list_t.
12779 (this_state): Remove.
12780 (new_itemsets, append_states, save_reductions): Take a state_t as
12782 (set_states, generate_states): Adjust.
12783 (save_shifts): Remove, replaced by...
12784 * src/state.h, src/state.c (state_shifts_set): New.
12785 (shifts): Rename as...
12787 Adjust all dependencies.
12788 * src/state.h (state_t): Remove the `next' member.
12790 2002-06-30 Akim Demaille <akim@epita.fr>
12792 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
12795 2002-06-30 Akim Demaille <akim@epita.fr>
12797 Use hash.h for the state hash table.
12799 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
12800 (allocate_storage): Use state_hash_new.
12801 (free_storage): Use state_hash_free.
12802 (new_state, get_state): Adjust.
12803 * src/lalr.h, src/lalr.c (states): Move to...
12804 * src/states.h (state_t): Remove the `link' member, no longer
12806 * src/states.h, src/states.c: here.
12807 (state_hash_new, state_hash_free, state_hash_lookup)
12808 (state_hash_insert, states_free): New.
12809 * src/states.c (state_table, state_compare, state_hash): New.
12810 * src/output.c (output_actions): Do not free states now, since we
12811 still need to know the final_state number in `prepare', called
12812 afterwards. Do it...
12813 * src/main.c (main): here: call states_free after `output'.
12815 2002-06-30 Akim Demaille <akim@epita.fr>
12817 * src/state.h, src/state.c (state_new): New, extracted from...
12818 * src/LR0.c (new_state): here.
12819 * src/state.h (STATE_ALLOC): Move to...
12820 * src/state.c: here.
12821 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
12822 * src/state.h, src/state.c: here.
12824 2002-06-30 Akim Demaille <akim@epita.fr>
12826 * src/reader.c (gensym): Rename as...
12827 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
12828 (getsym): Rename as...
12829 (symbol_get): this.
12831 2002-06-30 Akim Demaille <akim@epita.fr>
12833 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
12834 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
12835 * src/output.c, src/print.c, src/print_graph.c: Propagate.
12836 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
12838 2002-06-30 Akim Demaille <akim@epita.fr>
12840 Make the test suite pass with warnings checked.
12842 * tests/actions.at (Printers and Destructors): Improve.
12843 Avoid unsigned vs. signed issues.
12844 * tests/calc.at: Don't exercise the scanner here, do it...
12845 * tests/input.at (Torturing the Scanner): here.
12847 2002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12849 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
12850 reorganize first lines parallel to yacc.c.
12852 2002-06-28 Akim Demaille <akim@epita.fr>
12854 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
12855 (b4_token_enum, b4_token_defines): New, factored from...
12856 * data/lalr1.cc, data/yacc.c, glr.c: here.
12858 2002-06-28 Akim Demaille <akim@epita.fr>
12860 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
12862 * src/output.c (merger_output): static.
12864 2002-06-28 Akim Demaille <akim@epita.fr>
12866 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
12867 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
12869 * src/output.c (save_row): Initialize all the variables to pacify GCC.
12871 2002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12873 Accumulated changelog for new GLR parsing features.
12875 * src/conflicts.c (count_total_conflicts): Change name to
12876 conflicts_total_count.
12877 * src/conflicts.h: Ditto.
12878 * src/output.c (token_actions): Use the new name.
12879 (output_conflicts): Change conflp => conflict_list_heads, and
12880 confl => conflict_list for better readability.
12881 * data/glr.c: Use the new names.
12882 * NEWS: Add self to GLR announcement.
12884 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
12886 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
12889 * data/bison.glr: Change name to glr.c
12890 * data/glr.c: Renamed from bison.glr.
12891 * data/Makefile.am: Add glr.c
12895 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
12896 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
12898 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12900 * data/bison.glr: Be sure to restore the
12901 current #line when returning to the skeleton contents after having
12902 exposed the input file's #line.
12904 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12906 * data/bison.glr: Bring up to date with changes to bison.simple.
12908 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12910 * data/bison.glr: Correct definitions that use b4_prefix.
12911 Various reformatting.
12912 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
12913 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
12914 yytokenp argument; now part of stack.
12915 (yychar): Define to behave as documented.
12916 (yyclearin): Ditto.
12918 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12920 * src/reader.h: Add declaration for free_merger_functions.
12922 * src/reader.c (merge_functions): New variable.
12923 (get_merge_function): New function.
12924 (free_merger_functions): New function.
12925 (readgram): Check for %prec that is not followed by a symbol.
12926 Handle %dprec and %merge declarations.
12927 (packgram): Initialize dprec and merger fields in rules array.
12929 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
12930 conflict_list_cnt, conflict_list_free): New variables.
12931 (table_grow): Also grow conflict_table.
12932 (prepare_rules): Output dprec and merger tables.
12933 (conflict_row): New function.
12934 (action_row): Output conflict lists for GLR parser. Don't use
12935 default reduction in conflicted states for GLR parser so that there
12936 are spaces for the conflict lists.
12937 (save_row): Also save conflict information.
12938 (token_actions): Allocate conflict list.
12939 (merger_output): New function.
12940 (pack_vector): Pack conflict table, too.
12941 (output_conflicts): New function to output yyconflp and yyconfl.
12942 (output_check): Allocate conflict_tos.
12943 (output_actions): Output conflict tables, also.
12944 (output_skeleton): Output b4_mergers definition.
12945 (prepare): Output b4_max_rhs_length definition.
12946 Use 'bison.glr' as default skeleton for GLR parsers.
12948 * src/gram.c (glr_parser): New flag.
12949 (grammar_free): Call free_merger_functions.
12951 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
12952 all pairs of conflicting reductions, rather than just all tokens
12953 causing conflicts. Needed to size conflict tables.
12954 (conflicts_output): Modify call to count_rr_conflicts for new
12956 (conflicts_print): Ditto.
12957 (count_total_conflicts): New function.
12959 * src/reader.h (merger_list): New type.
12960 (merge_functions): New variable.
12962 * src/lex.h (tok_dprec, tok_merge): New token types.
12964 * src/gram.h (rule_s): Add dprec and merger fields.
12965 (glr_parser): New flag.
12967 * src/conflicts.h (count_total_conflicts): New function.
12969 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
12971 * doc/bison.texinfo (Generalized LR Parsing): New section.
12972 (GLR Parsers): New section.
12973 (Language and Grammar): Mention GLR parsing.
12974 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
12975 Correct typo ("tge" -> "the").
12977 * data/bison.glr: New skeleton for GLR parsing.
12979 * tests/cxx-gram.at: New tests for GLR parsing.
12981 * tests/testsuite.at: Include cxx-gram.at.
12983 * tests/Makefile.am: Add cxx-gram.at.
12985 * src/parse-gram.y:
12987 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
12989 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
12991 2002-06-27 Akim Demaille <akim@epita.fr>
12993 * src/options.h, src/options.c: Remove.
12994 * src/getargs.c (short_options, long_options): New.
12996 2002-06-27 Akim Demaille <akim@epita.fr>
12998 * data/bison.simple, data/bison.c++: Rename as...
12999 * data/yacc.c, data/lalr1.cc: these.
13000 * doc/bison.texinfo (Environment Variables): Remove.
13002 2002-06-25 Raja R Harinath <harinath@cs.umn.edu>
13004 * src/getargs.c (report_argmatch): Initialize strtok().
13006 2002-06-20 Akim Demaille <akim@epita.fr>
13008 * data/bison.simple (b4_symbol_actions): New, replaces...
13009 (b4_symbol_destructor, b4_symbol_printer): these.
13010 (yysymprint): Be sure to call YYPRINT only for tokens, and using
13011 user token numbers.
13013 2002-06-20 Akim Demaille <akim@epita.fr>
13015 * data/bison.simple (yydestructor): Rename as...
13016 (yydestruct): this.
13018 2002-06-20 Akim Demaille <akim@epita.fr>
13020 * src/symtab.h, src/symtab.c (symbol_type_set)
13021 (symbol_destructor_set, symbol_precedence_set): The location is
13023 Adjust all callers.
13025 2002-06-20 Akim Demaille <akim@epita.fr>
13027 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
13029 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
13031 * src/symtab.h, src/symtab.c (symbol_class_set)
13032 (symbol_user_token_number_set): Likewise.
13033 Adjust all callers.
13034 Promote complain_at.
13035 * tests/input.at (Type Clashes): Adjust.
13037 2002-06-20 Akim Demaille <akim@epita.fr>
13039 * data/bison.simple (YYLEX): Fix the declaration when
13042 2002-06-20 Akim Demaille <akim@epita.fr>
13044 * data/bison.simple (yysymprint): Don't print the token number,
13046 * tests/actions.at (Destructors): Rename as...
13047 (Printers and Destructors): this.
13048 Also exercise %printer.
13050 2002-06-20 Akim Demaille <akim@epita.fr>
13052 * data/bison.simple (YYDSYMPRINT): New.
13053 Use it to remove many of the #if YYDEBUG/if (yydebug).
13055 2002-06-20 Akim Demaille <akim@epita.fr>
13057 * src/symtab.h, src/symtab.c (symbol_t): printer and
13058 printer_location are new members.
13059 (symbol_printer_set): New.
13060 * src/parse-gram.y (PERCENT_PRINTER): New token.
13061 Handle its associated rule.
13062 * src/scan-gram.l: Adjust.
13063 (handle_destructor_at, handle_destructor_dollar): Rename as...
13064 (handle_symbol_code_at, handle_symbol_code_dollar): these.
13065 * src/output.c (symbol_printers_output): New.
13066 (output_skeleton): Call it.
13067 * data/bison.simple (yysymprint): New. Cannot be named yyprint
13068 since there are already many grammar files with a user `yyprint'.
13069 Replace the calls to YYPRINT to calls to yysymprint.
13070 * tests/calc.at: Adjust.
13071 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
13072 taking advantage of parser very internal details (stack size!).
13074 2002-06-20 Akim Demaille <akim@epita.fr>
13076 * src/scan-gram.l: Complete the scanner with the missing patterns
13078 Use `quote' and `symbol_tag_get' where appropriate.
13080 2002-06-19 Akim Demaille <akim@epita.fr>
13082 * tests/actions.at (Destructors): Augment to test locations.
13083 * data/bison.simple (yydestructor): Pass it the current location
13084 if locations are enabled.
13085 Prototype only when __STDC__ or C++.
13086 Change the argument names to move into the yy name space: there is
13089 2002-06-19 Akim Demaille <akim@epita.fr>
13091 * data/bison.simple (b4_pure_if): New.
13092 Use it instead of #ifdef YYPURE.
13094 2002-06-19 Akim Demaille <akim@epita.fr>
13096 * data/bison.simple (b4_location_if): New.
13097 Use it instead of #ifdef YYLSP_NEEDED.
13099 2002-06-19 Akim Demaille <akim@epita.fr>
13101 Prepare @$ in %destructor, but currently don't bind it in the
13102 skeleton, as %location use is not cleaned up yet.
13104 * src/scan-gram.l (handle_dollar, handle_destructor_at)
13105 (handle_action_at): New.
13106 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
13107 a braced_code_t and a location as additional arguments.
13108 (handle_destructor_dollar): Instead of requiring `b4_eval', just
13109 unquote one when outputting `b4_dollar_dollar'.
13111 * data/bison.simple (b4_eval): Remove.
13112 (b4_symbol_destructor): Adjust.
13113 * tests/input.at (Invalid @n): Adjust.
13115 2002-06-19 Zack Weinberg <zack@codesourcery.com>
13117 * doc/bison.texinfo: Document ability to have multiple
13120 2002-06-18 Akim Demaille <akim@epita.fr>
13122 * src/files.c (compute_base_names): When computing the output file
13123 names from the input file name, strip the directory part.
13125 2002-06-18 Akim Demaille <akim@epita.fr>
13127 * data/bison.simple.new: Comment changes.
13128 Reported by Andreas Schwab.
13130 2002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
13132 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
13133 there are no `label `yyoverflowlab' defined but not used' warnings
13134 when yyoverflow is defined.
13136 2002-06-18 Akim Demaille <akim@epita.fr>
13138 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
13140 (symbol_destructor_set): Adjust.
13141 * src/output.c (symbol_destructors_output): Output the destructor
13143 Output the symbol name.
13144 * data/bison.simple (b4_symbol_destructor): Adjust.
13146 2002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
13147 and Akim Demaille <akim@epita.fr>
13149 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
13150 what's left on the stack when the error recovery hits EOF.
13151 * tests/actions.at (Destructors): Complete to exercise this case.
13153 2002-06-17 Akim Demaille <akim@epita.fr>
13155 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
13156 arguments is really empty, not only equal to `[]'.
13157 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
13159 (symbol_destructor_set): New.
13160 * src/output.c (symbol_destructors_output): New.
13161 * src/reader.h (brace_code_t, current_braced_code): New.
13162 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
13163 (handle_dollar): Rename as...
13164 (handle_action_dollar): this.
13165 (handle_destructor_dollar): New.
13166 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
13167 (grammar_declaration): Use it.
13168 * data/bison.simple (yystos): Is always defined.
13169 (yydestructor): New.
13170 * tests/actions.at (Destructors): New.
13171 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
13173 2002-06-17 Akim Demaille <akim@epita.fr>
13175 * src/symlist.h, src/symlist.c (symbol_list_length): New.
13176 * src/scan-gram.l (handle_dollar, handle_at): Compute the
13177 rule_length only when needed.
13178 * src/output.c (actions_output, token_definitions_output): Output
13180 * src/symtab.c: Don't access directly to the symbol tag, use
13182 * src/parse-gram.y: Use symbol_list_free.
13184 2002-06-17 Akim Demaille <akim@epita.fr>
13186 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
13187 (symbol_list_prepend, get_type_name): Move to...
13188 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
13189 (symbol_list_prepend, symbol_list_n_type_name_get): here.
13190 Adjust all callers.
13191 (symbol_list_free): New.
13192 * src/scan-gram.l (handle_dollar): Takes a location.
13193 * tests/input.at (Invalid $n): Adjust.
13195 2002-06-17 Akim Demaille <akim@epita.fr>
13197 * src/reader.h, src/reader.c (symbol_list_new): Export it.
13198 (symbol_list_prepend): New.
13199 * src/parse-gram.y (%union): `list' is a new member.
13200 (symbols.1): New, replaces...
13201 (terms_to_prec.1, nterms_to_type.1): these.
13202 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
13203 Take a location as additional argument.
13204 Adjust all callers.
13206 2002-06-15 Akim Demaille <akim@epita.fr>
13208 * src/parse-gram.y: Move %token in the declaration section so that
13209 we don't depend upon CVS Bison.
13211 2002-06-15 Akim Demaille <akim@epita.fr>
13213 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
13214 * src/print.c (print_core): Use it.
13216 2002-06-15 Akim Demaille <akim@epita.fr>
13218 * src/conflicts.c (log_resolution): Accept the rule involved in
13219 the sr conflicts instead of the lookahead number that points to
13221 (flush_reduce): Accept the current lookahead vector as argument,
13222 instead of the index in LA.
13223 (resolve_sr_conflict): Accept the current number of lookahead
13224 bitset to consider for the STATE, instead of the index in LA.
13225 (set_conflicts): Adjust.
13226 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
13228 2002-06-15 Akim Demaille <akim@epita.fr>
13230 * src/state.h (state_t): Replace the `lookaheadsp' member, a
13231 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
13232 Adjust all dependencies.
13233 * src/lalr.c (initialize_lookaheads): Split into...
13234 (states_lookaheads_count, states_lookaheads_initialize): these.
13237 2002-06-15 Akim Demaille <akim@epita.fr>
13239 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
13241 (grammar_rules_print): here.
13242 * src/reduce.c (reduce_output): Use it.
13243 * tests/reduce.at (Useless Rules, Reduced Automaton)
13244 (Underivable Rules): Adjust.
13246 2002-06-15 Akim Demaille <akim@epita.fr>
13248 Copy BYacc's nice way to report the grammar.
13250 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
13252 Don't print the rules' location, it is confusing and useless.
13253 (rule_print): Use grammar_rhs_print.
13254 * src/print.c (print_grammar): Use grammar_rules_print.
13256 2002-06-15 Akim Demaille <akim@epita.fr>
13258 Complete and rationalize `useless thing' warnings.
13260 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
13261 (symbol_tag_print): New.
13262 Use them everywhere in place of accessing directly the tag member.
13263 * src/gram.h, src/gram.c (rule_print): New.
13264 Use it where a rule used to be printed `by hand'.
13265 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
13266 (reduce_grammar_tables): Report the useless rules.
13267 (reduce_print): Useless things are a warning, not an error.
13269 * tests/reduce.at (Useless Nonterminals, Useless Rules):
13270 (Reduced Automaton, Underivable Rules): Adjust.
13271 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
13272 * tests/conflicts.at (Unresolved SR Conflicts)
13273 (Solved SR Conflicts): Adjust.
13275 2002-06-15 Akim Demaille <akim@epita.fr>
13277 Let symbols have a location.
13279 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
13281 Adjust all callers.
13282 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
13283 Use location_t, not int.
13284 * src/symtab.c (symbol_check_defined): Take advantage of the
13286 * tests/regression.at (Invalid inputs): Adjust.
13288 2002-06-15 Akim Demaille <akim@epita.fr>
13290 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
13291 (input): Don't try to initialize yylloc here, do it in the
13293 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
13294 * src/gram.h (rule_t): Change line and action_line into location
13295 and action_location, of location_t type.
13296 Adjust all dependencies.
13297 * src/location.h, src/location.c (empty_location): New.
13298 * src/reader.h, src/reader.c (grammar_start_symbol_set)
13299 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
13300 (grammar_current_rule_symbol_append)
13301 (grammar_current_rule_action_append): Expect a location as argument.
13302 * src/reader.c (grammar_midrule_action): Adjust to attach an
13303 action's location as dummy symbol location.
13304 * src/symtab.h, src/symtab.c (startsymbol_location): New.
13305 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
13308 2002-06-14 Akim Demaille <akim@epita.fr>
13310 Grammar declarations may be found in the grammar section.
13312 * src/parse-gram.y (rules_or_grammar_declaration): New.
13313 (declarations): Each declaration may end with a semicolon, not
13315 (grammar_declaration): `"%union"'.
13316 (grammar): Branch to rules_or_grammar_declaration.
13318 2002-06-14 Akim Demaille <akim@epita.fr>
13320 * src/main.c (main): Invoke scanner_free.
13322 2002-06-14 Akim Demaille <akim@epita.fr>
13324 * src/output.c (m4_invoke): Extracted from...
13325 (output_skeleton): here.
13328 2002-06-14 Akim Demaille <akim@epita.fr>
13330 * src/parse-gram.y (directives, directive, gram)
13331 (grammar_directives, precedence_directives, precedence_directive):
13333 (declarations, declaration, grammar, grammar_declaration)
13334 (precedence_declaration, precedence_declarator): these.
13335 (symbol_declaration): New.
13337 2002-06-14 Akim Demaille <akim@epita.fr>
13339 * src/files.c (action_obstack): Remove, unused.
13340 (output_obstack): Remove it, and all its dependencies, as it is no
13342 * src/reader.c (epilogue_set): Build the epilogue in the
13344 * src/output.h, src/output.c (muscle_obstack): Move to...
13345 * src/muscle_tab.h, src/muscle_tab.h: here.
13346 (muscle_init): Initialize muscle_obstack.
13347 (muscle_free): New.
13348 * src/main.c (main): Call it.
13350 2002-06-14 Akim Demaille <akim@epita.fr>
13352 * src/location.h: New, extracted from...
13353 * src/reader.h: here.
13354 * src/Makefile.am (noinst_HEADERS): Merge into
13355 (bison_SOURCES): this.
13357 * src/parse-gram.y: Use location_t instead of Bison's.
13358 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
13359 Use location_t instead of ints.
13361 2002-06-14 Akim Demaille <akim@epita.fr>
13363 * data/bison.simple, data/bison.c++: Be sure to restore the
13364 current #line when returning to the skeleton contents after having
13365 exposed the input file's #line.
13367 2002-06-12 Akim Demaille <akim@epita.fr>
13369 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
13371 * tests/actions.at (Exotic Dollars): New.
13373 2002-06-12 Akim Demaille <akim@epita.fr>
13375 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
13377 * tests/input.at (Torturing the Scanner): New.
13379 2002-06-11 Akim Demaille <akim@epita.fr>
13381 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
13382 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
13383 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
13384 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
13385 * src/reader.c (reader): Use it.
13387 2002-06-11 Akim Demaille <akim@epita.fr>
13389 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
13390 Adjust all callers.
13391 (scanner_last_string_free): New.
13393 2002-06-11 Akim Demaille <akim@epita.fr>
13395 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
13396 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
13397 (last_string, YY_OBS_FREE): New.
13398 Use them when returning an ID.
13400 2002-06-11 Akim Demaille <akim@epita.fr>
13402 Have Bison grammars parsed by a Bison grammar.
13404 * src/reader.c, src/reader.h (prologue_augment): New.
13405 * src/reader.c (copy_definition): Remove.
13407 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
13408 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
13409 (grammar_current_rule_prec_set, grammar_current_rule_check)
13410 (grammar_current_rule_symbol_append)
13411 (grammar_current_rule_action_append): Export.
13412 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
13413 (symbol_list_action_append): Remove.
13414 Hook the routines from reader.
13415 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
13416 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
13418 * src/reader.c (read_declarations): Remove, unused.
13420 * src/parse-gram.y: Handle the epilogue.
13421 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
13422 (grammar_start_symbol_set): this.
13423 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
13424 * src/reader.c (readgram): Remove, unused.
13425 (reader): Adjust to insert eoftoken and axiom where appropriate.
13427 * src/reader.c (copy_dollar): Replace with...
13428 * src/scan-gram.h (handle_dollar): this.
13429 * src/parse-gram.y: Remove `%thong'.
13431 * src/reader.c (copy_at): Replace with...
13432 * src/scan-gram.h (handle_at): this.
13434 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
13437 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
13440 * src/reader.h, src/reader.c (grammar_rule_end): New.
13442 * src/parse.y (current_type, current_class): New.
13443 Implement `%nterm', `%token' support.
13444 Merge `%term' into `%token'.
13445 (string_as_id): New.
13446 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
13449 * src/parse-gram.y: Be sure to handle properly the beginning of
13452 * src/parse-gram.y: Handle %type.
13453 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
13455 * src/parse-gram.y: More directives support.
13456 * src/options.c: No longer handle source directives.
13458 * src/parse-gram.y: Fix %output.
13460 * src/parse-gram.y: Handle %union.
13461 Use the prologue locations.
13462 * src/reader.c (parse_union_decl): Remove.
13464 * src/reader.h, src/reader.c (epilogue_set): New.
13465 * src/parse-gram.y: Use it.
13467 * data/bison.simple, data/bison.c++: b4_stype is now either not
13468 defined, then default to int, or to the contents of %union,
13469 without `union' itself.
13471 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
13473 * src/output.c (actions_output): Don't output braces, as they are
13474 already handled by the scanner.
13476 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
13477 characters to themselves.
13479 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
13480 that the epilogue has a proper #line.
13482 * src/parse-gram.y: Handle precedence/associativity.
13484 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
13486 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
13487 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
13488 at all to define terminals that cannot be emitted.
13490 * src/scan-gram.l: Escape M4 characters.
13492 * src/scan-gram.l: Working properly with escapes in user
13493 strings/characters.
13495 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
13496 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
13498 Use more modest sizes, as for the time being the parser does not
13499 release memory, and therefore the process swallows a huge amount
13502 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
13503 stricter %token grammar.
13505 * src/symtab.h (associativity): Add `undef_assoc'.
13506 (symbol_precedence_set): Do nothing when passed an undef_assoc.
13507 * src/symtab.c (symbol_check_alias_consistence): Adjust.
13509 * tests/regression.at (Invalid %directive): Remove, as it is now
13511 (Invalid inputs): Adjust to the new error messages.
13512 (Token definitions): The new grammar doesn't allow too many
13515 * src/lex.h, src/lex.c: Remove.
13516 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
13517 (copy_character, copy_string2, copy_string, copy_identifier)
13518 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
13519 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
13520 (parse_action): Remove.
13521 * po/POTFILES.in: Adjust.
13523 2002-06-11 Akim Demaille <akim@epita.fr>
13525 * src/reader.c (parse_action): Don't store directly into the
13526 rule's action member: return the action as a string.
13527 Don't require `rule_length' as an argument: compute it.
13528 (grammar_current_rule_symbol_append)
13529 (grammar_current_rule_action_append): New, eved out from
13531 Remove `action_flag', `rulelength', unused now.
13533 2002-06-11 Akim Demaille <akim@epita.fr>
13535 * src/reader.c (grammar_current_rule_prec_set).
13536 (grammar_current_rule_check): New, eved out from...
13538 Remove `xaction', `first_rhs': useless.
13539 * tests/input.at (Type clashes): New.
13540 * tests/existing.at (GNU Cim Grammar): Adjust.
13542 2002-06-11 Akim Demaille <akim@epita.fr>
13544 * src/reader.c (grammar_midrule_action): New, Eved out from
13547 2002-06-11 Akim Demaille <akim@epita.fr>
13549 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
13551 (readgram): Use them as replacement of inlined code, crule and
13554 2002-06-11 Akim Demaille <akim@epita.fr>
13556 * src/reader.c (grammar_end, grammar_symbol_append): New.
13557 (readgram): Use them.
13558 Make the use of `p' as local as possible.
13560 2002-06-10 Akim Demaille <akim@epita.fr>
13562 GCJ's parser requires the tokens to be defined before the prologue.
13564 * data/bison.simple: Output the token definition before the user's
13566 * tests/regression.at (Braces parsing, Duplicate string)
13567 (Mixing %token styles): Check the output from bison.
13568 (Early token definitions): New.
13570 2002-06-10 Akim Demaille <akim@epita.fr>
13572 * src/symtab.c (symbol_user_token_number_set): Don't complain when
13573 assigning twice the same user number to a token, so that we can
13575 * src/lex.c (lex): here.
13576 Also use `symbol_class_set' instead of hand written code.
13577 * src/reader.c (parse_assoc_decl): Likewise.
13579 2002-06-10 Akim Demaille <akim@epita.fr>
13581 * src/symtab.c, src/symtab.c (symbol_class_set)
13582 (symbol_user_token_number_set): New.
13583 * src/reader.c (parse_token_decl): Use them.
13584 Use a switch instead of ifs.
13585 Use a single argument.
13587 2002-06-10 Akim Demaille <akim@epita.fr>
13589 Remove `%thong' support as it is undocumented, unused, duplicates
13590 `%token's job, and creates useless e-mail traffic with people who
13591 want to know what it is, why it is undocumented, unused, and
13592 duplicates `%token's job.
13594 * src/reader.c (parse_thong_decl): Remove.
13595 * src/options.c (option_table): Remove "thong".
13596 * src/lex.h (tok_thong): Remove.
13598 2002-06-10 Akim Demaille <akim@epita.fr>
13600 * src/symtab.c, src/symtab.c (symbol_type_set)
13601 (symbol_precedence_set): New.
13602 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
13603 (value_components_used): Remove, unused.
13605 2002-06-09 Akim Demaille <akim@epita.fr>
13607 Move symbols handling code out of the reader.
13609 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
13610 (axiom): Move to...
13611 * src/symtab.h, src/symtab.c: here.
13613 * src/gram.c (start_symbol): Remove: use startsymbol->number.
13614 * src/reader.c (startval): Rename as...
13615 * src/symtab.h, src/symtab.c (startsymbol): this.
13616 * src/reader.c: Adjust.
13618 * src/reader.c (symbol_check_defined, symbol_make_alias)
13619 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
13620 (token_translations_init)
13622 * src/symtab.c: here.
13623 * src/reader.c (packsymbols): Move to...
13624 * src/symtab.h, src/symtab.c (symbols_pack): here.
13625 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
13628 2002-06-03 Akim Demaille <akim@epita.fr>
13630 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
13633 2002-06-03 Akim Demaille <akim@epita.fr>
13635 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
13636 structs with non literals.
13637 * src/scan-skel.l: never-interactive.
13638 * src/conflicts.c (enum conflict_resolution_e): No trailing
13640 * src/getargs.c (usage): Split long literal strings.
13641 Reported by Hans Aberg.
13643 2002-05-28 Akim Demaille <akim@epita.fr>
13645 * data/bison.c++: Use C++ ostreams.
13646 (cdebug_): New member.
13648 2002-05-28 Akim Demaille <akim@epita.fr>
13650 * src/output.c (output_skeleton): Be sure to allocate enough room
13651 for `/' _and_ for `\0' in full_skeleton.
13653 2002-05-28 Akim Demaille <akim@epita.fr>
13655 * data/bison.c++: Catch up with bison.simple:
13656 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13657 and Paul Eggert <eggert@twinsun.com>: `error' handing.
13658 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
13659 and popping traces.
13661 2002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13663 * src/output.c (output_skeleton): Put an explicit path in front of
13664 the skeleton file name, rather than relying on the -I directory,
13665 to partially alleviate effects of having a skeleton file lying around
13666 in the current directory.
13668 2002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13670 * src/conflicts.c (log_resolution): Correct typo:
13671 obstack_printf should be obstack_fgrow1.
13673 2002-05-26 Akim Demaille <akim@epita.fr>
13675 * src/state.h (state_t): `solved_conflicts' is a new member.
13676 * src/LR0.c (new_state): Set it to 0.
13677 * src/conflicts.h, src/conflicts.c (print_conflicts)
13678 (free_conflicts, solve_conflicts): Rename as...
13679 (conflicts_print, conflicts_free, conflicts_solve): these.
13681 * src/conflicts.c (enum conflict_resolution_e)
13682 (solved_conflicts_obstack): New, used by...
13683 (log_resolution): this.
13684 Adjust to attach the conflict resolution to each state.
13685 Complete the description with the precedence/associativity
13687 (resolve_sr_conflict): Adjust.
13688 * src/print.c (print_state): Output its solved_conflicts.
13689 * tests/conflicts.at (Unresolved SR Conflicts)
13690 (Solved SR Conflicts): Exercise --report=all.
13692 2002-05-26 Akim Demaille <akim@epita.fr>
13694 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
13695 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
13696 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
13697 (token_number_t, item_number_as_token_number)
13698 (token_number_as_item_number, muscle_insert_token_number_table):
13700 (symbol_number_t, item_number_as_symbol_number)
13701 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
13702 these, since it is more appropriate.
13704 2002-05-26 Akim Demaille <akim@epita.fr>
13706 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
13708 * data/bison.simple (yystos) [YYDEBUG]: New.
13709 (yyparse) [YYDEBUG]: Display the symbols which are popped during
13711 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
13713 2002-05-25 Akim Demaille <akim@epita.fr>
13715 * doc/bison.texinfo (Debugging): Split into...
13716 (Tracing): this new section, its former contents, and...
13717 (Understanding): this new section.
13718 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
13720 (report_flag): this.
13721 Adjust all dependencies.
13722 (report_args, report_types, report_argmatch): New.
13723 (usage, getargs): Report/support -r, --report.
13725 (struct option_table_struct): Rename as..,
13726 (struct option_table_s): this.
13727 Rename the `set_flag' member to `flag' to match with getopt_long's
13729 * src/options.c (option_table): Split verbose into an entry for
13730 %verbose, and another for --verbose.
13731 Support --report/-r, so remove -r from the obsolete --raw.
13732 * src/print.c: Attach full item sets and lookaheads reports to
13733 report_flag instead of trace_flag.
13734 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
13736 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13737 and Paul Eggert <eggert@twinsun.com>
13739 * data/bison.simple (yyparse): Correct error handling to conform to
13740 POSIX and yacc. Specifically, after syntax error is discovered,
13741 do not reduce further before shifting the error token.
13742 Clean up the code a bit by removing the labels yyerrdefault,
13743 yyerrhandle, yyerrpop.
13744 * NEWS: Document the above.
13746 2002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13748 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
13749 type; it isn't always big enough, since it doesn't necessarily
13750 include non-terminals.
13751 (yytranslate): Expand definition of yy_token_number_type, so that
13752 the latter can be removed.
13753 (yy_token_number_type): Remove, only one use.
13754 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
13755 don't use TokenNumberType as element type.
13757 * tests/regression.at: Modify expected output to agree with change
13758 to yyr1 and yytranslate.
13760 2002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
13762 * src/reader.c (parse_action): Use copy_character instead of
13765 2002-05-13 Akim Demaille <akim@epita.fr>
13767 * tests/regression.at (Token definitions): Prototype yylex and
13770 2002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13772 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
13773 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
13775 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
13777 2002-05-07 Akim Demaille <akim@epita.fr>
13779 * tests/synclines.at: Be sure to prototype yylex and yyerror to
13780 avoid GCC warnings.
13782 2002-05-07 Akim Demaille <akim@epita.fr>
13786 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
13787 over the RHS of each rule.
13788 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
13789 * src/state.h (state_t): Member `nitems' is unsigned short.
13790 * src/LR0.c (get_state): Adjust.
13791 * src/reader.c (packgram): Likewise.
13792 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
13794 (muscle_insert_int_table): Remove, unused.
13795 (prepare_rules): Remove `max'.
13797 2002-05-06 Akim Demaille <akim@epita.fr>
13799 * src/closure.c (print_firsts): Display of the symbol tags.
13800 (bitmatrix_print): Move to...
13801 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
13803 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
13805 2002-05-06 Akim Demaille <akim@epita.fr>
13807 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
13810 2002-05-06 Akim Demaille <akim@epita.fr>
13812 * src/LR0.c (new_state, get_state): Instead of using the global
13813 `kernel_size' and `kernel_base', have two new arguments:
13814 `core_size' and `core'.
13817 2002-05-06 Akim Demaille <akim@epita.fr>
13819 * src/reader.c (packgram): No longer end `ritem' with a 0
13820 sentinel: it is not used.
13822 2002-05-05 Akim Demaille <akim@epita.fr>
13824 New experimental feature: display the lookaheads in the report and
13827 * src/print (print_core): When --trace-flag, display the rules
13829 * src/print_graph.c (print_core): Likewise.
13830 Swap the arguments.
13833 2002-05-05 Akim Demaille <akim@epita.fr>
13835 * tests/torture.at (Many lookaheads): New test.
13837 2002-05-05 Akim Demaille <akim@epita.fr>
13839 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
13840 (GENERATE_MUSCLE_INSERT_TABLE): this.
13841 (output_int_table, output_unsigned_int_table, output_short_table)
13842 (output_token_number_table, output_item_number_table): Replace with...
13843 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
13844 (muscle_insert_short_table, muscle_insert_token_number_table)
13845 (muscle_insert_item_number_table): these.
13846 Adjust all callers.
13847 (prepare_tokens): Don't free `translations', since...
13848 * src/reader.h, src/reader.c (grammar_free): do it.
13850 * src/gram.h, src/gram.c (grammar_free): here.
13851 * data/bison.simple, data/bison.c++: b4_token_number_max is now
13854 2002-05-05 Akim Demaille <akim@epita.fr>
13856 * src/output.c (output_unsigned_int_table): New.
13857 (prepare_rules): `i' is unsigned.
13858 `prhs', `rline', `r2' are unsigned int.
13859 Rename muscle `rhs_number_max' as `rhs_max'.
13860 Output muscles `prhs_max', `rline_max', and `r2_max'.
13862 * data/bison.simple, data/bison.c++: Adjust to use these muscles
13863 to compute types instead of constant types.
13864 * tests/regression.at (Web2c Actions): Adjust.
13866 2002-05-04 Akim Demaille <akim@epita.fr>
13868 * src/symtab.h (SALIAS, SUNDEF): Rename as...
13869 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
13870 Adjust dependencies.
13871 * src/output.c (token_definitions_output): Be sure not to output a
13872 `#define 'a'' when fed with `%token 'a' "a"'.
13873 * tests/regression.at (Token definitions): New.
13875 2002-05-03 Paul Eggert <eggert@twinsun.com>
13877 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
13880 2002-05-03 gettextize <bug-gnu-gettext@gnu.org>
13882 * Makefile.am (SUBDIRS): Remove intl.
13883 (EXTRA_DIST): Add config/config.rpath.
13885 2002-05-03 Akim Demaille <akim@epita.fr>
13887 * data/bison.simple (m4_if): Don't output empty enums.
13888 And actually, output valid enum definitions :(.
13890 2002-05-03 Akim Demaille <akim@epita.fr>
13892 * configure.bat: Remove, completely obsolete.
13893 * Makefile.am (EXTRA_DIST): Adjust.
13894 Don't distribute config.rpath...
13895 * config/Makefile.am (EXTRA_DIST): Do it.
13897 2002-05-03 Akim Demaille <akim@epita.fr>
13899 * configure.in (GETTEXT_VERSION): New.
13900 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
13902 2002-05-03 Akim Demaille <akim@epita.fr>
13904 * data/bison.simple (b4_token_enum): New.
13905 (b4_token_defines): Use it to output tokens both as #define and
13907 Suggested by Paul Eggert.
13908 * src/output.c (token_definitions_output): Don't output spurious
13911 2002-05-03 Akim Demaille <akim@epita.fr>
13913 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
13915 2002-05-02 Robert Anisko <robert@lrde.epita.fr>
13917 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
13918 Update the stack class, give a try to deque as the default container.
13920 2002-05-02 Akim Demaille <akim@epita.fr>
13922 * data/bison.simple (yyparse): Do not implement @$ = @1.
13923 (YYLLOC_DEFAULT): Adjust to do it.
13924 * doc/bison.texinfo (Location Default Action): Fix.
13926 2002-05-02 Akim Demaille <akim@epita.fr>
13928 * src/reader.c (parse_braces): Merge into...
13929 (parse_action): this.
13931 2002-05-02 Akim Demaille <akim@epita.fr>
13933 * configure.in (ALL_LINGUAS): Remove.
13934 * po/LINGUAS, hr.po: New.
13936 2002-05-02 Akim Demaille <akim@epita.fr>
13938 Remove the so called hairy (semantic) parsers.
13940 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
13941 * src/gram.h, src/gram.c (semantic_parser): Remove.
13942 (rule_t): Remove the guard and guard_line members.
13943 * src/lex.h (token_t): remove tok_guard.
13944 * src/options.c (option_table): Remove %guard and %semantic_parser
13946 * src/output.c, src/output.h (guards_output): Remove.
13948 (token_definitions_output): Don't output the `T'
13950 (output_skeleton): Don't output the guards.
13951 * src/files.c, src/files.c (attrsfile): Remove.
13952 * src/reader.c (symbol_list): Remove the guard and guard_line
13954 Adjust dependencies.
13955 (parse_guard): Remove.
13956 * data/bison.hairy: Remove.
13957 * doc/bison.texinfo (Environment Variables): Remove occurrences of
13960 2002-05-02 Akim Demaille <akim@epita.fr>
13962 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
13963 (parse_guard): Rename the formal argument `stack_offset' as
13964 `rule_length', which is more readable.
13966 (copy_at, copy_dollar): Instead of outputting the hard coded
13967 values of $$, $n and so forth, output invocation to b4_lhs_value,
13968 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
13969 Note: this patch partially drops `semantic-parser' support: it
13970 always does `rule_length - n', where semantic parsers ought to
13972 * data/bison.simple, data/bison.c++ (b4_lhs_value)
13973 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
13975 2002-05-02 Akim Demaille <akim@epita.fr>
13977 * configure.in (AC_INIT): Bump to 1.49b.
13978 (AM_INIT_AUTOMAKE): Short invocation.
13980 2002-05-02 Akim Demaille <akim@epita.fr>
13984 2002-05-01 Akim Demaille <akim@epita.fr>
13986 * src/skeleton.h: Remove.
13988 2002-05-01 Akim Demaille <akim@epita.fr>
13990 * src/skeleton.h: Fix the #endif.
13991 Reported by Magnus Fromreide.
13993 2002-04-26 Paul Eggert <eggert@twinsun.com>
13995 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
13996 Define if we define YYSTYPE and YYLTYPE, respectively.
13997 (YYCOPY): Fix [] quoting problem in the non-GCC case.
13999 2002-04-25 Robert Anisko <robert@lrde.epita.fr>
14001 * src/scan-skel.l: Postprocess quadrigraphs.
14003 * src/reader.c (copy_character): New function, used to output
14004 single characters while replacing `[' and `]' with quadrigraphs, to
14005 avoid troubles with M4 quotes.
14006 (copy_comment): Output characters with copy_character.
14007 (read_additionnal_code): Likewise.
14008 (copy_string2): Likewise.
14009 (copy_definition): Likewise.
14011 * tests/calc.at: Exercise M4 quoting.
14013 2002-04-25 Akim Demaille <akim@epita.fr>
14015 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
14016 between `!' and the command.
14017 Reported by Paul Eggert.
14019 2002-04-24 Robert Anisko <robert@lrde.epita.fr>
14021 * tests/calc.at: Exercise prologue splitting.
14023 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
14024 `b4_post_prologue' instead of `b4_prologue'.
14026 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
14028 (output): Free pre_prologue_obstack and post_prologue_obstack.
14029 * src/files.h, src/files.c (attrs_obstack): Remove.
14030 (pre_prologue_obstack, post_prologue_obstack): New.
14031 * src/reader.c (copy_definition): Add a parameter to specify the
14032 obstack to fill, instead of using attrs_obstack unconditionally.
14033 (read_declarations): Pass pre_prologue_obstack to copy_definition if
14034 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
14036 2002-04-23 Paul Eggert <eggert@twinsun.com>
14038 * data/bison.simple: Remove unnecessary commentary and white
14039 space differences from 1_29-branch.
14040 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
14042 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
14043 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
14044 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
14045 constructors or destructors.
14047 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
14049 2002-04-23 Akim Demaille <akim@epita.fr>
14051 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
14052 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
14053 location with columns.
14054 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
14055 All reported by Paul Eggert.
14057 2002-04-22 Akim Demaille <akim@epita.fr>
14059 * src/reduce.c (dump_grammar): Move to...
14060 * src/gram.h, src/gram.c (grammar_dump): here.
14061 Be sure to separate long item numbers.
14062 Don't read the members of a rule's prec if its nil.
14064 2002-04-22 Akim Demaille <akim@epita.fr>
14066 * src/output.c (table_size, table_grow): New.
14067 (MAXTABLE): Remove, replace uses with table_size.
14068 (pack_vector): Instead of dying when the table is too big, grow it.
14070 2002-04-22 Akim Demaille <akim@epita.fr>
14072 * data/bison.simple (yyr1): Its type is that of a token number.
14073 * data/bison.c++ (r1_): Likewise.
14074 * tests/regression.at (Web2c Actions): Adjust.
14076 2002-04-22 Akim Demaille <akim@epita.fr>
14078 * src/reader.c (token_translations_init): 256 is now the default
14079 value for the error token, i.e., it will be assigned another
14080 number if the user assigned 256 to one of her tokens.
14081 (reader): Don't force 256 to error.
14082 * doc/bison.texinfo (Symbols): Adjust.
14083 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
14084 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
14085 etc. instead of 10, 20, 30 (which was used to `jump' over error
14086 (256) and undefined (2)).
14088 2002-04-22 Akim Demaille <akim@epita.fr>
14090 Propagate more token_number_t.
14092 * src/gram.h (token_number_as_item_number)
14093 (item_number_as_token_number): New.
14094 * src/output.c (GENERATE_OUTPUT_TABLE): New.
14095 Use it to create output_item_number_table and
14096 output_token_number_table.
14097 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
14098 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
14099 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
14100 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
14102 2002-04-22 Akim Demaille <akim@epita.fr>
14104 * src/output.h, src/output.c (get_lines_number): Remove.
14106 2002-04-19 Akim Demaille <akim@epita.fr>
14108 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
14110 (Debugging): More details about enabling the debugging features.
14111 (Table of Symbols): Describe $$, $n, @$, and @n.
14112 Suggested by Tim Josling.
14114 2002-04-19 Akim Demaille <akim@epita.fr>
14116 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
14118 2002-04-10 Akim Demaille <akim@epita.fr>
14120 * src/system.h: Rely on HAVE_LIMITS_H.
14121 Suggested by Paul Eggert.
14123 2002-04-09 Akim Demaille <akim@epita.fr>
14125 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
14126 full stderr, and strip it according to the bison options, instead
14127 of composing the error message from different bits.
14128 This makes it easier to check for several error messages.
14129 Adjust all the invocations.
14130 Add an invocation exercising the error token.
14131 Add an invocation demonstrating a stupid error message.
14132 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
14134 Error message are for stderr, not stdout.
14136 2002-04-09 Akim Demaille <akim@epita.fr>
14138 * src/gram.h, src/gram.c (error_token_number): Remove, use
14140 * src/reader.c (reader): Don't specify the user token number (2)
14141 for $undefined, as it uselessly prevents using it.
14142 * src/gram.h (token_number_t): Move to...
14143 * src/symtab.h: here.
14144 (state_t.number): Is a token_number_t.
14145 * src/print.c, src/reader.c: Use undeftoken->number instead of
14147 (Even though this 2 is not the same as above: the number of the
14148 undeftoken remains being 2, it is its user token number which
14150 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
14151 `user_token_number_max'.
14152 Output `undef_token_number'.
14153 * data/bison.simple, data/bison.c++: Use them.
14154 Be sure to map invalid yylex return values to
14155 `undef_token_number'. This saves us from gratuitous SEGV.
14157 * tests/conflicts.at (Solved SR Conflicts)
14158 (Unresolved SR Conflicts): Adjust.
14159 * tests/regression.at (Web2c Actions): Adjust.
14161 2002-04-08 Akim Demaille <akim@epita.fr>
14163 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
14165 Remove the duplicate `typedefs'.
14166 (RhsNumberType): Fix the declaration and various other typos.
14168 * data/bison.simple: Use __ofile__.
14169 * src/scan-skel.l: Handle __ofile__.
14171 2002-04-08 Akim Demaille <akim@epita.fr>
14173 * src/gram.h (item_number_t): New, the type of item numbers in
14174 RITEM. Note that it must be able to code symbol numbers as
14175 positive number, and the negation of rule numbers as negative
14177 Adjust all dependencies (pretty many).
14178 * src/reduce.c (rule): Remove this `short *' pointer: use
14180 * src/system.h (MINSHORT, MAXSHORT): Remove.
14181 Include `limits.h'.
14182 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
14183 (shortcpy): Remove.
14184 (MAXTABLE): Move to...
14185 * src/output.c (MAXTABLE): here.
14186 (prepare_rules): Use output_int_table to output rhs.
14187 * data/bison.simple, data/bison.c++: Adjust.
14188 * tests/torture.at (Big triangle): Move the limit from 254 to
14190 * tests/regression.at (Web2c Actions): Ajust.
14192 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
14193 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
14194 passes, but produces negative #line number, once fixed, GCC is
14195 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
14197 * src/state.h (state_h): Code input lines on ints, not shorts.
14199 2002-04-08 Akim Demaille <akim@epita.fr>
14201 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
14202 and then the grammar.
14204 2002-04-08 Akim Demaille <akim@epita.fr>
14206 * src/system.h: No longer using strndup.
14208 2002-04-07 Akim Demaille <akim@epita.fr>
14210 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
14211 * src/output.c (output_table_data): Return the longest number.
14212 (prepare_tokens): Output `token_number_max').
14213 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
14215 Use them to define yy_token_number_type/TokenNumberType.
14216 Use this type for yytranslate.
14217 * tests/torture.at (Big triangle): Push the limit from 124 to
14219 * tests/regression.at (Web2c Actions): Adjust.
14221 2002-04-07 Akim Demaille <akim@epita.fr>
14223 * tests/torture.at (Big triangle): New.
14224 (GNU AWK Grammar, GNU Cim Grammar): Move to...
14225 * tests/existing.at: here.
14227 2002-04-07 Akim Demaille <akim@epita.fr>
14229 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
14231 Adjust dependencies.
14233 2002-04-07 Akim Demaille <akim@epita.fr>
14235 * src/reader.c: Normalize increments to prefix form.
14237 2002-04-07 Akim Demaille <akim@epita.fr>
14239 * src/reader.c, symtab.c: Remove debugging code.
14241 2002-04-07 Akim Demaille <akim@epita.fr>
14243 Rename all the `bucket's as `symbol_t'.
14245 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
14246 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
14247 * src/symtab.c, src/symtab.h (bucket): Rename as...
14249 (symbol_list_new, bucket_check_defined, bucket_make_alias)
14250 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
14251 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
14252 (buckets_new, buckets_free, buckets_do): Rename as...
14253 (symbol_list_new, symbol_check_defined, symbol_make_alias)
14254 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
14255 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
14256 (symbols_new, symbols_free, symbols_do): these.
14258 2002-04-07 Akim Demaille <akim@epita.fr>
14260 Use lib/hash for the symbol table.
14262 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
14264 * src/lex.c (lex): Set the `number' member of new terminals.
14265 * src/reader.c (bucket_check_defined, bucket_make_alias)
14266 (bucket_check_alias_consistence, bucket_translation): New.
14267 (reader, grammar_free, readgram, token_translations_init)
14268 (packsymbols): Adjust.
14269 (reader): Number the predefined tokens.
14270 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
14271 for predefined tokens.
14272 * src/symtab.h (bucket): Remove all the hash table related
14274 * src/symtab.c (symtab): Replace by...
14275 (bucket_table): this.
14276 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
14277 (buckets_new, buckets_do): New.
14279 2002-04-07 Akim Demaille <akim@epita.fr>
14281 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
14282 (start_symbol, max_user_token_number, semantic_parser)
14283 (error_token_number): Initialize.
14284 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
14287 (errtoken, eoftoken, undeftoken, axiom): Extern.
14289 2002-04-07 Akim Demaille <akim@epita.fr>
14291 * src/gram.h (rule_s): prec and precsym are now pointers
14292 to the bucket giving the priority/associativity.
14293 Member `associativity' removed: useless.
14294 * src/reduce.c, src/conflicts.c: Adjust.
14296 2002-04-07 Akim Demaille <akim@epita.fr>
14298 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
14299 Properly escape the symbols' TAG when outputting them.
14301 2002-04-07 Akim Demaille <akim@epita.fr>
14303 * src/lalr.h (LA): Is a bitsetv, not bitset*.
14305 2002-04-07 Akim Demaille <akim@epita.fr>
14307 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
14308 (LArule): this, which is an array to rule_t*.
14309 * src/print.c, src/conflicts.c: Adjust.
14311 2002-04-07 Akim Demaille <akim@epita.fr>
14313 * src/gram.h (rule_t): Rename `number' as `user_number'.
14314 `number' is a new member.
14315 Adjust dependencies.
14316 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
14318 2002-04-07 Akim Demaille <akim@epita.fr>
14320 As a result of the previous patch, it is no longer needed
14321 to reorder ritem itself.
14323 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
14325 2002-04-07 Akim Demaille <akim@epita.fr>
14327 Be sure never to walk through RITEMS, but use only data related to
14328 the rules themselves. RITEMS should be banished.
14330 * src/output.c (output_token_translations): Rename as...
14331 (prepare_tokens): this.
14332 In addition to `translate', prepare the muscles `tname' and
14333 `toknum', which were handled by...
14334 (output_rule_data): this.
14335 Remove, and move the remainder of its outputs into...
14336 (prepare_rules): this new routines, which also merges content from
14337 (output_gram): this.
14338 (prepare_rules): Be sure never to walk through RITEMS.
14339 (output_stos): Rename as...
14340 (prepare_stos): this.
14341 (output): Always invoke prepare_states, after all, just don't use it
14342 in the output if you don't need it.
14344 2002-04-07 Akim Demaille <akim@epita.fr>
14346 * src/LR0.c (new_state): Display `nstates' as the name of the
14347 newly created state.
14348 Adjust to initialize first_state and last_state if needed.
14349 Be sure to distinguish the initial from the final state.
14350 (new_states): Create the itemset of the initial state, and use
14352 * src/closure.c (closure): Now that the initial state has its
14353 items properly set, there is no need for a special case when
14354 creating `ruleset'.
14356 As a result, now the rule 0, reducing to $axiom, is visible in the
14357 outputs. Adjust the test suite.
14359 * tests/conflicts.at (Solved SR Conflicts)
14360 (Unresolved SR Conflicts): Adjust.
14361 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
14362 * tests/conflicts.at (S/R in initial): New.
14364 2002-04-07 Akim Demaille <akim@epita.fr>
14366 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
14367 the RHS of the rules.
14368 * src/output.c (output_gram): Likewise.
14370 2002-04-07 Akim Demaille <akim@epita.fr>
14372 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
14374 Adjust all dependencies.
14375 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
14376 `number' of the buckets too.
14377 * src/gram.h: Include `symtab.h'.
14378 (associativity): Move to...
14379 * src/symtab.h: here.
14380 No longer include `gram.h'.
14382 2002-04-07 Akim Demaille <akim@epita.fr>
14384 * src/gram.h, src/gram.c (rules_rhs_length): New.
14385 (ritem_longest_rhs): Use it.
14386 * src/gram.h (rule_t): `number' is a new member.
14387 * src/reader.c (packgram): Set it.
14388 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
14389 the end of `rules', and count them out of `nrules'.
14390 (reduce_output, dump_grammar): Adjust.
14391 * src/print.c (print_grammar): It is no longer needed to check for
14392 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
14393 * tests/reduce.at (Reduced Automaton): New test.
14395 2002-04-07 Akim Demaille <akim@epita.fr>
14397 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
14398 lacking `+ 1' to nrules, Bison reported as useless a token if it
14399 was used solely to set the precedence of the last rule...
14401 2002-04-07 Akim Demaille <akim@epita.fr>
14403 * data/bison.c++, data/bison.simple: Don't output the current file
14404 name in #line, to avoid useless diffs between two identical
14405 outputs under different names.
14407 2002-04-07 Akim Demaille <akim@epita.fr>
14409 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
14410 Normalize loops to using `< nrules + 1', not `<= nrules'.
14412 2002-04-07 Akim Demaille <akim@epita.fr>
14416 2002-04-07 Akim Demaille <akim@epita.fr>
14418 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
14419 bucket.value as bucket.number.
14421 2002-04-07 Akim Demaille <akim@epita.fr>
14423 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
14424 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
14425 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
14426 RHS, instead of being an index in RITEMS.
14428 2002-04-04 Paul Eggert <eggert@twinsun.com>
14430 * doc/bison.texinfo: Update copyright date.
14431 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
14432 (Symbols): Warn about running Bison in one character set,
14433 but compiling and/or running in an incompatible one.
14434 Warn about character code 256, too.
14436 2002-04-03 Paul Eggert <eggert@twinsun.com>
14438 * src/bison.data (YYSTACK_ALLOC): Depend on whether
14439 YYERROR_VERBOSE is nonzero, not whether it is defined.
14441 Merge changes from bison-1_29-branch.
14443 2002-03-20 Paul Eggert <eggert@twinsun.com>
14445 Merge fixes from Debian bison_1.34-1.diff.
14447 * configure.in (AC_PREREQ): 2.53.
14449 2002-03-20 Akim Demaille <akim@epita.fr>
14451 * src/conflicts.c (log_resolution): Argument `resolution' is const.
14453 2002-03-19 Paul Eggert <eggert@twinsun.com>
14455 * src/bison.simple (YYCOPY): New macro.
14456 (YYSTACK_RELOCATE): Use it.
14457 Remove Type arg; no longer needed. All callers changed.
14458 (yymemcpy): Remove; no longer needed.
14460 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
14461 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
14463 2002-03-19 Akim Demaille <akim@epita.fr>
14465 Test and fix the #line outputs.
14467 * tests/atlocal.at (GCC): New.
14468 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
14469 (Prologue synch line, %union synch line, Postprologue synch line)
14470 (Action synch line, Epilogue synch line): New tests.
14471 * src/reader.c (parse_union_decl): Define the muscle stype_line.
14472 * data/bison.simple, data/bison.c++: Use it.
14474 2002-03-19 Akim Demaille <akim@epita.fr>
14476 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
14477 (Solved SR Conflicts, %expect not enough, %expect right)
14478 (%expect too much): Move to...
14479 * tests/conflicts.at: this new file.
14481 2002-03-19 Akim Demaille <akim@epita.fr>
14483 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
14484 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
14485 that we can move to enums for instance.
14486 * src/output.c (token_definitions_output): Output a list of
14487 `token-name, token-number' instead of the #define.
14488 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
14490 2002-03-14 Akim Demaille <akim@epita.fr>
14492 Use Gettext 0.11.1.
14494 2002-03-09 Robert Anisko <robert@lrde.epita.fr>
14496 * data/bison.c++: Make the user able to add members to the generated
14497 parser by subclassing.
14499 2002-03-05 Robert Anisko <robert@lrde.epita.fr>
14501 * src/reader.c (read_additionnal_code): `c' should be an integer, not
14503 Reported by Nicolas Tisserand and Nicolas Burrus.
14505 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
14507 * src/reader.c: Warn about lacking semi-colons, do not complain.
14509 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
14511 * data/bison.c++: Remove a debug line.
14513 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
14515 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
14516 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
14517 provide a default implementation.
14519 2002-03-04 Akim Demaille <akim@epita.fr>
14521 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
14522 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
14523 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
14524 * tests/semantic.at (Parsing Guards): Similarly.
14525 * src/reader.at (readgram): Complain if the last rule is not ended
14528 2002-03-04 Akim Demaille <akim@epita.fr>
14530 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
14531 * src/closure.c: here.
14532 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
14534 * src/warshall.h, src/warshall.c: Remove.
14535 * tests/sets.at (Broken Closure): Adjust.
14537 2002-03-04 Akim Demaille <akim@epita.fr>
14539 * src/output.c (output_skeleton): tempdir is const.
14540 bytes_read is unused.
14542 2002-03-04 Akim Demaille <akim@epita.fr>
14544 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
14545 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
14547 From Michael Hayes.
14549 2002-03-04 Akim Demaille <akim@epita.fr>
14551 * src/closure.c (closure): `r' is unused.
14553 2002-03-04 Akim Demaille <akim@epita.fr>
14555 * tests/sets.at (Broken Closure): Add the ending `;'.
14556 * src/reader.at (readgram): Complain if a rule is not ended with a
14559 2002-03-04 Akim Demaille <akim@epita.fr>
14561 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
14562 (count_sr_conflicts): Use bitset_count.
14563 * src/reduce.c (inaccessable_symbols): Ditto.
14564 (bits_size): Remove.
14565 * src/warshall.h, src/warshall.c: Convert to bitsetv.
14567 2002-03-04 Akim Demaille <akim@epita.fr>
14569 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
14570 * src/reduce.c: Remove the `bitset_zero's following the
14571 `bitset_create's, as now it is performed by the latter.
14573 2002-03-04 Akim Demaille <akim@epita.fr>
14575 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
14576 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
14577 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
14578 latest sources from Michael.
14580 2002-03-04 Akim Demaille <akim@epita.fr>
14582 * src/output.c (output): Don't free the grammar.
14583 * src/reader.c (grammar_free): New.
14584 * src/main.c (main): Call it and don't free symtab here.
14586 2002-03-04 Akim Demaille <akim@epita.fr>
14588 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
14590 Reported by Benoit Perrot.
14592 2002-03-04 Akim Demaille <akim@epita.fr>
14594 Use bitset operations when possible, not loops over bits.
14596 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
14598 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
14599 * src/reduce.c (useless_nonterminals): Formatting changes.
14600 * src/warshall.c (TC): Use bitset_or.
14602 2002-03-04 Akim Demaille <akim@epita.fr>
14604 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
14605 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
14608 2002-03-04 Akim Demaille <akim@epita.fr>
14610 * src/lalr.c (F): Now a bitset*.
14611 Adjust all dependencies.
14613 2002-03-04 Akim Demaille <akim@epita.fr>
14615 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
14616 Adjust all dependencies.
14618 2002-03-04 Akim Demaille <akim@epita.fr>
14620 * src/L0.c, src/LR0.h (nstates): Be size_t.
14621 Adjust comparisons (signed vs unsigned).
14622 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
14624 Adjust all dependencies.
14626 2002-03-04 Akim Demaille <akim@epita.fr>
14628 * src/closure.c (firsts): Now, also a bitset.
14629 Adjust all dependencies.
14630 (varsetsize): Remove, now unused.
14631 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
14633 2002-03-04 Akim Demaille <akim@epita.fr>
14635 * src/print.c: Convert to use bitset.h, not hand coded iterations
14638 2002-03-04 Akim Demaille <akim@epita.fr>
14640 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
14642 2002-03-04 Akim Demaille <akim@epita.fr>
14644 * src/closure.c (ruleset): Be a bitset.
14645 (rulesetsize): Remove.
14647 2002-03-04 Akim Demaille <akim@epita.fr>
14649 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
14650 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
14651 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
14652 * src/closure.c (fderives): Be an array of bitsets.
14654 2002-02-28 Robert Anisko <robert@lrde.epita.fr>
14656 * data/bison.c++: Merge the two generated headers. Insert a copyright
14657 notice in each output file.
14659 2002-02-28 Akim Demaille <akim@epita.fr>
14661 * data/bison.c++: Copy the prologue of bison.simple to fetch
14662 useful M4 definitions, such as b4_header_guard.
14664 2002-02-25 Akim Demaille <akim@epita.fr>
14666 * src/getargs.c (version): Give the name of the authors, and use a
14667 translator friendly scheme for the bgr
14670 2002-02-25 Akim Demaille <akim@epita.fr>
14672 * src/output.c (header_output): Remove, now handled completely via
14675 2002-02-25 Akim Demaille <akim@epita.fr>
14677 * m4/m4.m4: New, from CVS Autoconf.
14678 * configure.in: Invoke it.
14679 * src/output.c (output_skeleton): Use its result instead of the
14682 2002-02-25 Akim Demaille <akim@epita.fr>
14684 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
14686 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
14687 * src/output.c (output_skeleton): Use mkstemp to create a real
14689 Move the filling of `skeleton' and its muscle to...
14691 (output): Move the definition of the prologue muscle to...
14693 * src/system.h (DEFAULT_TMPDIR): New.
14695 2002-02-14 Paul Eggert <eggert@twinsun.com>
14697 Remove the support for C++ namespace cleanliness; it was
14698 causing more problems than it was curing, since it didn't work
14699 properly on some nonstandard C++ compilers. This can wait
14700 for a proper C++ parser.
14702 * NEWS: Document this.
14703 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
14704 of C++, as it's treated like C now.
14705 * src/bison.simple (YYSTD): Remove.
14706 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
14707 Treat C++ just like Standard C instead of trying to support
14708 namespace cleanliness.
14710 2002-02-14 Akim Demaille <akim@epita.fr>
14712 * tests/regression.at (else): Adjust to Andreas' change.
14714 2002-02-14 Akim Demaille <akim@epita.fr>
14716 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
14718 2002-02-13 Andreas Schwab <schwab@suse.de>
14720 * src/output.c (output_rule_data): Don't output NULL, it might
14721 not be defined yet.
14723 2002-02-11 Robert Anisko <robert@lrde.epita.fr>
14725 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
14726 (Copyright notice): Update.
14728 2002-02-11 Akim Demaille <akim@epita.fr>
14730 * tests/regression.at (%nonassoc and eof): Don't include
14731 nonportable headers.
14733 2002-02-08 Robert Anisko <robert@lrde.epita.fr>
14735 * data/bison.c++: Correct error recovery. Make the user able to
14736 initialize the starting location.
14738 2002-02-07 Akim Demaille <akim@epita.fr>
14740 * tests/input.at: New.
14742 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
14744 * data/bison.c++: Replace some direct m4 expansions by constants. Be
14745 more consistent when naming methods and variables. Put preprocessor
14746 directives around tables only needed for debugging.
14748 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
14750 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
14752 (yy::b4_name::parse): Use print_.
14754 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
14756 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
14758 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
14760 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
14762 (yy::b4_name::parse): Build verbose error messages, and use error_.
14764 2002-02-06 Robert Anisko <robert@lrde.epita.fr>
14766 * data/bison.c++: Fix m4 quoting in comments.
14768 2002-02-06 Robert Anisko <robert@lrde.epita.fr>
14770 * data/bison.c++: Adjust the parser code. Fix some muscles that were
14771 not expanded by m4.
14773 2002-02-05 Akim Demaille <akim@epita.fr>
14775 * data/bison.c++: Adjust to the M4 back end.
14776 More is certainly needed.
14778 2002-02-05 Akim Demaille <akim@epita.fr>
14780 Give a try to M4 as a back end.
14782 * lib/readpipe.c: New, from wdiff.
14783 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
14785 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
14786 specific values. Now it is m4 that performs the lookup.
14787 * src/parse-skel.y: Remove.
14788 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
14789 * src/output.c (actions_output, guards_output)
14790 (token_definitions_output): No longer keeps track of the output
14791 line number, hence remove the second argument.
14792 (guards_output): Check against the guard member of a rule, not the
14795 (output_skeleton): Don't look for the skeleton location, let m4 do
14797 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
14799 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
14800 (prepare): Given that for the time being changesyntax is not
14801 usable in M4, rename the muscles using `-' to `_'.
14802 Define `defines_flag', `output_parser_name' and `output_header_name'.
14803 * src/output.h (actions_output, guards_output)
14804 (token_definitions_output): Adjust prototypes.
14805 * src/scan-skel.l: Instead of scanning the skeletons, it now
14806 processes the output of m4: `__oline__' and `#output'.
14807 * data/bison.simple: Adjust to be used by M4(sugar).
14808 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
14810 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
14811 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
14812 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
14813 shamelessly stolen from CVS Autoconf.
14815 2002-02-05 Akim Demaille <akim@epita.fr>
14817 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
14818 * configure.in: Check for the declarations of free and malloc.
14819 * src/muscle_tab.c: Adjust.
14821 2002-02-05 Akim Demaille <akim@epita.fr>
14823 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
14824 which have no values.
14826 2002-02-05 Akim Demaille <akim@epita.fr>
14828 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
14831 2002-01-29 Paul Eggert <eggert@twinsun.com>
14833 * src/bison.simple (YYSIZE_T): Do not define merely because
14834 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
14835 On some platforms, <alloca.h> does not declare YYSTD (size_t).
14837 2002-01-27 Akim Demaille <akim@epita.fr>
14839 Fix `%nonassoc and eof'.
14841 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
14842 which were not properly copied! Replace
14843 memcpy (res->errs, src->errs, src->nerrs);
14845 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
14847 * tests/regression.at (%nonassoc and eof): Adjust to newest
14848 Autotest: `.' is not in the PATH.
14850 2002-01-27 Akim Demaille <akim@epita.fr>
14852 * tests/sets.at (AT_EXTRACT_SETS): New.
14853 (Nullable): Use it.
14856 2002-01-26 Akim Demaille <akim@epita.fr>
14858 * tests/actions.at, tests/calc.at, tests/headers.at,
14859 * tests/torture.at: Adjust to the newest Autotest which no longer
14860 forces `.' in the PATH.
14862 2002-01-25 Akim Demaille <akim@epita.fr>
14864 * tests/regression.at (%nonassoc and eof): New.
14865 Suggested by Robert Anisko.
14867 2002-01-24 Akim Demaille <akim@epita.fr>
14869 Bison dumps core when trying to complain about broken input files.
14870 Reported by Cris van Pelt.
14872 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
14873 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
14875 (Invalid inputs): Strengthen: exercise parse_percent_token.
14877 2002-01-24 Robert Anisko <robert.anisko@epita.fr>
14879 * src/Makefile.am: Add bison.c++.
14880 * src/bison.c++: New skeleton.
14882 2002-01-21 Paolo Bonzini <bonzini@gnu.org>
14886 2002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
14888 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
14890 2002-01-20 Marc Autret <marc@gnu.org>
14892 * src/files.c (compute_output_file_names): Fix
14894 2002-01-20 Marc Autret <marc@gnu.org>
14896 * tests/output.at: New test.
14897 * src/files.c (compute_base_names): Don't map extensions when
14898 the YACC flag is set, use defaults.
14899 Reported by Evgeny Stambulchik.
14901 2002-01-20 Marc Autret <marc@gnu.org>
14903 * src/system.h: Need to define __attribute__ away for non-GCC
14904 compilers as well (i.e., the vendor C compiler).
14905 Suggested by Albert Chin-A-Young.
14907 2002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
14909 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
14910 canonical definition.
14911 * src/system.h: Use the canonical definition for PARAMS (avoids
14912 a conflict with the macro from lib/hash.h).
14914 2002-01-11 Akim Demaille <akim@epita.fr>
14916 * configure.in: Use AC_FUNC_STRNLEN.
14917 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
14919 2002-01-09 Akim Demaille <akim@epita.fr>
14921 * src/files.c, src/files.h (output_infix): New.
14922 (tab_extension): Remove.
14923 (compute_base_names): Compute the former, drop the latter.
14924 * src/output.c (prepare): Insert the muscles `output-infix', and
14926 * src/parse-skel.y (string, string.1): New.
14927 (section.header): Use it.
14928 (section.yacc): Remove.
14929 (prefix): Remove too.
14930 * src/scan-skel.l: Adjust.
14931 * src/bison.simple, src/bison.hairy: Adjust.
14933 2002-01-09 Akim Demaille <akim@epita.fr>
14935 * configure.in (WERROR_CFLAGS): Compute it.
14936 * src/Makefile.am (CFLAGS): Pass it.
14937 * tests/atlocal.in (CFLAGS): Idem.
14938 * src/files.c: Fix a few warnings.
14939 (get_extension_index): Remove, unused.
14941 2002-01-08 Akim Demaille <akim@epita.fr>
14943 * src/getargs.c (AS_FILE_NAME): New.
14944 (getargs): Use it to convert DOSish file names.
14945 * src/files.c (base_name): Rename as full_base_name to avoid
14946 clashes with `base_name ()'.
14947 (filename_split): New.
14948 (compute_base_names): N-th rewrite, using filename_split.
14950 2002-01-08 Akim Demaille <akim@epita.fr>
14952 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
14953 New, stolen from the Fileutils 4.1.
14954 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
14955 * configure.in: Check for the presence of memrchr, and of its
14958 2002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
14960 * lib/hash.h (__P): Added definition for this macro.
14961 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
14962 BUILT_SOURCES, to ensure they are generated first.
14963 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
14964 %error-verbose to allow bootstrapping with bison 1.30x.
14966 2002-01-06 Akim Demaille <akim@epita.fr>
14968 * src/reader.c (parse_braces): Don't fetch the next char, the
14969 convention is to fetch on entry.
14970 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
14971 'switch' without a following semicolon.
14972 * tests/regression.at (braces parsing): New.
14974 2002-01-06 Akim Demaille <akim@epita.fr>
14976 Bison is dead wrong in its RR conflict reports.
14978 * tests/torture.at (GNU Cim Grammar): New.
14979 * src/conflicts.c (count_rr_conflicts): Fix.
14981 2002-01-06 Akim Demaille <akim@epita.fr>
14983 Creating package.m4 from configure.ac causes too many problems.
14985 * tests/Makefile.am (package.m4): Create it by hand,
14986 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
14988 2002-01-06 Akim Demaille <akim@epita.fr>
14990 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
14993 2002-01-04 Paul Eggert <eggert@twinsun.com>
14995 * doc/bison.texinfo (Debugging):
14996 Remove YYSTDERR; it's no longer defined or used.
14997 Also, s/cstdio.h/cstdio/.
14999 2002-01-03 Akim Demaille <akim@epita.fr>
15001 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
15003 2002-01-03 Akim Demaille <akim@epita.fr>
15005 * src/parse-skel.y (process_skeleton): Don't bind the parser's
15006 tracing code to --trace, wait for a better --trace option, with
15009 2002-01-03 Akim Demaille <akim@epita.fr>
15011 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
15012 The ISO C++ standard is extremely clear about it: stderr is
15013 considered a macro, not a regular symbol (see table 94 `Header
15014 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
15015 Therefore std:: does not apply to it. It still does with fprintf.
15016 Also, s/cstdio.h/cstdio/.
15018 2002-01-03 Akim Demaille <akim@epita.fr>
15020 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
15021 for non system headers.
15023 2002-01-02 Akim Demaille <akim@epita.fr>
15025 Equip the skeleton chain with location tracking, runtime trace,
15026 pure parser and scanner.
15028 * src/parse-skel.y: Request a pure parser, locations, and prefix
15030 (%union): Having several members with the same type does not help
15031 type mismatches, simplify.
15032 (YYPRINT, yyprint): New.
15033 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
15034 (skel_error): this.
15036 * src/scan-skel.l: Adjust to these changes.
15037 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
15038 (LOCATION_PRINT, skel_control_t): New.
15040 2001-12-30 Akim Demaille <akim@epita.fr>
15042 * src/parse-skel.y: Get rid of the shift/reduce conflict:
15043 replace `gb' with BLANKS.
15044 * src/scan-skel.l: Adjust.
15046 2001-12-30 Akim Demaille <akim@epita.fr>
15048 * src/system.h: We don't need nor want bcopy.
15049 Throw away MS-DOS crap: we don't need getpid.
15050 * configure.in: We don't need strndup. It was even causing
15051 problems: because Flex includes the headers *before* us,
15052 _GNU_SOURCE is not defined by config.h, and therefore strndup was
15054 * lib/xstrndup.c: New.
15055 * src/scan-skel.l: Use it.
15056 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
15057 * src/parse-skel.y: Use %directives instead of #defines.
15059 2001-12-30 Akim Demaille <akim@epita.fr>
15061 * src/skeleton.h: New.
15062 * src/output.c (output_parser, output_master_parser): Remove, dead
15064 * src/output.h (get_lines_number, actions_output, guards_output)
15065 (token_definitions_output): Prototype them.
15066 * src/parse-skel.y: Add the license notice.
15067 Include output.h and skeleton.h.
15068 (process_skeleton): Returns void, and takes a single parameter.
15069 * src/scan-skel.l: Add the license notice.
15070 Include skeleton.h.
15071 Don't use %option yylineno: it seems that then Flex imagines
15072 REJECT has been used, and therefore it won't reallocate its
15073 buffers (which makes no other sense to me than a bug). It results
15074 in warnings for `unused: yy_flex_realloc'.
15076 2001-12-30 Robert Anisko <robert.anisko@epita.fr>
15078 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
15079 (MUSCLE_INSERT_PREFIX): ...to there.
15080 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
15081 (MUSCLE_INSERT_PREFIX): Move from here...
15083 * src/bison.hairy: Add a section directive. Put braces around muscle
15084 names. This parser skeleton is still broken, but Bison should not
15085 choke on a bad muscle 'syntax'.
15086 * src/bison.simple: Add a section directive. Put braces around muscle
15089 * src/files.h (strsuffix, stringappend): Add declarations.
15090 (tab_extension): Add declaration.
15091 (short_base_name): Add declaration.
15093 * src/files.c (strsuffix, stringappend): No longer static. These
15094 functions are used in the skeleton parser.
15095 (tab_extension): New.
15096 (compute_base_names): Use the computations done in this function
15097 to guess if the generated parsers should have '.tab' in their
15099 (short_base_name): No longer static.
15101 * src/output.c (output_skeleton): New.
15102 (output): Disable call to output_master_parser, and give a try to
15103 a new skeleton handling system.
15104 (guards_output, actions_output): No longer static.
15105 (token_definitions_output, get_lines_number): No longer static.
15107 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
15109 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
15112 * src/parse-skel.y: New file.
15113 * src/scan-skel.l: New file.
15115 2001-12-29 Akim Demaille <akim@epita.fr>
15117 %name-prefix is broken.
15119 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
15120 Adjust all dependencies.
15121 * tests/headers.at (export YYLTYPE): Strengthen this test: use
15124 Renaming yylval but not yylloc is not consistent. Now we do.
15126 * src/bison.simple: Prefix yylloc if used.
15127 * doc/bison.texinfo (Decl Summary): Document that.
15129 2001-12-29 Akim Demaille <akim@epita.fr>
15131 * doc/bison.texinfo: Promote `%long-directive' over
15133 Remove all references to fixed-output-files, yacc is enough.
15135 2001-12-29 Akim Demaille <akim@epita.fr>
15137 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
15138 user prologue. These are defaults.
15139 * tests/actions.at (Mid-rule actions): Make sure the user can
15140 define YYDEBUG and YYERROR_VERBOSE.
15142 2001-12-29 Akim Demaille <akim@epita.fr>
15144 * src/output.c (header_output): Don't forget to export YYLTYPE and
15146 * tests/headers.at (export YYLTYPE): New, make sure it does.
15147 * tests/regression.at (%union and --defines, Invalid CPP headers):
15149 * tests/headers.at: here.
15151 2001-12-29 Akim Demaille <akim@epita.fr>
15153 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
15155 2001-12-29 Akim Demaille <akim@epita.fr>
15157 * tests/actions.at (Mid-rule actions): Output on a single line
15158 instead of several.
15160 2001-12-29 Akim Demaille <akim@epita.fr>
15162 * doc/bison.texinfo: Formatting changes.
15164 2001-12-29 Akim Demaille <akim@epita.fr>
15166 Don't store the token defs in a muscle, just be ready to output it
15167 on command. Now possible via `symbols'. Fixes a memory leak.
15169 * src/output.c (token_definitions_output): New.
15170 (output_parser, header_output): Use it.
15171 * src/reader.c (symbols_save): Remove.
15173 2001-12-29 Akim Demaille <akim@epita.fr>
15175 * src/bison.simple: Do not provide a default for YYSTYPE and
15176 YYLTYPE before the user's prologue. Otherwise it's hardly... a
15179 2001-12-29 Akim Demaille <akim@epita.fr>
15181 Mid-rule actions are simply... ignored!
15183 * src/reader.c (readgram): Be sure to attach mid-rule actions to
15184 the empty-rule associated to the dummy symbol, not to the host
15186 * tests/actions.at (Mid-rule actions): New.
15188 2001-12-29 Akim Demaille <akim@epita.fr>
15192 * src/reader.c (reader): Free grammar.
15194 2001-12-29 Akim Demaille <akim@epita.fr>
15198 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
15199 since it allocates it for each state, although only one is needed.
15200 (allocate_storage): Do it here.
15202 2001-12-29 Akim Demaille <akim@epita.fr>
15204 * src/options.h, src/options.c (create_long_option_table): Rename
15206 (long_option_table_new): this, with a clearer prototype.
15207 (percent_table): Remove, unused,
15208 * src/getargs.c (getargs): Adjust.
15210 2001-12-29 Akim Demaille <akim@epita.fr>
15212 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
15213 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
15216 2001-12-29 Akim Demaille <akim@epita.fr>
15218 * src/lalr.c (build_relations): Rename `states' as `states1'.
15219 Sorry, I don't understand exactly what it is, no better name...
15221 2001-12-29 Akim Demaille <akim@epita.fr>
15223 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
15224 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
15225 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
15228 2001-12-29 Akim Demaille <akim@epita.fr>
15230 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
15233 2001-12-29 Akim Demaille <akim@epita.fr>
15235 * src/reader.c, src/reader.h (user_toknums): Remove.
15236 Adjust all users to use symbols[i]->user_token_number.
15238 2001-12-29 Akim Demaille <akim@epita.fr>
15240 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
15241 Adjust all users to use symbols[i]->prec or ->assoc.
15243 2001-12-29 Akim Demaille <akim@epita.fr>
15245 * src/reader.c, src/reader.h (tags): Remove.
15246 Adjust all users to use symbols[i]->tag.
15248 2001-12-29 Akim Demaille <akim@epita.fr>
15250 * src/gram.h, src/gram.c (symbols): New, similar to state_table
15252 * src/reader.c (packsymbols): Fill this table.
15254 * src/conflicts.c (resolve_sr_conflict): Adjust.
15255 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
15257 Use symbols[i]->tag instead of tags[i].
15259 2001-12-29 Akim Demaille <akim@epita.fr>
15261 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
15262 In addition, put a comment in there, to replace...
15263 * tests/regression.at (%union and C comments): Remove.
15265 2001-12-29 Akim Demaille <akim@epita.fr>
15267 * tests/regression.at (Web2c Actions): Blindly move the actual
15268 output as expected output. The contents *seem* right to me, but I
15269 can't pretend reading perfectly parser tables... Nonetheless, all
15270 the other tests pass correctly, the table look OK, even though the
15271 presence of `$axiom' is to be noted: AFAICS it is useless (but
15274 2001-12-29 Akim Demaille <akim@epita.fr>
15276 * src/reader.c (readgram): Don't add the rule 0 if there were no
15277 rules read. In other words, add it _after_ having performed
15278 grammar sanity checks.
15279 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
15281 2001-12-29 Akim Demaille <akim@epita.fr>
15283 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
15284 visible, and some states have now a different number.
15286 2001-12-29 Akim Demaille <akim@epita.fr>
15288 * src/reader.c (readgram): Bind the initial rule's lineno to that
15290 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
15291 (Solved SR Conflicts): Adjust rule 0's line number.
15293 2001-12-29 Akim Demaille <akim@epita.fr>
15295 Fix the `GAWK Grammar' failure.
15297 * src/LR0.c (final_state): Initialize to -1 so that we do compute
15298 the reductions of the first state which was mistakenly confused
15299 with the final state because precisely final_state was initialized
15301 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
15302 now noticed by Bison.
15303 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
15304 have a reduction on $default.
15306 2001-12-29 Akim Demaille <akim@epita.fr>
15308 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
15310 * src/closure.c (print_closure): Likewise.
15311 * src/derives.c (print_derives): Likewise.
15312 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
15315 2001-12-29 Akim Demaille <akim@epita.fr>
15317 * src/lalr.c (lookaheads_print): New.
15318 (lalr): Call it when --trace-flag.
15319 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
15322 2001-12-29 Akim Demaille <akim@epita.fr>
15324 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
15325 when walking through ritem, even via rule->rhs.
15326 * src/reduce.c (dump_grammar, useful_production, reduce_output)
15327 (useful_production, useless_nonterminals): Likewise.
15328 (reduce_grammar_tables): Likewise, plus update nritems.
15329 * src/nullable.c (set_nullable): Likewise.
15330 * src/lalr.c (build_relations): Likewise.
15331 * tests/sets.at (Nullable): Adjust.
15332 Fortunately, now, the $axiom is no longer nullable.
15334 2001-12-29 Akim Demaille <akim@epita.fr>
15336 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
15338 * src/gram.c (ritem_longest_rhs): Likewise.
15339 * src/reduce.c (nonterminals_reduce): Likewise.
15340 * src/print_graph.c (print_graph): Likewise.
15341 * src/output.c (output_rule_data): Likewise.
15342 * src/nullable.c (set_nullable): Likewise.
15344 2001-12-29 Akim Demaille <akim@epita.fr>
15346 * src/output.c: Comment changes.
15348 2001-12-27 Paul Eggert <eggert@twinsun.com>
15350 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
15351 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
15352 Sparc, as they were causing more porting problems than the
15353 (minor) performance improvement was worth.
15355 Also, catch up with 1.31's YYSTD.
15357 2001-12-27 Akim Demaille <akim@epita.fr>
15359 * src/output.c (output_gram): Rely on nritems, not the
15360 0-sentinel. See below.
15361 Use -1 as separator, not 0.
15362 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
15363 Rely on -1 as separator in yyrhs, instead of 0.
15364 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
15365 twice `Now at end of input', therefore there are two lines less to
15368 2001-12-27 Akim Demaille <akim@epita.fr>
15370 * tests/regression.at (Unresolved SR Conflicts):
15371 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
15374 2001-12-27 Akim Demaille <akim@epita.fr>
15376 * src/LR0.c (new_state): Recognize the final state by the fact it
15377 is reached by eoftoken.
15378 (insert_start_shifting_state, insert_eof_shifting_state)
15379 (insert_accepting_state, augment_automaton): Remove, since now
15380 these states are automatically computed from the initial state.
15381 (generate_states): Adjust.
15382 * src/print.c: When reporting a rule number to the user, substract
15383 1, so that the axiom rule is rule 0, and the first user rule is 1.
15384 * src/reduce.c: Likewise.
15385 * src/print_graph.c (print_core): For the time being, just as for
15386 the report, depend upon --trace-flags to dump the full set of
15388 * src/reader.c (readgram): Once the grammar read, insert the rule
15389 0: `$axiom: START-SYMBOL $'.
15390 * tests/set.at: Adjust: rule 0 is now displayed, and since the
15391 number of the states has changed (the final state is no longer
15392 necessarily the last), catch up.
15394 2001-12-27 Akim Demaille <akim@epita.fr>
15396 Try to make the use of the eoftoken valid. Given that its value
15397 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
15398 is used instead of > 0 where appropriate, (ii), depend upon nritems
15399 instead of the 0-sentinel.
15401 * src/gram.h, src/gram.c (nritems): New.
15402 Expected to be duplication of nitems, but for the time being...
15403 * src/reader.c (packgram): Assert nritems and nitems are equal.
15404 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
15405 * src/closure.c (print_closure, print_fderives): Likewise.
15406 * src/gram.c (ritem_print): Likewise.
15407 * src/print.c (print_core, print_grammar): Likewise.
15408 * src/print_graph.c: Likewise.
15410 2001-12-27 Akim Demaille <akim@epita.fr>
15412 * src/main.c (main): If there are complains after grammar
15413 reductions, then output the report anyway if requested, then die.
15414 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
15415 * src/reader.c (eoftoken): New.
15416 (parse_token_decl): If the token being defined has value `0', it
15418 (packsymbols): No longer hack `tags' to insert `$' by hand.
15419 Be sure to preserve the value of the eoftoken.
15420 (reader): Make sure eoftoken is defined.
15421 Initialize nsyms to 0: now eoftoken is created just like the others.
15422 * src/print.c (print_grammar): Don't special case the eof token.
15423 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
15424 lie anyway, albeit pleasant.
15425 * tests/calc.at: Exercise error messages with eoftoken.
15426 Change the grammar so that empty input is invalid.
15427 Adjust expectations.
15428 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
15430 2001-12-27 Akim Demaille <akim@epita.fr>
15432 * configure.in: Check the protos of strchr ans strspn.
15433 Replace strchr if needed.
15434 * src/system.h: Provide the protos of strchr, strspn and memchr if
15436 * lib/strchr.c: New.
15437 * src/reader.c (symbols_save): Use strchr.
15439 2001-12-27 Akim Demaille <akim@epita.fr>
15441 * src/print.c, src/print_graph.c (escape): New.
15442 Use it to quote the TAGS outputs.
15443 * src/print_graph.c (print_state): Now errors are in red, and
15444 reductions in green.
15445 Prefer high to wide: output the state number on a line of its own.
15447 2001-12-27 Akim Demaille <akim@epita.fr>
15449 * src/state.h, src/state.c (reductions_new): New.
15450 * src/LR0.c (set_state_table): Let all the states have a
15451 `reductions', even if reduced to 0.
15452 (save_reductions): Adjust.
15453 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
15454 * src/print.c (print_reductions, print_actions): Adjust.
15455 * src/output.c (action_row): Adjust.
15457 2001-12-27 Akim Demaille <akim@epita.fr>
15459 * src/state.h, src/state.c (errs_new, errs_dup): New.
15460 * src/LR0.c (set_state_table): Let all the states have an errs,
15461 even if reduced to 0.
15462 * src/print.c (print_errs, print_reductions): Adjust.
15463 * src/output.c (output_actions, action_row): Adjust.
15464 * src/conflicts.c (resolve_sr_conflict): Adjust.
15466 2001-12-27 Akim Demaille <akim@epita.fr>
15468 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
15470 2001-12-27 Akim Demaille <akim@epita.fr>
15472 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
15473 * src/print.c: here.
15474 (lookaheadset, shiftset): New, used as additional storage by
15476 (print_results): Adjust.
15477 (print_shifts, print_gotos, print_errs): New, extracted from...
15478 (print_actions): here.
15479 * src/print_graph.c (print_actions): Remove dead code.
15481 2001-12-27 Akim Demaille <akim@epita.fr>
15483 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
15486 2001-12-27 Akim Demaille <akim@epita.fr>
15488 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
15489 (build_relations): Adjust.
15491 2001-12-27 Akim Demaille <akim@epita.fr>
15493 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
15496 2001-12-27 Akim Demaille <akim@epita.fr>
15498 * src/reader.c (packgram): Catch nitems overflows.
15500 2001-12-27 Akim Demaille <akim@epita.fr>
15502 * src/files.c, src/files.h (guard_obstack): Remove.
15503 * src/output.c (output): Adjust.
15504 * src/reader.c (parse_braces): New, factoring...
15505 (copy_action, copy_guard): these two which are renamed as...
15506 (parse_action, parse_guard): these.
15507 As a voluntary consequence, using braces around guards is now
15510 2001-12-27 Akim Demaille <akim@epita.fr>
15512 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
15513 * src/reader.c (symbol_list): `guard' and `guard_line' are new
15515 (symbol_list_new): Adjust.
15516 (copy_action): action_line is the first line, not the last.
15517 (copy_guard): Just as for actions, store the `action' only, not
15518 the switch/case/break flesh.
15519 Don't parse the user action that might follow the guard, let...
15520 (readgram): do it, i.e., now, there can be an action after a
15522 In other words the guard is just explicitly optional.
15523 (packgram): Adjust.
15524 * src/output.c (guards_output): New.
15525 (output_parser): Call it when needed.
15526 (output): Also free the guard and attrs obstacks.
15527 * src/files.c, src/files.h (obstack_save): Remove.
15528 (output_files): Remove.
15529 As a result, if one needs the former `.act' file, using an
15530 appropriate skeleton which requires actions and guards is now
15532 * src/main.c (main): Adjust.
15533 * tests/semantic.at: New.
15534 * tests/regression.at: Use `input.y' as input file name.
15535 Avoid 8+3 problems by requiring input.c when the test needs the
15538 2001-12-27 Akim Demaille <akim@epita.fr>
15540 * src/reader.c (symbol_list_new): Be sure to initialize all the
15543 2001-12-27 Akim Demaille <akim@epita.fr>
15545 All the hacks using a final pseudo state are now useless.
15547 * src/LR0.c (set_state_table): state_table holds exactly nstates.
15548 * src/lalr.c (nLA): New.
15549 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
15550 instead of lookaheadsp from the pseudo state (nstate + 1).
15552 2001-12-27 Akim Demaille <akim@epita.fr>
15554 * src/output.c (action_row, token_actions): Use a state_t instead
15555 of a integer, and nlookaheads instead of the following state's
15558 2001-12-27 Akim Demaille <akim@epita.fr>
15560 * src/conflicts.c (log_resolution, flush_shift)
15561 (resolve_sr_conflict, set_conflicts, solve_conflicts)
15562 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
15563 (conflicts_print, print_reductions): Use a state_t instead of an
15564 integer when referring to a state.
15565 As much as possible, depend upon nlookaheads, instead of the
15566 `lookaheadsp' member of the following state (since lookaheads of
15567 successive states are successive, the difference between state n + 1
15568 and n served as the number of lookaheads for state n).
15569 * src/lalr.c (add_lookback_edge): Likewise.
15570 * src/print.c (print_core, print_actions, print_state)
15571 (print_results): Likewise.
15572 * src/print_graph.c (print_core, print_actions, print_state)
15573 (print_graph): Likewise.
15574 * src/conflicts.h: Adjust.
15576 2001-12-27 Akim Demaille <akim@epita.fr>
15578 * src/bison.hairy: Formatting/comment changes.
15580 Remove `register' indications.
15581 Add plenty of `static'.
15583 2001-12-27 Akim Demaille <akim@epita.fr>
15585 * src/output.c (prepare): Drop the muscle `ntbase' which
15586 duplicates ntokens.
15587 * src/bison.simple: Formatting/comment changes.
15588 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
15589 is an undocumented synonym.
15591 2001-12-22 Akim Demaille <akim@epita.fr>
15593 * src/output.c (output_table_data): Change the prototype to use
15594 `int' for array ranges: some invocations do pass an int, not a
15596 Reported by Wayne Green.
15598 2001-12-22 Akim Demaille <akim@epita.fr>
15600 Some actions of web2c.y are improperly triggered.
15601 Reported by Mike Castle.
15603 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
15604 * tests/regression.at (Web2c): Rename as...
15605 (Web2c Report): this.
15606 (Web2c Actions): New.
15608 2001-12-22 Akim Demaille <akim@epita.fr>
15610 Reductions in web2c.y are improperly reported.
15611 Reported by Mike Castle.
15613 * src/conflicts.c (print_reductions): Fix.
15614 * tests/regression.at (Web2c): New.
15616 2001-12-18 Akim Demaille <akim@epita.fr>
15618 Some host fail on `assert (!"foo")', which expands to
15619 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
15620 Reported by Nelson Beebee.
15622 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
15623 `#define it_succeeded 0' and `assert (it_succeeded)'.
15625 2001-12-17 Marc Autret <autret_m@epita.fr>
15627 * src/bison.simple: Don't hard code the skeleton line and filename.
15628 * src/output.c (output_parser): Rename 'line' as 'output_line'.
15629 New line counter 'skeleton_line' (skeleton-line muscle).
15631 2001-12-17 Paul Eggert <eggert@twinsun.com>
15633 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
15634 YYDEBUG must be defined to a nonzero value.
15636 * src/bison.simple (yytname): Do not assume that the user defines
15637 YYDEBUG to a properly parenthesized expression.
15639 2001-12-17 Akim Demaille <akim@epita.fr>
15641 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
15642 nlookaheads is a new member.
15644 * src/lalr.h (nlookaheads): Remove this orphan declaration.
15645 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
15648 2001-12-17 Akim Demaille <akim@epita.fr>
15650 * src/files.h, src/files.c (open_files, close_files): Remove.
15651 * src/main.c (main): Don't open/close files, nor invoke lex_free,
15653 * src/reader.c (reader): Do it.
15655 2001-12-17 Akim Demaille <akim@epita.fr>
15657 * src/conflicts.c (print_reductions): Formatting changes.
15659 2001-12-17 Akim Demaille <akim@epita.fr>
15661 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
15662 (flush_reduce): New.
15663 (resolve_sr_conflict): Adjust.
15665 2001-12-17 Akim Demaille <akim@epita.fr>
15667 * src/output.c (output_obstack): Be static and rename as...
15668 (format_obstack): this, to avoid any confusion with files.c's
15670 * src/reader.h (muscle_obstack): Move to...
15671 * src/output.h: here, since it's defined in output.c.
15673 2001-12-17 Akim Demaille <akim@epita.fr>
15675 * src/output.c (action_row, save_column, default_goto)
15676 (sort_actions, matching_state, pack_vector): Better variable
15679 2001-12-17 Akim Demaille <akim@epita.fr>
15681 * src/output.c: Various formatting changes.
15683 2001-12-17 Akim Demaille <akim@epita.fr>
15685 * src/files.c (output_files): Free the output_obstack.
15686 * src/main.c (main): Call print and print_graph conditionally.
15687 * src/print.c (print): Work unconditionally.
15688 * src/print_graph.c (print_graph): Work unconditionally.
15689 * src/conflicts.c (log_resolution): Output only if verbose_flag.
15691 2001-12-16 Marc Autret <autret_m@epita.fr>
15693 * src/output.c (actions_output): Fix. When we use %no-lines,
15694 there is one less line per action.
15696 2001-12-16 Marc Autret <autret_m@epita.fr>
15698 * src/bison.simple: Remove a useless #line directive.
15699 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
15700 * src/output.c (get_lines_number): New.
15701 (output_parser): Adjust, now takes care about the lines of a
15703 Fix line numbering.
15704 (actions_output): Computes the number of lines taken by actions.
15705 (output_master_parser): Insert new skeleton which is the name of
15706 the output parser file name.
15708 2001-12-15 Marc Autret <autret_m@epita.fr>
15710 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
15712 2001-12-15 Marc Autret <autret_m@epita.fr>
15714 * src/output.c (output_gram): Keep track of the hairy one.
15716 2001-12-15 Akim Demaille <akim@epita.fr>
15718 Make `make distcheck' work.
15720 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
15721 system.h which uses libgettext.h.
15723 2001-12-15 Akim Demaille <akim@epita.fr>
15725 * src/nullable.c (set_nullable): Useless rules must be skipped,
15726 otherwise, since we range over their symbols, we might look at a
15727 nonterminal which no longer ``exists'', i.e., it is not counted in
15728 `nvars', hence we overflow our arrays.
15730 2001-12-15 Akim Demaille <akim@epita.fr>
15732 The header can also be produced directly, without any obstack!
15735 * src/files.c, src/files.h (defines_obstack): Remove.
15736 (compute_header_macro): Global.
15737 (defines_obstack_save): Remove.
15738 * src/reader.c (parse_union_decl): No longer output to
15739 defines_obstack: its content can be found in the `stype' muscle
15741 (output_token_translations): Merge into...
15742 (symbols_output): this.
15744 (symbols_save): this.
15746 * src/output.c (header_output): New.
15749 2001-12-15 Akim Demaille <akim@epita.fr>
15751 * src/reader.c (parse_union_decl): Instead of handling two obstack
15752 simultaneously, use one to define the `stype' muscle, and use the
15753 value of the latter to fill defines_obstack.
15754 (copy_comment): Remove.
15755 (copy_comment2): Work for a single obstack.
15757 (copy_comment): this.
15759 2001-12-15 Akim Demaille <akim@epita.fr>
15761 * src/lex.c, src/lex.h (xgetc): No longer static.
15762 * src/reader.c (parse_union_decl): Revamp.
15764 2001-12-15 Akim Demaille <akim@epita.fr>
15766 Still making progress in separating Bison into (i) input, (ii)
15767 process, (iii) output: now we can directly output the parser file
15768 without using table_obstack at all.
15770 * src/files.c, src/files.h (table_obstack): Bye bye.
15771 (parser_file_name): New.
15772 * src/files.c (compute_output_file_names): Compute it.
15773 * src/output.c (actions_output, output_parser)
15774 (output_master_parser): To a file instead of an obstack.
15776 2001-12-15 Akim Demaille <akim@epita.fr>
15778 Attach actions to rules, instead of pre-outputting them to
15781 * src/gram.h (rule_t): action and action_line are new members.
15782 * src/reader.c (symbol_list): Likewise.
15783 (copy_action): Save the actions within the rule.
15784 (packgram): Save them in rule_table.
15785 * src/output.c (actions_output): New.
15786 (output_parser): Use it on `%%actions'.
15787 (output_rule_data): Don't free rule_table.
15789 (prepare): Don't save the `action' muscle.
15790 * src/bison.simple: s/%%action/%%actions/.
15792 2001-12-15 Akim Demaille <akim@epita.fr>
15794 * src/reader.c (copy_action): When --yacc, don't append a `;'
15795 to the user action: let it fail if lacking.
15796 Suggested by Arnold Robbins and Tom Tromey.
15798 2001-12-14 Akim Demaille <akim@epita.fr>
15800 * src/lex.c (literalchar): Simply return the char you decoded, non
15801 longer mess around with obstacks and int pointers.
15802 Adjust all callers.
15804 2001-12-14 Akim Demaille <akim@epita.fr>
15806 * src/lex.c (literalchar): Don't escape the special characters,
15807 just decode them, and keep them as char (before, eol was output as
15808 the 2 char string `\n' etc.).
15809 * src/output.c (output_rule_data): Use quotearg to output the
15812 2001-12-13 Paul Eggert <eggert@twinsun.com>
15814 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
15815 Do not infringe on the global user namespace when using C++.
15816 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
15817 All uses of `fprintf' and `stderr' changed.
15819 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
15821 2001-12-13 Akim Demaille <akim@epita.fr>
15823 The computation of nullable is broken: it doesn't handle empty
15826 * tests/torture.at (GNU AWK Grammar): New.
15827 * tests/sets.at (Nullable): New.
15828 * src/nullable.c (set_nullable): Instead of blindly looping over
15829 `ritems', loop over the rules, and then over their rhs's.
15831 Work around Autotest bugs.
15833 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
15834 frame, because Autotest understand lines starting with a `+' as
15835 traces from the shell. Then, they are not processed properly.
15836 Admittedly an Autotest bug, but we don't have time to wait for
15837 Autotest to catch up.
15838 * tests/regression.at (Broken Closure): Adjust to the new table
15841 * tests/sets.at: here.
15843 2001-12-13 Akim Demaille <akim@epita.fr>
15845 * src/closure.c (closure): Use nrules instead of playing tricks
15846 with BITS_PER_WORD.
15848 2001-12-13 Akim Demaille <akim@epita.fr>
15850 * src/print.c (print_actions): Output the handling of `$' as the
15851 traces do: shifting the token EOF. Before EOF was treated as a
15853 * tests/regression.at: Adjust some tests.
15854 * src/print_graph.c (print_core): Complete the set of items via
15855 closure. The next-to-final and final states are still unsatisfying,
15856 but that's to be addressed elsewhere.
15857 No longer output the rule numbers, but do output the state number.
15858 A single loop for the shifts + gotos is enough, but picked a
15859 distinct color for each.
15860 (print_graph): Initialize and finalize closure.
15862 2001-12-13 Akim Demaille <akim@epita.fr>
15864 * src/reader.c (readgram): Remove dead code, an strip useless
15866 (get_type): Remove, unused.
15868 2001-12-12 Akim Demaille <akim@epita.fr>
15870 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
15871 on that of lib/error.c.
15873 2001-12-12 Akim Demaille <akim@epita.fr>
15875 Some hosts don't like `/' in includes.
15877 * src/system.h: Include libgettext.h without qualifying the path.
15878 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
15881 2001-12-11 Marc Autret <autret_m@epita.fr>
15883 * src/output.c (output_parser): Remove useless muscle.
15885 2001-12-11 Marc Autret <autret_m@epita.fr>
15887 * src/bison.simple: Remove #line just before %%epilogue. It
15888 is now handled in ...
15889 * src/reader.c (read_additionnal_code): Add the output of a
15890 #line for the epilogue.
15892 2001-12-10 Marc Autret <autret_m@epita.fr>
15894 * src/reader.c (copy_definition): Re-use CPP-outed code which
15895 replace precedent remove.
15896 * src/bison.simple: Remove #line before %%prologue because
15897 %%input-line is wrong at this time.
15899 2001-12-10 Marc Autret <autret_m@epita.fr>
15901 * src/reader.c (symbols_output): Clean up.
15902 * src/output.c (output_gram, output): Clean up.
15904 2001-12-10 Akim Demaille <akim@epita.fr>
15906 * src/lalr.c (initialize_lookaheads): New. Extracted from...
15907 * src/LR0.c (set_state_table): here.
15908 * src/lalr.c (lalr): Call it.
15910 2001-12-10 Akim Demaille <akim@epita.fr>
15912 * src/state.h (shifts): Remove the `number' member: shifts are
15913 attached to state, hence no longer need to be labelled with a
15916 2001-12-10 Akim Demaille <akim@epita.fr>
15918 Now that states have a complete set of members, the linked list of
15919 shifts is useless: just fill directly the state's shifts member.
15921 * src/state.h (shifts): Remove the `next' member.
15922 * src/LR0.c (first_state, last_state): Remove.
15923 Adjust the callers.
15924 (augment_automaton): Don't look for the shifts that must be added
15925 a shift on EOF: it is those of the state we looked for! But now,
15926 since shifts are attached, it is no longer needed to looking
15927 merely by its id: its number.
15929 2001-12-10 Akim Demaille <akim@epita.fr>
15931 * src/LR0.c (augment_automaton): Better variable locality.
15932 Remove an impossible branch: if there is a state corresponding to
15933 the start symbol being shifted, then there is shift for the start
15934 symbol from the initial state.
15936 2001-12-10 Akim Demaille <akim@epita.fr>
15938 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
15939 only when appropriate: when insert_start_shifting_state' is not
15941 * tests/regression.at (Rule Line Numbers): Adjust.
15943 2001-12-10 Akim Demaille <akim@epita.fr>
15945 * src/LR0.c (augment_automaton): Now that all states have shifts,
15946 merge the two cases addition shifts to the initial state.
15948 2001-12-10 Akim Demaille <akim@epita.fr>
15950 * src/lalr.c (set_state_table): Move to...
15952 * src/lalr.c (lalr): Don't call it...
15953 * src/LR0.c (generate_states): do it.
15954 * src/LR0.h (first_state): Remove, only the table is used.
15956 2001-12-10 Akim Demaille <akim@epita.fr>
15958 * src/LR0.h (first_shift, first_reduction): Remove.
15959 * src/lalr.c: Don't use first_shift: find shifts through the
15962 2001-12-10 Akim Demaille <akim@epita.fr>
15964 * src/LR0.c: Attach shifts to states as soon as they are
15966 * src/lalr.c (set_state_table): Instead of assigning shifts to
15967 state, just assert that the mapping was properly done.
15969 2001-12-10 Akim Demaille <akim@epita.fr>
15971 * src/LR0.c (insert_start_shift): Rename as...
15972 (insert_start_shifting_state): this.
15973 (insert_eof_shifting_state, insert_accepting_state): New.
15974 (augment_automaton): Adjust.
15975 Better locality of the variables.
15976 When looking if the start_symbol is shifted from the initial
15977 state, using `while (... symbol != start_symbol ...)' sounds
15978 better than `while (... symbol < start_symbol ...)': If fail
15979 to see how the order between symbols could be relevant!
15981 2001-12-10 Akim Demaille <akim@epita.fr>
15983 * src/getargs.h: Don't declare `spec_name_prefix' and
15984 `spec_file_prefix', declared by src/files.h.
15985 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
15986 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
15987 * src/output.c (prepare): Adjust.
15988 * src/reader.c (symbols_output): Likewise.
15989 * src/vmsgetargs.c: Vaguely adjust, but who cares?
15991 2001-12-10 Akim Demaille <akim@epita.fr>
15993 * src/muscle_tab.c (muscle_init): NULL is a better default than
15996 2001-12-10 Akim Demaille <akim@epita.fr>
15998 * src/reader.c (reader): Calling symbols_output once is enough.
16000 2001-12-10 Akim Demaille <akim@epita.fr>
16002 Now that states have a complete set of members, the linked list of
16003 reductions is useless: just fill directly the state's reductions
16006 * src/state.h (struct reductions): Remove member `number' and
16008 * src/LR0.c (first_reduction, last_reduction): Remove.
16009 (save_reductions): Don't link the new reductions, store them in
16011 * src/lalr.c (set_state_table): No need to attach reductions to
16012 states, it's already done.
16013 * src/output.c (output_actions): No longer free the shifts, then
16014 the reductions, then the states: free all the states and their
16017 2001-12-10 Akim Demaille <akim@epita.fr>
16019 * src/options.c (OPTN, DRTV, BOTH): New.
16020 (option_table): Use them.
16022 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
16023 the job of system.h.
16024 * src/options.c: Don't include stdio.h and xalloc.h for the same
16027 2001-12-10 Akim Demaille <akim@epita.fr>
16029 * src/output.c (output, prepare): Make sure the values of the
16030 muscles `action' and `prologue' are 0-terminated.
16032 2001-12-10 Akim Demaille <akim@epita.fr>
16034 Clean up GCC warnings.
16036 * src/reader.c (copy_action): `buf' is not used.
16037 (parse_skel_decl): Be static.
16038 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
16039 * src/options.h (create_long_option_table): Have a real prototype.
16040 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
16041 (hash_delete_at): Return const void *.
16042 Adjust casts to preserve the const.
16044 2001-12-10 Akim Demaille <akim@epita.fr>
16046 * configure.in: Require 2.52g.
16047 M4 is not needed, but AUTOM4TE is.
16048 * m4/m4.m4: Remove.
16049 * tests/Makefile.am: Adjust.
16051 2001-12-10 Akim Demaille <akim@epita.fr>
16053 One structure for states is enough, even though theoretically
16054 there are LR(0) states and LALR(1) states.
16056 * src/lalr.h (state_t): Remove.
16057 (state_table): Be state_t **, not state_t *.
16058 * src/state.h (core, CORE_ALLOC): Rename as...
16059 (state_t, STATE_ALLOC): this.
16060 Add the LALR(1) members: shifts, reductions, errs.
16061 * src/LR0.c (state_table): Rename as...
16062 (state_hash): this, to avoid name clashes with the global
16064 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
16065 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
16067 2001-12-10 Akim Demaille <akim@epita.fr>
16069 Bison dumps core on bash.y.
16070 Reported by Pascal Bart.
16072 * src/warshall.c (bitmatrix_print): New.
16074 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
16075 j must be the outer loop.
16076 * tests/regression.at (Broken Closure): New.
16078 2001-12-05 Akim Demaille <akim@epita.fr>
16080 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
16082 Reported by Peter Hamorsky.
16084 2001-12-05 Akim Demaille <akim@epita.fr>
16086 * src/conflicts.c (err_table): Remove.
16087 (resolve_sr_conflict): Adjust.
16088 * src/lalr.h (state_t.reduction_table, state_t.shift_table):
16090 (state_t.reductions, state_t.shifts): this.
16092 2001-12-05 Akim Demaille <akim@epita.fr>
16094 * src/reduce.c (reduce_grammar_tables): No longer disable the
16095 removal of useless rules via CPP but via `if (0)', so that the
16096 compiler still check the code is valid.
16097 For instance, it should have noticed `rline' no longer exists: use
16098 the `line' member of rule_t.
16099 * src/gram.c (dummy, rline): Remove, unused.
16101 2001-12-05 Akim Demaille <akim@epita.fr>
16103 * src/output.c (pack_vector): Use assert, not berror.
16104 * src/main.c (berror): Remove, unused.
16106 2001-12-05 Akim Demaille <akim@epita.fr>
16108 New experimental feature: if --verbose --trace output all the
16109 items of a state, not only its kernel.
16111 * src/print.c (print_core): If `trace_flag', then invoke closure
16112 before outputting the items of the state (print_core is no longer
16113 a correct name them).
16114 (print_results): Invoke new_closure/free_closure if needed.
16116 2001-12-05 Akim Demaille <akim@epita.fr>
16118 * src/LR0.c (new_itemsets): Use nshifts only, not shiftcount.
16119 * src/closure.c, src/closure.h (itemsetsize): Rename as...
16120 (nitemset): for consistency with the rest of the project.
16122 2001-12-05 Akim Demaille <akim@epita.fr>
16124 * src/closure.c (print_closure): Improve.
16125 (closure): Use it for printing input and output.
16127 2001-12-05 Akim Demaille <akim@epita.fr>
16129 * src/closure.c (FIRSTS, FDERIVES): Adjust to reality: they are
16130 indexed by nonterminals.
16132 2001-12-05 Akim Demaille <akim@epita.fr>
16134 * src/warshall.c (TC, RTC): De-obsfucate (source reduced to 22% of
16136 * src/warshall.h: Remove accidental duplication of the content.
16138 2001-12-05 Akim Demaille <akim@epita.fr>
16140 * src/closure.c (set_fderives): De-obfuscate.
16142 2001-12-05 Akim Demaille <akim@epita.fr>
16144 * src/closure.c (print_firsts, print_fderives): De-obfuscate.
16146 2001-12-05 Akim Demaille <akim@epita.fr>
16148 * src/closure.c (set_firsts): De-obfuscate.
16150 2001-12-05 Akim Demaille <akim@epita.fr>
16152 * src/output.c (action_row): De-obfuscate
16153 using the good o' techniques: arrays not pointers, variable
16154 locality, BITISSET, RESETBIT etc.
16156 2001-12-05 Akim Demaille <akim@epita.fr>
16158 Pessimize the code to simplify it: from now on, all the states
16159 have a valid SHIFTS, which NSHIFTS is possibly 0.
16161 * src/LR0.c (shifts_new): Be global and move to..
16162 * src/state.c, src/state.h: here.
16163 * src/conflicts, src/lalr.c, src/output.c, src/print.c,
16164 * src/print_graph: Adjust.
16166 2001-12-05 Akim Demaille <akim@epita.fr>
16168 * src/state.h (SHIFT_DISABLE, SHIFT_IS_DISABLED): New.
16169 * src/conflicts.c: Use it.
16170 Restore a few missing `if (!SHIFT_IS_DISABLED)' which were
16171 incorrectly ``simplified''.
16173 2001-12-05 Akim Demaille <akim@epita.fr>
16175 * src/conflicts.c (flush_shift, resolve_sr_conflict): De-obfuscate
16176 using the good o' techniques: arrays not pointers, variable
16177 locality, BITISSET, RESETBIT etc.
16179 2001-12-05 Akim Demaille <akim@epita.fr>
16181 * src/state.h (SHIFT_SYMBOL): New.
16182 * src/conflicts.c: Use it to deobfuscate.
16184 2001-12-05 Akim Demaille <akim@epita.fr>
16186 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts)
16187 (print_reductions): De-obfuscate using the good o' techniques:
16188 arrays not pointers, variable locality, BITISSET.
16190 2001-12-05 Akim Demaille <akim@epita.fr>
16192 * src/conflicts.c (print_reductions): Arrays, not pointers.
16195 2001-12-05 Akim Demaille <akim@epita.fr>
16197 * src/conflicts.c (print_reductions): Pessimize, but clarify.
16199 2001-12-05 Akim Demaille <akim@epita.fr>
16201 * src/conflicts.c (print_reductions): Improve variable locality.
16203 2001-12-05 Akim Demaille <akim@epita.fr>
16205 * src/conflicts.c (print_reductions): Pessimize, but clarify.
16207 2001-12-05 Akim Demaille <akim@epita.fr>
16209 * src/conflicts.c (print_reductions): Improve variable locality.
16211 2001-12-05 Akim Demaille <akim@epita.fr>
16213 * src/state.h (SHIFT_IS_ERROR, SHIFT_IS_GOTO, SHIFT_IS_SHIFT): New.
16214 * src/lalr.c: Use them.
16216 2001-12-05 Akim Demaille <akim@epita.fr>
16218 * src/LR0.c (augment_automaton): Formatting changes.
16219 Better variable locality.
16221 2001-12-05 Akim Demaille <akim@epita.fr>
16223 * src/lalr.c (matrix_print): New.
16224 (transpose): Use it.
16225 Use arrays instead of pointers.
16227 2001-12-05 Akim Demaille <akim@epita.fr>
16229 * src/lalr.c (maxrhs): Move to...
16230 * src/gram.c, src/gram.h (ritem_longest_rhs): here.
16231 * src/lalr.c (build_relations): Adjust.
16233 2001-12-05 Akim Demaille <akim@epita.fr>
16235 * src/lalr.c (transpose): Free the memory allocated to the
16236 argument, as it is replaced by the results by the unique caller.
16237 (build_relations): Merely invoke transpose: it handles the memory
16239 Improve variable locality.
16240 Avoid variables used as mere abbreviations.
16241 (compute_lookaheads): Use arrays instead of pointers.
16243 2001-12-05 Akim Demaille <akim@epita.fr>
16245 * src/lalr.c (initialize_F): Improve variable locality.
16246 Avoid variables used as mere abbreviations.
16248 2001-12-05 Akim Demaille <akim@epita.fr>
16250 * src/derives.c (print_derives): Display the ruleno.
16251 * src/lalr.c (initialize_F, transpose): Better variable locality
16252 to improve readability.
16253 Avoid variables used as mere abbreviations.
16255 2001-12-05 Akim Demaille <akim@epita.fr>
16257 * src/lalr.c (traverse): Use arrays instead of pointers.
16259 2001-12-05 Akim Demaille <akim@epita.fr>
16261 * src/nullable.c (set_nullable): Use a for loop to de-obfuscate
16262 the handling of squeue.
16263 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
16265 2001-12-05 Akim Demaille <akim@epita.fr>
16267 Because useless nonterminals are now kept alive (instead of being
16268 `destroyed'), we now sometimes examine them, and store information
16269 related to them. Hence we need to know their number, and adjust
16270 memory allocations.
16272 * src/reduce.c, src/reduce.h (nuseless_nonterminals): No longer
16274 * src/LR0.c (allocate_itemsets): The memory allocated to
16275 `symbol_count' was used for two different purpose: once to count
16276 the number of occurrences of each symbol, and later reassigned to
16277 `shift_symbol', containing the symbol that can be shifted from a
16279 Deobfuscate, i.e., allocate, use and free `symbol_count' here
16281 (new_itemsets): Allocate `shift_symbol' here.
16282 (allocate_itemsets): symbol_count includes useless nonterminals.
16283 Make room for them.
16284 (free_storage): Use `free', not `XFREE', for pointers that cannot
16287 2001-12-05 Akim Demaille <akim@epita.fr>
16289 * src/nullable.c (set_nullable): Deobfuscate the handling of
16291 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
16293 2001-12-05 Akim Demaille <akim@epita.fr>
16295 * src/gram.c, src/gram.h (ritem_print): New.
16296 * src/gram.c (dummy): Remove, now there is actual code in gram.c.
16297 (This useless function was defined only to work around VMS linkers
16298 that can't handle compilation units with variables only).
16299 * src/reduce.c (dump_grammar): Use it to trace the construction of
16302 2001-12-04 Paul Eggert <eggert@twinsun.com>
16304 * src/bison.simple (union yyalloc): Change member names
16305 to be the same as the stack names.
16306 (yyparse): yyptr is now union yyalloc *, not char *.
16307 (YYSTACK_RELOCATE): Likewise. This avoids a GCC warning,
16308 and may generate better code on some machines.
16309 (yystpcpy): Use prototype if __STDC__ is defined, not just
16310 if __cplusplus is defined.
16312 2001-11-30 Akim Demaille <akim@epita.fr>
16314 * configure.in (WARNING_CFLAGS): Add -Werror when possible.
16315 (CFLAGS): Do not include the WARNING_CFLAGS here, since GNU
16316 Gettext doesn't compile cleanly, and dies with -Werror.
16317 * src/Makefile.am, lib/Makefile.am, tests/atlocal.in (CFLAGS):
16318 Include WARNING_CFLAGS here.
16319 * lib/xstrdup.c: Include xalloc.h, so that xstrdup be declared
16320 before being defined.
16322 2001-11-27 Paul Eggert <eggert@twinsun.com>
16324 * lib/quotearg.h (quotearg_n, quotearg_n_style):
16325 First arg is int, not unsigned.
16326 * lib/quotearg.c (quotearg_n, quotearg_n_style): Likewise.
16327 (SIZE_MAX, UINT_MAX): New macros.
16328 (quotearg_n_options): Abort if N is negative.
16329 Avoid overflow check on hosts where size_t is 64 bits and int
16330 is 32 bits, as overflow is impossible there.
16331 Fix off-by-one typo that caused unnecessary reallocation.
16333 2001-11-29 Paul Eggert <eggert@twinsun.com>
16335 Name space cleanup in generated parser.
16337 * doc/bison.texinfo (Bison Parser): Discuss system headers
16338 and their effect on the user name space.
16340 * src/bison.simple:
16341 (YYSTACK_ALLOC, YYSTACK_FREE, union yyalloc, YYSTACK_GAP_MAX,
16342 YYSTACK_BYTES, YYSTACK_RELOCATE): Do not define unless necessary,
16343 i.e. unless ! defined (yyoverflow) || defined (YYERROR_VERBOSE).
16345 (YYSIZE_T): New macro. Use it instead of size_t, to avoid infringing
16346 on user names when possible.
16348 (YYSTACK_USE_ALLOCA): Do not define; just use any existing defn.
16349 Simplify test for whather <alloca.h> exists.
16351 (<stdlib.h>): Include if we will use malloc, and if standard C or C++.
16353 (<stdio.h>): Include if YYDEBUG.
16355 (yymemcpy): Renamed from __yy_memcpy. Do not define unless
16356 ! defined (yyoverflow) && ! defined (yymemcpy).
16358 (yymemcpy, yyparse): Rename local variables as needed so that
16359 they all begin with 'yy'.
16361 (yystrlen, yystpcpy): New functions.
16363 (YY_DECL_NON_LSP_VARIABLES): Renamed from _YY_DECL_VARIABLES.
16366 (yyparse): size_t -> YYSIZE_T. Use yystrlen and yystpcpy
16367 instead of relying on string.h functions. Use YYSTACK_ALLOC
16368 and YYSTACK_FREE instead of malloc and free.
16370 2001-11-30 Akim Demaille <akim@epita.fr>
16372 * src/bison.simple (YYSTYPE, YYLTYPE): Move their definitions
16373 before their first uses.
16374 (YYBISON, YYPURE): Move to the top of the output.
16376 2001-11-30 Akim Demaille <akim@epita.fr>
16378 * tests/reduce.at (Useless Nonterminals): Fix.
16380 2001-11-30 Akim Demaille <akim@epita.fr>
16382 * src/bison.simple (YYSTACK_FREE): Use `do {;} while (0)' as empty
16383 if body instead of `;' to pacify GCC's warnings.
16385 2001-11-30 Akim Demaille <akim@epita.fr>
16387 Instead of mapping the LHS of unused rules to -1, keep the LHS
16388 valid, but flag the rules as invalid.
16390 * src/gram.h (rule_t): `useful' is a new member.
16391 * src/print.c (print_grammar): Adjust.
16392 * src/derives.c (set_derives): Likewise.
16393 * src/reader.c (packgram, reduce_output): Likewise.
16394 * src/reduce.c (reduce_grammar_tables): Likewise.
16395 * tests/reduce.at (Underivable Rules, Useless Rules): New.
16397 2001-11-30 Akim Demaille <akim@epita.fr>
16399 * src/reduce.c (reduce_output): Formatting changes.
16400 * src/print.c (print_results, print_grammar): Likewise.
16401 * tests/regression.at (Rule Line Numbers)
16402 (Solved SR Conflicts, Unresolved SR Conflicts): Adjust.
16404 2001-11-30 Akim Demaille <akim@epita.fr>
16406 * src/reduce.c (nonterminals_reduce): Instead of throwing away
16407 useless nonterminals, move them at the end of the symbol arrays.
16408 (reduce_output): Adjust.
16409 * tests/reduce.at (Useless Nonterminals): Adjust.
16411 2001-11-30 Akim Demaille <akim@epita.fr>
16413 * src/reduce.c: Various comment/formatting changes.
16414 (nonterminals_reduce): New, extracted from...
16415 (reduce_grammar_tables): here.
16416 (reduce_grammar): Call nonterminals_reduce.
16418 2001-11-29 Paul Eggert <eggert@twinsun.com>
16420 * src/bison.simple (YYSTACK_REALLOC): Remove.
16421 (YYSTACK_ALLOC): Resurrect this macro, with its old meaning.
16422 (YYSTACK_FREE, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYSTACK_RELOCATE):
16424 (union yyalloc): New type.
16425 (__yy_memcpy): Last arg is size_t, not unsigned int, to remove
16426 an arbitrary restriction on hosts where size_t is wider than int.
16428 (yyparse): Don't dump core if alloca or malloc fails; instead, report
16429 a parser stack overflow. Allocate just one block of memory for all
16430 three stacks, instead of allocating three blocks; this typically is
16431 faster and reduces fragmentation.
16433 Do not limit the number of items in the stack to a value that fits
16434 in 'int', as this is an arbitrary limit on hosts with 64-bit
16435 size_t and 32-bit int.
16437 2001-11-29 Marc Autret <autret_m@epita.fr>
16439 * tests/calc.at [AT_DATA_CALC_Y]: Use %error-verbose instead
16440 of defining YYERROR_VERBOSE.
16441 [AT_DATA]: $4 is now out of C declarations in the prologue.
16443 2001-11-28 Marc Autret <autret_m@epita.fr>
16445 * src/reader.c (parse_dquoted_param): New.
16446 (parse_skel_decl): Use it.
16447 * src/lex.h: Add its prototype.
16448 * src/lex.c (literalchar): Become not static.
16450 2001-11-28 Marc Autret <autret_m@epita.fr>
16452 * src/output.h: And put its extern declaration here.
16453 * src/output.c (error_verbose): Define here.
16454 (prepare): Echo name modification.
16455 * src/getargs.h: Clean its extern declaration.
16456 * src/getargs.c (error_verbose_flag): Remove.
16457 (getargs): Remove case 'e'.
16458 * src/options.c (option_table): 'error-verbose' is now seen as simple
16462 * src/reader.c (read_declarations): Remove case tok_include.
16463 (parse_include_decl): Remove.
16464 * src/lex.h (token_t): Remove tok_include.
16465 * src/options.c (option_table): 'include' is now a simple command line
16468 2001-11-28 Marc Autret <autret_m@epita.fr>
16470 * src/bison.simple: Adjust muscle names.
16471 * src/muscle_tab.c (muscle_init): Also rename the muscles.
16472 * src/output.c (prepare): s/_/-/ for the muscles names.
16473 (output_parser): When scanning for a muscle, allow '-' instead of '_'.
16475 2001-11-28 Marc Autret <autret_m@epita.fr>
16477 * src/bison.simple: Fix debug.
16478 [YYERROR_VERBOSE]: Re-integrate as an internal macro.
16480 2001-11-28 Akim Demaille <akim@epita.fr>
16482 * src/LR0.c (shifts_new): New.
16483 (save_shifts, insert_start_shift, augment_automaton): Use it.
16485 2001-11-28 Akim Demaille <akim@epita.fr>
16487 * src/closure.c (closure): `b' and `ruleno' denote the same value:
16490 2001-11-28 Akim Demaille <akim@epita.fr>
16492 * src/closure.c (closure): Instead of looping over word in array
16493 then bits in words, loop over bits in array.
16495 2001-11-28 Akim Demaille <akim@epita.fr>
16497 * src/closure.c (closure): No longer optimize the special case
16498 where all the bits of `ruleset[r]' are set to 0, to make the code
16501 2001-11-28 Akim Demaille <akim@epita.fr>
16503 * src/closure.c (closure): `r' and `c' are new variables, used to
16504 de-obfuscate accesses to RULESET and CORE.
16506 2001-11-28 Akim Demaille <akim@epita.fr>
16508 * src/reduce.c (reduce_print): Use ngettext.
16509 (dump_grammar): Improve the trace accuracy.
16511 2001-11-28 Akim Demaille <akim@epita.fr>
16513 * src/reduce.c (dump_grammar): Don't translate trace messages.
16515 2001-11-28 Akim Demaille <akim@epita.fr>
16517 * tests/reduce.at (Useless Terminals, Useless Nonterminals): New.
16518 * src/reduce.c (reduce_grammar_tables): Do not free useless tags,
16519 as all tags are free'ed afterwards.
16520 From Enrico Scholz.
16522 2001-11-27 Paul Eggert <eggert@twinsun.com>
16524 * src/bison.simple (YYSTACK_REALLOC): Fix typo that caused us to
16525 use alloca when we didn't want to, and vice versa.
16527 2001-11-27 Marc Autret <autret_m@epita.fr>
16529 * src/muscle_tab.c (muscle_init): Remove 'verbose' muscle
16531 * src/output.c (prepare): Remove its update.
16533 2001-11-27 Marc Autret <autret_m@epita.fr>
16535 * tests/torture.at [AT_DATA]: Remove YYERROR_VERBOSE definition.
16536 Use %error-verbose.
16538 2001-11-27 Marc Autret <autret_m@epita.fr>
16540 * src/bison.simple: Remove YYERROR_VERBOSE using.
16541 Use %%error_verbose.
16542 (yyparse): Likewise.
16543 * src/output.c (prepare): Give its final value.
16544 * src/muscle_tab.c (muscle_init): Init new muscle 'error_verbose'.
16545 * src/getargs.h: Add its extern declaration.
16546 * src/getargs.c (error_verbose_flag): New int.
16547 (getargs): Update to catch new case.
16548 * src/options.c (option_table): 'error-verbose' is a new option.
16549 (shortopts): Update.
16551 2001-11-27 Akim Demaille <akim@epita.fr>
16553 * src/system.h: Use intl/libgettext.h.
16554 * src/Makefile.am (INCLUDES): Add -I $(top_srcdir).
16556 2001-11-27 Akim Demaille <akim@epita.fr>
16558 * tests/torture.at (Exploding the Stack Size with Malloc):
16559 s/YYSTACK_USE_ALLOCA_ALLOCA/YYSTACK_USE_ALLOCA/.
16561 2001-11-27 Akim Demaille <akim@epita.fr>
16563 * src/files.c: Include error.h.
16564 Reported by Hans Aberg.
16566 2001-11-26 Marc Autret <autret_m@epita.fr>
16568 * src/reader.c (parse_include_decl): New, not yet implemented.
16569 (read_declarations): Add case tok_include.
16570 * src/getargs.h (include): Add its extern definition.
16571 * src/getargs.c (include): New const char *.
16572 (getargs): Add case '-I'.
16573 * src/options.c (option_table): Add include as command line and
16575 * src/lex.h (token_t): Add tok_include.
16577 2001-11-26 Akim Demaille <akim@epita.fr>
16579 * src/reader.c (readgram): Make sure rules for mid-rule actions
16580 have a lineno equal to that of their host rule.
16581 Reported by Hans Aberg.
16582 * tests/regression.at (Rule Line Numbers): New.
16584 2001-11-26 Akim Demaille <akim@epita.fr>
16586 * src/LR0.c (allocate_itemsets): kernel_size contains ints, not
16589 2001-11-26 Akim Demaille <akim@epita.fr>
16591 * src/complain.c, src/complain.h (error): Remove, provided by
16594 2001-11-26 Akim Demaille <akim@epita.fr>
16596 * src/reader.c (read_declarations): Don't abort on tok_illegal,
16597 issue an error message.
16598 * tests/regression.at (Invalid %directive): New.
16599 Reported by Hans Aberg.
16601 2001-11-26 Akim Demaille <akim@epita.fr>
16603 * configure.in: Invoke AC_FUNC_OBSTACK and AC_FUNC_ERROR_AT_LINE.
16604 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
16606 2001-11-26 Akim Demaille <akim@epita.fr>
16608 * src/conflicts.c (conflicts_print): Don't complain at all when
16609 there are no reduce/reduce conflicts, and as many shift/reduce
16610 conflicts as expected.
16611 * tests/regression.at (%expect right): Adjust.
16613 2001-11-23 Akim Demaille <akim@epita.fr>
16615 * lib/alloca.c: Update, from fileutils.
16617 2001-11-23 Akim Demaille <akim@epita.fr>
16619 * lib/Makefile.am (libbison_a_LIBADD): Add @ALLOCA@.
16621 2001-11-23 Akim Demaille <akim@epita.fr>
16623 * src/system.h: Include alloca.h.
16624 * src/main.c (main) [C_ALLOCA]: Call alloca (0).
16626 2001-11-23 Akim Demaille <akim@epita.fr>
16628 * src/print_graph.c (print_actions): Remove `rule', unused.
16629 * src/LR0.c (kernel_size): Contain `int' instead of `size_t' to
16630 pacify GCC's signed < unsigned warnings.
16631 * src/closure.c (itemsetsize): Likewise.
16632 * src/reader.c (symbol_list_new): Static.
16634 2001-11-23 Akim Demaille <akim@epita.fr>
16636 Attaching lineno to buckets is stupid, since only one copy of each
16637 symbol is kept, only the line of the first occurrence is kept too.
16639 * src/symtab.h, src/symtab.c (bucket): Remove the line member.
16640 * src/reader.c (rline_allocated): Remove, unused.
16641 (symbol_list): Have a `line' member.
16642 (symbol_list_new): New.
16643 (readgram): Use it.
16644 * src/print.c (print_grammar): Output the rule line numbers.
16645 * tests/regression.at (Solved SR Conflicts)
16646 (Unresolved SR Conflicts): Adjust.
16647 Reported by Hans Aberg.
16649 2001-11-22 Marc Autret <autret_m@epita.fr>
16651 * src/bison.simple [YYERROR_VERBOSE]: Force its value to be 1 or 0.
16653 2001-11-22 Marc Autret <autret_m@epita.fr>
16655 * src/muscle_tab.c (muscle_init): Remove initialization of
16657 * src/output.c (output_master_parser): Do it here.
16659 2001-11-20 Akim Demaille <akim@epita.fr>
16662 * configure.in (ALL_LINGUAS): Adjust.
16663 * po/POTFILE.in: Remove `nullable.c' and `derives.c' which no
16664 longer contains strings to translate.
16666 2001-11-19 Akim Demaille <akim@epita.fr>
16668 * src/conflicts.c (conflicts_print): Add a missing \n.
16670 2001-11-19 Akim Demaille <akim@epita.fr>
16672 * src/nullable.c (nullable_print): New.
16673 (set_nullable): Call it when tracing.
16674 Better locality of variables.
16676 2001-11-19 Akim Demaille <akim@epita.fr>
16678 * src/print.c (print_actions): Better locality of variables.
16680 2001-11-19 Akim Demaille <akim@epita.fr>
16682 * src/derives.c (print_derives): Fix and enrich.
16683 * src/closure.c (print_fderives): Likewise.
16685 2001-11-19 Akim Demaille <akim@epita.fr>
16687 * src/closure.c (itemsetend): Remove, replaced with...
16688 (itemsetsize): new.
16690 2001-11-19 Akim Demaille <akim@epita.fr>
16692 * src/LR0.c (kernel_end): Remove, replaced with...
16693 (kernel_size): new.
16695 2001-11-19 Akim Demaille <akim@epita.fr>
16697 * src/conflicts.c (set_conflicts): Use arrays instead of pointers
16700 2001-11-19 Akim Demaille <akim@epita.fr>
16702 * src/closure.c (closure): Use arrays instead of pointers to clarify.
16704 2001-11-19 Akim Demaille <akim@epita.fr>
16706 * src/closure.c, src/derives.c, src/nullable.c: Adjust various
16708 * src/LR0.c: Likewise.
16709 (allocate_itemsets): Use arrays instead of pointers to clarify.
16711 2001-11-19 Akim Demaille <akim@epita.fr>
16713 * src/getargs.c (statistics_flag): Replace with...
16715 (longopts): Accept --trace instead of --statistics.
16716 * src/getargs.h, src/options.c: Adjust.
16717 * src/LR0.c, src/closure.c, src/derives.c, src/nullable.c,
16718 * src/reduce.c: Use trace_flags instead of the CPP conditional TRACE.
16720 2001-11-19 Akim Demaille <akim@epita.fr>
16722 * src/LR0.c (new_itemsets, get_state): Use more arrays and fewer
16723 pointers to clarify the code.
16724 (save_reductions, save_shifts): Factor common parts of alternatives.
16726 2001-11-19 Akim Demaille <akim@epita.fr>
16728 * src/LR0.c (new_state, get_state): Complete TRACE code.
16729 * src/closure.c: Include `reader.h' to get `tags', needed by the
16731 Rename the conditional DEBUG as TRACE.
16732 Output consistently TRACEs to stderr, not stdout.
16733 * src/derives.c: Likewise.
16734 * src/reduce.c: (inaccessable_symbols): Using if is better style
16736 Use `#if TRACE' instead of `#if 0' for tracing code.
16738 2001-11-19 Akim Demaille <akim@epita.fr>
16740 * src/system.h (LIST_FREE, shortcpy): New.
16741 * src/LR0.c: Use them.
16742 * src/output.c (free_itemsets, free_reductions, free_shifts):
16743 Remove, replaced by LIST_FREE.
16745 2001-11-19 Akim Demaille <akim@epita.fr>
16747 * src/state.h (CORE_ALLOC, SHIFTS_ALLOC, ERRS_ALLOC)
16748 (REDUCTIONS_ALLOC): New.
16749 * src/LR0.c, src/conflicts.c: Use them to de-obfuscate memory
16752 2001-11-19 Akim Demaille <akim@epita.fr>
16754 * src/LR0.c (new_state): Complete trace code.
16755 * src/nullable.c (set_nullable): Don't translate traces.
16757 2001-11-19 Akim Demaille <akim@epita.fr>
16759 * src/print_graph.c (print_core): Better locality of variables.
16760 * src/print.c (print_core): Likewise.
16762 2001-11-19 Akim Demaille <akim@epita.fr>
16764 * src/vcg.c: You do the output, so you are responsible of the
16765 handling of VCG syntax, in particular: use quotearg.
16766 * src/print_graph.c: Don't.
16767 (print_actions): Don't output the actions as part of the nodes,
16768 since that's the job of the edges.
16769 (print_state): Don't output by hand: fill the node description,
16770 and ask for its output.
16772 2001-11-19 Akim Demaille <akim@epita.fr>
16774 * src/bison.simple (yyparse): When verbosely reporting an error,
16775 no longer put additional quotes around token names.
16776 * tests/calc.at: Adjust.
16778 2001-11-19 Akim Demaille <akim@epita.fr>
16780 * src/symtab.h, src/symtab.c: `line' is a new member of `bucket'.
16781 * src/reader.c (record_rule_lines, rline, rline_allocated): Remove.
16782 * src/output.c: Adjust.
16784 2001-11-19 Akim Demaille <akim@epita.fr>
16786 * src/gram.h (rprec, rprecsym, rassoc): Remove, now part of...
16788 * src/conflicts.c, src/reader.c, src/reduce.c: Adjust.
16790 2001-11-19 Akim Demaille <akim@epita.fr>
16792 * src/gram.h (rule_t): New.
16794 (rrhs, rlhs): Remove, part of state_t.
16795 * src/print_graph.c, src/closure.c, src/conflicts.c, src/derives.c,
16796 * src/lalr.c, src/nullable.c, src/output.c, src/print.c,
16797 * src/reader.c, src/reduce.c: Adjust.
16799 2001-11-19 Akim Demaille <akim@epita.fr>
16801 * src/reader.c (symbols_output): New, extracted from...
16802 (packsymbols): Here.
16805 2001-11-19 Akim Demaille <akim@epita.fr>
16807 * src/lalr.c (set_maxrhs, maxrhs): Remove, replaced with...
16808 (maxrhs): this new function.
16810 2001-11-19 Akim Demaille <akim@epita.fr>
16812 * src/lalr.c (F): New macro to access the variable F.
16815 2001-11-19 Akim Demaille <akim@epita.fr>
16817 * src/lalr.h (LA): New macro to access the variable LA.
16818 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
16819 * src/lalr.c: Adjust.
16821 2001-11-19 Akim Demaille <akim@epita.fr>
16823 * src/lalr.c (initialize_LA): Only initialize LA. Let...
16824 (set_state_table): handle the `lookaheads' members.
16826 2001-11-19 Akim Demaille <akim@epita.fr>
16828 * src/lalr.h (lookaheads): Removed array, whose contents is now
16830 (state_t): this structure.
16831 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
16834 2001-11-19 Akim Demaille <akim@epita.fr>
16836 * src/lalr.h (consistent): Removed array, whose contents is now
16838 (state_t): this structure.
16839 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
16842 2001-11-19 Akim Demaille <akim@epita.fr>
16844 * src/lalr.h (reduction_table, shift_table): Removed arrays, whose
16845 contents are now members of...
16846 (state_t): this structure.
16847 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
16850 2001-11-19 Akim Demaille <akim@epita.fr>
16852 * src/lalr.h (state_t): New.
16853 (state_table): Be a state_t * instead of a core **.
16854 (accessing_symbol): Remove, part of state_t.
16855 * src/lalr.c: Adjust.
16856 (set_accessing_symbol): Merge into...
16857 (set_state_table): this.
16858 * src/print_graph.c, src/conflicts.c: Adjust.
16860 2001-11-14 Akim Demaille <akim@epita.fr>
16862 * tests/calc.at, tests/output.at, tests/regression.at,
16863 * tests/testsuite.at, tests/torture.at: Rely on Autotest 2.52g:
16864 now the tests are run in private dirs, therefore AC_CLEANUP and
16865 family can be simplified to 0-ary.
16866 * tests/atlocal.in: Now that we run `elsewhere' than in tests/,
16867 use abs. path to find config.h.
16868 * tests/calc.at (AT_CHECK_CALC): Don't try to check the compiler's
16869 stderr, there can be way too much random noise.
16870 Instead pass -Werror to GCC and rely on the exit status.
16871 Reported by Wolfram Wagner.
16873 2001-11-14 Akim Demaille <akim@epita.fr>
16875 * src/bison.simple (yyparse): Let yyls1, yyss1 and yyvs1 be
16876 defined only if yyoverflow is defined, to avoid `warning: unused
16878 Reported by The Test Suite.
16880 2001-11-14 Akim Demaille <akim@epita.fr>
16882 * src/print.c: Include reduce.h.
16883 Reported by Hans Aberg.
16885 2001-11-14 Akim Demaille <akim@epita.fr>
16887 * src/lex.c, src/lex.h (token_buffer, unlexed_token_buffer):
16888 Revert a previous patch: these are really const.
16889 * src/conflicts.c (conflict_report): Additional useless pair of
16890 braces to pacify GCC's warnings for `if () if () {} else {}'.
16891 * src/lex.c (parse_percent_token): Replace equal_offset with
16894 Be sure to strdup `arg' when used, since there is no reason for
16895 token_buffer not to change.
16897 2001-11-14 Akim Demaille <akim@epita.fr>
16899 * src/system.h (EXIT_SUCCESS, EXIT_FAILURE): Ensure a proper
16901 * src/main.c (main): Use them.
16902 Suggested by Hans Aberg.
16904 2001-11-12 Akim Demaille <akim@epita.fr>
16906 * src/system.h (ngettext): Now that we use ngettext, be sure to
16907 provide a default definition when NLS are not used.
16909 2001-11-12 Akim Demaille <akim@epita.fr>
16911 * doc/bison.texinfo: Use `$' as shell prompt, not `%'.
16912 Use @kbd to denote user input.
16913 (Language and Grammar): ANSIfy the example.
16914 Adjust its layout for info/notinfo.
16915 (Location Tracking Calc): Output error messages to stderr.
16916 Output locations in a more GNUtically correct way.
16917 Fix a couple of Englishos.
16918 Adjust @group/@end group pairs.
16920 2001-11-12 Akim Demaille <akim@epita.fr>
16922 %expect was not functioning at all.
16924 * src/conflicts.c (expected_conflicts): Set to -1.
16925 (conflict_report): Use ngettext.
16926 (conflicts_print): Check %expect and make its violation an error.
16927 * doc/bison.texinfo (Expect Decl): Adjust.
16928 * configure.in (AM_GNU_GETTEXT): Ask for ngettext.
16929 * tests/regression.at (%expect not enough, %expect right)
16930 (%expect too much): New.
16932 2001-11-12 Akim Demaille <akim@epita.fr>
16934 * tests/regression.at (Conflicts): Rename as...
16935 (Unresolved SR Conflicts): this.
16936 (Solved SR Conflicts): New.
16938 2001-11-12 Akim Demaille <akim@epita.fr>
16940 * src/reduce.c (print_results): Rename as...
16941 (reduce_output): This.
16942 Output to OUT, passed as argument, instead of output_obstack.
16943 (dump_grammar): Likewise.
16944 (reduce_free): New.
16946 (reduce_grammar): No longer call reduce_output, since...
16947 * src/print.c (print_results): do it.
16948 * src/main.c (main): Call reduce_free;
16950 2001-11-12 Akim Demaille <akim@epita.fr>
16952 * src/conflicts.c (print_reductions): Accept OUT as argument.
16953 Output to it, not to output_obstack.
16954 * src/print.c (print_actions): Adjust.
16956 2001-11-12 Akim Demaille <akim@epita.fr>
16958 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts): Return
16959 the result instead of using...
16960 (src_total, rrc_total, src_count, rrc_count): Remove.
16961 (any_conflicts): Remove.
16962 (print_conflicts): Split into...
16963 (conflicts_print, conflicts_output): New.
16964 * src/conflicts.h: Adjust.
16965 * src/main.c (main): Invoke both conflicts_output and conflicts_print.
16966 * src/print.c (print_grammar): Issue `\n' between two rules.
16967 * tests/regression.at (Conflicts): New.
16968 Reported by Tom Lane.
16970 2001-11-12 Akim Demaille <akim@epita.fr>
16972 * tests/regression.at (Invalid input): Remove, duplicate with
16973 ``Invalid input: 1''.
16975 2001-11-12 Akim Demaille <akim@epita.fr>
16977 * tests/torture.at (AT_DATA_STACK_TORTURE)
16978 (Exploding the Stack Size with Alloca)
16979 (Exploding the Stack Size with Malloc): New.
16981 2001-11-12 Akim Demaille <akim@epita.fr>
16983 * src/bison.simple (YYSTACK_REALLOC): New.
16984 (yyparse) [!yyoverflow]: Use it and free the old stack.
16985 Reported by Per Allansson.
16987 2001-11-12 Pascal Bart <pascal.bart@epita.fr>
16989 * src/bison.simple: Define type yystype instead of YYSTYPE, and
16990 define CPP macro, which substitute YYSTYPE by yystype.
16991 * src/reader.c (parse_union_decl): Output yystype/YYSTYPE as we do
16992 with yyltype/YYLTYPE. This allows inclusion of the generated
16993 header within the parser if the compiler, such as GGC, accepts
16994 multiple equivalent #defines.
16997 2001-11-05 Akim Demaille <akim@epita.fr>
16999 * src/reader.c (symbols_output): New, extracted from...
17000 (packsymbols): here.
17003 2001-11-05 Akim Demaille <akim@epita.fr>
17005 * src/lex.c (parse_percent_token): s/quotearg/quote/.
17007 2001-11-05 Akim Demaille <akim@epita.fr>
17009 * tests/regression.at (AT_TEST_CPP_GUARD_H): Adjust the clean up
17012 2001-11-05 Akim Demaille <akim@epita.fr>
17014 * src/options.h (struct option_table_struct): set_flags is void*.
17015 * src/options.c (longopts): Support `--output' and `%output'.
17017 * src/lex.h (tok_setopt): Remove, replaced with...
17018 (tok_intopt, tok_stropt): these new guys.
17019 * src/lex.c (getopt.h): Not needed.
17020 (token_buffer, unlexed_token_buffer): Not const.
17021 (percent_table): Promote `-' over `_' in directive names.
17022 Active `%name-prefix', `file-prefix', and `output'.
17023 (parse_percent_token): Accept possible arguments to directives.
17024 Promote `-' over `_' in directive names.
17026 2001-11-04 Akim Demaille <akim@epita.fr>
17028 * doc/bison.texinfo (Decl Summary): Split the list into
17029 `directives for grammars' and `directives for bison'.
17031 Add description of `%name-prefix', `file-prefix', and `output'.
17032 Promote `-' over `_' in directive names.
17033 (Bison Options): s/%locactions/%locations/. Nice Freudian slip.
17034 Simplify the description of `--name-prefix'.
17035 Promote `-' over `_' in directive names.
17036 Promote `--output' over `--output-file'.
17037 Fix the description of `--defines'.
17038 * tests/output.at: Exercise %file-prefix and %output.
17040 2001-11-02 Akim Demaille <akim@epita.fr>
17042 * doc/refcard.tex: Update.
17044 2001-11-02 Akim Demaille <akim@epita.fr>
17046 * src/symtab.h (SUNDEF): New.
17047 * src/symtab.c (bucket_new): Init user_token_number to SUNDEF to
17048 stand for `uninitialized', instead of 0.
17049 * src/reader.c (packsymbols, parse_thong_decl): Adjust.
17050 * src/lex.c (lex): Adjust.
17052 * tests/calc.at (_AT_DATA_CALC_Y): Declare a token for EOF.
17054 Let yylex return it instead of a plain 0.
17055 Reported by Dick Streefland.
17057 2001-11-02 Akim Demaille <akim@epita.fr>
17059 * tests/regression.at (Mixing %token styles): New test.
17061 2001-11-02 Akim Demaille <akim@epita.fr>
17063 * src/reader.c (parse_thong_decl): Formatting changes.
17064 (token_translations_init): New, extracted from...
17065 (packsymbols): Here.
17068 2001-11-01 Akim Demaille <akim@epita.fr>
17070 * tests/regression.at (AT_TEST_CPP_GUARD_H): New.
17071 Check that `9foo.y' produces correct cpp guards.
17072 * src/files.c (compute_header_macro): Prepend `BISON_' to CPP
17076 2001-11-01 Akim Demaille <akim@epita.fr>
17078 * tests/regression.at (Invalid input: 2): New.
17079 * src/lex.c (unlexed_token_buffer): New.
17080 (lex, unlex): Adjust: when unlexing, be sure to save token_buffer
17084 2001-11-01 Akim Demaille <akim@epita.fr>
17086 * tests/calc.at: Catch up with 1.30.
17087 * configure.in: Bump to 1.49a.
17088 Adjust to newer Autotest.
17090 2001-10-19 Pascal Bart <pascal.bart@epita.fr>
17092 * src/conflicts.c: Move global variables rrc_total and src_total ...
17093 (print_conflicts): here.
17094 * src/output.c (output): Free global variable user_toknums.
17095 * src/lex.c (token_obstack): Become static.
17097 2001-10-18 Akim Demaille <akim@epita.fr>
17099 * tests/atlocal.in (GCC): Add.
17100 * tests/calc.at: s/m4_match/m4_bmatch/.
17101 s/m4_patsubst/m4_bpatsubst/.
17102 (AT_CHECK_CALC): Check the compiler's stderr only if it's GCC.
17103 * configure.in: AC_SUBST(GCC).
17105 2001-10-14 Marc Autret <autret_m@epita.fr>
17107 * src/options.c (create_long_option_table): Fix.
17109 2001-10-10 Akim Demaille <akim@epita.fr>
17111 * src/bison.simple: Be sure to set YYSTACK_USE_ALLOCA.
17113 2001-10-04 Akim Demaille <akim@epita.fr>
17115 * src/reader.c (parse_union_decl): Push the caracters in
17116 union_obstack, not attrs_obstack.
17118 2001-10-04 Akim Demaille <akim@epita.fr>
17120 Merge in the branch 1.29.
17122 * src/reader.c (packsymbols): Use a temporary obstack for
17123 `%%tokendef', since output_stack is already used elsewhere.
17125 2001-10-02 Akim Demaille <akim@epita.fr>
17129 2001-10-02 Akim Demaille <akim@epita.fr>
17133 2001-10-02 Akim Demaille <akim@epita.fr>
17135 * tests/regression.at (Invalid CPP headers): New.
17136 From Alexander Belopolsky.
17137 * src/files.c (compute_header_macro): Map non alnum chars to `_'.
17139 2001-10-02 Akim Demaille <akim@epita.fr>
17141 * tests/regression.at (Invalid input): New.
17142 * src/lex.c (lex): Be sure to set `token_buffer' in any case.
17145 2001-10-02 Akim Demaille <akim@epita.fr>
17147 * tests/calc.at: Now that --debug works, the tests must be adjusted.
17149 2001-10-02 Akim Demaille <akim@epita.fr>
17151 * src/output.c (output_parser): Assert `skeleton'.
17152 * src/files.c (skeleton_find): Look harder for skeletons on DOSish
17156 2001-10-01 Marc Autret <autret_m@epita.fr>
17158 * src/lex.h: Echo modifications.
17159 * src/lex.c (unlex): Parameter is now token_t.
17162 2001-10-01 Marc Autret <autret_m@epita.fr>
17164 * src/main.c: Include lex.h.
17167 2001-09-29 Akim Demaille <akim@epita.fr>
17169 * src/getargs.c (longopts): `--debug' is `-t', not `-d'.
17171 2001-09-28 Akim Demaille <akim@epita.fr>
17173 * tests/testsuite.at: Update to newer Autotest.
17174 * tests/Makefile.am (EXTRA_DIST): bison is not to be shipped.
17176 2001-09-27 Akim Demaille <akim@epita.fr>
17178 Position independent wrapper.
17180 * tests/bison: Remove.
17181 * tests/bison.in: New.
17182 * configure.in: Adjust.
17184 2001-09-27 Paul Eggert <eggert@twinsun.com>
17186 Port quotearg fixes from tar 1.13.24.
17188 * lib/quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
17190 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
17191 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
17193 * m4/Makefile.am (EXTRA_DIST): Add mbrtowc.m4.
17194 * m4/mbrtowc.m4: New file.
17195 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Check for mbsinit and stddef.h.
17196 Use jm_FUNC_MBRTOWC instead of AC_CHECK_FUNCS(mbrtowc).
17198 2001-09-27 Akim Demaille <akim@epita.fr>
17202 2001-09-27 Akim Demaille <akim@epita.fr>
17206 2001-09-25 Akim Demaille <akim@epita.fr>
17208 * src/system.h: Include `xalloc.h'.
17209 Remove it from the C files.
17210 * src/files.c (output_files): Free the obstacks.
17211 * src/lex.c (init_lex): Rename as...
17214 * src/main.c (main): Use it.
17216 2001-09-24 Marc Autret <autret_m@epita.fr>
17218 * src/vcg.c (open_edge, close_edge, open_node, close_node): Change
17219 to output informations in fout (FILE*).
17220 (open_graph, close_graph): Likewise.
17221 (output_graph, output_edge, output_node): Likewise.
17222 * src/vcg.h: Update function prototypes.
17223 * src/print_graph.c (print_graph): Open output graph file.
17224 (print_actions): Adjust.
17225 * src/files.h: Remove extern declaration.
17226 * src/files.c: Remove graph_obstack declaration.
17227 (open_files): Remove graph_obstack initialization.
17228 (output_files): Remove graph_obstack saving.
17230 2001-09-24 Marc Autret <autret_m@epita.fr>
17232 * src/files.c (compute_output_file_names): Fix.
17234 2001-09-24 Marc Autret <autret_m@epita.fr>,
17235 Akim Demaille <akim@epita.fr>
17237 * src/reader.c (reader): Remove call to free_symtab ().
17238 * src/main.c (main): Call it here.
17240 * src/conflicts.c (initialize_conflicts): Rename as...
17241 (solve_conflicts): this.
17242 * src/print.c (print_core, print_actions, print_state)
17243 (print_grammar): Dump to a file instead a `output_obstack'.
17244 (print_results): Dump `output_obstack', and then proceed with the
17246 * src/files.c (compute_output_file_names, close_files): New.
17247 (output_files): Adjust.
17248 * src/main.c (main): Adjust.
17250 2001-09-23 Marc Autret <autret_m@epita.fr>
17252 * src/files.c (compute_header_macro): Computes header macro name
17253 from spec_defines_file when given.
17255 2001-09-23 Marc Autret <autret_m@epita.fr>
17257 * src/files.c (output_files): Add default extensions.
17259 2001-09-22 Akim Demaille <akim@epita.fr>
17261 * src/conflicts.c (finalize_conflicts): Rename as...
17262 (free_conflicts): this.
17264 2001-09-22 Akim Demaille <akim@epita.fr>
17266 * src/gram.c (gram_free): Rename back as...
17268 (output_token_translations): Free `token_translations'.
17269 * src/symtab.c (free_symtab): Free the tag field.
17271 2001-09-22 Akim Demaille <akim@epita.fr>
17273 Remove `translations' as it is always set to true.
17275 * src/gram.h: Adjust.
17276 * src/reader.c (packsymbols, parse_token_decl): Adjust
17277 * src/print.c (print_grammar): Adjust.
17278 * src/output.c (output_token_translations): Adjust.
17279 * src/lex.c (lex): Adjust.
17280 * src/gram.c: Be sure the set pointers to NULL.
17281 (dummy): Rename as...
17284 2001-09-22 Akim Demaille <akim@epita.fr>
17286 * configure.in: Invoke AM_LIB_DMALLOC.
17287 * src/system.h: Use dmalloc.
17288 * src/LR0.c: Be sure to have pointers initialized to NULL.
17289 (allocate_itemsets): Allocate kernel_items only if needed.
17291 2001-09-22 Akim Demaille <akim@epita.fr>
17293 * configure.in: Bump to 1.29b.
17294 * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
17295 * tests/calc.at (_AT_DATA_CALC_Y): #undef malloc so that we don't
17296 need xmalloc.c in calc.y.
17299 2001-09-21 Akim Demaille <akim@epita.fr>
17302 * Makefile.maint, config/config.guess, config/config.sub,
17303 * config/missing: Update from masters.
17304 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): No longer depend
17306 * configure.in (ALL_LINGUAS): Add `tr'.
17308 2001-09-21 Akim Demaille <akim@epita.fr>
17310 * tests/Makefile.am (package.m4): Move to...
17311 ($(srcdir)/$(TESTSUITE)): here.
17313 2001-09-20 Akim Demaille <akim@epita.fr>
17315 * src/complain.c: No longer try to be standalone: use system.h.
17316 Don't assume __STDC__ is defined to 1. Just test if it is defined.
17317 * src/complain.h: Likewise.
17318 * src/reduce.c (useless_nonterminals, inaccessable_symbols):
17319 Remove the unused variable `n'.
17320 From Albert Chin-A-Young.
17322 2001-09-18 Marc Autret <autret_m@epita.fr>
17324 * doc/bison.1: Update.
17325 * doc/bison.texinfo (Bison Options): Update --defines and --graph
17327 (Option Cross Key): Update.
17330 2001-09-18 Marc Autret <autret_m@epita.fr>
17332 * tests/regression.at: New test (comment in %union).
17334 2001-09-18 Marc Autret <autret_m@epita.fr>
17336 * src/reader.c (parse_union_decl): Do not output '/'. Let copy_comment
17338 Reported by Keith Browne.
17340 2001-09-18 Marc Autret <autret_m@epita.fr>
17342 * tests/output.at: Add tests for --defines and --graph.
17344 2001-09-18 Marc Autret <autret_m@epita.fr>
17346 * tests/output.at: Removes tests of %{header,src}_extension features.
17348 2001-09-18 Akim Demaille <akim@epita.fr>
17350 * tests/Makefile.am (package.m4): New.
17351 * tests/calc.at (_AT_CHECK_CALC): Just run `calc input'.
17352 (_AT_CHECK_CALC_ERROR): Likewise.
17353 Factor the `, ' part of verbose error messages.
17355 2001-09-18 Marc Autret <autret_m@epita.fr>
17357 * src/getargs.c (longopts): Declare --defines and --graph as options
17358 with optional arguments.
17359 * src/files.h: Add extern declarations.
17360 * src/files.c (spec_graph_file, spec_defines_file): New.
17361 (output_files): Update.
17362 Remove CPP-outed code.
17364 2001-09-18 Marc Autret <autret_m@epita.fr>
17366 Turn off %{source,header}_extension feature.
17368 * src/files.c (compute_exts_from_gf): Update.
17369 (compute_exts_from_src): Update.
17370 (output_files): CPP-out useless code.
17371 * src/files.h: Remove {header,source}_extension extern declarations.
17372 * src/reader.c (parse_dquoted_param): CPP-out.
17373 (parse_header_extension_decl): Remove.
17374 (parse_source_extension_decl): Remove.
17375 (read_declarations): Remove cases tok_{hdrext,srcext}.
17376 * src/lex.c (percent_table): Remove {header,source}_extension entries.
17377 * src/lex.h (token_t): Remove tok_hdrext and tok_srcext.
17379 2001-09-10 Akim Demaille <akim@epita.fr>
17381 * tests/output.at (AT_CHECK_BISON_FLAGS, AT_CHECK_BISON_PERCENT):
17382 (AT_CHECK_BISON_PERCENT_FLAGS): Merge into...
17383 (AT_CHECK_OUTPUT): this.
17384 Merely check ls' exit status, its output is useless.
17386 2001-09-10 Akim Demaille <akim@epita.fr>
17388 * tests/calc.at: Use m4_match.
17389 (_AT_DATA_CALC_Y): Check `yyin != NULL', not `stdin != NULL'.
17391 2001-09-10 Marc Autret <autret_m@epita.fr>,
17392 Akim Demaille <akim@epita.fr>
17394 * src/vcg.h (graph_s): color, textcolor, bordercolor are now
17396 * src/print_graph.c (print_graph): Initalize graph.layoutalgorithm
17398 * src/reader.c (parse_token_decl): Initialize token with tok_eof.
17399 * src/lex.h: Adjust prototype.
17400 (token_t): Add `tok_undef'.
17401 * src/lex.c (struct percent_table_struct): Retval is now a token_t.
17402 (parse_percent_token): Now returns token_t.
17403 Add default statement in switch.
17404 (lex): Separate `c' as an input variable, from the token_t result
17406 (unlexed): Is a token_t.
17408 2001-09-10 Akim Demaille <akim@epita.fr>
17410 * configure.in: Bump to 1.29a.
17412 2001-09-07 Akim Demaille <akim@epita.fr>
17416 2001-08-30 Akim Demaille <akim@epita.fr>
17418 * tests/atgeneral.m4, tests/atconfig.in, tests/suite.at: Remove.
17419 * m4/atconfig.m4: Remove.
17420 * tests/testsuite.at, tests/atlocal.in, tests/output.at,
17421 * tests/bison: New.
17422 * tests/regression.at, tests/calc.at: Use m4_define, AT_BANNER,
17423 m4_if, m4_patsubst, and m4_regexp.
17424 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Use an
17425 `input' file instead of echo.
17427 2001-08-29 Akim Demaille <akim@epita.fr>
17431 2001-08-29 Akim Demaille <akim@epita.fr>
17435 2001-08-29 Paul Eggert <eggert@twinsun.com>
17437 * src/bison.simple (yyparse): Don't take the address of an
17438 item before the start of an array, as that doesn't conform to
17441 2001-08-29 Robert Anisko <anisko_r@epita.fr>
17443 * doc/bison.texinfo (Location Tracking Calc): New node.
17445 2001-08-29 Paul Eggert <eggert@twinsun.com>
17447 * src/output.c (output): Do not define const, as this now
17448 causes more problems than it cures.
17450 2001-08-29 Akim Demaille <akim@epita.fr>
17452 * doc/bison.texinfo: Modernize `@node' and `@top' use: just name
17454 Be sure to tag the `detailmenu'.
17456 2001-08-29 Akim Demaille <akim@epita.fr>
17458 * Makefile.maint (do-po-update): Wget refuses to overwrite files:
17459 download in a tmp dir.
17461 2001-08-28 Marc Autret <autret_m@epita.fr>
17463 * config/depcomp: New file.
17465 2001-08-28 Marc Autret <autret_m@epita.fr>
17467 * doc/bison.1 (mandoc): Adjust.
17468 From Juan Manuel Guerrero.
17470 2001-08-28 Marc Autret <autret_m@epita.fr>
17472 * src/print_graph.c (print_state): Fix.
17474 2001-08-27 Marc Autret <autret_m@epita.fr>
17476 * src/vcg.h (classname_s, infoname_s, node_s): Constify the
17478 Echo modifications to the functions prototypes.
17479 * src/vcg.c (add_classname, add_infoname): Adjust arguments.
17481 2001-08-27 Marc Autret <autret_m@epita.fr>
17483 * src/vcg.c: Include `xalloc.h'.
17484 (add_colorentry): New.
17485 (add_classname): New.
17486 (add_infoname): New.
17487 * src/vcg.h: Add new prototypes.
17489 2001-08-27 Akim Demaille <akim@epita.fr>
17491 * Makefile.maint: Sync. again with CVS Autoconf.
17493 2001-08-27 Akim Demaille <akim@epita.fr>
17495 * Makefile.maint: Formatting changes.
17496 (po-update, cvs-update, update): New targets.
17499 2001-08-27 Akim Demaille <akim@epita.fr>
17501 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
17502 * Makefile.maint: Sync. with CVS Autoconf.
17504 2001-08-27 Marc Autret <autret_m@epita.fr>
17506 * src/vcg.h (struct infoname_s): New.
17507 (struct colorentry_s): New.
17508 (graph_s): New fields {vertical,horizontal}_order in structure.
17509 Add `infoname' field.
17510 Add `colorentry' field;
17511 * src/vcg_defaults.h (G_VERTICAL_ORDER): New.
17512 (G_HORIZONTAL_ORDER): New.
17514 (G_COLORENTRY): New.
17515 * src/vcg.c (output_graph): Add output of {vertical,horizontal}_order.
17516 Add output of `infoname'.
17517 Add output of `colorentry'.
17519 2001-08-27 Marc Autret <autret_m@epita.fr>
17521 * src/reader.c (parse_dquoted_param): Rename variable `index' to `i'.
17522 This one shadowed a global parameter.
17524 2001-08-24 Marc Autret <autret_m@epita.fr>
17526 * src/print_graph.c (node_output_size): Declared POSIX `size_t' type,
17527 instead of `unsigned'.
17528 (print_state): Do not call obstack_object_size () in obstack_grow ()
17529 to avoid macro variables shadowing.
17531 2001-08-23 Marc Autret <autret_m@epita.fr>
17533 * src/lex.c (percent_table): Typo: s/naem/name/.
17535 Normalize new options declarations.
17537 2001-08-20 Pascal Bart <pascal.bart@epita.fr>
17539 * tests/suite.at: Exercise %header_extension and %source_extension.
17541 2001-08-16 Marc Autret <autret_m@epita.fr>
17543 * src/reader.c (parse_dquoted_param): New.
17544 (parse_header_extension_decl): Use it.
17545 (parse_source_extension_decl): Likewise.
17547 2001-08-16 Marc Autret <autret_m@epita.fr>
17549 * src/vcg.c: Remove includes of `complain.h' and `xalloc.h'.
17550 (get_xxxx_str): Use assert () instead of complain ().
17551 Remove return invokations in default cases.
17552 (get_decision_str): Modify default behaviour. Remove second argument.
17553 Echo modifications on calls.
17554 (output_graph): Fix.
17556 2001-08-16 Marc Autret <autret_m@epita.fr>
17558 * src/getargs.c (usage): Update with ``-g, --graph''.
17560 2001-08-16 Marc Autret <autret_m@epita.fr>
17562 * doc/bison.texinfo (Bison Options): Add items `-g', `--graph'.
17563 (Option Cross Key): Likewise.
17564 * doc/bison.1: Update.
17566 2001-09-25 Pascal Bart <pascal.bart@epita.fr>
17568 * src/output.c (output_master_parser): Don't finish action_obstack.
17569 (output_parser): Don't care about the muscle action, here.
17570 (prepare): Copy the action_obstack in the action muscle.
17571 (output): Free action_obstack.
17573 2001-09-23 Pascal Bart <pascal.bart@epita.fr>
17575 * src/reader.c (parse_union_decl): Add new obstack union_obstack. Which
17576 will contain `%union' declaration.
17577 (parse_union_decl): Delete #line directive output.
17578 (parse_union_decl): Substitute /attrs_obstack/union_obstack for all
17579 informations about %union.
17580 (parse_union_decl): Copy the union_obstack in the muscle stype.
17581 * src/bison.simple: Add new #line directive.
17582 Add typdef %%stype YYSTYPE.
17584 2001-09-23 Pascal Bart <pascal.bart@epita.fr>
17586 * src/bison.simple: Add new `#line' directive.
17588 2001-09-22 Pascal Bart <pascal.bart@epita.fr>
17590 * src/bison.simple: New `#line' directive.
17591 * src/output.c (output_parser): Support new dynamic muscle input_line.
17593 2001-09-22 Marc Autret <autret_m@epita.fr>
17595 * src/output.c (output_master_parser): New.
17596 (output_parser): Be more re-entrant.
17598 2001-09-21 Marc Autret <autret_m@epita.fr>
17600 * src/reader.c (copy_definition, parse_union_decl): Update and use
17602 (copy_action): Likewise.
17603 Use obstack_1grow ().
17604 * src/muscle_tab.c (muscle_init): Add muscle `linef'.
17606 2001-09-21 Marc Autret <autret_m@epita.fr>
17608 * src/options.c (option_table): Adjust.
17609 * src/lex.c (parse_percent_token): Fix.
17611 2001-09-20 Pascal Bart <pascal.bart@epita.fr>
17613 * src/options.c (symtab.h): Include it, need by lex.h.
17615 2001-09-20 Pascal Bart <pascal.bart@epita.fr>
17617 * src/lex.c (parse_percent_token): Change type of variable `tx', which
17618 is now an option_table_struct*.
17619 (option_strcmp): New function option_strcmp.
17620 (parse_percent_token): Call option_strcmp.
17621 * src/getargs.c (xalloc.h, options.h): Include it.
17622 (getargs): Call create_long_option_table.
17623 (getargs): Free longopts at the end of the function.
17624 (shortopts): Move in options.c.
17625 * src/options.c (create_long_option_table): New function. Convert
17626 information from option_table to option structure.
17627 * src/reader.c (options.h): Include it.
17629 * src/Makefile.am: Adjust.
17630 * src/options.c (option_table): Create from longopts and percent_table.
17631 * src/getargs.c (longopts): Delete.
17632 * src/lex.c (struct percent_table_struct): Delete.
17633 (percent_table): Delete.
17634 (options.h): Include it.
17635 * src/options.c: Create.
17636 * src/options.h: Create.
17637 Declare enum opt_access_e.
17638 Define struct option_table_struct.
17640 2001-09-20 Marc Autret <autret_m@epita.fr>
17642 * doc/bison.texinfo: Adjust terminologies about prologue and epilogue
17645 2001-09-19 Pascal Bart <pascal.bart@epita.fr>
17647 * src/bison.simple: s/%%filename/%%skeleton.
17648 * src/muscle_tab.c (getargs.h): Include it.
17649 (muscle_init): Insert new muscle skeleton.
17651 2001-09-18 Pascal Bart <pascal.bart@epita.fr>
17653 * src/output.c (output_parser): Delete unused variable actions_dumped.
17655 2001-09-07 Pascal Bart <pascal.bart@epita.fr>
17657 * src/output.c (output): Delete call to reader_output_yylsp.
17658 * src/reader.c (reader): Likewise.
17659 * src/reader.h: Delete declaration of reader_output_yylsp.
17661 2001-09-02 Marc Autret <autret_m@epita.fr>
17663 * src/reader.c: Include muscle_tab.h.
17664 (parse_union_decl): Update.
17665 (parse_macro_decl): Rename parse_muscle_decl.
17666 Update to use renamed functions and variable.
17667 (read_declarations, copy_action, read_additionnal_code, : Updated
17668 with correct variables and functions names.
17669 (packsymbols, reader): Likewise.
17671 * src/reader.h (muscle_obstack): Extern declaration update.
17673 * src/output.c: Include muscle_tab.h
17674 In all functions using macro_insert, change by using muscle_insert ().
17675 (macro_obstack): Rename muscle_obstack.
17676 Echo modifications in the whole file.
17677 (MACRO_INSERT_INT): Rename MUSCLE_INSERT_INT.
17678 (MACRO_INSERT_STRING): Rename MUSCLE_INSERT_STRING.
17679 (MACRO_INSERT_PREFIX): Rename MUSCLE_INSERT_PREFIX.
17681 * src/muscle_tab.h: Update double inclusion macros.
17682 (macro_entry_s): Rename muscle_entry_s.
17685 * src/muscle_tab.c: Include muscle_tab.h.
17686 Rename macro_tabble to muscle_table.
17687 (mhash1, mhash2, mcmp): Use muscle_entry.
17688 (macro_init): Rename muscle_init. Update.
17689 (macro_insert): Rename muscle_insert. Update.
17690 (macro_find): Rename muscle_find. Update.
17692 * src/main.c: Include muscle_tab.h.
17693 (main): Call muscle_init ().
17694 * src/Makefile.am (bison_SOURCES): Echo modifications.
17696 2001-09-02 Marc Autret <autret_m@epita.fr>
17698 Now the files macro_tab.[ch] are named muscle_tab.[ch].
17700 * src/muscle_tab.c, src/muscle_tab.h: Add files.
17702 2001-09-02 Marc Autret <autret_m@epita.fr>
17704 * src/macrotab.c, src/macrotab.h: Remove.
17706 2001-09-01 Pascal Bart <pascal.bart@epita.fr>
17708 * src/reader.c (copy_guard): Use muscle to specify the `#line'
17711 2001-09-01 Marc Autret <autret_m@epita.fr>
17713 * tests/calc.at (exp): Now, YYERROR_VERBOSE need to be set
17714 to an explicit value to activate the feature. We do it here.
17716 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
17718 * src/output.c (prepare): Delete the `filename' muscule insertion.
17719 * src/reader.c (copy_action): Use `filename' muscule with `#line'.
17720 (parse_union_decl): Likewise.
17721 * src/macrotab.c (macro_init): Initialize filename by infile.
17723 2001-08-31 Marc Autret <autret_m@epita.fr>
17725 * src/bison.simple (YYLSP_NEEDED): New definition.
17726 * src/output.c (prepare): Add macro insertion of `locations_flag'
17728 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
17730 * src/output.c (prepare): Delete insertion of previous muscles,
17731 and insert the `prefix' muscles.
17732 * src/macrotab.c (macro_init): Likewise.
17733 (macro_init): Initialization prefix directive by `yy'.
17734 * src/bison.simple: Substitute all %%yylex, %%yychar, %%yylval,
17735 %%yydebug, %%yyerror, %%yynerrs and %%yyparse by yylex, yychar,
17736 yylval, yydebug, yyerror, yynerrs and yyparse.
17737 New directive `#define' to substitute yydebug, ... with option
17740 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
17742 * src/main.c (main): Standardize.
17743 * src/output.c (output_table_data, output_parser): Likewise.
17744 * src/macrotab.h, src/macrotab.c, src/bison.simple: Likewise.
17746 2001-08-31 Pascal Bart <pascal.bart@epita.fr>, Marc Autret <autret_m@epita.fr>
17748 * src/reader.c (read_additionnal_code): Rename %%user_code to
17750 * src/output.c (output): Rename %%declarations to %%prologue.
17751 * src/bison.simple: Echo modifications.
17753 2001-08-31 Marc Autret <autret_m@epita.fr>
17755 * src/reader.c (readgram): CleanUp.
17756 (output_token_defines): Likewise.
17757 (packsymbols): Likewise.
17758 (reader): Likewise.
17759 * src/output.c (output): CPP-out useless code.
17761 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
17763 * src/reader.c (reader): Delete obsolete call to function
17764 output_trailers and output_headers.
17765 * src/output.h: Remove obsolete functions prototypes of output_headers
17766 and output_trailers.
17768 2001-08-30 Pascal Bart <pascal.bart@epita.fr>
17770 * src/main.c: Include macrotab.h.
17771 * src/macrotab.h (macro_entry_s): Constify fields.
17772 Adjust functions prototypes.
17773 * src/macrotab.c (macro_insert): Constify key and value.
17774 (macro_find): Constify key.
17775 (macro_insert): Include 'xalloc.h'
17776 (macro_insert): Use XMALLOC.
17777 (macro_find): Constify return value.
17778 * src/output.c (output_table_data): Rename table to table_data.
17779 (output_parser): Constify macro_key, macro_value.
17781 2001-08-30 Marc Autret <autret_m@epita.fr>
17783 * src/reader.c (parse_skel_decl): New.
17784 (read_declarations): Add case `tok_skel', call parse_skel_decl ().
17785 * src/lex.h (token_t): New token `tok_skel'.
17786 * src/lex.c (percent_table): Add skeleton option entry.
17789 2001-08-29 Marc Autret <autret_m@epita.fr>
17791 * src/bison.simple: Add %%user_code directive at the end.
17792 * src/reader.c (read_additionnal_code): New.
17794 * src/output.c (output_program): Remove.
17797 2001-08-28 Marc Autret <autret_m@epita.fr>
17799 * src/output.c (output_actions): Clean up.
17800 (output_gram): CPP-out useless code.
17801 * src/reader.c (reader): Clean up, CPP-out useless code.
17803 2001-08-28 Pascal Bart <pascal.bart@epita.fr>
17805 * src/output.c (output): Copy attrs_obstack in the '%%definitions'
17807 * src/bison.simple: Add `%%definitions'.
17809 2001-08-28 Marc Autret <autret_m@epita.fr>
17811 * config/depcomp: New file.
17813 2001-08-27 Paul Eggert <eggert@twinsun.com>
17815 * src/bison.simple (yyparse): Don't take the address of an
17816 item before the start of an array, as that doesn't conform to
17819 2001-08-27 Robert Anisko <robert.anisko@epita.fr>
17821 * src/output.c (output): Remove the initialization of the macro
17822 obstack. It was done too late here.
17824 * src/reader.c (parse_macro_decl): Fix. Use of the macro obstack was
17826 (reader): Initialize the macro obstack here, since we need it to grow
17827 '%define' directives.
17829 * src/reader.h: Declare the macro obstack as extern.
17831 2001-08-27 Robert Anisko <robert.anisko@epita.fr>
17833 * src/output.c (output_parser): Fix. Store single '%' characters in
17834 the output obstack instead of throwing them away.
17836 2001-08-27 Akim Demaille <akim@epita.fr>
17838 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
17840 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
17842 * lib/Makefile.am: Adjust.
17844 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
17846 * src/bison.simple: Update and add '%%' directives.
17848 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
17850 * src/reader.c (reader): Remove calls to 'output_headers' and
17851 'output_trailers'. Remove some C output.
17852 (readgram): Disable a piece of code that was writing a default
17853 definition for 'YYSTYPE'.
17854 (reader_output_yylsp): Remove.
17855 (packsymbols): Output token defintions to a macro.
17856 (copy_definition): Disable C output.
17858 * src/reader.c (parse_macro_decl): New function used to parse macro
17860 (copy_string2): Put the body of copy_string into this new function.
17861 Add a parameter to let the caller choose whether he wants to copy the
17862 string delimiters or not.
17863 (copy_string): Be a simple call to copy_string2 with the last argument
17865 (read_declarations): Add case for macro definition.
17866 (copy_identifier): New.
17867 (parse_macro_decl): Read macro identifiers using copy_identifier
17870 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
17872 * src/output.c (prepare): Add prefixed names.
17873 (output_parser): Output semantic actions.
17874 (output_parser): Fix bug on '%%line' directives.
17876 * src/output.c (output_headers): Remove. The C code printed by this
17877 function should now be in the skeletons.
17878 (output_trailers): Remove.
17879 (output): Disable call to 'reader_output_yylsp'.
17880 (output_rule_data): Do not output tables to the table obstack.
17882 * src/output.c: Remove some C dedicated output.
17883 Improve the use of macro and output obstacks.
17884 (output_defines): Remove.
17886 * src/output.c (output_token_translations): Associate 'translate'
17887 table with a macro. No output to the table obstack.
17888 (output_gram): Same for 'rhs' and 'prhs'.
17889 (output_stos): Same for 'stos'.
17890 (output_rule_data): Same for 'r1' and 'r2'.
17891 (token_actions): Same for 'defact'.
17892 (goto_actions): Same for 'defgoto'.
17893 (output_base): Same for 'pact' and 'pgoto'.
17894 (output_table): Same for 'table'.
17895 (output_check): Same for 'check'.
17897 * src/output.c (output_table_data): New function.
17898 (output_short_table): Remove.
17899 (output_short_or_char_table): Remove.
17901 * src/output.c (output_parser): Replace most of the skeleton copy code
17902 with something new. Skeletons are now processed character by character
17903 rather than line by line, and Bison looks for '%%' macros. This is the
17904 first step in making Bison's output process (a lot) more flexible.
17905 (output_parser): Use the macro table.
17907 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
17909 * src/main.c (main): Initialize the macro table.
17911 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
17913 * src/lex.c (percent_table): Add tok_define.
17914 * src/lex.h: Add tok_define.
17916 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
17918 * src/macrotab.c: New file.
17919 * src/macrotab.h: New file.
17920 * src/Makefile.am: Update.
17922 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
17924 * lib/hash.c: New file.
17925 * lib/hash.h: New file.
17926 * lib/Makefile.am: Update.
17928 2001-08-15 Akim Demaille <akim@epita.fr>
17932 2001-08-15 Marc Autret <autret_m@epita.fr>
17934 * src/reader.c (readgram): Indent output macro YYSTYPE.
17935 (packsymbols): Likewise.
17936 (output_token_defines): Likewise.
17937 * src/files.c: Standardize.
17938 (compute_header_macro): New.
17939 (defines_obstack_save): New. Use compute_header_macro.
17940 (output_files): Update. Use defines_obstack_save.
17942 2001-08-15 Akim Demaille <akim@epita.fr>
17944 * doc/bison.texinfo (Table of Symbols): Document
17945 YYSTACK_USE_ALLOCA.
17947 2001-08-15 Akim Demaille <akim@epita.fr>
17949 * missing: Update from CVS Automake.
17950 * config/config.guess, config/config.sub, config/texinfo.tex:
17951 Update from gnu.org.
17953 2001-08-15 Akim Demaille <akim@epita.fr>
17955 * Makefile.maint: Sync with CVS Autoconf.
17957 2001-08-14 Pascal Bart <pascal.bart@epita.fr>
17959 * doc/bison.texinfo: Include GNU Free Documentation License from
17961 * doc/fdl.texi: Add to package.
17963 2001-08-14 Marc Autret <autret_m@epita.fr>
17965 Turn on %{source,header}_extension features.
17967 * src/lex.c (percent_table): Un-CPP out header_extension and
17969 * src/files.c (compute_exts_from_gf): Compare pointers with NULL.
17970 (compute_exts_from_src): Remove conditions. It restores priorities
17973 2001-08-14 Marc Autret <autret_m@epita.fr>
17975 * src/files.c (compute_base_names): Add extensions computing when
17976 `--file-prefix' used.
17977 Standardize function calls.
17979 2001-08-13 Marc Autret <autret_m@epita.fr>
17981 * src/bison.simple (YYSTACK_USE_ALLOCA): Changed to allow users
17982 defining it (defined but null disables alloca).
17984 2001-08-13 Marc Autret <autret_m@epita.fr>
17986 * src/bison.simple (_yy_memcpy): CPP reformat.
17988 2001-08-13 Pascal Bart <pascal.bart@epita.fr>
17990 * tests/atconfig.in (CPPFLAGS): Fix.
17992 2001-08-10 Pascal Bart <pascal.bart@epita.fr>
17994 * doc/bison.texinfo: Include GNU General Public License from
17996 * doc/gpl.texi: Add to package.
17998 2001-08-10 Marc Autret <autret_m@epita.fr>
18000 * src/print_graph.h: Fix.
18001 * src/reader.c (read_declarations): Use parse_header_extension_decl ().
18003 2001-08-10 Akim Demaille <akim@epita.fr>
18005 * src/system.h: Provide default declarations for stpcpy, strndup,
18008 2001-08-10 Robert Anisko <anisko_r@epita.fr>
18010 * doc/bison.texinfo (Locations): Update @$ stuff.
18012 2001-08-09 Robert Anisko <anisko_r@epita.fr>
18014 * src/bison.simple (YYLLOC_DEFAULT): Update.
18017 2001-08-08 Marc Autret <autret_m@epita.fr>
18019 * doc/bison.texinfo: Change @samp{$<@dots{}>} to
18020 @samp{$<@dots{}>@var{n}} in Section Actions in Mid-Rule.
18021 Reported by Fabrice Bauzac.
18023 2001-08-08 Marc Autret <autret_m@epita.fr>
18025 * src/vcg_default.h: Use NULL instead of 0 to initialize pointers.
18026 * src/vcg.c (output_node): Fix.
18027 * src/vcg.h: Cleanup.
18028 * src/print_graph.c: Add comments.
18029 (node_output_size): New global variable. Simplify the formatting of
18030 the VCG graph output.
18031 (print_actions): Unused code is now used. It notifies the final state
18032 and no action states in the VCG graph. It also give the reduce actions.
18033 The `shift and goto' edges are red and the `go to state' edges are
18035 Get the current node name and node_obstack by argument.
18036 (node_obstack): New variable.
18037 (print_state): Manage node_obstack.
18038 (print_core): Use node_obstack given by argument.
18039 A node is not only computed here but in print_actions also.
18040 (print_graph): CPP out useless code instead of commenting it.
18042 2001-08-07 Pascal Bart <pascal.bart@epita.fr>
18044 * tests/atconfig.in (CPPFLAGS): Fix.
18046 2001-08-07 Akim Demaille <akim@epita.fr>
18048 * src/print_graph.c (quote): New.
18049 (print_core): Use it.
18051 2001-08-06 Akim Demaille <akim@epita.fr>, Marc Autret <autret_m@epita.fr>
18053 * src/vcg.c (complain.h): Include it.
18054 Unepitaize `return' invocations.
18055 [NDEBUG] (main): Remove.
18056 * src/vcg.h (node_t, edge_t, graph_t): Constify the char * members.
18057 * src/files.c (open_files): Initialize graph_obstack.
18058 * src/print_graph.c (print_actions): CPP out useless code.
18059 (print_core): Don't output the last `\n' in labels.
18061 * src/files.c (output_files): Output the VCG file.
18062 * src/main.c (main): Invoke print_graph ();
18064 2001-08-06 Marc Autret <autret_m@epita.fr>
18066 Automaton VCG graph output.
18067 Using option ``-g'' or long option ``--graph'', you can generate
18068 a gram_filename.vcg file containing a VCG description of the LALR (1)
18069 automaton of your grammar.
18071 * src/main.c: Call to print_graph() function.
18072 * src/getargs.h: Update.
18073 * src/getargs.c (options): Update to catch `-g' and `--graph' options.
18074 (graph_flag): New flag.
18075 (longopts): Update.
18076 (getargs): Add case `g'.
18077 * src/files.c (graph_obstack): New obstack struct.
18078 (open_files): Initialize new obstack.
18079 (output_files): Saves graph_obstack if required.
18080 * src/files.h (graph_obstack): New extern declaration.
18081 * src/Makefile.am: Add new source files.
18083 2001-08-06 Marc Autret <autret_m@epita.fr>
18085 * src/print_graph.c, src/print_graph.h (graph): New.
18086 * src/vcg.h: New file.
18087 * src/vcg.c: New file, VCG graph handling.
18089 2001-08-06 Marc Autret <autret_m@epita.fr>
18091 Add of %source_extension and %header_extension which specify
18092 the source or/and the header output file extension.
18094 * src/files.c (compute_base_names): Remove initialisation of
18095 src_extension and header_extension.
18096 (compute_exts_from_gf): Update.
18097 (compute_exts_from_src): Update.
18098 (output_files): Update.
18099 * src/reader.c (parse_header_extension_decl): New.
18100 (parse_source_extension_decl): New.
18101 (read_declarations): New case statements for the new tokens.
18102 * src/lex.c (percent_table): Add entries for %source_extension
18103 and %header_extension.
18104 * src/lex.h (token_e): New tokens tok_hdrext and tok_srcext.
18106 2001-08-06 Marc Autret <autret_m@epita.fr>
18108 * configure.in: Bump to 1.28c.
18109 * doc/bison.texinfo: Texinfo thingies.
18111 2001-08-04 Pascal Bart <pascal.bart@epita.fr>
18113 * tests/atconfig.in (CPPFLAGS): Add.
18114 * tests/calc.at (AT_CHECK): Use CPPFLAGS.
18116 2001-08-03 Akim Demaille <akim@epita.fr>
18120 2001-08-03 Akim Demaille <akim@epita.fr>
18122 * tests/Makefile.am (check-local): Ship testsuite.
18123 * tests/calc.at (_AT_DATA_CALC_Y): Prototype all the functions.
18124 Include `string.h'.
18126 2001-08-03 Akim Demaille <akim@epita.fr>
18128 * configure.in: Try using -Wformat when compiling.
18130 2001-08-03 Akim Demaille <akim@epita.fr>
18132 * configure.in: Bump to 1.28b.
18134 2001-08-03 Akim Demaille <akim@epita.fr>
18136 * src/complain.c: Adjust strerror_r portability issues.
18138 2001-08-03 Akim Demaille <akim@epita.fr>
18142 2001-08-03 Akim Demaille <akim@epita.fr>
18144 * src/getargs.c, src/getarg.h (skeleton)): Constify.
18145 * src/lex.c (literalchar): Avoid name clashes on `buf'.
18146 * src/getargs.c: Include complain.h.
18147 * src/files.c, src/files.h (skeleton_find): Avoid name clashes.
18148 * lib/quotearg.c, lib/quotearg.h: Update from fileutils 4.1.
18150 2001-08-03 Akim Demaille <akim@epita.fr>
18152 * src/reader.c (readgram): Display hidden chars in error messages.
18154 2001-08-03 Akim Demaille <akim@epita.fr>
18156 Update to gettext 0.10.39.
18158 2001-08-03 Akim Demaille <akim@epita.fr>
18160 * lib/strspn.c: New.
18162 2001-08-01 Marc Autret <autret_m@epita.fr>
18164 * doc/bison.texinfo: Update.
18165 * doc/bison.1 (mandoc): Update.
18166 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove .c and .h.
18167 * src/files.c: Support output files extensions computing.
18168 (src_extension): New static variable.
18169 (header_extension): New static variable.
18170 (tr): New function.
18171 (get_extension_index): New function, gets the index of an extension
18172 filename in a string.
18173 (compute_exts_from_gf): New function, computes extensions from the
18174 grammar file extension.
18175 (compute_exts_from_src): New functions, computes extensions from the
18176 C source file extension, file given by ``-o'' option.
18177 (compute_base_names): Update.
18178 (output_files): Update.
18180 2001-08-01 Robert Anisko <anisko_r@epita.fr>
18182 * doc/bison.texi: Document @$.
18183 (Locations): New section.
18185 2001-07-18 Akim Demaille <akim@epita.fr>
18187 * Makefile.maint, GNUmakefile: New, from Autoconf 2.52.
18188 * config/prev-version.txt, config/move-if-change: New.
18189 * Makefile.am: Adjust.
18191 2001-07-08 Pascal Bart <pascal.bart@epita.fr>
18193 * src/bison.simple (yyparse): Suppress warning `comparaison
18194 between signed and unsigned'.
18196 2001-07-05 Pascal Bart <pascal.bart@epita.fr>
18198 * src/getargs.h (raw_flag): Remove.
18199 * src/getargs.c: Die on `-r'/`--raw'.
18200 * src/lex.c (parse_percent_token): Die on `%raw'.
18201 * src/reader.c (output_token_defines): Suppress call to `raw_flag'.
18202 * tests/calc.at: Suppress test with option `--raw'.
18204 2001-07-14 Akim Demaille <akim@epita.fr>
18207 * configure.in: Require Autoconf 2.50.
18208 Update to gettext 0.10.38.
18210 2001-03-16 Akim Demaille <akim@epita.fr>
18212 * doc/bison.texinfo: ANSIfy the examples.
18214 2001-03-16 Akim Demaille <akim@epita.fr>
18216 * getargs.c (skeleton): New variable.
18217 (longopts): --skeleton is a new option.
18218 (shortopts, getargs): -S is a new option.
18219 * getargs.h: Declare skeleton.
18220 * output.c (output_parser): Use it.
18222 2001-03-16 Akim Demaille <akim@epita.fr>
18224 * m4/strerror_r.m4: New.
18225 * m4/error.m4: Run AC_FUNC_STRERROR_R.
18226 * lib/error.h, lib/error.c: Update.
18228 2001-03-16 Akim Demaille <akim@epita.fr>
18230 * src/getargs.c (longopts): Clean up.
18232 2001-02-21 Akim Demaille <akim@epita.fr>
18234 * src/reader.c (gensym): `gensym_count' is your own.
18235 Use a static buf to create the symbol name, as token_buffer is no
18238 2001-02-08 Akim Demaille <akim@epita.fr>
18240 * src/conflicts.c (conflict_report): Be sure not to append to res
18241 between two calls, which could happen if both first sprintf were
18242 skipped, but not the first cp += strlen.
18244 2001-02-08 Akim Demaille <akim@epita.fr>
18246 * lib/memchr.c, lib/stpcpy.c, lib/strndup.c, lib/strnlen.c:
18247 New, from fileutils 4.0.37.
18248 * configure.in: Require Autoconf 2.49c. I took some time before
18249 making this decision. This is the only way out for portability
18250 issues in Bison, it would mean way too much duplicate effort to
18251 import in Bison features implemented in 2.49c since 2.13.
18252 AC_REPLACE_FUNCS and AC_CHECK_DECLS the functions above.
18254 2001-02-02 Akim Demaille <akim@epita.fr>
18256 * lib/malloc.c, lib/realloc.c: New, from the fileutils 4.0.37.
18257 * lib/xalloc.h, lib/xmalloc.c: Update.
18259 2001-01-19 Akim Demaille <akim@epita.fr>
18261 Get rid of the ad hoc handling of token_buffer in the scanner: use
18264 * src/lex.c (token_obstack): New.
18265 (init_lex): Initialize it. No longer call...
18266 (grow_token_buffer): this. Remove it.
18267 Adjust all the places which used it to use the obstack.
18269 2001-01-19 Akim Demaille <akim@epita.fr>
18271 * src/lex.h: Rename all the tokens:
18272 s/\bENDFILE\b/tok_eof/g;
18273 s/\bIDENTIFIER\b/tok_identifier/g;
18275 Let them be enums, not #define, to ease debugging.
18276 Adjust all the code.
18278 2001-01-18 Akim Demaille <akim@epita.fr>
18280 * src/lex.h (MAXTOKEN, maxtoken, grow_token_buffer): Remove, private.
18281 * src/lex.c (maxtoken, grow_token_buffer): Static.
18283 2001-01-18 Akim Demaille <akim@epita.fr>
18285 Since we now use obstacks, more % directives can be enabled.
18287 * src/lex.c (percent_table): Also accept `%yacc',
18288 `%fixed_output_files', `%defines', `%no_parser', `%verbose', and
18290 Handle the actions for `%semantic_parser' and `%pure_parser' here,
18291 instead of returning a token.
18292 * src/lex.h (SEMANTIC_PARSER, PURE_PARSER): Remove, unused.
18293 * src/reader.c (read_declarations): Adjust.
18294 * src/files.c (open_files): Don't call `compute_base_names', don't
18295 compute `attrsfile' since they depend upon data which might be
18296 *in* the input file now.
18297 (output_files): Do it here.
18298 * src/output.c (output_headers): Document the fact that this patch
18299 introduces a guaranteed SEGV for semantic parsers.
18300 * doc/bison.texinfo: Document them.
18301 * tests/suite.at: Exercise these %options.
18303 2000-12-20 Akim Demaille <akim@epita.fr>
18305 Also handle the output file (--verbose) with obstacks.
18307 * files.c (foutput): Remove.
18308 (output_obstack): New.
18309 Adjust all dependencies.
18310 * src/conflicts.c: Return a string.
18311 * src/system.h (obstack_grow_string): Rename as...
18312 (obstack_sgrow): this. Be ready to work with non literals.
18313 (obstack_fgrow4): New.
18315 2000-12-20 Akim Demaille <akim@epita.fr>
18317 * src/files.c (open_files): Fix the computation of short_base_name
18318 in the case of `-o foo.tab.c'.
18320 2000-12-20 Akim Demaille <akim@epita.fr>
18322 * src/reader.c (copy_string, copy_comment, copy_comment2, copy_at)
18323 (copy_dollar): Now that everything uses obstacks, get rid of the
18326 2000-12-20 Akim Demaille <akim@epita.fr>
18328 * src/files.c (open_files): Actually the `.output' file is based
18329 on the short_base_name, not base_name.
18330 * tests/suite.at (Checking output file names): Adjust.
18332 2000-12-20 Akim Demaille <akim@epita.fr>
18334 * src/bison.s1: Remove, we now use directly...
18335 * src/bison.simple: this.
18336 * src/Makefile.am: Use pkgdata instead of data.
18338 2000-12-20 Akim Demaille <akim@epita.fr>
18340 * src/files.c (guard_obstack): New.
18341 (open_files): Initialize it.
18342 (output_files): Dump it...
18343 * src/files.h: Export it.
18344 * src/reader.c (copy_guard): Use it.
18346 2000-12-19 Akim Demaille <akim@epita.fr>
18348 * src/files.c (outfile, defsfile, actfile): Removed as global
18350 (open_files): Don't compute them.
18351 (output_files): Adjust.
18352 (base_name, short_base_name): Be global.
18353 Adjust dependencies.
18355 2000-12-19 Akim Demaille <akim@epita.fr>
18357 * src/files.c (strsuffix): New.
18358 (stringappend): Be just like strcat but allocate.
18359 (base_names): Eve out from open_files.
18360 Try to simplify the rather hairy computation of base_name and
18362 (open_files): Use it.
18363 * tests/suite.at (Checking output file names): New test.
18365 2000-12-19 Akim Demaille <akim@epita.fr>
18367 * src/system.h (obstack_grow_literal_string): Rename as...
18368 (obstack_grow_string): this.
18369 * src/output.c (output_parser): Recognize `%% actions' instead of
18371 * src/bison.s1: s/$/%% actions/.
18372 * src/bison.hairy: Likewise.
18374 2000-12-19 Akim Demaille <akim@epita.fr>
18376 * src/output.c (output_parser): Compute the `#line' lines when
18378 * src/Makefile.am (bison.simple): Be a simple copy of bison.s1.
18379 Suggested by Hans Aberg.
18381 2000-12-19 Akim Demaille <akim@epita.fr>
18383 Let the handling of the skeleton files be local to the procedures
18386 * src/files.c (xfopen, xfclose, skeleton_find, guardfile): No
18388 (fparser, open_extra_files): Remove.
18389 (open_files, output_files): Don't take care of fparser.
18390 * src/files.h: Adjust.
18391 * src/output.c (output_parser): Open and close the file to the
18393 * src/reader.c (read_declarations): When %semantic_parser, open
18396 2000-12-19 Akim Demaille <akim@epita.fr>
18398 * src/file.h (BISON_SIMPLE, BISON_HAIRY): Move from here...
18399 * src/system.h (BISON_SIMPLE, BISON_HAIRY): ... to here.
18401 2000-12-19 Akim Demaille <akim@epita.fr>
18403 * src/files.c (open_files): Yipee! We no longer need all the code
18404 looking for `/tmp' since we have no tmp file.
18406 2000-12-19 Akim Demaille <akim@epita.fr>
18408 * src/system.h (EXT_TAB, EXT_OUTPUT, EXT_STYPE_H, EXT_GUARD_C):
18410 * src/files.c (open_files): Less dependency on MSDOS etc.
18412 2000-12-14 Akim Demaille <akim@epita.fr>
18414 * src/bison.s1 (YYLLOC_DEFAULT): New macro.
18415 Provide a default definition.
18416 Use it when executing the default @ action.
18417 * src/reader.c (reader_output_yylsp): No longer include
18418 `timestamp' and `text' in the default YYLTYPE.
18420 2000-12-12 Akim Demaille <akim@epita.fr>
18422 * src/reader.c (copy_definition, parse_union_decl, copy_action)
18423 (copy_guard): Quote the file names.
18424 Reported by Laurent Mascherpa.
18426 2000-12-12 Akim Demaille <akim@epita.fr>
18428 * src/output.c (output_headers, output_program, output): Be sure
18429 to escape special characters when outputting filenames.
18430 (ACTSTR_PROLOGUE, ACTSTR_EPILOGUE): Remove.
18431 (output_headers): Don't depend on them, Use ACTSTR.
18433 2000-11-17 Akim Demaille <akim@epita.fr>
18435 * lib/obstack.h: Formatting changes.
18436 (obstack_grow, obstack_grow0): Don't cast WHERE at all: it
18437 prevents type checking.
18438 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
18439 cast the value to (void *): assigning a `foo *' to a `void *'
18441 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
18442 * src/reader.c (parse_union_decl): Typo: use obstack_1grow to
18445 2000-11-17 Akim Demaille <akim@epita.fr>
18447 * tests/Makefile.am (suite.m4, regression.m4, calc.m4): Rename
18449 (suite.m4, regression.m4, calc.m4): these.
18450 * tests/atgeneral.m4: Update from CVS Autoconf.
18452 2000-11-17 Akim Demaille <akim@epita.fr>
18454 * tests/regression.m4 (%union and --defines): New test,
18455 demonstrating a current bug in the obstack implementation.
18457 2000-11-17 Akim Demaille <akim@epita.fr>
18459 * src/bison.s1 (_YY_DECL_VARIABLES, YY_DECL_VARIABLES): New
18461 Use them to declare the variables which are global or local to
18464 2000-11-17 Akim Demaille <akim@epita.fr>
18466 * acconfig.h: Remove, no longer used.
18468 2000-11-07 Akim Demaille <akim@epita.fr>
18470 * src: s/Copyright (C)/Copyright/g.
18472 2000-11-07 Akim Demaille <akim@epita.fr>
18474 * src/reader.c (reader): #define YYLSP_NEEDED to 1 instead of just
18476 * src/bison.s1: s/#ifdef YYLSP_NEEDED/#if YYLSP_NEEDED/.
18478 2000-11-07 Akim Demaille <akim@epita.fr>
18480 * src/bison.s1 (YYLEX): Use #if instead of #ifdef.
18481 Merge in a single CPP if/else.
18483 2000-11-07 Akim Demaille <akim@epita.fr>
18485 * src/output.c (output): Remove useless variables.
18486 * lib/obstack.c (obstack_grow, obstack_grow0): Rename the second
18487 argument `data' for consistency with the prototypes.
18488 Qualify it `const'.
18489 (obstack_copy, obstack_copy0): Rename the second argument as
18490 `address' for consistency. Qualify it `const'.
18491 * lib/obstack.h (obstack_copy, obstack_copy0, obstack_grow)
18492 (obstack_grow0, obstack_ptr_grow, obstack_ptr_grow_fast): Qualify
18493 `const' their input argument (`data' or `address').
18494 Adjust the corresponding macros to include `const' in casts.
18496 2000-11-03 Akim Demaille <akim@epita.fr>
18498 * src/Makefile.am (INCLUDES): s/PFILE/BISON_SIMPLE/.
18499 s/PFILE1/BISON_HAIRY/.
18500 Adjust dependencies.
18502 2000-11-03 Akim Demaille <akim@epita.fr>
18504 For some reason, this was not applied.
18506 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
18507 `unlink': it's no longer used.
18509 2000-11-03 Akim Demaille <akim@epita.fr>
18511 * src/files.c (skeleton_find): New function, eved out of...
18512 (open_files, open_extra_files): here.
18514 2000-11-03 Akim Demaille <akim@epita.fr>
18516 Don't use `atexit'.
18518 * src/files.c (obstack_save): New function.
18519 (done): Rename as...
18520 (output_files): this.
18521 Use `obstack_save'.
18522 * src/main.c (main): Don't use `atexit' to register `done', since
18523 it no longer has to remove tmp files, just call `output_files'
18524 when there are no errors.
18526 2000-11-02 Akim Demaille <akim@epita.fr>
18528 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
18529 `unlink': it's no longer used.
18530 * src/files.h: Formatting changes.
18532 2000-11-02 Akim Demaille <akim@epita.fr>
18534 Remove the last uses of mktemp and unlink/delete.
18536 * src/files.c (fdefines, ftable): Removed.
18537 (defines_ostack, table_obstack): New.
18538 Adjust dependencies of the former into uses of the latter.
18539 * src/output.c (output_short_or_char_table, output_short_table):
18540 Convert to using obstacks.
18541 * src/reader.c (copy_comment2): Accept one FILE * and two
18543 (output_token_defines, reader_output_yylsp): Use obstacks.
18544 * src/system.h (obstack_fgrow3): New.
18545 * po/POTFILES.in: Adjust.
18547 2000-11-01 Akim Demaille <akim@epita.fr>
18549 Change each use of `fattrs' into a use of `attrs_obstack'.
18551 * src/reader.c (copy_at): Typo: s/yylloc/yyloc/.
18552 * src/files.c (fattrs): Remove.
18553 (attrs_obstack): New.
18554 Adjust all dependencies.
18555 (done): If SEMANTIC_PARSER, dump attrs_obstack into attrsfile.
18557 2000-11-01 Akim Demaille <akim@epita.fr>
18559 Introduce obstacks.
18560 Change each use of `faction' into a use of `action_obstack'.
18562 * lib/obstack.h, lib/obstack.c: New files.
18563 * src/files.c (faction): Remove.
18564 (action_obstack): New.
18565 Adjust all dependencies.
18567 2000-10-20 Akim Demaille <akim@epita.fr>
18569 * lib/quote.h (PARAMS): New macro. Use it.
18571 2000-10-16 Akim Demaille <akim@epita.fr>
18573 * src/output.c (output_short_or_char_table): New function.
18574 (output_short_table, output_token_translations): Use it.
18575 (goto_actions): Use output_short_table.
18577 2000-10-16 Akim Demaille <akim@epita.fr>
18579 * src/symtab.c (bucket_new): New function.
18582 * src/output.c (output_short_table): New argument to display the
18583 comment associated with the table.
18584 Adjust dependencies.
18585 (output_gram): Use it.
18586 (output_rule_data): Nicer output layout for YYTNAME.
18588 2000-10-16 Akim Demaille <akim@epita.fr>
18590 * src/lex.c (read_typename): New function.
18592 * src/reader.c (copy_dollar): Likewise.
18594 2000-10-16 Akim Demaille <akim@epita.fr>
18596 * src/reader.c (copy_comment2): Expect the input stream to be on
18597 the `/' which is suspected to open a comment, instead of being
18598 called after `//' or `/*' was read.
18599 (copy_comment, copy_definition, parse_union_decl, copy_action)
18600 (copy_guard): Adjust.
18602 2000-10-16 Akim Demaille <akim@epita.fr>
18604 * src/reader.c (parse_expect_decl): Use `skip_white_space' and
18605 `read_signed_integer'.
18607 2000-10-16 Akim Demaille <akim@epita.fr>
18609 * src/reader.c (copy_dollar): New function.
18610 (copy_guard, copy_action): Use it.
18612 2000-10-16 Akim Demaille <akim@epita.fr>
18614 * lib/quote.h, lib/quote.c, lib/quotearg.h, lib/quotearg.c:
18615 * m4/prereq.m4, m4/c-bs-a.m4, m4/mbstate.m4:
18616 New files, from Fileutils 4.0.27.
18617 * src/main.c (printable_version): Remove.
18618 * src/lex.c, src/reader.c: Use `quote'.
18620 2000-10-04 Akim Demaille <akim@epita.fr>
18622 * lib/error.c, lib/error.h: New files, needed by xmalloc.c.
18624 2000-10-04 Akim Demaille <akim@epita.fr>
18626 * doc/bison.texinfo: Various typos spotted by Neil Booth.
18628 2000-10-04 Akim Demaille <akim@epita.fr>
18630 When a literal string is used to define two different tokens,
18631 `bison -v' segfaults.
18632 Reported by Piotr Gackiewicz, and fixed by Neil Booth.
18634 * tests/regression.m4: New file.
18635 Include the core of the sample provided by Piotr Gackiewicz.
18636 * src/reader.c (parse_token_decl): Diagnose bad cases, and proceed
18639 2000-10-04 Akim Demaille <akim@epita.fr>
18641 * src/reader.c (parse_expect_decl): Keep `count' within the size
18645 2000-10-02 Paul Eggert <eggert@twinsun.com>
18647 * bison.s1 (yyparse): Assign the default value
18648 unconditionally, to avoid a GCC warning and make the parser a
18651 2000-10-02 Akim Demaille <akim@epita.fr>
18653 * src/getargs.c (getargs): Don't dump `--help' on unrecognized
18656 2000-10-02 Akim Demaille <akim@epita.fr>
18658 * src/derives.c, src/print.c, src/reduce.c: To ease the
18659 translation, move some `\n' out of the translated strings.
18661 2000-10-02 Akim Demaille <akim@epita.fr>
18663 The location tracking mechanism is precious for parse error
18664 messages. Nevertheless, it is enabled only when `@n' is used in
18665 the grammar, which is a different issue (you can use it in error
18666 message, but not in the grammar per se). Therefore, there should
18667 be another means to enable it.
18669 * src/getargs.c (getargs): Support `--locations'.
18670 (usage): Report it.
18671 * src/getargs.h (locationsflag): Export it.
18672 * src/lex.c (percent_table): Support `%locations'.
18673 * src/reader.c (yylsp_needed): Remove this variable, now replaced
18674 with `locationsflag'.
18675 * doc/bison.texinfo: Document `--locations' and `%locations'.
18677 * tests/calc.m4: Test it.
18679 For regularity of the names, replace each
18680 (nolineflag, toknumflag, rawtokenumflag, noparserflag): with...
18681 (no_lineflag, token_tableflag, rawflag, no_parserflag): this.
18682 In addition replace each `flag' with `_flag'.
18684 2000-10-02 Akim Demaille <akim@epita.fr>
18686 Also test parse error messages, including with YYERROR_VERBOSE.
18688 * tests/calc.m4 (calc.y): Add support for `exp = exp' (non
18690 Use it to check the computations.
18691 Use it to check `nonassoc' is honored.
18692 (AT_DATA_CALC_Y): Equip `calc.y' with YYERROR_VERBOSE when passed
18693 `--yyerror-verbose'.
18694 (_AT_CHECK_CALC): Adjust to this option.
18695 (_AT_CHECK_CALC_ERROR): New macro to check parse error messages.
18697 2000-10-02 Akim Demaille <akim@epita.fr>
18699 Test also `--verbose', `--defines' and `--name-prefix'. Testing
18700 the latter demonstrates a flaw in the handling of non debugging
18701 parsers introduced by myself on 2000-03-16: `#define yydebug 0'
18702 was used in order to simplify:
18718 unfortunately this leads to a CPP conflict when
18719 `--name-prefix=foo' is used since it produces `#define yydebug
18722 * src/bison.s1 [!YYDEBUG]: Do not define yydebug.
18723 (YYDPRINTF): New macro.
18725 * tests/calc.m4 (AT_CHECK_CALC): Do require a title, build it from
18727 Also test `--verbose', `--defines' and `--name-prefix'.
18729 2000-10-02 Akim Demaille <akim@epita.fr>
18731 Improve the readability of the produced parsers.
18733 * src/bison.s1: Formatting changes.
18734 Improve the comment related to the `$' mark.
18735 (yydefault): Don't fall through to `yyresume': `goto' there.
18736 * src/output.c (output_parser): When the `$' is met, skip the end
18738 New variable, `number_of_dollar_signs', to check there's exactly
18739 one `$' in the parser skeleton.
18741 2000-10-02 Akim Demaille <akim@epita.fr>
18743 * lib/xstrdup.c: New file, from the fileutils.
18744 * src/reader.c (parse_token_decl, get_type_name, parse_type_decl)
18745 (parse_assoc_decl, parse_thong_decl, get_type): Use `xstrdup'
18746 instead of strlen + xmalloc + strcpy.
18747 * src/symtab.c (copys): Remove, use xstrdup instead.
18749 2000-10-02 Akim Demaille <akim@epita.fr>
18751 * src/gram.h (associativity): New enum type which replaces the
18752 former CPP macros `RIGHT_ASSOC', `LEFT_ASSOC' and `NON_ASSOC' with
18753 `right_assoc', `left_assoc' and `non_assoc'.
18754 Adjust all dependencies.
18755 * src/reader.c: Formatting changes.
18756 (LTYPESTR): Don't define it, use it as a literal in
18757 `reader_output_yylsp'.
18758 * src/symtab.h (symbol_class): New enum type which replaces the
18759 former CPP macros `SUNKNOWN', `STOKEN and `SNTERM' with
18760 `sunknown', `stoken and `snterm'.
18762 2000-10-02 Akim Demaille <akim@epita.fr>
18764 * src/getargs.c (fixed_outfiles): Rename as...
18765 (yaccflag): for consistency and accuracy.
18766 Adjust dependencies.
18768 2000-10-02 Akim Demaille <akim@epita.fr>
18770 Use the more standard files `xalloc.h' and `xmalloc.c' instead of
18771 Bison's `allocate.c' and `alloc.h'. This patch was surprisingly
18772 difficult and introduced a lot of core dump. It turns out that
18773 Bison used an implementation of `xmalloc' based on `calloc', and
18774 at various places it does depend upon the initialization to 0. I
18775 have not tried to isolate the pertinent places, and all the former
18776 calls to Bison's `xmalloc' are now using `XCALLOC'. Someday,
18777 someone should address this issue.
18779 * src/allocate.c, src/alloc.h, m4/bison-decl.m4: Remove.
18780 * lib/xmalloc.c, lib/xalloc.h, m4/malloc.m4, m4/realloc.m4: New
18782 Adjust dependencies.
18783 * src/warshall.h: New file.
18786 2000-10-02 Akim Demaille <akim@epita.fr>
18788 Various anti-`extern in *.c' changes.
18790 * src/system.h: Include `assert.h'.
18792 2000-10-02 Akim Demaille <akim@epita.fr>
18794 * src/state.h (nstates, final_state, first_state, first_shift)
18795 (first_reduction): Move their exportation from here...
18796 * src/LR0.h: to here.
18797 Adjust dependencies.
18798 * src/getargs.c (statisticsflag): New variable.
18799 Add support for `--statistics'.
18800 Adjust dependencies.
18802 Remove a lot of now useless `extern' statements in most files.
18804 2000-10-02 Akim Demaille <akim@epita.fr>
18806 * src/LR0.h: New file.
18809 2000-10-02 Akim Demaille <akim@epita.fr>
18811 * src/print.h: New file.
18813 * src/print.c: Formatting and ordering changes.
18814 (verbose, terse): Replace with...
18815 (print_results): this new function.
18816 Adjust dependencies.
18818 2000-10-02 Akim Demaille <akim@epita.fr>
18820 * src/conflicts.c (conflict_report): New function.
18821 (conflict_log, verbose_conflict_log): Replace with...
18822 (print_conflicts): this function.
18823 Adjust dependencies.
18824 * src/conflicts.h: New file.
18825 Propagate its inclusion.
18827 2000-10-02 Akim Demaille <akim@epita.fr>
18829 * src/nullable.h: New file.
18830 Propagate its inclusion.
18831 * src/nullable.c: Formatting changes.
18833 2000-10-02 Akim Demaille <akim@epita.fr>
18835 * src/reduce.h: New file.
18836 Propagate its inclusion.
18837 * src/reduce.c: Topological sort and other formatting changes.
18838 (bool, TRUE, FALSE): Move their definition to...
18839 * src/system.h: here.
18841 2000-10-02 Akim Demaille <akim@epita.fr>
18843 * src/files.c: Formatting changes.
18844 (tryopen, tryclose, openfiles): Rename as...
18845 (xfopen, xfclose, open_files): this.
18846 (stringappend): static.
18847 * src/files.h: Complete the list of exported symbols.
18850 2000-10-02 Akim Demaille <akim@epita.fr>
18852 * src/reader.h: New file.
18853 Propagate its use instead of tedious list of `extern' and
18855 * src/reader.c: Formatting changes, topological sort,
18858 2000-10-02 Akim Demaille <akim@epita.fr>
18860 * src/lex.h: Prototype `lex.c' exported functions.
18861 * src/reader.c: Adjust.
18862 * src/lex.c: Formatting changes.
18863 (safegetc): Rename as...
18866 2000-10-02 Akim Demaille <akim@epita.fr>
18868 * src/lalr.h: New file.
18869 Propagate its inclusion instead of prototypes and `extern'.
18870 * src/lalr.c: Formatting changes, topological sorting etc.
18872 2000-10-02 Akim Demaille <akim@epita.fr>
18874 * src/output.c (token_actions): Introduce a temporary array,
18875 YYDEFACT, that makes it possible for this function to use
18876 output_short_table.
18878 2000-10-02 Akim Demaille <akim@epita.fr>
18880 `user_toknums' is output as a `short[]' in `output.c', while it is
18881 defined as a `int[]' in `reader.c'. For consistency with the
18882 other output tables, `user_toknums' is now defined as a table of
18885 * src/reader.c (user_toknums): Be a short table instead of an int
18887 Adjust dependencies.
18889 Factor the short table outputs.
18891 * src/output.c (output_short_table): New function.
18892 * src/output.c (output_gram, output_stos, output_rule_data)
18893 (output_base, output_table, output_check): Use it.
18895 2000-10-02 Akim Demaille <akim@epita.fr>
18897 * src/output.c (output): Topological sort of the functions, in
18898 order to get rid of the `static' prototypes.
18899 No longer use `register'.
18900 * src/output.h: New file.
18901 Propagate its inclusion in files explicitly prototyping functions
18904 2000-09-21 Akim Demaille <akim@epita.fr>
18906 * src/atgeneral.m4: Update from Autoconf.
18908 2000-09-21 Akim Demaille <akim@epita.fr>
18910 * src/closure.h: New file.
18911 * src/closure.c: Formatting changes, topological sort over the
18912 functions, use of closure.h.
18913 (initialize_closure, finalize_closure): Rename as...
18914 (new_closure, free_closure): these. Adjust dependencies.
18915 * src/LR0.c: Formatting changes, topological sort, use of
18917 (initialize_states): Rename as...
18918 (new_states): this.
18919 * src/Makefile.am (noinst_HEADERS): Adjust.
18921 2000-09-20 Akim Demaille <akim@epita.fr>
18923 * src/acconfig.h: Don't protect config.h against multiple
18925 Don't define PARAMS.
18926 * src/system.h: Define PARAMS.
18927 Remove some of the ad-hoc CPP magic for DOS, VMS etc.: this is the
18928 purpose of config.h. system.h must not try to fix wrong
18929 definitions in config.h.
18931 2000-09-20 Akim Demaille <akim@epita.fr>
18933 * src/derives.h: New file.
18934 * src/main.c, src/derives.h: Use it.
18935 Formatting changes.
18936 * src/Makefile.am (noinst_HEADERS): Adjust.
18938 2000-09-20 Akim Demaille <akim@epita.fr>
18940 * tests/atgeneral.m4: Update from Autoconf.
18941 * tests/calc.m4 (_AT_DATA_CALC_Y, AT_DATA_CALC_Y, _AT_CHECK_CALC)
18942 (AT_CHECK_CALC): New macros.
18943 Use these macros to test bison with options `', `--raw',
18944 `--debug', `--yacc', `--yacc --debug'.
18946 2000-09-19 Akim Demaille <akim@epita.fr>
18948 * src/output.c: Formatting changes.
18949 * src/machine.h: Remove, leaving its contents in...
18950 * src/system.h: here.
18952 Adjust all dependencies on stdio.h and machine.h.
18953 * src/getargs.h: New file.
18954 Let all `extern' declarations about getargs.c be replaced with
18955 inclusion of `getargs.h'.
18956 * src/Makefile.am (noinst_HEADERS): Adjust.
18958 * tests/calc.m4 (yyin): Be initialized in main, not on the global
18960 (yyerror): Returns void, not int.
18961 * doc/bison.texinfo: Formatting changes.
18963 2000-09-19 Akim Demaille <akim@epita.fr>
18965 * tests/calc.m4 (calc.y): Do not assign to stdin, as it's not
18968 2000-09-18 Akim Demaille <akim@epita.fr>
18970 * configure.in: Append WARNING_CFLAGS to CFLAGS.
18971 * src/Makefile.am (INCLUDES): Don't.
18972 Be ready to fetch headers in lib/.
18974 2000-09-18 Akim Demaille <akim@epita.fr>
18976 * doc/bison.texinfo: Update the copyright.
18977 ANSIfy and GNUify the examples.
18978 Remove the old menu.
18980 2000-09-18 Akim Demaille <akim@epita.fr>
18982 First set of tests: use the `calc' example from the documentation.
18984 * src/bison.s1 (yyparse): Condition the code using `yytname' which
18985 is defined only when YYDEBUG is.
18986 * m4/atconfig.m4 (AT_CONFIG): Adjust to Autoconf 2.13.
18987 * src/files.c (tryopen, tryclose): Formatting changes.
18988 Move to the top and be static.
18989 * src/reader.c (read_signed_integer): Likewise.
18990 * tests/calc.m4: New file.
18991 * Makefile.am, suite.m4: Adjust.
18992 * m4/atconfig.m4: Set BISON_SIMPLE and BISON_HAIRY.
18994 2000-09-18 Akim Demaille <akim@epita.fr>
18996 Add support for an Autotest test suite for Bison.
18998 * m4/m4.m4, m4/atconfig.m4: New files.
18999 * m4/Makefile.am (EXTRA_DIST): Adjust.
19000 * tests/suite.m4, tests/Makefile.am, tests/atgeneral.m4: New
19002 * src/getargs.c: Display a more standard --version message.
19003 * src/reader.c (reader): Formatting changes.
19004 No longer depend upon VERSION_STRING.
19005 * configure.in: No longer use `dnl'.
19006 Set up the test suite and the new directory `tests/.
19007 (VERSION_STRING): Remove.
19009 2000-04-14 Akim Demaille <akim@epita.fr>
19011 * src/reader.c (copy_comment2): New function, same as former
19012 `copy_comment', but outputs into two FILE *.
19013 (copy_comment): Use it.
19014 (parse_union_decl): Use it.
19015 (get_type, parse_start_decl): Use the same `invalid' message.
19016 (parse_start_decl, parse_union_decl): Use the same `multiple'
19018 (parse_union_decl, copy_guard, copy_action): Use the same
19019 `unmatched' message.
19020 * m4/Makefile.am (EXTRA_DIST): Add `warning.m4'.
19022 2000-03-31 Akim Demaille <akim@epita.fr>
19024 * src/files.c (tryopen, tryclose): Move to the top.
19027 2000-03-31 Akim Demaille <akim@epita.fr>
19029 * src/main.c (main): Don't call `done', exit does it.
19031 2000-03-31 Akim Demaille <akim@epita.fr>
19033 * allocate.c: s/return (foo)/return foo/.
19034 * lalr.c: Likewise.
19036 * output.c: Likewise.
19037 * reader.c: Likewise.
19038 * symtab.c: Likewise.
19039 * vmsgetargs.c: Likewise.
19041 2000-03-31 Akim Demaille <akim@epita.fr>
19043 Clean up the error reporting functions.
19045 * src/report.c: New file.
19046 * src/report.h: Likewise.
19047 * src/Makefile.am: Adjust.
19048 * m4/error.m4: New file.
19049 * m4/Makefile.am: Adjust.
19050 * configure.in (jm_PREREQ_ERROR): Call it.
19051 * src/main.c (int_to_string, banner, fatal_banner, warn_banner):
19053 (fatal, fatals): Remove. All callers use complain.c::fatal.
19054 (warn, warni, warns, warnss, warnss): Remove. All callers use
19055 complain.c::complain.
19056 (toomany): Remove, use fatal instead.
19057 * src/files.c (done): No argument, use complain_message_count.
19058 * src/main.c (main): Register `done' to `atexit'.
19060 * src/getargs.c (usage): More `fputs', less `fprintf'.
19062 2000-03-28 Akim Demaille <akim@epita.fr>
19064 * lib/: New directory.
19065 * Makefile.am (SUBDIRS): Adjust.
19066 * configure.in: Adjust.
19067 (LIBOBJS): Although not used yet, AC_SUBST it, otherwise it's
19069 * src/alloca.c: Moved to lib/.
19070 * src/getopt.c: Likewise.
19071 * src/getopt1.c: Likewise.
19072 * src/getopt.h: Likewise.
19073 * src/ansi2knr.c: Likewise.
19074 * src/ansi2knr.1: Likewise.
19075 * src/Makefile.am: Adjust.
19076 * lib/Makefile.am: New file.
19078 2000-03-28 Akim Demaille <akim@epita.fr>
19080 * src/getargs.c (usage): Refresh the help message.
19082 2000-03-17 Akim Demaille <akim@epita.fr>
19084 * src/getopt1.c: Updated from textutils 2.0e
19085 * src/getopt.c: Likewise.
19086 * src/getopt.h: Likewise.
19088 2000-03-17 Akim Demaille <akim@epita.fr>
19090 * src/Makefile.am (bison.simple): Fix the awk program: quote only
19091 the file name, not the whole `#line LINE FILE'.
19093 2000-03-17 Akim Demaille <akim@epita.fr>
19095 On syntax errors, report the token on which we choked.
19097 * src/bison.s1 (yyparse): In the label yyerrlab, when
19098 YYERROR_VERBOSE, add yychar in msg.
19100 2000-03-17 Akim Demaille <akim@epita.fr>
19102 * src/reader.c (copy_at): New function.
19103 (copy_guard): Use it.
19104 (copy_action): Use it.
19106 2000-03-17 Akim Demaille <akim@epita.fr>
19108 Be kind to translators, save some useless translations.
19110 * src/main.c (banner): New function.
19111 (fatal_banner): Use it.
19112 (warn_banner): Use it.
19114 2000-03-17 Akim Demaille <akim@epita.fr>
19116 * src/reader.c (copy_definition): Use copy_string and
19117 copy_comment. Removed now unused `match', `ended',
19119 (copy_comment, copy_string): Moved, to be visible from
19122 2000-03-17 Akim Demaille <akim@epita.fr>
19124 * src/reader.c (copy_string): Declare `static inline'. No
19125 problems with inline, since it is checked by configure.
19126 (copy_comment): Likewise.
19128 2000-03-17 Akim Demaille <akim@epita.fr>
19130 * src/reader.c (packsymbols): Formatting changes.
19132 2000-03-17 Akim Demaille <akim@epita.fr>
19134 * src/reader.c (copy_comment): New function, factored out from:
19135 (copy_action): Use it. Removed now unused `match', `ended',
19137 (copy_guard): Likewise.
19139 2000-03-17 Akim Demaille <akim@epita.fr>
19141 * src/reader.c (copy_string): New function, factored out from:
19142 (copy_action): Use it.
19143 (copy_guard): Likewise.
19145 2000-03-17 Akim Demaille <akim@epita.fr>
19147 Change the handling of @s so that they behave exactly like $s.
19148 There is now a pseudo variable @$ (readble and writable), location
19149 of the lhs of the rule (by default ranging from the location of
19150 the first symbol of the rhs, to the location of the last symbol,
19151 or, if the rhs is empty, YYLLOC).
19153 * src/bison.s1 [YYLSP_NEEDED] (yyloc): New variable, twin of
19155 (yyparse): When providing a default semantic action, provide a
19156 default location action.
19157 (after the $): No longer change `*YYLSP', just stack YYLOC the
19158 same way you stack YYVAL.
19159 * src/reader.c (read_declarations): Use warns.
19160 (copy_guard, case '@'): Also recognize `@$', expanded as `YYLOC'.
19161 (copy_action, case '@'): Likewise.
19162 Use a standard error message, to save useless work from
19165 2000-03-17 Akim Demaille <akim@epita.fr>
19167 * src/bison.s1: Formatting and cosmetics changes.
19168 * src/reader.c: Likewise.
19169 Update the Copyright notice.
19171 2000-03-17 Akim Demaille <akim@epita.fr>
19173 * src/bison.s1 (#line): All set to `#line' only, since the
19174 Makefile now handles them.
19176 2000-03-16 Akim Demaille <akim@epita.fr>
19178 * src/output.c (output_rule_data): Output the documentation of
19179 some of the tables.
19180 (Copyright notice): Update.
19181 Formatting changes.
19183 2000-03-16 Akim Demaille <akim@epita.fr>
19185 * src/bison.s1 [!YYDEBUG]: Define yydebug to 0. This allows to
19186 remove most `#if YYDEBUG != 0', since `if (yydebug)' is enough.
19187 One `#if YYDEBUG' remains, since it uses variables which are
19188 defined only if `YYDEBUG != 0'.
19190 2000-03-16 Akim Demaille <akim@epita.fr>
19192 * src/bison.s1 (yyparse): Reorganize the definitions of the stacks
19193 and related variables so that the similarities are highlighted.
19195 2000-03-16 Akim Demaille <akim@epita.fr>
19197 * src/bison.s1: Properly indent CPP directives.
19199 2000-03-16 Akim Demaille <akim@epita.fr>
19201 * src/bison.s1: Properly indent the `alloca' CPP section.
19203 2000-03-16 Akim Demaille <akim@epita.fr>
19205 Do not hard code values of directories in `configure.in'.
19206 Update the `configure' tool chain.
19208 * configure.in (XPFILE, XPFILE1, LOCALEDIR): Remove, handled by
19210 (VERSION_STRING): Use the third arg of AC_DEFINE_UNQUOTED.
19211 (AC_OUTPUT): Add m4/Makefile.
19212 Bump to bison 1.28a, 1.29 has never been released.
19213 * acconfig.h (XPFILE, XPFILE1, LOCALEDIR): Remove, since they are
19214 handled via src/Makefile.am.
19215 (VERSION_STRING, PROTOTYPES, ENABLE_NLS, HAVE_CATGETS,
19216 HAVE_GETTEXT, HAVE_LC_MESSAGES, HAVE_STPCPY): Remove, handled by
19218 * Makefile.am (SUBDIRS): Add m4.
19219 (ACLOCAL_AM_FLAGS): New variable.
19220 (AUTOMAKE_OPTIONS): Add check-news.
19221 * src/Makefile.am (bison.simple): Use awk to replace #line lines with
19222 the proper line number and file name.
19223 (DEFS): Propagate the location of bison library files and of the
19225 (INCLUDES): Added `-I ..' so that one can compile with srcdir !=
19227 * acinclude.m4: Remove, replaced by the directory m4.
19228 * m4/Makefile.am (EXTRA_DIST): New variable.
19229 * m4/gettext.m4: New file, from the fileutils.
19230 * m4/lcmessage.m4: Likewise
19231 * m4/progtest.m4: Likewise.
19232 * m4/bison-decl.m4: New file, extracted from former acinclude.m4.
19234 2000-03-10 Akim Demaille <akim@epita.fr>
19237 Formatting changes of various comments.
19238 Respect the GNU coding standards at various places.
19239 Don't use `_()' when no translation is needed.
19241 1999-12-13 Jesse Thilo <jthilo@gnu.org>
19244 OS/2 honors TMPDIR environment variable.
19246 1999-12-13 Jesse Thilo <jthilo@gnu.org>
19248 * doc/bison.texinfo: Tweaked spelling and grammar.
19250 Removed reference to price of printed copy.
19251 Mention BISON_SIMPLE and BISON_HAIRY.
19253 1999-12-13 Jesse Thilo <jthilo@gnu.org>
19255 * configure.in, NEWS:
19256 Bison 1.29 released.
19258 1999-10-27 Jesse Thilo <jthilo@gnu.org>
19260 * doc/.cvsignore, doc/Makefile.am, doc/refcard.tex:
19261 Added reference card.
19263 1999-07-26 Jesse Thilo <jthilo@gnu.org>
19265 * po/ru.po: Added Russian translation.
19267 1999-07-26 Jesse Thilo <jthilo@gnu.org>
19269 * configure.in: Added Russian translation.
19271 1999-07-06 Jesse Thilo <jthilo@gnu.org>
19273 * configure.in, NEWS, README:
19274 Released version 1.28.
19276 1999-06-14 Jesse Thilo <jthilo@gnu.org>
19279 Squashed redefinition warning on some systems.
19281 * src/getargs.c, src/Makefile.am, src/reader.c, src/version.c:
19282 Have configure build version string instead of relying on ANSI string
19285 1999-06-14 Jesse Thilo <jthilo@gnu.org>
19287 * po/POTFILES.in: Got rid of version.c.
19289 1999-06-14 Jesse Thilo <jthilo@gnu.org>
19291 * acconfig.h, configure.in:
19292 Have configure build version string instead of relying on ANSI string
19295 1999-06-08 Jesse Thilo <jthilo@gnu.org>
19298 Dropped mention of `+' for long-named options.
19300 1999-05-30 Jesse Thilo <jthilo@gnu.org>
19302 * src/files.c: Added <unistd.h> for unlink().
19304 * src/Makefile.am, src/system.h:
19307 1999-05-30 Jesse Thilo <jthilo@gnu.org>
19309 * README: Added a FAQ list.
19311 * configure.in, acconfig.h:
19314 1999-05-30 Jesse Thilo <jthilo@gnu.org>
19316 * doc/FAQ, doc/Makefile.am:
19319 1999-05-19 Jesse Thilo <jthilo@gnu.org>
19321 * src/alloc.h, src/symtab.h, src/version.c:
19322 Protected inclusion of "config.h" with HAVE_CONFIG_H.
19324 1999-04-18 Jesse Thilo <jthilo@gnu.org>
19326 * src/.cvsignore, src/Makefile.am:
19327 Reorganized: sources in `src', documentation in `doc'.
19329 * src/lex.c (literalchar):
19330 fixed the code for escaping double quotes (thanks
19333 1999-04-18 Jesse Thilo <jthilo@gnu.org>
19335 * po/de.po, po/es.po, po/fr.po, po/nl.po, po/POTFILES.in:
19336 Adjusted paths to reflect directory reorganization.
19338 1999-04-18 Jesse Thilo <jthilo@gnu.org>
19340 * doc/.cvsignore, doc/Makefile.am:
19341 Reorganized: sources in `src', documentation in `doc'.
19343 1999-04-18 Jesse Thilo <jthilo@gnu.org>
19346 Updated AC_INIT file to reflect directory reorganization.
19348 * configure.in, .cvsignore, Makefile.am, POTFILES.in:
19349 Reorganized: sources in `src', documentation in `doc'.
19351 1999-04-13 Jesse Thilo <jthilo@gnu.org>
19354 Don't declare calloc() and realloc() if not necessary.
19356 1999-04-13 Jesse Thilo <jthilo@gnu.org>
19358 * configure.in, acconfig.h, acinclude.m4:
19359 Don't declare calloc() and realloc() if not necessary.
19361 1999-03-23 Jesse Thilo <jthilo@gnu.org>
19363 * po/.cvsignore: Added i18n support.
19365 1999-03-23 Jesse Thilo <jthilo@gnu.org>
19367 * acconfig.h, configure.in, Makefile.am:
19368 Added i18n support.
19370 1999-03-22 Jesse Thilo <jthilo@gnu.org>
19372 * src/bison.s1: Fixed #line numbers.
19374 1999-03-15 Jesse Thilo <jthilo@gnu.org>
19376 * po/es.po, po/fr.po, po/nl.po, po/de.po:
19377 Added PO files from Translation Project.
19379 1999-03-03 Jesse Thilo <jthilo@gnu.org>
19382 Added support for non-ANSI compilers (ansi2knr).
19384 1999-02-16 Jesse Thilo <jthilo@gnu.org>
19386 * configure.in: Bumped version number to 1.27.
19389 Added `bison.simple' to list of files removed by `make distclean'.
19391 1999-02-12 Jesse Thilo <jthilo@gnu.org>
19393 * src/files.c, src/files.h:
19394 Defined locations of parser files in config.h instead of Makefile.
19396 1999-02-12 Jesse Thilo <jthilo@gnu.org>
19398 * acconfig.h, acinclude.m4, configure.in, Makefile.am:
19399 Defined locations of parser files in config.h instead of Makefile.
19401 1999-02-09 Jesse Thilo <jthilo@gnu.org>
19404 Removed inappropriate use of $< macro.
19406 1999-02-05 Jesse Thilo <jthilo@gnu.org>
19408 * po/Makefile.in.in, po/POTFILES.in:
19409 Add `po' directory skeleton.
19411 1999-01-27 Jesse Thilo <jthilo@gnu.org>
19413 * README: Document help-bison list.
19415 * configure.in: Add check for mkstemp().
19417 1999-01-20 Jesse Thilo <jthilo@gnu.org>
19419 * src/conflicts.c, src/LR0.c, src/output.c, src/reader.c:
19420 Hush a few compiler warnings.
19423 Add tryclose(), which verifies that fclose was successful.
19424 Hush a couple of compiler warnings.
19426 1999-01-20 Jesse Thilo <jthilo@gnu.org>
19428 * Makefile.am, OChangeLog:
19429 ChangeLog is now automatically generated. Include the old version as
19432 1999-01-14 Jesse Thilo <jthilo@gnu.org>
19434 * 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:
19435 Update FSF address.
19437 1999-01-14 Jesse Thilo <jthilo@gnu.org>
19439 * doc/bison.texinfo: Fix formatting glitch.
19441 * doc/bison.texinfo: Update FSF address.
19443 1999-01-14 Jesse Thilo <jthilo@gnu.org>
19445 * acconfig.h: Update FSF address.
19447 1999-01-08 Jesse Thilo <jthilo@gnu.org>
19450 Don't define PACKAGE here, since config.h defines it.
19452 1998-12-30 Jesse Thilo <jthilo@gnu.org>
19454 * src/reader.c: Update copyright date.
19457 Ditch sprintf to statically-sized buffers in fatal/warn functions in
19458 favor of output directly to stderr (avoids buffer overruns).
19460 * src/reader.c: Some checks for premature EOF.
19462 * 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:
19463 Use prototypes if the compiler understands them.
19465 * src/files.c: Honor TMPDIR on Unix hosts.
19466 Use prototypes if the compiler understands them.
19469 Fix a couple of buffer overrun bugs.
19470 Use prototypes if the compiler understands them.
19472 * src/system.h: Include unistd.h and ctype.h.
19473 Use #ifdef instead of #if for NLS symbols.
19475 1998-12-30 Jesse Thilo <jthilo@gnu.org>
19477 * doc/bison.texinfo:
19478 Delete comment "consider using @set for edition number, etc..." since
19479 we now are doing so.
19481 1998-12-30 Jesse Thilo <jthilo@gnu.org>
19484 Use prototypes if the compiler understands them.
19486 * NEWS: Document 1.26 highlights.
19488 * Makefile.am: Require Automake 1.3 or later.
19491 Use prototypes if the compiler understands them.
19493 1998-12-29 Jesse Thilo <jthilo@gnu.org>
19496 Use VERSION symbol from automake for version number.
19498 1998-12-29 Jesse Thilo <jthilo@gnu.org>
19500 * acconfig.h, configure.in, version.cin:
19501 Use VERSION symbol from automake for version number.
19503 1998-11-28 Jesse Thilo <jthilo@gnu.org>
19506 Distribute original version of simple parser (bison.s1), not built
19507 version (bison.simple).
19509 1998-11-28 Jesse Thilo <jthilo@gnu.org>
19511 * doc/bison.texinfo: Add info dir entry.
19513 * doc/bison.texinfo:
19514 Let automake put version number into documentation.
19516 1998-11-26 Jesse Thilo <jthilo@gnu.org>
19518 * src/bison.cld, src/build.com, src/vmshlp.mar:
19519 Add non-RCS files from /gd/gnu/bison.
19521 1998-11-26 Jesse Thilo <jthilo@gnu.org>
19524 Document the BISON_HAIRY and BISON_SIMPLE variables.
19526 1998-11-25 Jesse Thilo <jthilo@gnu.org>
19528 * src/version.c: Build version.c automatically.
19531 Fix token numbering (used to start at 258, not 257).
19533 * src/system.h: Include config.h.
19535 * src/getargs.c: Update bug report address.
19537 * src/alloca.c, src/getopt1.c, src/getopt.c, src/getopt.h:
19538 Get latest copies of alloca.c, getopt.c, getopt.h, getopt1.c from gnu.org.
19540 1998-11-25 Jesse Thilo <jthilo@gnu.org>
19543 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
19545 * configure.in, version.cin:
19546 Build version.c automatically.
19548 * AUTHORS: Add AUTHORS file.
19550 * README: Update bug report address.
19553 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
19555 * configure.in, Makefile.am, Makefile.in, stamp-h.in:
19556 Add automake stuff.
19558 1998-11-25 Jesse Thilo <jthilo@gnu.org>
19560 * doc/bison.texinfo: Clean up some formatting.
19562 1998-05-05 Richard Stallman <rms@gnu.org>
19564 * doc/bison.texinfo:
19565 Explain better why to make a pure parser.
19567 1998-01-05 Richard Stallman <rms@gnu.org>
19569 * src/files.c (openfiles):
19570 [_WIN32 && !__CYGWIN32__] Use TEMP or Temp to
19571 find a temporary directory, if possible. Do not unlink files while
19574 1997-08-25 Richard Stallman <rms@gnu.org>
19576 * src/reader.c (stack_offset;):
19577 Change some warni to warns.
19579 * src/lex.c (literalchar): Use warns, not warni.
19581 1997-06-28 Richard Stallman <rms@gnu.org>
19583 * src/bison.s1: Add a Bison version comment.
19585 * src/main.c (fatal, warn, berror):
19588 1997-06-28 Richard Stallman <rms@gnu.org>
19590 * Makefile.in (bison_version): New variable.
19591 (dist): Use that variable.
19592 (bison.s1): Substitute the Bison version into bison.simple.
19594 * bison.simple: Add a Bison version comment.
19596 1997-06-18 Richard Stallman <rms@gnu.org>
19598 * src/main.c (fatal, warn, berror):
19599 Make error messages standard.
19600 (toomany): Improve error message text.
19602 * 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:
19603 new.h renamed to alloc.h.
19605 1997-06-18 Richard Stallman <rms@gnu.org>
19607 * Makefile.in: new.h renamed to alloc.h.
19609 1997-05-24 Richard Stallman <rms@gnu.org>
19611 * src/lex.c (literalchar):
19612 Fix the code for escaping \, " and '.
19614 (lex): Avoid trouble when there are many chars
19615 to discard in a char literal with just several chars in it.
19617 1997-05-17 Richard Stallman <rms@gnu.org>
19620 Use malloc, if using alloca is troublesome.
19621 (YYSTACK_USE_ALLOCA): New flag macro.
19622 Define it for some systems and compilers.
19623 (YYSTACK_ALLOC): New macro.
19624 (yyparse): Use YYSTACK_ALLOC to allocate stack.
19625 If it was malloc'd, free it.
19627 1997-05-17 Richard Stallman <rms@gnu.org>
19630 Use malloc, if using alloca is troublesome.
19631 (YYSTACK_USE_ALLOCA): New flag macro.
19632 Define it for some systems and compilers.
19633 (YYSTACK_ALLOC): New macro.
19634 (yyparse): Use YYSTACK_ALLOC to allocate stack.
19635 If it was malloc'd, free it.
19637 1997-04-23 Richard Stallman <rms@gnu.org>
19640 (alloca) [__hpux]: Always define as __builtin_alloca.
19642 1997-04-23 Richard Stallman <rms@gnu.org>
19645 (alloca) [__hpux]: Always define as __builtin_alloca.
19647 1997-04-22 Richard Stallman <rms@gnu.org>
19650 [__hpux]: Include alloca.h (right for HPUX 10)
19651 instead of declaring alloca (right for HPUX 9).
19653 * src/bison.s1 (__yy_memcpy):
19654 Declare arg `count' as unsigned int.
19655 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
19657 1997-04-22 Richard Stallman <rms@gnu.org>
19660 [__hpux]: Include alloca.h (right for HPUX 10)
19661 instead of declaring alloca (right for HPUX 9).
19663 * bison.simple (__yy_memcpy):
19664 Declare arg `count' as unsigned int.
19665 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
19667 1997-01-03 Richard Stallman <rms@gnu.org>
19669 * src/allocate.c: [__STDC__ or _MSC_VER]:
19670 Declare calloc and realloc to return void *.
19672 1997-01-02 Richard Stallman <rms@gnu.org>
19675 [_MSC_VER]: Include stdlib.h and process.h.
19676 [_MSC_VER] (getpid): Define as macro--translate it to _getpid.
19678 * src/main.c (main): Return FAILURE as a value.
19679 (printable_version): Declare arg as int, not char.
19681 1997-01-02 Richard Stallman <rms@gnu.org>
19683 * Makefile.in (dist):
19684 Explicitly check for symlinks, and copy them.
19686 1996-12-19 Richard Stallman <rms@gnu.org>
19689 [_MSC_VER] (XPFILE, XPFILE1): Define, if not already defined.
19691 1996-12-18 Paul Eggert <eggert@gnu.org>
19693 * src/bison.s1 (yyparse):
19694 If __GNUC__ and YYPARSE_PARAM are both defined,
19695 declare yyparse to have a void * argument.
19697 1996-12-18 Paul Eggert <eggert@gnu.org>
19699 * bison.simple (yyparse):
19700 If __GNUC__ and YYPARSE_PARAM are both defined,
19701 declare yyparse to have a void * argument.
19703 1996-12-17 Richard Stallman <rms@gnu.org>
19705 * src/reduce.c (nbits): Add some casts.
19707 1996-08-12 Richard Stallman <rms@gnu.org>
19709 * src/bison.s1: Test _MSDOS as well as _MSDOS_.
19711 1996-08-12 Richard Stallman <rms@gnu.org>
19713 * bison.simple: Test _MSDOS as well as _MSDOS_.
19715 1996-07-31 Richard Stallman <rms@gnu.org>
19718 [__sun && __i386]: Include alloca.h.
19720 1996-07-31 Richard Stallman <rms@gnu.org>
19723 [__sun && __i386]: Include alloca.h.
19725 1996-07-30 Richard Stallman <rms@gnu.org>
19727 * src/bison.s1: Comment change.
19729 * src/bison.s1: Test _MSDOS_, not MSDOS.
19731 1996-07-30 Richard Stallman <rms@gnu.org>
19733 * bison.simple: Comment change.
19735 * bison.simple: Test _MSDOS_, not MSDOS.
19737 1996-06-01 Richard Stallman <rms@gnu.org>
19739 * 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:
19740 Insert `_' macro around many string constants.
19743 Insert `_' macro around many string constants.
19745 (main): Call setlocale, bindtextdomain and textdomain.
19747 * src/system.h: [HAVE_LOCALE_H]: Include locale.h.
19748 [! HAVE_LOCALE_H] (setlocale): Define as no-op.
19749 [ENABLE_NLS]: Include libintl.h.
19750 [ENABLE_NLS] (gettext): Define.
19751 [! ENABLE_NLS] (bintextdomain, textdomain, _): Consolation definitions.
19752 (N_, PACKAGE, LOCALEDIR): New macros.
19754 1996-06-01 Richard Stallman <rms@gnu.org>
19756 * POTFILES.in: New file.
19758 * Makefile.in (allocate.o):
19759 Define target explicitly.
19761 * Makefile.in (CFLAGS): Set to @CFLAGS@.
19762 (LDFLAGS): Set to @LDFLAGS@.
19763 (configure): Run autoconf only if preceding `cd' succeeds.
19764 (bison.s1): Redirect output to temporary file then move the
19765 temporary to the target, rather than redirecting directly to bison.s1.
19766 (clean): Remove config.status and config.log.
19767 (distclean): Don't remove config.status here.
19769 1996-05-12 Richard Stallman <rms@gnu.org>
19772 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
19774 1996-05-12 Richard Stallman <rms@gnu.org>
19777 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
19779 1996-05-11 Richard Stallman <rms@gnu.org>
19781 * src/bison.s1 (__yy_memcpy):
19782 Really reorder the args, as was supposedly done on Feb 14 1995.
19783 (yyparse): Calls changed accordingly.
19785 1996-05-11 Richard Stallman <rms@gnu.org>
19787 * Makefile.in (dist): Don't use $(srcdir).
19789 * bison.simple (__yy_memcpy):
19790 Really reorder the args, as was supposedly done on Feb 14 1995.
19791 (yyparse): Calls changed accordingly.
19793 1996-01-27 Richard Stallman <rms@gnu.org>
19795 * src/output.c (output_rule_data):
19796 Test YYERROR_VERBOSE in the conditional
19797 around the definition of ttyname.
19799 1995-12-29 Richard Stallman <rms@gnu.org>
19802 Fix line numbers in #line commands.
19804 1995-12-29 Richard Stallman <rms@gnu.org>
19807 Fix line numbers in #line commands.
19809 1995-12-27 Richard Stallman <rms@gnu.org>
19811 * src/bison.s1 (YYPARSE_PARAM_DECL):
19812 In C++, make it always null.
19813 (YYPARSE_PARAM_ARG): New macro.
19814 (yyparse): Use YYPARSE_PARAM_ARG.
19816 1995-12-27 Richard Stallman <rms@gnu.org>
19818 * bison.simple (YYPARSE_PARAM_DECL):
19819 In C++, make it always null.
19820 (YYPARSE_PARAM_ARG): New macro.
19821 (yyparse): Use YYPARSE_PARAM_ARG.
19823 1995-11-29 Richard Stallman <rms@gnu.org>
19825 * doc/bison.texinfo:
19826 Describe literal string tokens, %raw, %no_lines, %token_table.
19828 1995-11-29 Daniel Hagerty <hag@gnu.org>
19830 * doc/bison.texinfo: Fixed update date
19832 1995-10-16 Richard Stallman <rms@gnu.org>
19834 * src/version.c: Version 1.25.
19836 1995-10-16 Richard Stallman <rms@gnu.org>
19838 * NEWS: *** empty log message ***
19840 1995-10-16 Richard Stallman <rms@gnu.org>
19842 * doc/bison.1, doc/bison.rnh:
19845 1995-10-15 Richard Stallman <rms@gnu.org>
19847 * src/vmsgetargs.c, src/getargs.c:
19848 Added -n, -k, and -raw switches.
19849 (noparserflag, toknumflag, rawtoknumflag): New variables.
19851 * src/symtab.h (SALIAS):
19852 New #define for adding aliases to %token.
19853 (struct bucket): Added `alias' field.
19855 * src/reduce.c (reduce_grammar):
19856 Revise error message.
19857 (print_notices): Remove final `.' from error message.
19859 * src/reader.c (reader_output_yylsp):
19861 (readgram): Use `#if 0' around code that accepted %command
19862 inside grammar rules: The documentation doesn't allow it,
19863 and it will fail since the %command processors scan for the next %.
19864 (parse_token_decl): Extended the %token
19865 declaration to allow a multi-character symbol as an alias.
19866 (parse_thong_decl): New function.
19867 (read_declarations): Added %thong declarations.
19868 (read_declarations): Handle NOOP to deal with allowing
19869 % declarations as another means to specify the flags.
19870 (readgram): Allow %prec prior to semantics embedded in a rule.
19871 (skip_to_char, read_declarations, copy_definition)
19872 (parse_token_decl, parse_start_decl, parse_type_decl)
19873 (parse_assoc_decl, parse_union_decl, parse_expect_decl)
19874 (get_type_name, copy_guard, copy_action, readgram)
19875 (get_type, packsymbols): Revised most error messages.
19876 Changed `fatal' to `warnxxx' to avoid aborting for error.
19877 Revised and use multiple warnxxx functions to avoid using VARARGS1.
19878 (read_declarations): Improve the error message for
19879 an invalid character. Do not abort.
19880 (read_declarations, copy_guard, copy_action): Use
19881 printable_version to avoid unprintable characters in printed output.
19882 (parse_expect_decl): Error if argument to %expect exceeds 10 digits.
19883 (parse_token_decl, parse_assoc_decl, parse_type_decl, get_type):
19884 Allow the type of a non-terminal can be given
19885 more than once, as long as all specifications give the same type.
19888 (output_headers, output_trailers, output, output_gram)
19889 (output_rule_data): Implement noparserflag variable.
19890 Implement toknumflag variable.
19891 (output): Call reader_output_yylsp to output LTYPESTR.
19893 * src/main.c (main):
19894 If reader sees an error, don't process the grammar.
19895 (fatals): Updated to not use VARARGS1.
19896 (printable_version, int_to_string, warn, warni, warns, warnss)
19897 (warnsss): New error reporting functions. Avoid abort for error.
19900 Added THONG and NOOP for alias processing.
19901 Added SETOPT for the new code that allows setting options with %flags.
19904 Include getopt.h. Add some extern decls.
19905 (safegetc): New function to deal with EOF gracefully.
19906 (literalchar); new function to deal with reading \ escapes.
19907 (lex): Use literalchar.
19908 (lex): Implemented "..." tokens.
19909 (literalchar, lex, parse_percent_token): Made tokenbuffer
19910 always contain the token. This includes growing the token
19911 buffer while reading an integer.
19912 (parse_percent_token): Replaced if-else statement with percent_table.
19913 (parse_percent_token): Added % declarations as another
19914 way to specify the flags -n, -l, and -r. Also added hooks for
19915 -d, -k, -y, -v, -t, -p, -b, -o, but implementation requires
19916 major changes to files.c.
19917 (lex) Retain in the incoming stream a character following
19919 (skip_white_space, lex): Revised most error messages
19920 and changed fatal to warn to avoid aborting.
19921 (percent_table): Added %thong declarations.
19923 * src/gram.h: Comment changes.
19925 * src/files.c (openfiles, open_extra_files, done):
19927 and actfile file. Handle noparserflag. Both for -n switch.
19929 * src/conflicts.c (resolve_sr_conflict):
19930 Remove use of alloca.
19932 1995-06-01 Jim Meyering <meyering@gnu.org>
19934 * doc/bison.texinfo: *** empty log message ***
19936 1995-05-06 Richard Stallman <rms@gnu.org>
19938 * src/bison.s1: Comment change.
19940 1995-05-06 Richard Stallman <rms@gnu.org>
19942 * bison.simple: Comment change.
19944 1995-05-03 Richard Stallman <rms@gnu.org>
19946 * src/version.c: Version now 1.24.
19948 * src/bison.s1: Change distribution terms.
19950 * src/version.c: Version now 1.23.
19952 1995-05-03 Richard Stallman <rms@gnu.org>
19954 * doc/bison.texinfo:
19955 Rewrite "Conditions for Using Bison".
19956 Update version to 1.24.
19958 1995-05-03 Richard Stallman <rms@gnu.org>
19960 * bison.simple: Change distribution terms.
19962 1995-02-23 Richard Stallman <rms@gnu.org>
19964 * src/files.c: Test __VMS_POSIX as well as VMS.
19966 1995-02-14 Jim Meyering <meyering@gnu.org>
19968 * src/bison.s1 (__yy_memcpy):
19969 Renamed from __yy_bcopy to avoid
19970 confusion. Reverse FROM and TO arguments to be consistent with
19973 1995-02-14 Jim Meyering <meyering@gnu.org>
19975 * bison.simple (__yy_memcpy):
19976 Renamed from __yy_bcopy to avoid
19977 confusion. Reverse FROM and TO arguments to be consistent with
19980 1994-11-10 David J. MacKenzie <djm@gnu.org>
19986 * Makefile.in (DISTFILES): Include NEWS.
19988 * Makefile.in (DISTFILES):
19989 Include install-sh, not install.sh.
19991 * configure.in: Update to Autoconf v2 macro names.
19993 1994-10-05 David J. MacKenzie <djm@gnu.org>
19995 * Makefile.in: fix typo
19997 * Makefile.in (prefix, exec_prefix):
19998 Let configure set them.
20000 1994-09-28 David J. MacKenzie <djm@gnu.org>
20002 * Makefile.in: Set datadir to $(prefix)/share.
20004 1994-09-15 Richard Stallman <rms@gnu.org>
20007 Update copyright notice and GPL version.
20009 1994-09-15 Richard Stallman <rms@gnu.org>
20012 Update copyright notice and GPL version.
20014 1994-07-12 Richard Stallman <rms@gnu.org>
20016 * src/reduce.c, src/reader.c:
20019 1994-05-05 David J. MacKenzie <djm@gnu.org>
20021 * Makefile.in: entered into RCS
20023 1994-03-26 Richard Stallman <rms@gnu.org>
20025 * src/bison.s1: entered into RCS
20027 1994-03-26 Richard Stallman <rms@gnu.org>
20029 * bison.simple: entered into RCS
20031 1994-03-25 Richard Stallman <rms@gnu.org>
20033 * src/main.c: entered into RCS
20035 1994-03-24 Richard Stallman <rms@gnu.org>
20037 * src/conflicts.c: entered into RCS
20039 1994-01-02 Richard Stallman <rms@gnu.org>
20041 * Makefile.in: *** empty log message ***
20043 1993-11-21 Richard Stallman <rms@gnu.org>
20045 * src/bison.s1: *** empty log message ***
20047 1993-11-21 Richard Stallman <rms@gnu.org>
20049 * doc/bison.texinfo: entered into RCS
20051 * doc/bison.texinfo: *** empty log message ***
20053 1993-11-21 Richard Stallman <rms@gnu.org>
20055 * bison.simple: *** empty log message ***
20057 1993-10-25 David J. MacKenzie <djm@gnu.org>
20059 * doc/bison.texinfo: *** empty log message ***
20061 1993-10-19 Richard Stallman <rms@gnu.org>
20063 * src/bison.s1: *** empty log message ***
20065 1993-10-19 Richard Stallman <rms@gnu.org>
20067 * bison.simple: *** empty log message ***
20069 1993-10-14 Richard Stallman <rms@gnu.org>
20071 * src/bison.s1: *** empty log message ***
20073 1993-10-14 Richard Stallman <rms@gnu.org>
20075 * bison.simple: *** empty log message ***
20077 1993-09-14 David J. MacKenzie <djm@gnu.org>
20079 * doc/bison.texinfo: *** empty log message ***
20081 1993-09-13 Noah Friedman <friedman@gnu.org>
20083 * Makefile.in: *** empty log message ***
20085 1993-09-10 Richard Stallman <rms@gnu.org>
20087 * src/conflicts.c: *** empty log message ***
20089 * src/system.h: entered into RCS
20091 1993-09-10 Richard Stallman <rms@gnu.org>
20093 * doc/bison.1: entered into RCS
20095 1993-09-06 Noah Friedman <friedman@gnu.org>
20097 * src/version.c: entered into RCS
20099 1993-09-06 Noah Friedman <friedman@gnu.org>
20101 * Makefile.in: *** empty log message ***
20103 1993-07-30 David J. MacKenzie <djm@gnu.org>
20105 * Makefile.in: *** empty log message ***
20107 1993-07-24 Richard Stallman <rms@gnu.org>
20109 * src/bison.s1: *** empty log message ***
20111 1993-07-24 Richard Stallman <rms@gnu.org>
20113 * bison.simple: *** empty log message ***
20115 1993-07-08 David J. MacKenzie <djm@gnu.org>
20117 * Makefile.in: *** empty log message ***
20119 1993-07-04 Richard Stallman <rms@gnu.org>
20121 * src/bison.s1: *** empty log message ***
20123 1993-07-04 Richard Stallman <rms@gnu.org>
20125 * bison.simple: *** empty log message ***
20127 1993-06-26 David J. MacKenzie <djm@gnu.org>
20129 * src/getargs.c: entered into RCS
20131 1993-06-26 David J. MacKenzie <djm@gnu.org>
20133 * doc/bison.texinfo: *** empty log message ***
20135 * doc/bison.1: New file.
20137 1993-06-25 Richard Stallman <rms@gnu.org>
20139 * src/getargs.c: New file.
20141 1993-06-16 Richard Stallman <rms@gnu.org>
20143 * src/bison.s1: *** empty log message ***
20145 1993-06-16 Richard Stallman <rms@gnu.org>
20147 * bison.simple: *** empty log message ***
20149 1993-06-03 Richard Stallman <rms@gnu.org>
20151 * src/bison.s1: New file.
20153 1993-06-03 Richard Stallman <rms@gnu.org>
20155 * doc/bison.texinfo: *** empty log message ***
20157 1993-06-03 Richard Stallman <rms@gnu.org>
20159 * bison.simple: New file.
20161 1993-05-19 Richard Stallman <rms@gnu.org>
20163 * doc/bison.texinfo: New file.
20165 1993-05-07 Noah Friedman <friedman@gnu.org>
20167 * Makefile.in: *** empty log message ***
20169 1993-04-28 Noah Friedman <friedman@gnu.org>
20171 * src/reader.c: *** empty log message ***
20173 1993-04-23 Noah Friedman <friedman@gnu.org>
20175 * src/alloc.h: entered into RCS
20177 1993-04-20 David J. MacKenzie <djm@gnu.org>
20179 * src/version.c: *** empty log message ***
20181 * src/files.c, src/allocate.c:
20184 * src/reader.c: *** empty log message ***
20186 * src/lex.c: entered into RCS
20188 * src/conflicts.c: New file.
20190 * src/symtab.c: entered into RCS
20192 * src/alloc.h: New file.
20194 * src/LR0.c: entered into RCS
20196 1993-04-18 Noah Friedman <friedman@gnu.org>
20198 * src/reader.c: New file.
20200 * src/version.c: *** empty log message ***
20202 1993-04-18 Noah Friedman <friedman@gnu.org>
20204 * Makefile.in: *** empty log message ***
20206 1993-04-17 Noah Friedman <friedman@gnu.org>
20208 * Makefile.in: *** empty log message ***
20210 1993-04-15 Richard Stallman <rms@gnu.org>
20212 * src/main.c, src/files.c:
20215 1993-04-15 Noah Friedman <friedman@gnu.org>
20217 * configure.in: entered into RCS
20219 * configure.in: *** empty log message ***
20221 * configure.in: New file.
20223 1993-04-14 Richard Stallman <rms@gnu.org>
20225 * Makefile.in: New file.
20227 1993-04-13 Richard Stallman <rms@gnu.org>
20229 * src/version.c: New file.
20231 1993-03-25 Richard Stallman <rms@gnu.org>
20233 * src/output.c: entered into RCS
20235 1992-09-25 Richard Stallman <rms@gnu.org>
20237 * configure.bat: entered into RCS
20239 1992-06-22 Richard Stallman <rms@gnu.org>
20241 * src/vmsgetargs.c: entered into RCS
20243 1992-06-22 Richard Stallman <rms@gnu.org>
20245 * doc/bison.rnh: entered into RCS
20247 1992-04-20 David J. MacKenzie <djm@gnu.org>
20249 * README: entered into RCS
20251 1992-01-22 Richard Stallman <rms@gnu.org>
20253 * src/machine.h: entered into RCS
20255 1991-12-21 Richard Stallman <rms@gnu.org>
20257 * src/lalr.c, src/closure.c:
20260 1991-12-20 Richard Stallman <rms@gnu.org>
20262 * src/state.h: entered into RCS
20264 1991-12-18 Richard Stallman <rms@gnu.org>
20266 * src/print.c, src/nullable.c, src/derives.c:
20269 1991-11-03 David J. MacKenzie <djm@gnu.org>
20271 * src/warshall.c, src/types.h, src/symtab.h, src/lex.h, src/gram.c, src/gram.h, src/files.h:
20274 1988-09-09 Richard Stallman <rms@gnu.org>
20276 * src/bison.hairy: entered into RCS
20278 1987-12-16 Richard Stallman <rms@gnu.org>
20280 * REFERENCES: entered into RCS
20285 Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996,
20286 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
20287 Free Software Foundation, Inc.
20289 Copying and distribution of this file, with or without
20290 modification, are permitted provided the copyright notice and this
20291 notice are preserved.